open source software course: assignment 1 - chalmershani/kurser/os_cfd_2012/assignment1/mengm… ·...

15
Open Source Software Course - Assignment 1 Summary Open Source Software Course: Assignment 1 Mengmeng Zhang Aeronautical and Vehicle Engineering, Royal Insistute of Technology (KTH), Stockholm, Sweden 2012-09-09 Mengmeng Zhang Open Source Software Course 2012-09-09 1 / 15

Upload: tranxuyen

Post on 13-Apr-2018

219 views

Category:

Documents


3 download

TRANSCRIPT

Open Source Software Course - Assignment 1 Summary

Open Source Software Course: Assignment 1

Mengmeng Zhang

Aeronautical and Vehicle Engineering,Royal Insistute of Technology (KTH),

Stockholm, Sweden

2012-09-09

Mengmeng Zhang Open Source Software Course 2012-09-09 1 / 15

Open Source Software Course - Assignment 1 Summary

Solvers

Three solvers

icoFoam: incompressible flow solver

interFoam: two-phrase incompressible flow solver

simpleFoam: an implementation for steady incompressible flow usingthe SIMPLE algorithm 1

1http://openfoamwiki.net/index.php/TheSIMPLEalgorithminOpenFOAMMengmeng Zhang Open Source Software Course 2012-09-09 2 / 15

Open Source Software Course - Assignment 1 Summary

icoFoam

icoFoam: cavity, cavityFine

Pressue for cavity original meshPressure for cavity fine (doubled)

mesh

The mesh is refined by increasing the number of cells in each direction, inblockMeshDict file. The mesh is generated by blockMesh. One can seethat the coarse mesh results mapping on the fine mesh by mapFields.Mengmeng Zhang Open Source Software Course 2012-09-09 3 / 15

Open Source Software Course - Assignment 1 Summary

icoFoam

icoFoam: cavity, cavityFine, cavityGrade

Velocity magnitude forcavity coarse mesh

Velocity magnitude forcavity fine mesh

Velocity magnitude forcavity grade mesh

The grading mesh is obtained by changing the gradient (or mesh growthrate) in each direction from 1 to 2, in blockMeshDict under the folder/constant/polyMesh. The fine mesh result are mappling onto the grademesh by mapFields.The case is solved by running icoFoam.Mengmeng Zhang Open Source Software Course 2012-09-09 4 / 15

Open Source Software Course - Assignment 1 Summary

icoFoam

icoFoam: cavity, cavityClipped, cavityFine

Velocity vector for cavityoriginal mesh

Velocity vector for cavityclipped mesh

Velocity vector forcavity fine mesh

The cavity mesh and the fine mesh results are all mapped from the coarse(original) mesh results. Figures above show the velocity vector by filteringcell centers and then using Glyphs in ParaView c©.

Mengmeng Zhang Open Source Software Course 2012-09-09 5 / 15

Open Source Software Course - Assignment 1 Summary

icoFoam

icoFoam: cavity, cavityHighRe - I

Velocity magnitude for cavity withRe = 10

Velocity magnitude for cavity withRe = 100

The Reynolds number is increased 10 times in the latter case by decreasingthe kinematic viscosity by factor of 10 in transportProperties dictionary.

Mengmeng Zhang Open Source Software Course 2012-09-09 6 / 15

Open Source Software Course - Assignment 1 Summary

icoFoam

icoFoam: cavity, cavityHighRe - II

Streamline for cavity with Re = 10 Streamline for cavity with Re = 100

The streamline can be visualized by selecting Stream Tracer with “linesource” and the same number of the lines for both cases. All the cases foricoFoam can be run by Allrun.Mengmeng Zhang Open Source Software Course 2012-09-09 7 / 15

Open Source Software Course - Assignment 1 Summary

interFoam

interFoam: damBreak, damBreakFine - I

Velocity magnitude on coarse mesh,t=1s

Velocity magnitude on fine mesh,t=1s

Refine the mesh in blockMeshDict (same as in icoFoam solver). Use thesetFields utility to update the fields.

Mengmeng Zhang Open Source Software Course 2012-09-09 8 / 15

Open Source Software Course - Assignment 1 Summary

interFoam

interFoam: damBreak, damBreakFine - II

Water (blue) and air (red) oncoarse mesh, t=1s Water (blue) and air (red) on fine

mesh, t=1s

We can see that the mesh size effects the results quite a lot.

Mengmeng Zhang Open Source Software Course 2012-09-09 9 / 15

Open Source Software Course - Assignment 1 Summary

simpleFoam

simpleFoam: pitzDaily - I

In this case it calculates a steady turbulent flow over a backward-facingstep. The flow goes from inlet (left) to outlet (right). At the inlet we havestrong uniform flow in the x direction and, as it passes over the step, itgenerates shear on the fluid below, generating a vortex in the bottom halfof the domain. The regions of high shear will therefore be close to thecentreline of the domain and close to the walls.The mesh is defined in blockMeshDict and generated by blockMesh. IncontrolDict, the time step ”deltaT” is set to 1 since in steady state casessuch as this is effectively an iteration counter. With benefit of hindsightwe know that the solution requires 1000 iterations reach reasonableconvergence, hence “endTime” is set to 1000.

Mengmeng Zhang Open Source Software Course 2012-09-09 10 / 15

Open Source Software Course - Assignment 1 Summary

simpleFoam

simpleFoam: pitzDaily - II

Turbulent kinetic energy, 100iteration.

Turbulent kinetic energy, 1000iteration (steady state)

The case is convergeced after 765 iterations.

Mengmeng Zhang Open Source Software Course 2012-09-09 11 / 15

Open Source Software Course - Assignment 1 Summary

Utilities

Summary: utilities used, to be contid::

blockMesh: a multi-block mesh generator (every case);

checkMesh: checks validity of a mesh (every case);

refineMesh: refines cells in multiple directions (0,1,2 direction) (can beused in cavityFine instead of using mapFields);

Mengmeng Zhang Open Source Software Course 2012-09-09 12 / 15

Open Source Software Course - Assignment 1 Summary

Utilities

Summary: utilities used, to be contid::

mapFields: maps volume fields from one mesh to another, reading andinterpolating all fields present in the time directory of both cases. Paralleland non-parallel cases are handled without the need to reconstruct themfirst (cavityFine, cavityClipped);

setFields: set values on a selected set of cells/patchfaces through adictionary (damBreakFine);

decomposePar: makes a domain decomposition for parallel computations(can be used for large cases);

Mengmeng Zhang Open Source Software Course 2012-09-09 13 / 15

Open Source Software Course - Assignment 1 Summary

Utilities

Summary: utilities used

The usages for all the utilities can be found if we type:utility -helpFor example, if we would like to find out the usage of utility blockMesh,we type:blockMesh -helpin the command window. All of the utilities must be run under the ”case”folder we want to run.

Mengmeng Zhang Open Source Software Course 2012-09-09 14 / 15

Open Source Software Course - Assignment 1 Summary

Post-processing and visualization

Summary: paraFoam

Once the case is done, a temporary .OpenFOAM file is generated whenparaFoam is opened. It can be saved to VTK file for next time opening inParaview directly. In paraFoam (or Paraview) the case can be visualized inmany aspects, for different time steps and so on. Different filters help tovisualize different solutions, such as velocity, pressure, kinetic energy,transportation and so on. The mesh can be visualized by selecting edge.Vectors can be visualized by selecting Glyphs, streamline Stream Tracer,and contours Contour. The case can be cut by Clip and also sliced bySlice. The filtered/processed results can be saved as .csv file which dataare stored in columns that can be post-processed in other plotting tools.To open multiple cases in paraFoam one needs to generate additional caseby hand using touch command.

Mengmeng Zhang Open Source Software Course 2012-09-09 15 / 15