20
icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFo Assignment 1 for the course CFD with OpenSource Software Simon T¨ ornros Chalmers University of Technology, Gothenburg, Sweden 2012-09-07 SimonT¨ornros Assignment 1 2012-09-07 1 / 20

Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

Assignment 1for the course

CFD with OpenSource Software

Simon Tornros

Chalmers University of Technology,Gothenburg, Sweden

2012-09-07

Simon Tornros Assignment 1 2012-09-07 1 / 20

Page 2: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

Cavity

Cavity case utilities

the utility blockMesh is used to create the mesh according to theblockMeshDict file found in the$FOAM TUTORIALS/incompressible/icoFoam/cavity/constant/polyMesh/directory. The whole tutorial directory has been copied into the user’srun directory.

Finally the case was solved using the incompressible laminar solvericoFoam.

Simon Tornros Assignment 1 2012-09-07 2 / 20

Page 3: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

Cavity

Cavity case visualization

The velocity magnitude field is visualized by coloring the surface bythe velocity magnitude as can be seen in Figure 1 and Figure 2. Theleft image is colored by cells and the right image by points. Thecoloring by cells represents the solution better as the point field isinterpolated.

Figure: Velocity cell field Figure: Velocity point fieldSimon Tornros Assignment 1 2012-09-07 3 / 20

Page 4: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityFine

CavityFine case utilities

the utility blockMesh is used to create the mesh according to theblockMeshDict file found in theincompressible/icoFoam/cavityF ine/constant/polyMesh/directory which has been changed to create a 40× 40× 1 mesh.

mapFields to map the velocity and pressure fields from the cavity caseonto the new finer mesh. Observe that -consistent is used as thegeometry and boundary conditions are identical.

Finally the case was solved using the incompressible laminar solvericoFoam.

Simon Tornros Assignment 1 2012-09-07 4 / 20

Page 5: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityFine

CavityFine case visualization

The velocity field is presented by glyphs in Figure 3 (arrows in thiscase) created by applying a z-normal slice filter at half the thicknessand applying the cellcenters filter followed by the glyph filter. Thearrows are colored by the pressure.

Figure: Glyphs for the cavityFine case

Simon Tornros Assignment 1 2012-09-07 5 / 20

Page 6: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityGrade

CavityGrade case utilities

the utility blockMesh is used to create the nonuniform meshaccording to the blockMeshDict file found in theincompressible/icoFoam/cavityGrade/constant/polyMesh/directory.

mapFields to map the veloticy and pressure fields from the cavityFinecase onto the nonuniform mesh. Also now one can observe that-consistent is used as the geometry and boundary conditions areidentical.

Finally the case was solved using the incompressible laminar solvericoFoam.

Simon Tornros Assignment 1 2012-09-07 6 / 20

Page 7: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityGrade

CavityGrade case visualization

The pressure scalar field is presented by coloring the surface withedges which also shows the mesh in 4.

Figure: Surface colored by pressure and the mesh

Simon Tornros Assignment 1 2012-09-07 7 / 20

Page 8: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityHighRe

CavityHighRe case utilities

the utility blockMesh is used to create the nonuniform meshaccording to the blockMeshDict file found in theincompressible/icoFoam/cavityHighRe/constant/polyMesh/directory.

Finally the case was solved for the new Reynolds number using theincompressible laminar solver icoFoam.

Simon Tornros Assignment 1 2012-09-07 8 / 20

Page 9: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityFine

CavityFine case visualization

The velocity field is presented by glyphs in 5 (arrows in this case)created by applying a z-normal slice filter at half the thickness andapplying the cellcenters filter followed by the glyph filter. The arrowsare colored by the pressure.

Figure: Glyphs for the cavityHighRe case

Simon Tornros Assignment 1 2012-09-07 9 / 20

Page 10: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityClipped

CavityClipped case utilities

the utility blockMesh is used to create the mesh according to theblockMeshDict file found in theincompressible/icoFoam/cavityClipped/constant/polyMesh/directory.

mapFields to map the veloticy and pressure fields from the cavity caseonto the clipped geometry. Observe that the geometries areinconsistent and the fiels are mapped according to the mapFieldsDictfile found in the /cavityClipped/system/ directory.

Finally the case was solved for the new Reynolds number using theincompressible laminar solver icoFoam.

Simon Tornros Assignment 1 2012-09-07 10 / 20

Page 11: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

CavityClipped

CavityClipped case visualization

The cavityClipped case is visualized in 6 by applying a z-normal slicefilter followed by a streamtracer colored by vorticity.

Figure: Streamlines colored by vorticity

Simon Tornros Assignment 1 2012-09-07 11 / 20

Page 12: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

damBreak

damBreak case utilities

the utility blockMesh is used to create the mesh according to theblockMeshDict file found in themultiphase/interFoam/laminar/damBreak/constant/polyMesh/directory.

setFields is used to set the nonuniform field for the phase fractionalpha. According to the setFieldsDict in the system directory thedefault value in the domain is 0 (gas phase) and additionally a box isdefined where alpha is equal to 1 (liquid phase).

Finally the case was solved using the solver interFoam which solves, inthis case laminar flow, for two fluids using the VOF method.

Simon Tornros Assignment 1 2012-09-07 12 / 20

Page 13: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

damBreak

damBreak case visualization

The phases are visualized in Figure 7 and Figure 8 by coloring thesurface by alpha1.

Figure: Phase fraction at time 0 Figure: Phase fraction at time 1

Simon Tornros Assignment 1 2012-09-07 13 / 20

Page 14: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

damBreakFine

damBreakFine case utilities

the utility blockMesh is used to create the mesh according to the finerblockMeshDict file found in themultiphase/interFoam/laminar/damBreakFine/constant/polyMesh/directory.

setFields is used to set the nonuniform field for the phase fractionalpha. According to the setFieldsDict in the system directory thedefault value in the domain is 0 (gas phase) and additionally a box isdefined where alpha is equal to 1 (liquid phase).

Finally the case was solved using the solver interFoam which solves, inthis case laminar flow, for two fluids using the VOF method.

Simon Tornros Assignment 1 2012-09-07 14 / 20

Page 15: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

damBreakFine

damBreakFine case visualization

The phases are visualized in Figure 9 and Figure 10 by coloring thesurface by alpha1.

Figure: Phase fraction at time 0 Figure: Phase fraction at time 1

Simon Tornros Assignment 1 2012-09-07 15 / 20

Page 16: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

pitzDaily

pitzDaily case utilities

the utility blockMesh is used to create the mesh according to theblockMeshDict file found in theincompressible/simpleFoam/pitzDaily/constant/polyMesh/directory.

Finally the case was solved for the new Reynolds number using theincompressible steady state solver simpleFoam with the RANS k − εturbulence model.

Simon Tornros Assignment 1 2012-09-07 16 / 20

Page 17: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

pitzDaily

pitzDaily case visualization

The pitzDaily case is visualized in 11 by applying a streamtracer filtercreating 30 streamlines across the domain.

Figure: Streamlines colored by velocity magnitude

Simon Tornros Assignment 1 2012-09-07 17 / 20

Page 18: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

patchMassFlow

New tutorial: patchMassFlow applied to the pitzDaily case

The patchMassFlow functionObject calculates the massflow acrossselected patches.

This was performed using OpenFoam 1.6-ext to the pitzDaily case onthe inlet and outlet.

The simpleFunctionObjects were installed by

svn checkout https://openfoam-extend.svn.sourceforge.net

/svnroot/openfoam-extend/trunk/Breeder_1.6/libraries

/simpleFunctionObjects

followed by compilation

wmake libso

The functionObject patchMassFlow was activated by adding thefollowing lines to the end on the controlDict file (see next page)

Simon Tornros Assignment 1 2012-09-07 18 / 20

Page 19: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

controlDict - patchMassFlow

functions

(

massFlow

{

type patchMassFlow;

functionObjectLibs

(

"libsimpleFunctionObjects.so"

);

patches

(

inlet

outlet

);

}

);

Simon Tornros Assignment 1 2012-09-07 19 / 20

Page 20: Assignment 1 for the course CFD with OpenSource Software · case) created by applying a z-normal slice lter at half the thickness and applying the cellcenters lter followed by the

icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam icoFoam interFoam interFoam interFoam interFoam simpleFoam simpleFoam functionObject tutorial functionObject tutorial functionObject tutorial

patchMassFlow

After the case was run using the simpleFoam solver the mass flowsacross the inlet and outlet could be found inpatchMassF lows massF low/0/massF low. The expected result isequal magnitude but different signs, which is confirmed by Figure 12

Figure: Massflow across inlet and outlet

Simon Tornros Assignment 1 2012-09-07 20 / 20