Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4e308c2
added tutorial for foam-extend
hoehnp Jul 4, 2025
33776ae
Update quickstart/fluid-foam-extend/system/controlDict
hoehnp Jul 5, 2025
24d8a43
added missing variable
hoehnp Jul 5, 2025
4fc127b
add blockMeshDict in right folder
hoehnp Aug 5, 2025
85510a1
remove blockMeshDict from old location
hoehnp Aug 5, 2025
dbfdeb9
fix path for preciceDict in quickstart for foam-extend
hoehnp Aug 6, 2025
da48510
add missing keyword
hoehnp Aug 6, 2025
50ba26c
added missing keywords for foam-extend-5.0
hoehnp Aug 6, 2025
49c1e05
add missing scheme
hoehnp Aug 6, 2025
2085c00
add relaxationFactors for foam-extend-4.0
hoehnp Aug 8, 2025
dacad27
also add Ufinal for foam-extend-4.0
hoehnp Aug 8, 2025
af9e813
fix typo
hoehnp Aug 8, 2025
c153c42
add changes to combine foam-extend and openfoam for the quickstart tu…
hoehnp Sep 8, 2025
d911b72
make run-foam-extend.sh executable
hoehnp Sep 8, 2025
f132044
remove the too late creation of blockMeshDict for OpenFOAM
hoehnp Sep 8, 2025
0306949
adding missing values for foam-extend
hoehnp Sep 8, 2025
6a02f4f
add fix to adjust to limited version of getApplications in foam-extend
hoehnp Sep 8, 2025
7082467
add changes before deleting folder
hoehnp Sep 8, 2025
02ddabb
remove no longer required folder for foam-extend
hoehnp Sep 8, 2025
6baea22
run-foam-extend.sh: Back up original files
MakisH Sep 13, 2025
3f11c0c
Add comments in the controlDict
MakisH Sep 13, 2025
fea3aaa
Add comments for lines only relevant to foam-extend
MakisH Sep 13, 2025
6f4053c
Add a note in README.md
MakisH Sep 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions quickstart/fluid-openfoam/0/U
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ boundaryField
top
{
type noSlip;
value uniform (0 0 0);
}

bottom
{
type noSlip;
value uniform (0 0 0);
}

inlet
Expand Down
2 changes: 2 additions & 0 deletions quickstart/fluid-openfoam/constant/dynamicMeshDict
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ motionSolverLibs ("libfvMotionSolvers.so");
solver displacementLaplacian;
// OpenFOAM9 or newer: rename "solver" to "motionSolver"

diffusivity uniform;

displacementLaplacianCoeffs {
diffusivity quadratic inverseDistance (flap);
}
13 changes: 11 additions & 2 deletions quickstart/fluid-openfoam/system/controlDict
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}

application pimpleFoam; // latest OpenFOAM
// application pimpleDyMFoam; // OpenFOAM v1712, OpenFOAM 5.x, or older


startFrom startTime;

startTime 0;
Expand All @@ -36,14 +36,23 @@ timeFormat general;

timePrecision 8;

libs ("libpreciceAdapterFunctionObject.so");
libs
(
"libpreciceAdapterFunctionObject.so"
);
functions
{
forces
{
type forces;
libs ( "libforces.so" );
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 1;
patches (flap);
pName p;
UName U;
rhoName rhoInf;
rho rhoInf;
log true;
rhoInf 10;
Expand Down
1 change: 1 addition & 0 deletions quickstart/fluid-openfoam/system/fvSchemes
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ divSchemes
{
default none;
div(phi,U) Gauss linearUpwind grad(U);
div((nuEff*dev(T(grad(U))))) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

Expand Down
16 changes: 16 additions & 0 deletions quickstart/fluid-openfoam/system/fvSolution
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ solvers
tolerance 1e-6;
relTol 1e-4;
smoother DICGaussSeidel;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}

pFinal
Expand Down Expand Up @@ -78,3 +81,16 @@ potentialFlow
{
nNonOrthogonalCorrectors 1;
}

relaxationFactors
{
U 0.7;
UFinal 1;
}

fieldBounds
{
p -1e5 1e5;
U 100;
}

1 change: 1 addition & 0 deletions quickstart/fluid-openfoam/system/preciceDict
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ interfaces
FSI
{
rho rho [1 -3 0 0 0 0 0] 1000;
nu nu [0 2 -1 0 0 0 0] 0.001;
}
41 changes: 41 additions & 0 deletions tools/run-foam-extend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env sh
set -e # Not setting -u as it gets triggered by the OpenFOAM RunFunctions

# Prepare an (intentionally empty) .foam file for the ParaView OpenFOAM reader
CASENAME="$(pwd | xargs basename)"
touch "$CASENAME.foam"

# Modify code for foam-extend
echo "modifying everything now"
sed -i "s/noSlip;/noSlipWall;/g" 0/U
sed -i "s,application pimpleFoam;,//application pimpleFoam;,g" system/controlDict
sed -i "s,// application pimpleDyMFoam;,application pimpleDyMFoam;,g" system/controlDict
sed -i '41i\ \ \ \ "liblduSolvers.so"' system/controlDict
sed -i '41i\ \ \ \ "libforces.so"' system/controlDict
sed -i "s,writeCompression off,writeCompression uncompressed,g" system/controlDict

sed -i "s/libfvMotionSolvers\./libfvMotionSolver\./g" constant/dynamicMeshDict

# OpenFOAM run functions: getApplication, getNumberOfProcessors
# shellcheck disable=SC1090 # This is an OpenFOAM file which we don't need to check
. "${WM_PROJECT_DIR}/bin/tools/RunFunctions"
solver=$(getApplication | cut -f 1 -d " " | sed '\~//~d')
if [ "${1:-}" = "-parallel" ]; then
procs=$(getNumberOfProcessors)
decomposePar -force
mpirun -np "${procs}" "${solver}" -parallel
reconstructPar
else
${solver}
fi

# Reverse code for OpenFOAM
#rm -rf constant/polyMesh
#sed -i "s/noSlipWall;/noSlip;/g" 0/U
#sed -i "s,application pimpleDyMFoam;,// application pimpleDyMFoam;,g" system/controlDict
#sed -i "s,//application pimpleFoam;,application pimpleFoam;,g" system/controlDict
#sed -i '/ "liblduSolvers.so"/d' system/controlDict
#sed -i '/ "libforces.so/d' system/controlDict
#sed -i "s,writeCompression uncompressed,writeCompression off,g" system/controlDict
#
#sed -i "s/libfvMotionSolver\./libfvMotionSolvers\./g" constant/dynamicMeshDict