CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Allrun for SHM and LTSInterFoam (

laurent98 November 15, 2012 23:31

Allrun for SHM and LTSInterFoam
hi everybody
i try to run a calculation with this Allrun copy and modify from what i found on tutorial and on web
can some one tell me what doing this 2 lines?

find . -type f -iname "*level*" -exec rm {} \;
ls -d processor* | xargs -i cp -r* ./{}/0/ $1

here the allrun script;

cd ${0%/*} || exit 1    # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication topoSet -dict cRefine.topoSetDict
runApplication refineMesh -overwrite -dict
rm log.refineMesh > /dev/null 2>&1
rm log.topoSet > /dev/null 2>&1
runApplication topoSet -dict cRerefine.topoSetDict
runApplication refineMesh -overwrite -dict

cp system/decomposeParDict-nonPar system/decomposeParDict
runApplication  decomposePar
cp system/decomposeParDict-par system/decomposeParDict
runParallel snappyHexMesh 4  -overwrite

runApplication reconstructParMesh -constant
runApplication reconstructPar  # -constant -time 0
cp 0/ 0/alpha1
runApplication setFields
find . -type f -iname "*level*" -exec rm {} \;
ls -d processor* | xargs -i cp -r* ./{}/0/ $1

runApplication setFields
rm log.decomposePar > /dev/null 2>&1
runParallel changeDictionary 4  -literalRE # Set boundary conditions
runApplication  decomposePar
runParallel renumberMesh 4 -overwrite #slight improvement in speed
runParallel  `getApplication` 4
runApplication reconstructParMesh -constant
runApplication reconstructPar
# ----------------------------------------------------------------- end-of-file# #

i fill to be nearly there, after losing some hairs, the error message in log.LTSInterfoam is;
[0] size 679545 is not equal to the given value of 169885
[0] file: /mnt/disk2/laurent/boats/calculOF/laurent-2.1.x/hulls/a_04_refinemesh_parallel/processor0/0/alpha1 from line 18 to line 681403.

all suggestion or remarques will be very well come!
thanks you by advance for help!

laurent98 November 18, 2012 06:58

hello Foamers,
to make my question simple; if i want to run SHM and solver in parallel, do i need to reconstructPar, between SHM and the solver....
thanks you very much by advance

sail November 18, 2012 16:22

My guess is that you have still some processoN folder between after thw snappy reconstruct and the decomposition before the LTS and this might cause issues in cell number. I'd try to remove them in between.

Lieven November 18, 2012 19:00

Dear Laurent,
Regarding the two command lines:


find . -type f -iname "*level*" -exec rm {} \;
looks for all files with "level" in their name (regardless what comes before or after) and deletes these files

ls -d processor* | xargs -i cp -r* ./{}/0/ $1
copies all files and folders in to the 0 directory of each processor directory. Why the $1 is added at this end is not clear to me.

This second command seems pretty odd to me. DecomposePar will add the processor boundary conditions to each of the variables when decomposing but this command will overwrite the files again with the original 'undecomposed' ones. I expect this to be the cause of the error you get.

Besides this, the order of commands in your script also seems a bit odd to me. This is the order I would follow:

1. set up basic mesh (e.g. with blockMesh)
2. if necessary, refine/adjust mesh (e.g. refineMesh, snappyHexMesh)
3. set initial fields (e.g. copy 0.orig fields to 0, setFields, ...)
4. decomposePar
5. run the simulation (e.g. foamJob -p LTSinterFoam)
6. reconstructPar
7. Postprocessing ...

The message is, you should not make to many manipulations between decomposePar, running the simulation and reconstructPar (I would recommend not to make any). Try to modify your script according to this order and let me know if it solved the problem.



laurent98 November 18, 2012 21:07

first thanks you very much for answering, i just get the solver running!!! its very exciting!!!
in fact i saw that setFields is pretty smart: that set fields even when those are decomposed on multi processor!!!
and when i re-decompose, to run the solver, the repertories are re-write, so no need to delete them....
happy day to all LL

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