Professional Documents
Culture Documents
22 January 2013
V4.00
Page 1 of 25
22 January 2013
V4.00
Introduction
This tutorial has been adapted from a tutorial created by Jeff Berg (M.Sc. student) in 2004. That tutorial was based on running the CFX-TASCflow (V2.11) rct.lam tutorial in CFX-5 (v5.7).
Geometry Nomenclature
The duct has a length Lx , a height L y , and a depth
Lz .The duct length is aligned with the x axis, the depth with
the y axis, and the height with the z axis. The flow is assumed to be symmetric about an x-z plane that bisects the duct in the y direction and therefore only half the duct is modelled. One corner of the duct is assumed to lie at the origin. Figure 1 below shows the duct geometry. When the geometry was defined in the creation of the computational mesh, all faces of the domain were assigned names. The names of the inlet and outlet planes (at x 0 and x L x ) are RCT_W and RCT_E, respectively. The names of the planes at y 0 and y L y are RCT_S and RCT_N, respectively. The names of the planes at z 0 and z Lz are RCT_B and RCT_T, respectively.
Problem Definition
The problem is a laminar, incompressible, constant property flow of water in a rectangular duct. The code will be run with the heat transfer model turned off (even though an alternative approach would be to run the code with the heat transfer model as isothermal and specify the desired temperature for an isothermal flow). The flow is 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 therefore 1.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 ( Lx ). Duct height = 0.40 m ( Ly ). The actual grid height is 0.20 m due to symmetry. Duct depth = 0.30 m ( L z ). Hydraulic diameter of the duct, Dh , is 0.34286 m. Reynolds number based on the hydraulic diameter is 127.2.
Features
This tutorial demonstrates how to:
Department of Mechanical Engineering University of Manitoba Page 2 of 25
22 January 2013
V4.00
Import a grid (created using ICEM CFD) Specify boundary conditions Solve the flow problem Do some post-processing of the results
Setup
First, 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, a hyphen cannot be used in the simulation name). Make this new directory your current directory (i.e., cd to that directory). The grid for this tutorial has been pre-generated. It was created in software called ICEM CFD. For the purposes of this tutorial, the completed grid will be imported into CFX. The completed grid is in a file called duct.cfx5 that 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 the x, y, and z directions, respectively.
Page 3 of 25
22 January 2013
V4.00
22 January 2013
V4.00
3. Domain Specification
Select Insert > Domain Name: enter duct Click OK
Page 5 of 25
22 January 2013
V4.00
Under the Domain: duct tab in the Basic Settings tab, click on that appears, click on DUCT and then Click OK
Still under the Basic Settings tab: Location: this should be DUCT Domain Type: this should be Fluid Domain Coordinate Frame: this should be Coord 0 Fluid and Particle Definitions this should be Fluid 1 Fluid 1: Option: this should be Material Library Material: select Water Morphology: Option: this should be Continuous Fluid Do not click Minimum Volume Fraction. Domain Models Pressure: Reference Pressure: this should be 1 [atm] Buoyancy Model: Option: this should be Non Buoyant Domain Motion: Option: this should be Stationary Mesh Deformation: Option: this should be None
Page 6 of 25
22 January 2013
V4.00
Click Apply Under the Fluid Models tab: Heat Transfer: Option: select None Turbulence Model: Option: select None (Laminar) Combustion: Option: this should be None Thermal Radiation: Option: this should be None Do not click Electromagnetic Model.
Click Apply Under the Initialization tab: Click Domain Initialization box Click Initial Conditions box
Department of Mechanical Engineering University of Manitoba Page 7 of 25
22 January 2013
V4.00
Now, Click OK
Under Boundary: inlet tab: Basic Settings tab: Boundary Type: select Inlet Location: select RCT_W
Department of Mechanical Engineering University of Manitoba Page 8 of 25
22 January 2013
V4.00
Boundary Details tab: Flow Regime: Option: Subsonic Mass and Momentum: Option: select Mass Flow Rate Click on space beside Mass Flow Rate and enter: 0.01981 Flow Direction: Option: Normal to Boundary Condition Click OK
22 January 2013
V4.00
Under Boundary: outlet tab: Basic Settings tab: Boundary Type: select Outlet Location: select RCT_E
Boundary Details tab: Flow Regime: Option: Subsonic Mass and Momentum: Option: Average Static Pressure Click on space beside Relative Pressure and enter: 0.0 Leave Pres. Profile Blend at 0.05 Pressure Averaging: Option: Average Over Whole Outlet Click OK
Page 10 of 25
22 January 2013
V4.00
Page 11 of 25
22 January 2013
V4.00
Boundary Details tab: Mass And Momentum: Option: select No Slip Wall Do not check the box by Wall Velocity Click OK
Page 12 of 25
22 January 2013
V4.00
Note that there is no duct domain default in the list. This means that all surfaces have been assigned a boundary condition.
Page 13 of 25
22 January 2013
V4.00
In the window that appears: File name: rct_lam.def Files of type: CFX-Solver Input Files (*.def) Click Save
Page 14 of 25
22 January 2013
V4.00
Page 15 of 25
22 January 2013
V4.00
Click Start Run The calculation should proceed with text information in one window and the residuals of the equations in a 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 this window there is some run information. Click OK.
This solver run created the textual record of the run: rct_lam_001.out and the results file that can be postprocessed: rct_lam_001.res.
Department of Mechanical Engineering University of Manitoba Page 16 of 25
22 January 2013
V4.00
Page 17 of 25
22 January 2013
V4.00
A sidebar entitled Details of Exit Line should appear. Geometry tab: Domains: All Domains Definition: Method: Two Points Point 1: enter 2, 0, 0 Point 2: enter 2, 0, 0.3 Line Type: click on circle for Cut Click 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:
Page 18 of 25
22 January 2013
V4.00
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 move 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 duct again, click on the fit view icon: .
22 January 2013
V4.00
Variable: select Z Click on the circle for Hybrid Leave the box checked for Determine ranges automatically Y Axis tab: Variable: select Velocity u Click on the circle for Hybrid Leave the box checked for Determine ranges automatically Click 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: Click Export File name: enter u_exit_profile.csv File Type: Comma Separated Values (*.csv) Click on Save
Page 20 of 25
22 January 2013
V4.00
The file created, when loaded into Excel (and formatted with more decimals for column A and scientific 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.
22 January 2013
V4.00
Geometry tab: Domains: All Domains Definition: Locations: select symmetry Sampling: Vertex Reduction: Reduction Factor Factor: select 1.0 Variable: Velocity Boundary Data: Click on the circle for Hybrid Projection: None Click on Apply
The vector plot below should appear in the 3D Viewer window. The domain was zoomed in for the image.
Page 22 of 25
22 January 2013
V4.00
File name: enter rct_lam.cst Files of type: CFD-Post State (*.cst) Click on Save
Page 23 of 25
22 January 2013
V4.00
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 of results on the same geometry and all plots (charts, vectors, etc.) are re-computed automatically for the new results.
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 file d) 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.
Page 24 of 25
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 to add 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 Temperature. Then, 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/m2). 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 Line 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.
Page 25 of 25