willzyba |
September 23, 2014 19:18 |
Setting up Parallel Simulations of Dynamic Mesh
I'm find setting up new models for waveFoam and waveDyMFoam (which are essentially icoFoam and IcoDyMFoam) to be a process of random luck.
The process of creating a Mesh, Assigning values to the mesh (like Alpha levels and initial velocities), and splitting it across processors seems to require a lot more care and just when I think I get it - it doesn't.
To give an illustration, our Allrun script has the following form
Code:
#!/bin/sh
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication surfaceFeatureExtract
runApplication blockMesh
runApplication decomposePar
runParallel snappyHexMesh 40 -overwrite
# reconstruct
runApplication reconstructParMesh -mergeTol 1e-6 -constant
\rm -rf 0
\cp -r 0.org 0
rm -rf processor*
mv log.decomposePar log.decomposePar1
runApplication setWaveField
runApplication decomposePar
runParallel wave[DyM]Foam 40
parReconstructPar -n 20
Note we use either waveDyMFoam or waveFoam
I hate this script, since we split the mesh for snappyHexMesh, pull it all back together just to assign velocities and water levels to all the cells (with setWaveField) and then split it again. However, its the only way I get it to work consistently. Has anyone managed to get setWaveField to work sensible in parallel - which I know it can do.
Another issue that perplexes me, is that I see in many example the following lines or an appropriate variant, at the bottom of each file within 0.org
Code:
"procBoundary.*"
{
type processor;
value uniform (0 0 0);
}
What does this do? And when do we need these lines and when not. With our Allrun script above, it seems to work without.
As an example in 0.org/alpha.water contains
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Revision: 1740 |
| \\/ M anipulation | Web: http://www.OpenFOAM.org |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
bottom
{
type zeroGradient; // no flow through boundary
}
backWall
{
type zeroGradient;
}
inlet
{
type waveAlpha;
refValue uniform 0;
refGrad uniform 0;
valueFraction uniform 1;
value uniform 0;
}
outlet
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
ccell
{
type zeroGradient;
}
"procBoundary.*"
{
type processor;
value uniform (0 0 0);
}
}
Thanks in advance.
|