Sie sind auf Seite 1von 28

Tutorial: Modeling Two Stroke Engine Scavenging

Introduction
This tutorial explains how to model the scavenging process of a two-stroke engine. Scavenging is the operation of clearing the cylinder of burned gases and filling it with a fresh
mixture (or air). This is a combination of the intake and exhaust processes. Modeling
scavenging is very important in two-stroke engine for the following reasons:
1. Too much scavenging can cause the fresh charge to go directly to exhaust (shortcircuit) and thus generate excessive pollutants and wastage of fuel.
2. Too little scavenging will result in excessive exhaust gases in the cylinder thus reducing
the amount of fresh charge delivered to the cylinder which in turn reduces the engine
power.
The scavenging performance is not very sensitive to the initial conditions and thus simulating combustion is not necessary. The tutorial demonstrates how to do the following:
Set up dynamic mesh motion for two stroke engine inside ANSYS FLUENT.
Set up the species transport model.
Use the user-defined function (UDF) to calculate scavenging efficiency/ratio.

Prerequisites
This tutorial is written with the assumption that you have completed Tutorial 1 from
ANSYS FLUENT 13.0 Tutorial Guide, and that you are familiar with the ANSYS FLUENT
navigation pane and menu structure. Some steps in the setup and solution procedure will
not be shown explicitly.
This tutorial also assumes that you are familiar with ANSYS FLUENT MDM layering approach. See Section 11.6 in the ANSYS FLUENT 13.0 Users Guide.

Problem Description
The simulation starts after the completion of combustion and before the opening of the
exhaust port (typically 40 to 70 degree crank angle (CA) after top dead center (TDC)).
Simulation ends right after the exhaust port is closed (EPC).

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Setup and Solution


Preparation
1. Copy the files, 2-stroke-engine-scavenging.msh.gz and two stroke efficiency.c to your
working folder.
2. Use FLUENT Launcher to start the (3D) version of ANSYS FLUENT.
For more information about FLUENT Launcher refer to Section 1.1.2 in the ANSYS
FLUENT 12.0 Users Guide.
3. Enable Double-Precision in the Display Options list.
4. Click the Environment tab and make sure that Setup Compilation Environment for UDF
is enabled.
The path to the .bat file which is required to compile the UDF will be displayed as soon
as you enable Setup Compilation Environment for UDF.
If the Environment tab does not appear in the FLUENT Launcher dialog box by default,
click the Show More Options button to view the additional settings.
Note: The Display Options are enabled by default. Therefore, after you read in the
mesh, it will be displayed in the embedded graphics window.
Step 1: Mesh
1. Read the mesh file, 2-stroke-engine-scavenging.msh.gz.
File Read Mesh...
As ANSYS FLUENT reads the mesh file, messages will appear in the console reporting
the progress of the conversion.
2. Rotate and zoom the display to obtain the view as shown in Figure 1
Step 2: General Settings
1. Check the mesh.
General Check
ANSYS FLUENT will perform various checks on the mesh and report the progress in
the console. Make sure that the minimum volume reported is a positive number.
Warnings will be displayed regarding unassigned interface zones, resulting in the failure
of the mesh check. You do not need to take any action at this point, as this issue will
be rectified when you define the mesh interfaces in a later step.

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Figure 1: Mesh Display

2. Scale the mesh.


General Scale...

(a) Select mm from the View Length Unit In drop-down list.


(b) Select mm from the Mesh Was Created In drop-down list.
(c) Click Scale.
(d) Close the Scale Mesh dialog box.
3. Select the transient solver.
General

c ANSYS, Inc. November 3, 2010


Transient
3

Tutorial: Modeling Two Stroke Engine Scavenging

Step 3: Mesh Interface Setup


Mesh Interfaces Create/Edit...

1. Create a non-conformal interface.


(a) Enter interface for the Mesh Interface name.
(b) Select intf-export and intf-inport as Interface Zone 1
(c) Select intf-cylinder as Interface Zone 2.
(d) Click Create.
2. Similarly create another non-conformal interface.
(a) Enter interface-inlet-box for the Mesh Interface name.
(b) Select intf-inlet as Interface Zone 1
(c) Select intf-box as Interface Zone 2.
(d) Click Create.
3. Close the Create/Edit Mesh Interfaces dialog box.

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Step 4: Dynamic Mesh Setup


Dynamic Mesh

1. Enable Dynamic Mesh in the Dynamic Mesh task page.


2. Disable Smoothing and enable Layering in the Mesh Methods group box.
ANSYS FLUENT will automatically flag the existing mesh zones for use of the different
dynamic mesh methods where applicable.
3. Click Settings... to open the Mesh Method Settings dialog box.

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

(a) Click on Layering tab.


(b) Select Ratio Based from Options group box
(c) Enter 0.4 for Collapse Factor.
(d) Click OK to close the Mesh Method Settings dialog box.
4. Enable In-Cylinder and click Settings... in the Options group box.

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

(a) Enter the parameters as shown in the following table.


Crank Shaft Speed (rpm)
Starting Crank Angle (deg)
Crank Period (deg)
Crank Angle Step Size (deg)
Piston Stroke (mm)
Connecting Rod Length (mm)

700
75
360
0.25
54.5
104

(b) Click OK to save the parameters and close the In-Cylinder Settings dialog box.
5. Define dynamic mesh zones to simulate the moving mesh.
Dynamic Mesh Create/Edit...

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

(a) Select fluid-cylinder-top-layer from the Zone Names drop-down list.


(b) Make sure that the Type selected is Rigid Body.
(c) In Motion Attributes tab, make sure that **piston-full** is selected as the Motion
UDF/Profile.
(d) In the Valve/Piston Axis group box, enter 0, 0 ,1 for the X, Y, Z respectively.
(e) Click Create.

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

(f) Similarly for piston zone retain the other options and enter 0.9 mm for Cell
Height in Meshing Options tab.
(g) Click Create.

(h) For wall-deck, select Type as Stationary and in Meshing Options tab, retain 0.9
mm for Cell Height and click Create.

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

(i) Select default-interior:025 from the Zone Names drop-down list.


i. Retain selection of Stationary from the Type group box.
ii. Enter 0 mm for Cell Height next to fluid-cylinder.
iii. Enter 0.9 mm for Cell Height next to fluid-cylinder-top-layer.
iv. Click Create.
(j) Close the Dynamic Mesh Zones dialog box.
The zone motion can be previewed to check the correctness of the motions specified by
clicking the Display Zone Motion... button.
6. Save the case file. (2-stroke-engine-scavenging-dynamic-setup.cas.gz).
File Write Case...
Save the case file before previewing the mesh motion.
7. Perform a mesh motion preview.
Dynamic Mesh Preview Mesh Motion...

(a) Enter 900 for Number of Time Steps.


(b) Set Display Frequency to 5.
(c) Click Apply.
(d) Click Preview.
This simulation will be run for total 225 degree CA, at crank angle step size of
0.25 degree. Successful mesh motion for 225 degree CA will ensure that the mesh
is perfectly suitable for running the scavenging solution.
8. After the successful mesh motion preview, read the saved case file, 2-stroke-enginescavenging-dynamic-setup.cas.gz (without saving anything), for setting up boundary
conditions, UDF hooks, and other details required for modeling scavenging process.
File Read Case...

10

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Step 5: Compile, Load, and Hook the UDF


1. Compile and load the UDF.
Define User-Defined Functions Compiled...
(a) Click Add.. in the Source Files group box.
The Select File dialog box will open.
i. Select the file, two stroke efficiency.c and click OK.
(b) Click Build in the Compiled UDFs dialog box.
Here you will create a library with the default name of libudf in your working
folder. If you would like to use a different name, you can enter it in the Library
Name field. In this case you need to make sure that you will open the correct
library in the next step.
A dialog box will appear warning you to make sure that the UDF source files are
in the folder that contains your case and data files. Click OK in the warning
dialog box.
(c) Click Load to load the UDF library you just compiled.
When the UDF is built and loaded, it is available to hook to your model. Its
name will appear as libudf and can be selected from drop-down lists of various
dialog boxes.
2. Hook your model to the UDF library.
Define User-Defined Functions Hooks...

(a) Click Edit... next to Execute at End.


i. Select cal charge::libudf from the Available Execute at End Functions.
ii. Click Add.

c ANSYS, Inc. November 3, 2010


11

Tutorial: Modeling Two Stroke Engine Scavenging

iii. Click OK to close the Execute at End Functions dialog box.


(b) Click Edit... next to Read Data.
i. Select read data::libudf from the Available Read Data Functions.
ii. Click Add.
iii. Click OK to close the Read Data Functions dialog box.
(c) Click Edit... next to Write Data.
i. Select write data::libudf from the Available Write Data Functions.
ii. Click Add.
iii. Click OK to close the Write Data Functions dialog box.
(d) Click OK to close the User-Defined Function Hooks dialog box.
Step 6: Models
1. Enable the standard k- turbulence model.
Models

Viscous Edit...

(a) Select k-epsilon (2 eqn) from the Model list.


The original Viscous Model dialog box will expand when you do so.
(b) Select Realizable from the k-epsilon Model group box.
(c) Click OK to close the Viscous Model dialog box.
2. Enable the species transport model.
Models

Species Edit...

(a) Select Species Transport in the Model list.


(b) In Options group box enable Inlet Diffusion.
(c) Click OK to close the Species Model dialog box.
An Information dialog box will open, reminding you to confirm the property values
before continuing. Click OK to continue.
Note: A message is displayed in the console stating that the energy equation is enabled
as required by material density method.

12

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Step 7: Materials
Materials Create/Edit...
1. Copy carbon-dioxide from the database.

(a) Click on FLUENT Database....


(b) Select fluid from the Material Type drop-down list.
(c) Select carbon dioxide (co2) from the FLUENT Fluid materials list.
(d) Click Copy and close the FLUENT Database Materials dialog box.
(e) Select constant from the Cp (Specific Heat) drop-down list.
(f) Click Change/Create.
2. Modify the mixture template.

c ANSYS, Inc. November 3, 2010


13

Tutorial: Modeling Two Stroke Engine Scavenging

(a) Select mixture from the Material Type drop-down list.


(b) Enter scavenging-template for the Name.
(c) Click Edit... next to Mixture Species in the Properties group box.
i. Select carbon-dioxide (co2) from the Available Materials list and click Add.
ii. Similarly add air.
iii. Remove the other species (h2o, o2, and n2) by selecting in the Selected species
group box and clicking Remove.
iv. Click OK to close the Species dialog box.
v. Click Yes in the dialog box that appears.
(d) Select ideal-gas from the Density drop-down list in the Properties group box.
(e) Click Change/Create and close the Create/Edit Materials dialog box.

14

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Step 8: Boundary Conditions


Boundary Conditions
1. Set the conditions for the inlet.
Boundary Conditions

inlet-box Edit...

(a) In the Momentum tab, enter 132.11 pascal for the Gauge Total Pressure.
(b) Select Intensity and Viscosity Ratio from the Specification Method drop-down list
in the Turbulence group-box.
(c) Enter 7 % for Turbulent Intensity.
(d) In the Thermal tab enter 293K for Total Temperature.
(e) In the Species tab enter 1 for co2 in the Species Mass Fractions group box.
(f) Click OK to close the Pressure Inlet dialog box.

c ANSYS, Inc. November 3, 2010


15

Tutorial: Modeling Two Stroke Engine Scavenging

2. Set the conditions for the outlet.


Boundary Conditions

outlet Edit...

(a) In the Momentum tab, select Intensity and Viscosity Ratio from the Specification
Method drop-down list in the Turbulence group box.
(b) Retain the default values for turbulence.
(c) In the Thermal tab enter 293K for Total Temperature.
(d) In the Species tab ensure that co2 value is set to 0 in the Species Mass Fractions
group box.
(e) Click OK to close the Pressure Outlet dialog box.

16

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Step 9: Solution
1. Set the solution control methods.
Solution Methods

(a) Select PISO from Scheme drop-down list in the Pressure-Velocity Coupling group
box.
(b) Set 0 for Skewness Correction.
(c) Select Second Order from drop-down list of Pressure.
(d) Select Second Order Upwind from drop-down lists of Density, Momentum, co2,
and Energy.

c ANSYS, Inc. November 3, 2010


17

Tutorial: Modeling Two Stroke Engine Scavenging

2. Set the under-relaxation factors.


Solution Controls

(a) Enter 0.6 for Pressure in the Under-Relaxation Factors group box.
(b) Enter 0.7 for Turbulent Kinetic Energy and Turbulent Dissipation Rate.
3. Reduce convergence criterion for continuity.
Monitors

Residuals Edit...

(a) Enter 0.2 as Absolute Criteria for continuity.


(b) Click OK to close the Residual Monitors dialog box.
4. Initialize the field variables.
Solution Initialization
(a) Enter 293 for Temperature in the Initial Values group box.
(b) Click Initialize.

18

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

5. Patch the initial presure.


Solution Initialization Patch...

(a) Select Pressure from the Variable list.


(b) Enter 132.11 pascal as the Value.
(c) Select fluid-box and fluid-inlet from the Zones to Patch list.
(d) Click Patch.
6. Similarly patch the initial CO2 mole fraction.
(a) Select co2 from the Variable list.
(b) Enter 1 for the Value.
(c) Select fluid-box and fluid-inlet from the Zones to Patch list.
(d) Click Patch.
(e) Close the Patch dialog box.

c ANSYS, Inc. November 3, 2010


19

Tutorial: Modeling Two Stroke Engine Scavenging

7. Create an iso-surface.
Surface Iso-Surface...

(a) Select Mesh... and Y-Coordinate from the list of Surface of Constant.
(b) Enter -3 for Iso-Values.
(c) Enter y-01 for New Surface Name.
(d) Select all except fluid-box from the list of From Zones.
(e) Click Compute and then Create.
(f) Close the Iso-Surface dialog box.
8. Set the view and display the iso-surface.
(a) Display the iso-surface.
Graphics and Animations

Mesh Set Up...

i. Deselect all from the list of Surfaces.


ii. Select y-01 and click Display.
iii. Close the Mesh Display dialog box.
(b) Modify the view.
Graphics and Animations Views...
i. Select top from the list of Views.
ii. Enter view-01 for Save Name.
iii. Click Save.
iv. Click Apply and close the Views dialog box.

20

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Figure 2: Iso Surface (y = -3)

9. Set up commands to save figures for animations.


Calculation Activities (Execute Commands) Create/Edit...

(a) Set Defined Commands to 2.


(b) Enable Active for both commands.
(c) Set Every to 5 for both commands.
(d) Select Time-Step from the drop-down list of When for both commands.
(e) Enter /display/set/contours/surfaces y-01 () /display/set/contours
filled-contours? yes for command-1.

c ANSYS, Inc. November 3, 2010


21

Tutorial: Modeling Two Stroke Engine Scavenging

(f) Enter /display/contour molef-co2 0 1 ()/display/view/restore-view


view-01 /display/hc ./co2-molef %t.tif for command-2.
(g) Click OK.
10. Set the time step parameters for calculations.
Calculation Activities

(a) Enter 90 for Autosave Every(Time Steps).


(b) Click Edit....
i. Enter ./2-stroke-engine-tut-CA075.gz for File Name.
ii. Click OK to close the Autosave dialog box.
(c) Set the picture type.
File Save Picture...

i. Select TIFF from the Format group box.


ii. Select Color from the Coloring group box.
iii. Click Apply and close the Save Picture dialog box.

22

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

(d) Set the display of contours.


Graphics and Animations

Contours Set Up...

i. Select Filled from the Options group box.


ii. Ensure that Pressure... and Static Pressure are selected from the drop-down
list of Contours of.
iii. Select y-01 from the list of Surfaces.
iv. Click Display and close the Contours group box.
11. Run the simulation for 900 steps.
Run Calculation
Step 10: Postprocessing
1. The contours of co2 at various time steps are shown.
The tiff files generated by ANSYS FLUENT can be used to produce an animation.
Note: There is one execute on demand UDF, print out result, which calculates following parameters at EPC and print it in a file result.txt
(a) Fresh charge mass delivered to cylinder
(b) Fresh charge mass trapped in the cylinder
(c) Cylinder volume at Bottom Dead Center (BDC).
(d) Charge density at EPC
(e) Mass trapping efficiency
(f) Volume scavenging ratio
(g) Volume scavenging efficiency
2. To print the results on fluent console pick up the print out results :
Define User-Defined Execute On Demand...
(a) Select print out results from the Execute on Demand drop-down list.
(b) Click Execute.
************************* Results at CA = 300.00 deg *************************
Fresh charge mass delivered to the cylinder (kg) = 1.2589e-004
Fresh charge mass trapped in the cylinder (kg) = 5.9578e-005
Cylinder volume at BDC (m3) = 1.0286e-004
Charge density at EPC (kg/m3) = 1.5255e+000
Mass trapping efficiency, TEm = 14.7327e-001
Volume scavenging ratio, SRv = 8.0228e-001
Volume scavenging efficiency, SEv = 3.7969e-001
******************************************************************************

c ANSYS, Inc. November 3, 2010


23

Tutorial: Modeling Two Stroke Engine Scavenging

24

Figure 3: CA = 139 degree

Figure 4: CA = 168 degree

Figure 5: CA = 195 degree

Figure 6: CA = 243 degree

Figure 7: CA = 277 degree

Figure 8: CA = 308 degree

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

Appendix : Modify the UDF Inputs


A UDF to calculate different scavenging efficiencies is used in this tutorial.
1. Open two stroke efficiency.c using a text editor.
2. Under the user inputs heading in the source file provide following inputs :
(a) Cylinder Inlet ID : This can be obtained using command (rpgetvar sliding-interfaces).
For the tutorial case the, please follow steps below to find out this input.
i. Type in (rpgetvar sliding-interfaces) scheme command on ANSYS
FLUENT console.
ii. This command will provide the list of information about two non-conformal
interfaces.
iii. Look into the details of non-conformal interface called interface.
>(rpgetvar sliding-interfaces)
((interface-inlet-box (sb1-id 15) (sb2-id 14) (interior-id 36)
(periodic-id . 0) (bnd1-id 37) (bnd2-id 38) (periodic . #f)
(coupled . #f) (face-periodic . #f) (mperiodic-ids) (stretched . #f)
(sb1-str-id) (sb2-str-id) (mperiodic-str-ids) (interior-str-id)
(parent-ids)) (interface (sb1-id 16 17) (sb2-id 20) (interior-id 32 31)
(periodic-id . 0) (bnd1-id 34 33) (bnd2-id 35) (periodic . #f)
(coupled . #f) (face-periodic . #f) (mperiodic-ids) (stretched . #f)
(sb1-str-id) (sb2-str-id) (mperiodic-str-ids) (interior-str-id)
(parent-ids)))

c ANSYS, Inc. November 3, 2010


25

Tutorial: Modeling Two Stroke Engine Scavenging

(b) Compare with the interface details as shown in the Create/Edit Mesh Interfaces
dialog box.

(c) The interface ID is shown in the Boundary Conditions task page.


(d) Chamber Zone ID : This can be obtained from
Cell Zone Conditions task page.
This input consists of zone IDs of fluid-cylinder and fluid-cylinder-top-layer.

26

c ANSYS, Inc. November 3, 2010


Tutorial: Modeling Two Stroke Engine Scavenging

c ANSYS, Inc. November 3, 2010


27

Tutorial: Modeling Two Stroke Engine Scavenging

(e) EPC CA : This is the crank angle for exhaust port closed condition.
Note: For this tutorial case, there is no need to modify the UDF inputs. For your own
simulation, use the UDF as you will need to modify the UDF inputs following
the above procedure.

28

c ANSYS, Inc. November 3, 2010

Das könnte Ihnen auch gefallen