CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Trying to understand Allrun script

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 15, 2011, 07:13
Default Trying to understand Allrun script
  #1
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 52
Blog Entries: 1
Rep Power: 12
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
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)
);
j-avdeev is offline   Reply With Quote

Old   November 15, 2011, 07:57
Default link to manual
  #2
New Member
 
Martin Holecek
Join Date: Nov 2011
Location: Prague
Posts: 21
Rep Power: 5
darai is on a distinguished road
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.
darai is offline   Reply With Quote

Old   November 15, 2011, 08:26
Default
  #3
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Old   November 16, 2011, 03:22
Default
  #4
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 52
Blog Entries: 1
Rep Power: 12
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
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
j-avdeev is offline   Reply With Quote

Old   November 16, 2011, 03:47
Default
  #5
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
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.
akidess is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ICEM] Script: problems with face names Maweil ANSYS Meshing & Geometry 2 October 25, 2011 21:32
[ANSYS Meshing] Problem with Icem Script Krish ANSYS Meshing & Geometry 0 October 18, 2011 12:10
how I can write the file script to submite via HPC cluster at my UNI happy CFX 2 October 17, 2011 02:18
CFX mesh script error Malik77 CFX 0 June 24, 2011 07:42
Perl script for intialisation pratik mehta CFX 2 September 10, 2008 03:09


All times are GMT -4. The time now is 15:56.