Difference between revisions of "Contrib:BondMatt/LaminarPipeFlow"

From CAELinuxWiki
Jump to: navigation, search
Line 126: Line 126:
  
 
[[Image:b-c-def6.jpg|800x500px]]
 
[[Image:b-c-def6.jpg|800x500px]]
 +
 +
 +
The next file in the 'Boundary conditions' folder is 'Dynamic variables bound. cond.' Two boundary conditions should appear: the inlet and the wall. The default settings for the wall are left as is. The velocity components for the inlet must be set: u = 0 m/s, v = 1 m/s, and w = 0 m/s. The next file in this folder has no settings that can modified for this problem.
 +
 +
 +
[[Image:inlet-b-c.jpg|800x500px]]
 +
 +
 +
The next folder is 'Calculation control' and this is where I begin to become uncertain about what each value is. The first file is 'Steady management'. I leave the relaxation coefficient as is but change the 'Iterations number (restart included)' to 100. In the fluent tutorial the results converged to the desired residual after 46 iterations. With Fluent one specifies the maximum number of iterations without convergence to the desired residual. It looks like Saturne just runs a given number of iterations. It would be nice to see plots of residuals like you can get with Fluent. For a complex problem I can only guess that one would run the problem with an increasing number of iterations and do a quick analysis of the results each time to see if they are reasonable and improving. Perhaps there is a way of plotting residuals in the post-processor?
 +
 +
 +
[[Image:steady-management.jpg|800x500px]]
 +
 +
 +
The second file in the 'Calculation control' folder is 'Output control'. I did not modify anything in this file. The last file in this folder is 'Solution control'. I unchecked the u and w velocity component boxes under 'Print in listing' and 'Post-processing'. I found that if either of the u-velocity component checkboxes were selected, the u velocity component would be the only one in the output. The u and w velocity components should be 0 m/s at all points anyways.
 +
 +
 +
[[Image:solution-control.jpg|800x500px]]
 +
 +
 +
The next folder is 'Numerical parameters' and the first file is 'Equation parameters'. I did not modify anything in this file.

Revision as of 19:22, 9 September 2009

Introduction

The problem solved herein is that of a pipe with a uniform velocity field at the inlet and atmospheric pressure at the outlet. The pipe is sufficiently long that the viscous boundary layer is completely formed. A thin slice along the length of the pipe is studied to minimize the time to solve. The inlet velocity is very low (1 m/s) to ensure that flow is laminar. The medium is air and the diameter of the pipe is 0.2m. The Reynolds number, the ratio of inertial and viscous forces, is approximately 100. This is well below 2300, the Reynolds number magnitude commonly accepted as indicating the start of transition from laminar to turbulent flow. Side note: interesting tidbit: laminar flow can occur at extremely high Reynolds numbers (up to 100,000) if the pipe is very smooth and pipe vibrations are controlled. This problem is taken from a FLUENT tutorial from Cornell University, freely available on their website. Final desirables include plots of centerline velocity and wall skin-friction coefficient vs. axial position and the velocity profile at the outlet. Note that all screenshots are displayed at a reduced size and can be clicked on for larger images that may clarify small or cloudy text/fields.


Software Versions:

Ubuntu 8.04 LTS

Salome V4.1.4

Code Saturne V1.4.a (GUI)


Fluent Tutorial

The Cornell University Fluent tutorial can be found here Cornell Tutorial


Geometry / Mesh

The geometry is a box. The Cornell tutorial uses a 2-D box but Code Saturne can only work with 3-D geometry. The box represents a cross section of a pipe along its length cut in half to take advantage of the flow symmetry around the axis of the pipe. I created a box using the 'create a box' icon which brings up the same dialogue box if one goes to 'New Entity' and then 'Primitives' and then 'Box' in the task bar.


Box.jpg


Dx is the width of the box in the x-direction, starting at the origin. My dimensions: Dx=0.001, Dy=8, and Dz=0.1 Units are meters. The next step is to create the groups of faces for boundary conditions. As in the Cornell tutorial, half the pipe is studied to take advantage of symmetry. There are three symmetry B.C.s, one inlet B.C., one outlet B.C., and a wall B.C.


Box2.jpg


Groups can be created by going to 'New Entity', 'Group', and then 'Create'. When creating a group the elements are selected by type (points, lines, planes, solids) and added with the 'add' button. Descriptive group names should be used to make applying B.C.s easier. Once all elements for a group are selected and the name is specified the 'Apply' button is clicked.


Groups.jpg


Groups of edges were also created by direction so that the same mesh that is used in the Cornell tutorials could be created. In other words lines running in the x-direction were grouped into a group named 'xlines' and so on. This allows one dimensional submeshes to be created with the number of intervals on the edges specified. These submeshes are 1-dimensional and use the 'wire discretization' algorithm with the 'Nb. Segments' (number of segments) hypothesis. The main mesh used the 'Hexahedron' algorithm (3D) and 'Quadrangle (Mapping)' algorithm (2D). For the main mesh no 1D algorithm is specified since all edges are discretized by the submeshes.


Mesh1-3D.jpg


Mesh1-2D.jpg


Mesh1-submesh1.jpg


Mesh1-submesh1-hypothesis.jpg


Mesh1-submesh2-hypothesis.jpg


Mesh1-submesh3-hypothesis.jpg


The geometry groups are used to create groups of nodes. One method is to go to 'Mesh' and then 'Create Groups from Geometry' in the taskbar. The mesh and the geometry group are selected and the 'Apply' button selected.


Mesh-groups.jpg


Solver - Code Saturne

The CFD study was started by launching the 'Code-Saturne-Wizard' and creating a case. This dialogue box can be used to remember/select the right type of mesh to export (MED). To export the mesh it is just a matter of going back to Salome and right clicking on the mesh in the tree and selecting 'Export to MED file'.


ExportMEDmesh.jpg


Launch-cfd-wizard.jpg


The GUI will launch and directories will be created. I specified that the directories should be created on the desktop but they can be anywhere. The next step is to create a new case. There is an icon provided in the navigation toolbar for this in the form of a piece of paper with a pencil. A new case could also be created by going to 'File' and then 'New file'. On the left hand side of the GUI window is a series of folders and files. Each file corresponds to an aspect of the solver including boundary conditions, output file type, fluid properties, and number of iterations, just to name a few. If you should decide to close the Saturne GUI it can be started by opening the directory that was created with the CAELinux wizard and opening the DATA folder. In this folder is a file entitled 'SatuneGUI'. If you double click it and select the 'run in terminal' option from the dialogue box that comes up, the Saturne GUI will appear. You will need to open the .xml file that was saved the last time you were working on that case. As with most computer based work saving often is always a good idea.


New-case.jpg


Restarting-GUI.jpg


I follow the folders from top to bottom going through each file. The first folder is 'Calculation environment' and the first file is 'Identity and paths'. I do not edit anything here. The next file is 'Solution domain'. There are several tabs for this file but the first and last are the only significant ones for this problem. In the 'meshes' tab you should confirm that your mesh is listed. Under the 'stand-alone running' tab the output file type is selected. I used the Ensight Gold format which is compatible with Paraview. I have been unable to get results with the MED format which is compatible with the post processor in Salome. The simulation appears to run just fine but there are no result files created. The next file is 'Definition of volume zones'. I did not edit anything in this file.


The next folder is 'Thermophysical models'. In the first file ('Calculation features') the flow type must be changed to 'steady flow'. This indicates that the flow does not change at each point with respect to time, ie. the velocity is constant at each point with respect to time. I did not edit the next file ('Mobile mesh'). The next file is 'Turbulence models'. 'No model (ie. laminar flow)' is selected for this problem.


Calc-features.jpg


Turb-model.jpg


The next (and last) file in the 'Thermophysical models' folder is 'Initialization'. Saturne uses the finite volume CFD solver technique which essentially just conserves mass, energy, and momentum over each element. Partial differential equations for each of these conservation laws (mass: continuity, momentum: navier stokes) are integrated over the faces of the element and the integrals are evaluated numerically. The result is a set of linear algebraic equations. These equations are solved using an indirect, iterative technique. In other words a solution is assumed and then all but one of the assumed values are used to re-evaluate each unknown. This is done until a convergent solution is reached. In this 'Initialization' file the initial guess for all velocity magnitudes is specified. I assume that the u and w components are 0 m/s (these are known) and the v component is 1 m/s. The actual v-component will vary from 0 - 2 m/s but 1 m/s is the average.


Initialization.jpg


The next folder is 'Physical properties'. The first file is 'Reference values' which is where atmospheric pressure is set. The next file is 'Fluid properties'. As per the Cornell tutorial (Cornell Fluent tutorial) the density is 1 kg per cubic meter and the dynamic viscosity is 2e-3 kg/m/s. We are not concerned with the temperature field so the specific heat magnitude is fine as is. I may have previously stated that the fluid is air but the viscosity is much too high (comparable to very cold water). The last file in this folder is 'Gravity, hydrostatic pressure'. I did not modify anything in this file.


Fluid-properties.jpg


The next folder is 'Additional scalars'. No files in this folder were modified.


The next folder is 'Boundary conditions'. The first file is 'Definition of boundary regions'. There are several steps that need to be taken with this first file. The first step is to click on the folder/magnifying glass icon annotated 'Import groups and references from Preprocessor listing'. A window will open and the file 'listenv.pre' should be selected. Five regions should then appear under 'Definition of boundary regions'. There are four columns: Label, Zone, Nature, and Localisation. The 'Localisation' column will contain the group names created in Salome and can be used to set the boundary condition types.


B-c-def1.jpg


B-c-def2.jpg


B-c-def3.jpg


B-c-def4.jpg


B-c-def5.jpg


B-c-def6.jpg


The next file in the 'Boundary conditions' folder is 'Dynamic variables bound. cond.' Two boundary conditions should appear: the inlet and the wall. The default settings for the wall are left as is. The velocity components for the inlet must be set: u = 0 m/s, v = 1 m/s, and w = 0 m/s. The next file in this folder has no settings that can modified for this problem.


Inlet-b-c.jpg


The next folder is 'Calculation control' and this is where I begin to become uncertain about what each value is. The first file is 'Steady management'. I leave the relaxation coefficient as is but change the 'Iterations number (restart included)' to 100. In the fluent tutorial the results converged to the desired residual after 46 iterations. With Fluent one specifies the maximum number of iterations without convergence to the desired residual. It looks like Saturne just runs a given number of iterations. It would be nice to see plots of residuals like you can get with Fluent. For a complex problem I can only guess that one would run the problem with an increasing number of iterations and do a quick analysis of the results each time to see if they are reasonable and improving. Perhaps there is a way of plotting residuals in the post-processor?


Steady-management.jpg


The second file in the 'Calculation control' folder is 'Output control'. I did not modify anything in this file. The last file in this folder is 'Solution control'. I unchecked the u and w velocity component boxes under 'Print in listing' and 'Post-processing'. I found that if either of the u-velocity component checkboxes were selected, the u velocity component would be the only one in the output. The u and w velocity components should be 0 m/s at all points anyways.


Solution-control.jpg


The next folder is 'Numerical parameters' and the first file is 'Equation parameters'. I did not modify anything in this file.