Table of Contents
OpenFOAM
Installing OpenFoam
- Installing OpenFoam requires the use of the Sudo command therefore system admin needs to perform the first 4 steps from https://openfoam.org/download/11-linux/. User needs to be added to Docker group also.
- Ran OpenFOAM Docker image on Littlestorm. Following this procedure:
1) Edit your ~/.bashrc file and add the line: export XAUTHORITY=$HOME/.Xauthority
2) Start with “Step 5: Launching openfoam11-linux” at the following link https://openfoam.org/download/11-linux/ However, when you get to the last line that launches “openfoam11-linux” , you instead need to launch it like this: openfoam11-linux -p 510 -xhost ←-This will ensure that graphical programs get passed through and show up correctly when xforwarding. You may not need the extra flags if you are using a VNC session.
- Step 5 from link:
mkdir -p $HOME/OpenFOAM/${USER}-11
cd $HOME/OpenFOAM/${USER}-11
openfoam11-linux -p 510 -xhost
3) Once in the container, return to https://openfoam.org/download/11-linux/, and go to Step 6: Testing openfoam11-linux. This should ensure that everything is set correctly and afterward you should be ready to work with the program.
- Step 6 from link:
- Testing OpenFOAM
mkdir -p $FOAM_RUN cd $FOAM_RUN cp -r $FOAM_TUTORIALS/incompressibleFluid/pitzDailySteady . cd pitzDailySteady blockMesh foamRun paraFoam
Older Versions
- The https://develop.openfoam.com/Development/openfoam/-/wikis/precompiled/docker#running-openfoam-in-a- container contains the latest version of the OpenFOAM docker image, it updates automatically on their website.
- To install an older version go to https://openfoam.org/ and type “Download v#” (# = preferred version).
Note: every different version will need to be installed by a system admin.
Procedure
1) Within the 'run' directory start openFOAM: openfoam11-linux -p 510 -xhost
2) Navigate to the case directory.
3) Run the blockMesh command, to create a simple 3-D cubic domain.
4) Run the snappyHexMesh command, used to conform the volume mesh to the CAD model surface.
Issues
Problem (2024/09/24)
* OpenFOAM NASA_P3_extendedPylon_CDP_OAP_v5.obj object files does not exist so model does execute.
Cause
* .obj file missing from directory 0, in the NASA_extendedPylon_v2_tas120_aoa0_900T33.
Solution
* Locate file and place in correct directory.
Procedure
* After successfully running snappyHexMesh, run checkMesh.
Issues
Problem (2024/09/24)
* Max skewness = 6.02536, 39 highly skew faces detected which may impair the quality of the results
<<Writing 39 skew faces to set skewFaces Coupled point location match (average 0) OK.
Failed 1 mesh checks.
Cause
* maxBoundarySkewness set too high in the meshQualityDict.
Solution
* Go to the System directory in the case directory. Open and edit the meshQualityDict to include the lines below “minFaceWeight 0.02; Already in your file, leave as is.” Existing inclusion of defaults #includeEtc “caseDicts/mesh/generation/meshQualityDict” Overriding critical parameters minFaceWeight 0.02; Already in your file, leave as is. maxNonOrtho 65; Slightly above your max value of 64.99. maxBoundarySkewness 4.5; Reduce from default (typically 20). maxInternalSkewness 4.5; Reduce from default. maxAspectRatio 10; Reduce from current 21.34 if necessary. minVol 1e-8; Prevents extremely small cells. minTetQuality 1e-6; Ensures tetrahedral elements are valid.
Procedure
5) After updating the meshQualityDict, run checkMesh command again
Issues
Problem (2024/09/24)
* OpenFOAM NASA_P3_extendedPylon_CDP_OAP_v5.obj object files does not exist so model does execute.
Cause
* .obj file missing from directory 0, in the NASA_extendedPylon_v2_tas120_aoa0_900T33.
Solution
* Locate file and place in correct directory.
Procedure
6) After successfully running snappyHexMesh, run checkMesh.
Issues
Problem (2024/09/24)
* Max skewness = 4.49813, 42 highly skew faces detected which may impair the quality of the results
<<Writing 42 skew faces to set skewFaces Coupled point location match (average 0) OK.
Cause
* maxBoundarySkewness still set too high in the meshQualityDict.
Solution
* Go to the System directory in the case directory. Open and edit the meshQualityDict to include the lines below “minFaceWeight 0.02; Already in the file, leave as is.” Existing inclusion of defaults #includeEtc “caseDicts/mesh/generation/meshQualityDict” Overriding critical parameters minFaceWeight 0.05; Already in your file, leave as is. maxNonOrtho 65; Slightly above your max value of 64.99. maxBoundarySkewness 4.0; Reduce from default (typically 20). maxInternalSkewness 4.0; Reduce from default. maxAspectRatio 5; Reduce from current 21.34 if necessary. minVol 1e-8; Prevents extremely small cells. minTetQuality 1e-6; Ensures tetrahedral elements are valid.
Procedure
7) Run checkMesh.
8) Update the 0 directory to match the new mesh size and to set the desired boundary conditions.
9) Use decomposePar to run breakup the simulation into multiple cores.
10) Run the rhoSimpleFoam solver.
Switching to openfoam2506 from www.openfoam.com
As recommended by an OpenFOAM expert, a switch from openfoam11-linux (from openfoam.org) to openfoam2506 (from openfoam.com) was made, since the latter keeps syntax virtually the same between version thus allowing the use of old cases with minimal modification to the configuration files compared to the openfoam.org version.
Installation
Installation will need to be executed by an admin with sudo privileges.
yum -y install dnf-plugins-core sudo dnf install scotch scotch-devel metis metis-devel dnf -y copr enable openfoam/openfoam sudo yum install openfoam2406-default sudo yum install openfoam2506-default # binaries will be installed in /usr/bin/openfoam2406 and in /usr/bin/openfoam2506 # » Tutorials in /usr/lib/openfoam/openfoam2406/tutorials/ sudo chmod -R 777 /usr/lib/openfoam/openfoam2406/ sudo chmod -R 777 /usr/lib/openfoam/openfoam2506/ # in your ~/.bashrc we just add alias of24='. /usr/lib/openfoam/openfoam2406/etc/bashrc' alias of25='. /usr/lib/openfoam/openfoam2506/etc/bashrc'
Calling the docker image
Navigate to the case directory and type the command: openfoam2506
OpemFOAM will load and will be ready to execute commands to run the simulation.