CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Reporting a bug in Allrun script on wingMotion case (https://www.cfd-online.com/Forums/openfoam-bugs/202865-reporting-bug-allrun-script-wingmotion-case.html)

i.sabahi June 10, 2018 09:00

Reporting a bug in Allrun script on wingMotion case
 
Hello dear all,


I encountered a simple bug which took me some time to resolve, so i thought i'd better post it here as well as report it on the OpenFOAM's original bug-reporting link.


So when you run the ./Allrun script on the wingMotion case in OpenFOAM 3.0 (Ubuntu 14.04) the terminal or the log shows the following error:

cp: target ‘constant/polyMesh/’ is not a directory

The simpleFoam case is run without a problem, but the pimpleDyMFoam case won't run. the reason being that the "polyMesh" folder won't be copied from the simpleFoam/constant directory, so the process can't continue.


The original ./Allrun script is as follows:

Quote:

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

# Make 3D mesh in slab of cells.
cd wingMotion_snappyHexMesh
runApplication blockMesh
runApplication snappyHexMesh -overwrite

# Make a 2D mesh by extruding a patch and solve to steady state.
cd ../wingMotion2D_simpleFoam
runApplication extrudeMesh
runApplication createPatch -overwrite
cp -r 0.org 0
runApplication simpleFoam

# Copy the mesh from the steady state case and map the results to a
# mesh motion case, then solve transient.
cd ../wingMotion2D_pimpleDyMFoam
cp -r ../wingMotion2D_simpleFoam/constant/polyMesh/* constant/polyMesh/
cp -r 0.org 0
runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent
mv 0/pointDisplacement.unmapped 0/pointDisplacement
runApplication decomposePar
runParallel `getApplication` 4
runApplication reconstructPar

# ----------------------------------------------------------------- end-of-file
The problem is the "*" at the end of the first "cp -r .." line. so in order for the pimpleDyMFoam case to work, the "*" must be deleted. so the following ./Allrun file needs to be used instead:


Quote:

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

# Make 3D mesh in slab of cells.
cd wingMotion_snappyHexMesh
runApplication blockMesh
runApplication snappyHexMesh -overwrite

# Make a 2D mesh by extruding a patch and solve to steady state.
cd ../wingMotion2D_simpleFoam
runApplication extrudeMesh
runApplication createPatch -overwrite
cp -r 0.org 0
runApplication simpleFoam

# Copy the mesh from the steady state case and map the results to a
# mesh motion case, then solve transient.
cd ../wingMotion2D_pimpleDyMFoam
cp -r ../wingMotion2D_simpleFoam/constant/polyMesh/ constant/polyMesh/
cp -r 0.org 0
runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent
mv 0/pointDisplacement.unmapped 0/pointDisplacement
runApplication decomposePar
runParallel `getApplication` 4
runApplication reconstructPar

# ----------------------------------------------------------------- end-of-file
I don't know if this bug is resolved in the following versions of OpenFOAM, but i thought I'd share. (I also reported the bug on the original OpenFOAM website.)


Regards
Iman


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