Pyfoam, A User Contribution: BCS, Physics Models, Other Libraries For Other Languages Pyfoam Pyfoam
Pyfoam, A User Contribution: BCS, Physics Models, Other Libraries For Other Languages Pyfoam Pyfoam
• pyFoam is NOT in the OpenFOAM distribution! You will have to install it separately!
• We will now use pyFoam to set up dictionaries and to plot information in the log file.
Add to ˜/.bashrc:
alias PF=’export FOAM_INST_DIR=$HOME/OpenFOAM; \
export PYTHONPATH=$FOAM_INST_DIR/PyFoam/lib/python-2.3/site-packages:$PYTHONPATH; \
export PATH=$FOAM_INST_DIR/PyFoam/bin:$PATH’
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily $FOAM_RUN/simpleE
cd $FOAM_RUN/simpleElbow
• Modify all the dictionaries according to how you want to run your case (keep default
now).
• Modify the mesh by editing blockMeshDict and running blockMesh, or use a third-
party mesh-generator and a converter utility (fluentMeshToFoam usually works). Here:
cp $FOAM_TUTORIALS/incompressible/icoFoam/elbow/elbow.msh .
fluentMeshToFoam elbow.msh
• Now, the patch names in the time directory is probably not in accordance with the ones
in constant/polyMesh/boundary
• Edit all the dictionaries in the time directory so that all the patch names in
constant/polyMesh/boundary are present. Also set the appropriate boundary con-
dition for each patch. This is a lot of work! There is however an option...
• This also seems quite complicated, but if you use consistent naming, this can be re-used
for other cases.