Difference between revisions of "Contrib:BondMatt/TurbulentPipeFlow"

From CAELinuxWiki
Jump to: navigation, search
(Geometry/Mesh)
Line 74: Line 74:
  
 
[[Image:cell_face_node_groups.png|800x500px]]
 
[[Image:cell_face_node_groups.png|800x500px]]
 +
 +
The resulting mesh can be exported in the MED format for use with Code Saturn (right click on Mesh_1 and Export to MED File or in the File menu 'Export' then 'to MED File'.
 +
 +
 +
='''Boundary Conditions - Code Saturn'''=

Revision as of 05:59, 10 February 2013

Introduction

This tutorial will attempt to follow as closely as possible the turbulent pipe flow Fluent tutorial available on Cornell's website but will use the open source CFD solvers Code Saturne and OpenFOAM.

The model is very similar to the laminar pipe flow tutorial with the exception of the dynamic viscosity which is two orders of magnitude smaller at 2E-5kg/m/s. Therefore the Reynolds number, or ratio of inertial to viscous forces, is two order of magnitude higher with a value of 10 000. The flow will clearly be turbulent since viscous forces are minimal and damping will be essentially non existent. Laminar flow can be experimentally observed at much larger Reynolds numbers (up to approximately 100 000 if my memory serves me correctly) with very smooth pipes (I believe ceramics were used in some research) and controlled conditions. This makes sense, with no external disturbance and very low pipe roughness perturbations will be minimal.


Software Versions:

Ubuntu 8.04 LTS

Salome V4.1.4

Code Saturne V1.4.a (GUI)

OpenFOAM 2.0


Fluent Tutorial

The Cornell University Fluent tutorial can be found here [1].

Is it just me or are the variables 'd' and 'D' reversed in the figure?


Geometry/Mesh

Geometry

The geometry is identical to the previous tutorial. I was hoping to convert the OpenFOAM/snappyHexMesh coarse hexahedron mesh for use with Code Saturne but there is no direct conversion tool in OpenFOAM or that I could find online. It might be possible to manually convert the mesh if the file is ASCII text and perhaps I will try to do this and add it. For now I will create a mesh in the MED format in Salome. I may try to convert it to a format compatible with OpenFOAM. I think I still have the old Code Saturne files for the laminar tutorial but they would be on a laptop with a dead GPU.

First step was to create a quarter of a cylinder with a radius of 0.1 meters and a length of 8 meters. This was done by first creating a cylinder with the 'Create a cylinder' tool which can be accessed through a toolbar (at least in my installation) or through the 'New Entity' menu and 'Primitives'. I also created a box with dimensions of 0.1 X 0.1 X 8 meters. This was followed by a Boolean operation to extract the common or overlapping region.


Step1 geo turb.png


The next step was to 'Explode' the entity created by the Boolean operation through the 'New Entity' menu. The quarter cylinder was exploded into faces so that they could be re-named for boundary conditions. Mesh cells and/or nodes associated with these surfaces can be identified and grouped by Salome at the meshing stage for boundary conditions in the solver. Reasonable names like: wall, sym1, sym2, inlet, and outlet were used.


Mesh

Switching to the meshing interface, the procedure for creating a mesh was to first create global meshing settings by going to the Mesh menu and selecting Create Mesh. In the dialog box that pops up the Geometry entity Common_1 is selected and the 3D meshing Algorithm '3D extrusion' is selected (shown in the figure below).

Mesh 1.png

The global 2D mesh setting is (or can be) Netgen 2D with the Quadrangle Preference added hypothesis. The 1D meshing setting can be Wire Discretization with the Average Length hypothesis with the length set to 0.01.

Mesh 2.png

Mesh 3.png

The object browser should end up looking something like:

Obj browser.png

The next step I took was to create sub meshes with nice, regular quadrangle meshes. Go to the Mesh menu and select Create Sub-Mesh. Pick the mesh previously created (probably called Mesh_1) and the geometry entities that were created by exploding the solid quarter cylinder into faces. However, do not pick all of these faces. Only pick the faces that will be planes of symmetry and the wall of the pipe. I use the 2D algorithm Quadrangle Mapping with the Max Element Area hypothesis (max area of 0.01 * 0.01 meters, input 0.0001) and the Quadrangle Preference Add. Hypothesis. I used the 1D algorithm Wire Discretization with an Average Length hypothesis (set to 0.01 meters). Note I forgot the Max Element Area hypothesis and so it may not be in the figure.

Sub mesh 1.png

Sub mesh 2.png

Obj browser2.png

Finally, compute the mesh by, at least one way of doing it is, right clicking on Mesh_1 and selecting 'Compute'. It should compute successfully and there should be no tetrahedron elements. Most elements are hexahedron or elements with 6 sides where each side has 4 edges and 4 vertexes. There will likely be some 'Prisms' or 'Wedge' elements (perhaps more properly called pentahedrons?).

Meshing success.png

Mesh.png

The only step left is to create element/cell face and node groups for boundary conditions. This can be done by right clicking on the entry for the mesh in the tree (probably Mesh_1) and selecting Create Groups from Geometry. Then select the geometry faces creating by exploding the quarter cylinder and named after boundary conditions (BCs).

Create groups.png

Cell face node groups.png

The resulting mesh can be exported in the MED format for use with Code Saturn (right click on Mesh_1 and Export to MED File or in the File menu 'Export' then 'to MED File'.


Boundary Conditions - Code Saturn