Download - CFX Tutorial Ductflow Laminar v4p00
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
1/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 1 of 25University of Manitoba
ANSYS CFX Tutorial
Laminar Flow in a Rectangular Duct
Scott J. Ormiston
Jeffrey R. Berg
Department of Mechanical Engineering
University of Manitoba
Winnipeg, Manitoba
Canada
V4.00
22 January 2013
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
2/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 2 of 25University of Manitoba
IntroductionThis tutorial has been adapted from a tutorial created by Jeff Berg (M.Sc. student) in 2004. That tutorial was bas
on running the CFX-TASCflow (V2.11) rct.lam tutorial in CFX-5 (v5.7).
Geometry Nomenclature
The duct has a length xL , a height yL , and a depth zL .The duct length is aligned with thex axis, the depth w
they axis, and the height with thezaxis. The flow is assumed to be symmetric about anx-zplane that bisects t
duct in they direction and therefore only half the duct is modelled. One corner of the duct is assumed to lie at torigin. Figure 1 below shows the duct geometry. When the geometry was defined in the creation of t
computational mesh, all faces of the domain were assigned names. The names of the inlet and outlet planes (
0x andxLx ) are RCT_W and RCT_E, respectively. The names of the planes at 0y and yLy are RCT_
and RCT_N, respectively. The names of the planes at 0z and zLz are RCT_B and RCT_T, respectively.
Figure 1: Rectangular Duct Geometry
Problem DefinitionThe problem is a laminar, incompressible, constant property flow of water in a rectangular duct. The code will run with the heat transfer model turned off (even though an alternative approach would be to run the code with t
heat transfer model as isothermal and specify the desired temperature for an isothermal flow). The flow
modelled with a rectilinear uniform grid for half the domain using symmetry in the y direction.
The problem parameters are:
Mass flow = 3.962 x 10-2
[kg / s] for the full duct. The mass flow rate at the inlet of the half duct is therefo1.981 x 10
-2[kg / s].
Density = 997.0 [kg / m3].
Viscosity = 8.899 x 10-4 [kg / m s].
Duct length = 2.00 m ( xL ).
Duct height = 0.40 m ( yL ). The actual grid height is 0.20 m due to symmetry.
Duct depth = 0.30 m ( zL ).
Hydraulic diameter of the duct, hD , is 0.34286 m.
Reynolds number based on the hydraulic diameter is 127.2.
FeaturesThis tutorial demonstrates how to:
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
3/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 3 of 25University of Manitoba
Import a grid (created using ICEM CFD)
Specify boundary conditions
Solve the flow problem
Do some post-processing of the results
SetupFirst, create a new directory called cfx-tutorial. Make sure that the path to this directory does not contain
any space characters. Spaces in a directory name or path will cause an error message in CFX (in addition, ahyphen cannot be used in the simulation name). Make this new directory your current directory (i.e., cd to thadirectory).
The grid for this tutorial has been pre-generated. It was created in software called ICEM CFD. For the purposes
this tutorial, the completed grid will be imported into CFX. The completed grid is in a file called duct.cfx5that can be copied to your current directory using:
cp -p ~engsjo/pub/mech-4822/cfx-tutorial/duct.cfx5 ./
or it can be downloaded (it is inside a zip file called cfxtutorial_duct_cfx5.zip) from a link in the
following web page:
http://home.cc.umanitoba.ca/~engsjo/teaching/Tutorials/index.htm#cfxtutorial
You can also use the grid that you created if you did the ICEM CFD tutorial: Simple Duct Grid.This grid has uniform mesh spacing and 41, 11, and 16 nodes in each of thex, y, andzdirections, respectively.
Assumptions about Running CFXThese instructions assume that:
1. The user has modified (customised) his/her Unix account as specified in the Linux/Unix Hands On tutorinotes used in MECH 4822.2. The user is connected to a Linux-based server or workstation usingVNCviewer. Examples of suitable
Linux machines (with suffix .cc.umanitoba.ca) are mars, venus, jupiter, cc01, cc02,cc03, cc04, and moon.
3. The version of the software is ANSYS CFX v14.0.
The CFX launcher can be started by typing:
cfx5 &
and then using the buttons for CFX-Pre, CFX-Solver, and CFD-Post.
In the past, two synonyms were used for running the pre-processor (cfx5pre) and the post-processor
(cfx5post) in aVNCviewer environment:
vnc-cfxpre (which is equivalent to cfx5pre -gr mesa&)
vnc-cfxpost (which is equivalent to cfx5post -gr mesa& )
to obtain correct graphical images when usingVNCviewer. These can still be used as an alternative to thelauncher.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
4/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 4 of 25University of Manitoba
Defining the Simulation in CFX-PreTo begin using CFX-Pre, start the program by typing
vnc-cfxpre
1. Creating a New SimulationSelect File > NewSimulationSimulation Typedefault is General (click on General in the window and then click OK)
Also click on OK in the following window:
To name the simulation:Select File > SaveCase
In the window, set File name to rct_lam.cfx and clickSave.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
5/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 5 of 25University of Manitoba
2. Importing the MeshSelect File > Import > MeshFiles of type: Select ICEM CFD
File name: Enter (or browse for) duct.cfx5ClickOpen
3. Domain SpecificationSelect Insert > DomainName: enterductClickOK
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
6/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 6 of 25University of Manitoba
Under the Domain: duct tab in the Basic Settings tab, click on and then in the Selection Dialog bothat appears, click on DUCT and then ClickOK
Still under the Basic Settings tab:Location: this should be DUCTDomain Type: this should be Fluid DomainCoordinate Frame: this should be Coord 0Fluid and Particle Definitions this should be Fluid 1Fluid 1: Option: this should be Material Library
Material: select WaterMorphology: Option: this should be Continuous Fluid
Do not click Minimum Volume Fraction.
Domain ModelsPressure: Reference Pressure: this should be 1 [atm]Buoyancy Model: Option: this should be Non BuoyantDomain Motion: Option: this should be StationaryMesh Deformation: Option: this should be None
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
7/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 7 of 25University of Manitoba
ClickApply
Under the Fluid Models tab:Heat Transfer: Option: select NoneTurbulence Model: Option: select None (Laminar)Combustion: Option: this should be NoneThermal Radiation: Option: this should be NoneDo not click Electromagnetic Model.
ClickApply
Under the Initialization tab:ClickDomain Initialization boxClickInitial Conditions box
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
8/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 8 of 25University of Manitoba
Leave all the values as the default values.
Now, ClickOK
4. Defining the Inlet Boundary ConditionSelect Insert > Boundary
Name: enterinlet
ClickOK
UnderBoundary: inlet tab:Basic Settings tab:Boundary Type: select InletLocation: select RCT_W
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
9/25
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
10/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 10 of 25University of Manitoba
UnderBoundary: outlet tab:Basic Settings tab:Boundary Type: select OutletLocation: select RCT_E
Boundary Details tab:Flow Regime: Option:SubsonicMass and Momentum: Option: Average Static PressureClick on space beside Relative Pressureand enter: 0.0
Leave Pres. Profile Blend at 0.05
Pressure Averaging: Option:Average Over Whole OutletClickOK
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
11/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 11 of 25University of Manitoba
6. Defining the Symmetry Plane Boundary ConditionSelect Insert > Boundary ConditionName: entersymmetry
ClickOK
UnderBoundary: symmetry tab:Basic Settings tab:Boundary Type: select SymmetryLocation: select RCT_SClickOK
7. Defining the Walls Boundary ConditionSelect Insert > Boundary ConditionName: enterwalls
ClickOK
UnderBoundary: walls tab:Basic Settings tab:Boundary Type: select Wall
Location: click on the icon. In the Selection Dialog window, click on RCT_B, then, while
holding down the Ctrl key, click on RCT_N and RCT_T. ClickOK.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
12/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 12 of 25University of Manitoba
Boundary Details tab:Mass And Momentum: Option: select No Slip WallDo not check the box by Wall VelocityClickOK
The overall image of the domain should now appear as:
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
13/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 13 of 25University of Manitoba
Note that there is no duct domain default in the list. This means that all surfaces have been assigned
boundary condition.
8. Setting the Solver ControlsSelect Insert > Solver > Solver ControlUnderSolver Control tab:Details ofSolver Control in Flow Analysis 1 tab:Basic Settings tab:
Advection Scheme: Option: High ResolutionConvergence Control:
Min. Iterations: 1Max. Iterations: 100
Fluid Timescale Control:Timescale Control: select Physical TimescaleLength Scale Option: select Physical TimescalePhysical Timescale: click in the box and enter6000
Convergence Criteria:Residual Type: RMSResidual Target: 1.E-4
Leave the boxes unchecked for Conservation Target, Elapsed Wall Clock Time Control, and Interrupt
Control.
ClickOK
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
14/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 14 of 25University of Manitoba
9. Writing the Solver Definition FileSelect Tools > Solve > Write Solver Input FileAlternatively, you can click on the icon:
In the window that appears:
File name: rct_lam.defFiles of type: CFX-Solver Input Files (*.def)ClickSave
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
15/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 15 of 25University of Manitoba
10.Saving the SimulationSelect File > Save Case
11.Ending the CFX-Pre SessionSelect File > Quit
Obtaining a Solution Using the CFX-SolverTo start the solver, at the command line, type:
cfx5solve &
When the solver window comes up, if it is narrow, widen it by dragging the right edge of the window.
1. Defining the RunSelect File > Define RunIn the Define Run Window:
Solver Input File:browse for and select rct_lam.def
Run Definition tab:
Leave the box unchecked for Initial Values SpecificationType of Run:FullClick the box by Double PrecisionParallel Environment:Run Mode: select Platform MPI Local Parallel
You should see your host name appear in a table of Host Name and Partitions. Click the on theright to set the number of partitions to 4:
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
16/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 16 of 25University of Manitoba
ClickStart Run
The calculation should proceed with text information in one window and the residuals of the equationsa second window. In this case there should be a print-out of 12 outer loop iterations and then some
summary information, followed by a Solver Run Finished Normally window that pops up. In thiswindow there is some run information. ClickOK.
This solver run created the textual record of the run: rct_lam_001.outand the results file that can be post-processed: rct_lam_001.res.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
17/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 17 of 25University of Manitoba
2. Ending the Solver SessionSelect File > Quit
Viewing the Results using CFD-Post
As simple examples of post-processing, this tutorial illustrates how to create a graph of a velocity profile at theduct exit and a velocity vector plot on the plane of symmetry. There are many other features available in CFD-
Post. For more details on these features, consult the course instructor and teaching assistant, as well as the on-liCFD-Post help.To begin using CFD-Post type:
vnc-cfxpost
1. Loading the Results FileSelect File > Load ResultsIn the file browser window, click on rct_lam_001.res and then clickOpen.
2. Creating a Line at the Exit PlaneSelect Insert > Location > LineName: enterExit Line
ClickOK
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
18/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 18 of 25University of Manitoba
A sidebar entitled Details ofExit Line should appear.
Geometry tab:Domains: All DomainsDefinition:Method: Two PointsPoint 1: enter2, 0, 0Point 2: enter2, 0, 0.3Line Type: click on circle forCutClick on Apply
(Aside: In the future, we will use Line Type Sample and specify a number of points to sample.)A yellow line will appear at the end of the duct image in the 3D viewer.
After zooming, it should appear like:
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
19/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 19 of 25University of Manitoba
In order to zoom in, you can use some of the icons at the top of the 3D viewer window:
To zoom click the (zoom) or (zoom box) icons. You can also use the pan icon: to mov
the image around and a scroll wheel on a mouse to zoom. You can also change the view by right
clicking on the 3D viewer window and choosing a Predefined Camera. If you want to see the entire duc
again, click on the fit view icon: .
3. Creating a Graph (Chart) of a Velocity Profile at the ExitSelect Insert > ChartName: U Velocity versus zClickOKUnderDetails of U Velocity versus z:
General tab:Type: XYTitle: U Velocity at the ExitCaption: Exit Velocity Graph
Data Series tab:ForSeries 1:Name: click in the box and enterExit Line ProfileLocation: select Exit Line
X Axis tab:
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
20/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 20 of 25University of Manitoba
Variable: select ZClick on the circle forHybridLeave the box checked for Determine ranges automatically
Y Axis tab:Variable: select Velocity uClick on the circle forHybridLeave the box checked for Determine ranges automaticallyClick on Apply
You should see the chart shown below in the right window (Chart Viewer).
The data used in this chart can also be exported to a spreadsheet program by using the export feature.To do this:
ClickExport
File name: enteru_exit_profile.csvFile Type: Comma Separated Values (*.csv)Click on Save
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
21/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 21 of 25University of Manitoba
The file created, when loaded into Excel (and formatted with more decimals for column A andscientific notation for column B), looks like:
These data can also be exported in a text file format for plotting with gnuplot or other plotting software
4. Creating a Velocity Vector PlotClick on the3D Viewertab.Select Insert > VectorName: enterSymm Plane VectorsClickOKA sidebar entitled Details ofSymm Plane Vectors should appear.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
22/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 22 of 25University of Manitoba
Geometry tab:Domains: All DomainsDefinition:Locations: select symmetrySampling: VertexReduction: Reduction FactorFactor: select 1.0Variable: Velocity
Boundary Data: Click on the circle forHybridProjection: NoneClick on Apply
The vector plot below should appear in the 3D Viewer window. The domain was zoomed in for the
image.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
23/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 23 of 25University of Manitoba
3. Ending the CFD-Post SessionSelect File > QuitClick on Save & Quit
File name: enterrct_lam.cst
Files of type:CFD-Post State (*.cst)Click on Save
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
24/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
Department of Mechanical Engineering Page 24 of 25University of Manitoba
The state file that was saved (rct_lam.cst) has saved the new objects created in the previous CFD-Post
session. When examining the same results file another time in Post, those setting can be re-loaded using File >Load State. Another powerful feature is that the same state file can be loaded when viewing a different set ofresults on the same geometry and all plots (charts, vectors, etc.) are re-computed automatically for the new resul
Further Exploration
In order to get more experience using ANSYS CFX, you can try the following additional tasks.
1. Restart the flow calculation and converge to a tighter tolerance.a) Re-start CFX-Pre and re-load rct_lam.cfx.b) Go to the solution controls and change:
Maximum iterations to 500
Residual type to maxium
Residual target to 0.000001 (1.E-6)
c) Save the case filed) Write a new rct_lam.def file.
e) Start the Solver and define a new run Select the rct_lam.def file just created
Click on the box for Initial Values Specification
For Initial Values 1: for File Name, browse for rct_lam_001.res
Set up a Platform MPI Local Parallel run again with 4 partitions
Start the run and then close the solver after it is finished.f) Start CFD-Post and load the new results file.g) Load the rct_lam.cst file and examine the results.
-
7/28/2019 CFX Tutorial Ductflow Laminar v4p00
25/25
ANSYS CFX Tutorial Laminar Flow in a Rectangular Duct 22 January 2013 V4.00
2. Add energy equation calculation and thermal boundary conditions.a) Re-start CFX-Pre and re-load rct_lam.cfx.b) In the Outline below Analysis Type, double click on duct. Under Domain: duct, click on the
Fluid Models tab. Change the Heat Transfer Option to Thermal Energy. Click OK.
You will see an error message appear that refers to boundary conditions. This means you need toadd thermal boundary conditions. You will add an inlet temperature and a wall temperature. The
symmetry and outlet conditions do not need to be changed.
c) Double click on inlet below duct under Analysis Type.
Click on the Boundary Details tab. Under Heat Transfer Option, select Static TemperatureThen, click in the box beside Static Temperature and enter 300 (the units should be K).
Click OK.d) Double click on walls below duct under Analysis Type.
Click on the Boundary Details tab. Under Heat Transfer Option, select Heat Flux. Then,click in the box beside Heat Flux in and enter 2000 (the units should be W/m
2). Click OK
e) Use File > Save Case As to save the current setup as rct_lam_thermal.cfx.f) Write a Solver Input File: rct_lam_thermal.def.g) Start the Solver and define a new run
Select the rct_lam_thermal.def file just created Do not use Initial Values Specification
Use double precision
Set up a Platform MPI Local Parallel run again with 4 partitions
Start the run and then close the solver after it is finished.h) Start CFD-Post and load the new results file.i) Load the rct_lam.cst file and examine the results.j) Try creating a contour plot of Temperature at the outlet face.k) Save the modified state as rct_lam_thermal.cst.l) Examine the temperature results. Create a new chart that is the temperature profile at the Exit Lin
created earlier.m)Create a new line that goes down the centre of the duct. Create a chart that plots the temperature
along this line.