23
Section Evaluate the use of cfMesh for the Francis-99 turbine. CFD with OpenSource Software Jethro Raymond Nagawkar Applied Mechanics/Fluid Dynamics, Chalmers University of Technology, Gothenburg, Sweden 2015-12-08 Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 1 / 23

Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Embed Size (px)

Citation preview

Page 1: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Evaluate the use of cfMeshfor the

Francis-99 turbine.CFD with OpenSource Software

Jethro Raymond Nagawkar

Applied Mechanics/Fluid Dynamics,Chalmers University of Technology,

Gothenburg, Sweden

2015-12-08

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 1 / 23

Page 2: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Topics that will be covered

Introduction to cfMesh

Some options in cfMesh

Installing cfMesh

Meshing the 3 parts of the turbine

Problems during meshing

MergeMeshes

Setting up the Mixing Plane model

Implementing a boundary condition

Creating Zones

Running the simulations and results

Conclusions

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 2 / 23

Page 3: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Intorduction to cfMesh

Library for polyhedral mesh generation.

Uses and inside out method to generate the mesh.

Can generate 2D and 3D Cartesian meshes as well as 3D Tetrahedraland Polyhedral Meshes.

Uses both shared memory parallelization (SMP) and distributedmemory parallelization using MPI.

Can handle dirty geometry and is tolerable to small gaps, cracks andprotrusions.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 3 / 23

Page 4: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Options in cfMesh

surfaceFile ”filename.stl/filename.fms”This is the name of the surface file you want to mesh along with itspath. The suggested formats of the files are .fms, .stl and .ftr.

maxCellSizeThe global maximum cell size in the domain of the geometry. It isalso the default cell size.The above two options are the mandatory options for using cfMesh.

boundaryCellSizeThe global maximum cell size of the boundary faces. Also the defaultboundary cell size.

boundaryCellSizeRefinementThicknessThe distance from the boundary at which the boundary cell size isapplied. This is a global setting.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 4 / 23

Page 5: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Continued

minCellSize.This performs automatic refinement in regions where the cell size islarger than the feature size. This is a global setting.

localRefinementThis is used to specify a local refinement in the domain at theboundaries. It is done by specifying the patch name, its cell size andoptionally the distance from the patch for which the specified sizeshould be used.

objectRefinementsIt is used to specify refinement zones in the domain. Different typesare available namely box, cone, hollow cone, sphere and lines.

surfaceMeshRefinementUses a surface file to define a refinement zone in the domain. The cellsize and refinement zone thickness is used to specify the requiredsizes.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 5 / 23

Page 6: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Installing cfMesh

cfMesh is installed along with Foamextend-3.2. However is can beinstalled separately with other versions as well.Go to http://sourceforge.net/projects/cfmesh/ and download thecfMesh-v1.1.1.tgz file. Save it anywhere you like.

tar -xvzf cfMesh-v1.1.1.taz

cd cfMesh-v1.1.1/

OF24x

source $WM_PROJECT_DIR/etc/bashrc .

./Allwmake

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 6 / 23

Page 7: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Meshing

Copy the sBend tutorial and modify the meshDict file.

cp -r $FOAM_TUTORIALS/mesh/cfMesh/cartesianMesh/sBendOctree/ dt

cp -r dt dis

cp -r dt runner

rm dt/sBend.fms

rm dis/sBend.fms

rm runner/sBend.fms

cp jethro_openfoam/periodic/distributor/distributor.fms dis/

mv dis/distributor.fms dis/distributornew.fms

cp jethro_openfoam/periodic/dt/dt.fms dt/

cp jethro_openfoam/periodic/runner/runner.fms runner/

mv runner/runner.fms runner/runnernew.fms

cp jethro_openfoam/periodic/distributor/meshDict dis/system/

cp jethro_openfoam/periodic/dt/meshDict dt/system/

cp jethro_openfoam/periodic/runner/meshDict runner/system/

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 7 / 23

Page 8: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Meshing

Different utilities for meshing with different mesh types

2D Cartesian mesh - cartesian2DMesh

3D Cartesian mesh- cartesianMesh

Tetrahedral mesh - tetMesh

Polyhedral mesh - pMesh

The quality of the mesh can further be improved usingimproveMeshQuality ultility. To visualize problems in the mesh

foamToVTK -faceSet nonOrthoFaces

foamToVTK -faceSet highAspectRatioCells

foamToVTK -faceSet skewFaces

checkMesh

paraFoam

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 8 / 23

Page 9: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Problems during meshing

Mesh with collapsed gap.Mesh after using

keepCellsIntersectingPatchoption for runner inlet.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 9 / 23

Page 10: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

MergeMeshes

cd ..

cp -r dis francis

mergeMeshes . francis . runner

mv francis/0.001/polyMesh/* francis/constant/polyMesh/

cd francis

rm constant/polyMesh/boundary.gz

rm -r 0.001/

cd ..

mergeMeshes . francis . dt

mv francis/0.001/polyMesh/* francis/constant/polyMesh/

cd francis

rm -r 0.001/

scaleMesh 0.001

paraFoam

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 10 / 23

Page 11: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Running the simulations

Use MRFSimpleFoam solver

Steady state with at least one rotating zone and one stationary zone

Source term in rotating zone modified to account for Coriolis forcesand centrifugal forces.

Additional problems- wakes from rotating zones need to betransported properly to the stationary zone.

Done by doing a circumferential averaging of all the quantities.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 11 / 23

Page 12: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Setting up the mixing Plane

The setup is the same as the axial turbine mixing plane tutorial. But tosave time I have already set one up.

mv jethro_openfoam/turbine99/ .

cd turbine99

The boundary file has to be modified. Add the following to boundary file.The rest remains the same.

vi constant/polyMesh/boundary.gz

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 12 / 23

Page 13: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Modifying the boundary fileUnder disoutlet

type mixingPlane;

shadowPatch rninlet;

zone disoutletZone;

coordinateSystem

{

type cylindrical;

name mixingCS;

origin (0 0 0);

e1 (1 0 0);

e3 (0 0 1);

inDegrees true;

}

ribbonPatch

{

sweepAxis Theta;

stackAxis Z;

discretisation bothPatches;

}

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 13 / 23

Page 14: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Continued

Under discyclic1

type cyclicGgi;

shadowPatch discyclic2;

zone discyclic1Zone;

bridgeOverlap false;

rotationAxis (0 0 1);

rotationAngle 12.8571428;

separationOffset (0 0 0);

Under discyclic2

type cyclicGgi;

shadowPatch discyclic1;

zone discyclic2Zone;

bridgeOverlap false;

rotationAxis (0 0 1);

rotationAngle -12.8571428;

separationOffset (0 0 0);

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 14 / 23

Page 15: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Continued

Under rnoutlet

type mixingPlane;

shadowPatch dtinlet;

zone rnoutletZone;

coordinateSystem

{

type cylindrical;

name mixingCS;

origin (0 0 0);

e1 (1 0 0);

e3 (0 0 1);

inDegrees true;

}

ribbonPatch

{

sweepAxis Theta;

stackAxis R;

discretisation bothPatches;

}

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 15 / 23

Page 16: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Continued

Under rncyclic1

type cyclicGgi;

shadowPatch rncyclic2;

zone rncyclic1Zone;

bridgeOverlap true;

rotationAxis (0 0 1);

rotationAngle 24;

separationOffset (0 0 0);

Under rncyclic2

type cyclicGgi;

shadowPatch rncyclic1;

zone rncyclic2Zone;

bridgeOverlap true;

rotationAxis (0 0 1);

rotationAngle -24;

separationOffset (0 0 0);

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 16 / 23

Page 17: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Continued

Under rninlet

type mixingPlane;

shadowPatch disoutlet;

zone rninletZone;

Under dtinlet

type mixingPlane;

shadowPatch rnoutlet;

zone dtinletZone;

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 17 / 23

Page 18: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Implementing a boundary condition

Cylindrical inlet velocity boundary condition is used a the inlet.

cd ..

mkdir -p $WM_PROJECT_USER_DIR/src/finiteVolume/fields\

/fvPatchFields/derived

mv jethro_openfoam/rotatingWallTangentialVelocity\

$WM_PROJECT_USER_DIR/src/finiteVolume/fields\

/fvPatchFields/derived

cd $WM_PROJECT_USER_DIR/src/finiteVolume/fields\

/fvPatchFields/derived

cd rotatingWallTangentialVelocity

wclean

wmake libso

run

cd turbine99

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 18 / 23

Page 19: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Creating zone

Look inside setBatchmixingPlane

vi setBatchmixingPlane

Cell set named rotor created to define a rotor zone

Various face sets created for defining mixing plane zones and cycliczones

Use setsToZones -noFlipMap to create zones.This in the the Allrunnew file.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 19 / 23

Page 20: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Running the simulations

Add the following to the system/controlDict

libs ("libRotatingWallTangentialVelocityFvPatchVectorField.so");

Run

./Allrun

Open a new terminal to view the residuals.

OFextend32

run

cd turbine99

pyFoamPlotWacher.py log.MRFsimpleFoam

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 20 / 23

Page 21: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Velocity and pressure contours

Uz velocity contour Pressure contour

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 21 / 23

Page 22: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Velocity and pressure contours

Velocity contour Pressure contour

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 22 / 23

Page 23: Evaluate the use of cfMesh for the Francis-99 turbine. CFD ...hani/kurser/OS_CFD_2015/... · Francis-99 turbine. CFD with OpenSource Software ... Jethro Raymond Nagawkar Openfoam

Section

Subsection

Conclusions

Good part

cfMesh is easy to learn and use

Can handle dirty geometry.

Automatic and can be done in by using parallel processing.

Drawbacks

If patches too close to one another, the gap collapses.

Need to use keepCellsIntersectingPatches option, which increasesmeshing time

Sharp edges difficult to capture, the geometry gets distorted slightlycreating non orthogonal edges.

Jethro Raymond Nagawkar Openfoam presentation 2015-12-08 23 / 23