OpenFOAM: Difference between revisions

Jump to navigation Jump to search
no edit summary
(mark for translation)
No edit summary
Line 19: Line 19:


===Usage===
===Usage===
OpenFOAM requires substantial preparation of your environment. In order to run OpenFOAM commands (such as <code>paraFoam</code>, <code>blockMesh</code>, etc), you must load a [[Using modules| modulefile]] followed by sourcing a configuration script.
OpenFOAM requires substantial preparation of your environment. In order to run OpenFOAM commands (such as <code>paraFoam</code>, <code>blockMesh</code>, etc), you must load a [[Using modules| modulefile]].


Here is an example of a serial submission script for OpenFOAM 5.0:
Here is an example of a serial submission script for OpenFOAM 5.0:
<pre>
{{File
  |name=submit.sh
  |lang="bash"
  |contents=
#!/bin/bash
#!/bin/bash
#SBATCH --time=00:01:00
#SBATCH --time=00:01:00
Line 29: Line 32:
module purge
module purge
module load openfoam/5.0
module load openfoam/5.0
source $FOAM_ETC/bashrc


blockMesh
blockMesh
icoFoam
icoFoam
</pre>
}}


Here is an example of a parallel submission script:
Here is an example of a parallel submission script:
<pre>
{{File
  |name=submit.sh
  |lang="bash"
  |contents=
#!/bin/bash
#!/bin/bash
#SBATCH --account=def-someuser
#SBATCH --account=def-someuser
Line 45: Line 50:
module purge
module purge
module load openfoam/5.0
module load openfoam/5.0
source $FOAM_ETC/bashrc


decomposePar
decomposePar
Line 51: Line 55:
setFields
setFields
srun interFoam -parallel
srun interFoam -parallel
</pre>
}}


Mesh preparation (<code>blockMesh</code>) may be fast enough to be done at the command line (see [[Running jobs]]).  The solver (<code>icoFoam</code> and others) is usually the most expensive step and should always be submitted as a Slurm job except in very small test cases or tutorials.
Mesh preparation (<code>blockMesh</code>) may be fast enough to be done at the command line (see [[Running jobs]]).  The solver (<code>icoFoam</code> and others) is usually the most expensive step and should always be submitted as a Slurm job except in very small test cases or tutorials.
Line 57: Line 61:
===Performance===
===Performance===
OpenFOAM can emit a lot of debugging information in very frequent small writes (e.g. hundreds per second). This may lead to poor performance on our network file systems. If you are in stable production and don't need the debug output, you can reduce or disable it with:
OpenFOAM can emit a lot of debugging information in very frequent small writes (e.g. hundreds per second). This may lead to poor performance on our network file systems. If you are in stable production and don't need the debug output, you can reduce or disable it with:
<pre>
{{Commands
$ mkdir -p $HOME/.OpenFOAM/$WM_PROJECT_VERSION
|mkdir -p $HOME/.OpenFOAM/$WM_PROJECT_VERSION
$ cp $WM_PROJECT_DIR/etc/controlDict $HOME/.OpenFOAM/$WM_PROJECT_VERSION/
|cp $WM_PROJECT_DIR/etc/controlDict $HOME/.OpenFOAM/$WM_PROJECT_VERSION/
</pre>
}}


Then edit the <code>debugSwitches</code> dictionary in <code>$HOME/.OpenFOAM/$WM_PROJECT_VERSION/controlDict</code>, changing flags from values >0 to 0.  ''(Contribution from C. Lane)''
Then edit the <code>debugSwitches</code> dictionary in <code>$HOME/.OpenFOAM/$WM_PROJECT_VERSION/controlDict</code>, changing flags from values >0 to 0.  ''(Contribution from C. Lane)''


</translate>
</translate>
Bureaucrats, cc_docs_admin, cc_staff, rsnt_translations
2,837

edits

Navigation menu