CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Trying to understand Allrun script (http://www.cfd-online.com/Forums/openfoam-solving/94417-trying-understand-allrun-script.html)

j-avdeev November 15, 2011 07:13

Trying to understand Allrun script
 
Hello,
I'm working with
$FOAM_TUTORIALS/multiphase/interFoam/laminar
and trying to understand work of Allrun script, particularly

Code:

setDamBreakFine ()
{
    blockMeshDict="constant/polyMesh/blockMeshDict"
    controlDict="system/controlDict"
    sed \
    -e s/"23 8"/"46 10"/g \
    -e s/"19 8"/"40 10"/g \
    -e s/"23 42\(.*\) 1 1)"/"46 76\1 2 1)"/g \
    -e s/"4 42\(.*\) 1 1)"/"4 76\1 2 1)"/g \
    -e s/"19 42\(.*\) 1 1)"/"40 76\1 2 1)"/g \
    $blockMeshDict > temp.$$
    mv temp.$$ $blockMeshDict
    sed \
    -e s/"\(deltaT[ \t]*\) 0.001;"/"\1 5e-04;"/g \
    -e s/"\(endTime[ \t]*\) 1;"/"\1 0.4;"/g \
    $controlDict > temp.$$
    mv temp.$$ $controlDict
}

For what this substitutions in blockMeshDict file?

Code:

blocks         
(
    hex (0 1 5 4 12 13 17 16) (23 8 1) simpleGrading (1 1 1)
    hex (2 3 7 6 14 15 19 18) (19 8 1) simpleGrading (1 1 1)
    hex (4 5 9 8 16 17 21 20) (23 42 1) simpleGrading (1 1 1)
    hex (5 6 10 9 17 18 22 21) (4 42 1) simpleGrading (1 1 1)
    hex (6 7 11 10 18 19 23 22) (19 42 1) simpleGrading (1 1 1)
);


darai November 15, 2011 07:57

link to manual
 
Hello Avdeev,

The blockMesh is quite well described in user manual
http://www.openfoam.com/docs/user/

But in short the line:

hex (0 1 5 4 12 13 17 16) (23 8 1) simpleGrading (1 1 1)

Means "create a box of hex elements" "between vertices 0 1 5 4 12 13 17 and 16", in first direction of this box create 23 elements, in second direction 8 and in third direction 1. Use simple grading algorythm with coefficients 1 1 1 (no grading, all elements should have the same proportional dimensions)

Martin.

akidess November 15, 2011 08:26

In addition to what Martin said: sed is used to modify text files. In this instance, it will take the blockMesh description file from the dambreak tutorial and increase the cell count as well as the refinement to generate a second, finer mesh.

j-avdeev November 16, 2011 03:22

Thank you for answers.

But what the reason of creating second mesh?
Is it right to say that case will run two times - first time with first mesh, second time with second (changed by sed) mesh?

Also in Allrun changes endTime variable :confused:

akidess November 16, 2011 03:47

The discretization will be more accurate on the finer mesh. Thus you do mesh refinement to check if you have a grid independent solution by running a second simulation.

If I remember correctly, in the dam break case you will see a pocket of air on the fine mesh that is not there on the coarse mesh. Since the simulation will need more time to complete on a fine mesh, the end time is reduced for the tutorial case so it can complete in a reasonable time.


All times are GMT -4. The time now is 14:23.