Openfoam Open Source CFD On Anselm: Supercomputing For Industry - Sc4Industry
Openfoam Open Source CFD On Anselm: Supercomputing For Industry - Sc4Industry
Tom Brzobohat
OpenFOAM
Outline
OpenFOAM on ANSELM
Benchmarks
OpenFOAM is free and open source software, released under the GNU General Public License. OpenFOAM includes over 80 solver applications that simulate specific problems in engineering mechanics and over 170 utility applications that perform pre- and post-processing tasks, e.g. meshing, data visualization, etc. Friendly syntax for partial differential equations Unstructured polyhedral grid capabilities Automatic parallelization of applications written using OpenFOAM high-level syntax Commercial support and training provided by the developers
+ - = p
History
The original development of OpenFOAM started in the late 1980s at Imperial College, London. The FOAM, was sold by UK company Nabla Ltd. before being released as open source in 2004. On 15 August 2011, OpenCFD announced its acquisition by Silicon Graphics International (SGI). On September 12, 2012, the ESI Group announced the acquisition of OpenFOAM Ltd from SGI.
OpenFOAM Features
Incompressible flows
adjointShapeOptimizationFoam icoFoam MRFSimpleFoam nonNewtonianIcoFoam pimpleDyMFoam pimpleFoam pisoFoam porousSimpleFoam
simpleFoam SRFSimpleFoam
Incompressible flows
adjointShapeOptimizationFoam icoFoam MRFSimpleFoam nonNewtonianIcoFoam pimpleDyMFoam pimpleFoam pisoFoam porousSimpleFoam
simpleFoam SRFSimpleFoam
Multiphase flows
bubbleFoam cavitatingFoam compressibleInterFoam interFoam interDyMFoam interMixingFoam interPhaseChangeFoam LTSInterFoam MRFInterFoam MRFMultiphaseInterFoam multiphaseInterFoam porousInterFoam settlingFoam twoLiquidMixingFoam twoPhaseEulerFoam simpleFoam SRFSimpleFoam
Compressible flows
rhoCentralFoam rhoCentralDyMFoam rhoPimpleFoam rhoPorousMRFLTSPimpleFoam rhoPorousSimpleFoam rhoPorousMRFPimpleFoam rhoSimplecFoam rhoSimpleFoam
Compressible flows
rhoCentralFoam rhoCentralDyMFoam rhoPimpleFoam rhoPorousMRFLTSPimpleFoam chemFoam coldEngineFoam dieselEngineFoam dieselFoam rhoPorousMRFSimpleFoam rhoPorousMRFPimpleFoam rhoSimplecFoam rhoSimpleFoam engineFoam fireFoam PDRFoam reactingFoam
Combustion
rhoReactingFoam XiFoam
Compressible flows
rhoCentralFoam rhoCentralDyMFoam rhoPimpleFoam rhoPorousMRFLTSPimpleFoam chemFoam coldEngineFoam dieselEngineFoam dieselFoam rhoPorousMRFSimpleFoam rhoPorousMRFPimpleFoam rhoSimplecFoam rhoSimpleFoam engineFoam fireFoam PDRFoam reactingFoam
Combustion
rhoReactingFoam XiFoam
Transport models
Newtonian CrossPowerLaw BirdCarreau HerschelBulkley powerLaw interfaceProperties
Radiation Models
Mesh Generation
blockMesh extrudeMesh extrude2DMesh extrudeToRegionMesh snappyHexMesh
Mesh Conversion
ansysToFoam cfx4ToFoam fluentMeshToFoam foamMeshToFluent foamToStarMesh gambitToFoam gmshToFoam ideasUnvToFoam mshToFoam netgenNeutralToFoam plot3dToFoam star4ToFoam tetgenToFoam writeMeshObj
Pre-Processing
applyBoundaryLayer applyWallBoundaryConditions changeDictionary mapFields
setFields viewFactorsGen
Pre-Processing
applyBoundaryLayer applyWallBoundaryConditions changeDictionary mapFields
setFields viewFactorsGen
Post-Processing
foamDataToFluent foamToEnsight foamToEnsightParts
Co Lambda2 Mach
OpenFOAM case
Constant - contains a full description of the case mesh in a
subdirectory polyMesh and files specifying physical properties for the application concerned, e.g.transportProperties.
case constant
properties
system
controlDict fvSchemes fvSolution decomposeParDict
polyMesh
Points Faces Cells boundary
where N=0,1 represents a processor number and contains a time directory, containing the decomposed field descriptions, and a constant/polyMesh directory containing the decomposed mesh description.
processors*
OpenFOAM on ANSELM
------------------- /opt/modules/modulefiles/engineering -------------------ansys/14.5.x matlab/R2013a-EDU comsol/43b-COM openfoam/2.2.1-gcc481-openmpi1.6.5-DP comsol/43b-EDU openfoam/2.2.1-gcc481-openmpi1.6.5-SP lsdyna/7.x.x openfoam/2.2.1-icc-openmpi1.6.5-DP matlab/R2013a-COM
Getting Started
Create a project directory within the $HOME/OpenFOAM directory named <USER>-2.2.1 and create a directory named run within it, e.g. by typing: [[email protected] ~]$ mkdir -p $FOAM_RUN
or
[[email protected] ~]$ cd $FOAM_RUN
Copy the tutorial examples directory in the OpenFOAM distribution to the run directory
[[email protected] ~]$ cp -r $FOAM_TUTORIALS $FOAM_RUN
pokus.sh
#!/bin/bash module load openfoam/2.2.1-icc-openmpi1.6.5-DP source $FOAM_BASHRC # source to run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity runApplication blockMesh runApplication icoFoam
Job Submission
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=1,walltime=03:00:00 pokus.sh
OpenFOAM on ANSELM
Running applications in parallel
pokusParallel.pbs
module load openfoam/2.2.1-icc-openmpi1.6.5-DP source $FOAM_BASHRC cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike nproc = 32 mpirun hostfile ${PBS_NODEFILE} np $nproc snappyHexMesh overwrite parallel | tee snappyHexMesh.log mpirun hostfile ${PBS_NODEFILE} np $nproc potentialFoam -noFunctionObject-writep parallel | tee potentialFoam.log mpirun hostfile ${PBS_NODEFILE} np $nproc simpleFoam parallel | tee simpleFoam.log
system
controlDict fvSchemes fvSolution decomposeParDict
processors*
decomposeParDict
( 4 4 2 ); 0.001;
( 1 1 1 ); 0.001; xyz;
"";
simple - simple geometric decomposition in which the domain is split into pieces by direction
hierarchical - hierarchical geometric decomposition which is the same as simple except the user specifies the order in which the directional split is done
scotch - scotch decomposition which requires no geometric input from the user and attempts to minimise the number of processor boundaries. manual - manual decomposition, where the user directly specifies the allocation of each cell to a particular processor.
pokus.sh
#!/bin/bash module load openfoam/2.2.1-icc-openmpi1.6.5-DP source $FOAM_BASHRC # source to run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike runApplication blockMesh runApplication decomposePar
Job Submission
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=1,walltime=03:00:00 pokus.sh $ qsub pokusParallel.pbs
OpenFOAM on ANSELM
Compile an own solvers
[[email protected] ~]$ module load openfoam/2.2.1-icc-openmpi1.6.5-DP [[email protected] ~]$ source $FOAM_BASHRC $ cd $FOAM_RUN/
EXE = $(FOAM_APPBIN)/icoFoam
My_icoFoam.C EXE = $(FOAM_USER_APPBIN)/My_icoFoam
BENCHMARKS
solver parameters
- GAMG - smoothSolver - smoothSolver - smoothSolver
Tolerance relativeTolerance
1e-7 0.1
Lamborghini Aventador
Lamborghini Aventador
225.3 M Cells 1351.8 M Unknowns Mesh generated by snappyHexMesh simpleFoam k-omegaSST 2000 time step iter.
p U k omega
solver parameters
- GAMG - smoothSolver - smoothSolver - smoothSolver
Tolerance relativeTolerance
1e-8 0.001
Lamborghini Aventador
Hydraulic Valve
52.3 M Cells Mesh generated by ANSYS Workbench simpleFoam k-omegaSST 1000 time step iter.
Hydraulic Valve
Hydraulic Valve
2000 1500 Time [s] 1000 500 0 6 14 N Cells [M]
32
64
256
52
Thermal Sensor
5.3 M Cells Mesh generated by ANSYS Workbench chtMultiRegionSimpleFoam k-epsilon 1000 time step iter. 11 regions
Thermal Sensor
Lamp
17.3 M Cells Mesh generated by ANSYS Workbench chtMultiRegionSimpleFoam fvDOM Radiation Model laminar 20000 time step iter. 6 Regions
Lamp
Lamborghini Aventador
Transient solver - pisoFoam 23 M Cells nCorrectors 2 k-omegaSST solver parameters
p U k omega - PCG - PBiCG - PBiCG - PBiCG
Lamborghini Aventador
VSB Campus
VSB Campus
18 M Cells Mesh generated by snappyHexMesh simpleFoam k-epsilon 2000 time step iter.
VSB Campus
snappyHexMesh
Stonavka - Ole
Stonavka - Ole
snappyHexMesh
1,51
VSB Campus
1,01
0,51
0,01
20
40
60
80
100
120
140
1024 1.9
Lamborghini Aventador
snappyHexMesh scalability
N cores Time [h] 128 3.7 256 2.5
512 3.1
1024 3.7
Supermarine Spitfire
VW Beetle
benchmarket.it4i.cz