oc4-floatfoam is an OpenFOAM case repository for wave–structure interaction simulations of an OC4-DeepCwind-class floating semisubmersible platform.
The repository includes three case types:
- still-water decay,
- regular-wave response,
- Pierson–Moskowitz irregular-wave response.
The repository showcases the OC4-DeepCwind semisubmersible setup used in this work, but it can also be used as a starting point for other semisubmersible geometries. To use another floating platform, replace the STL geometry and update the mesh domain, refinement regions, mass properties, centre of mass, inertia, restraints, waterline, and force/moment reference values.
For a first run, start with the regular-wave case:
git clone https://github.com/rithikrn/oc4-floatfoam.git
cd oc4-floatfoam/cases/regular
module load openfoam
cp ../../geometry/float-base.stl constant/triSurface/float.stl # stage geometry
chmod +x mesh.sh run.sh
./mesh.sh
./run.shFor local post-processing after a parallel run, reconstruct the case manually:
reconstructParOpen the reconstructed case:
touch regular.foam
paraFoam -case .On Slurm, mesh first, then submit the solver job. Reconstruction is handled inside submit.slurm.
cd oc4-floatfoam/cases/regular
module load openfoam
./mesh.sh
sbatch submit.slurm| Path | Purpose |
|---|---|
cases/decay/ |
Still-water case for checking hydrostatics, dynamic mesh motion, mass properties, and restraint behavior. |
cases/regular/ |
Deterministic regular-wave case using OpenFOAM StokesII. |
cases/irregular/ |
Pierson–Moskowitz irregular-wave case using generated waveProperties. |
tools/ |
Python PM wave generator used only by the irregular case. |
geometry/ |
Shared STL files and guidance for swapping to another semisubmersible geometry. |
oc4-floatfoam/
├── README.md
├── LICENSE
├── requirements.txt
├── geometry/
│ ├── README.md
│ ├── float-base.stl
│ └── float-hollow.stl
├── tools/
│ ├── README.md
│ ├── environment.yml
│ └── generate-pm-waveproperties.py
└── cases/
├── README.md
├── decay/
│ ├── README.md
│ ├── 0.orig/
│ ├── constant/
│ ├── system/
│ ├── mesh.sh
│ ├── run.sh
│ └── submit.slurm
├── regular/
│ ├── README.md
│ ├── 0.orig/
│ ├── constant/
│ ├── system/
│ ├── mesh.sh
│ ├── run.sh
│ └── submit.slurm
└── irregular/
├── README.md
├── 0.orig/
├── constant/
├── system/
├── prepare-waves.sh
├── mesh.sh
├── run.sh
└── submit.slurm
Generated OpenFOAM outputs are not tracked by Git. Expect these to appear after meshing/running:
0/
processor*/
postProcessing/
constant/polyMesh/
log.*
time directories
Target environment:
ESI/OpenCFD OpenFOAM v2206
Required OpenFOAM tools:
interFoam
blockMesh
surfaceFeatureExtract
snappyHexMesh
checkMesh
setFields
decomposePar
reconstructPar
reconstructParMesh
Quick environment check:
module avail openfoam
module load openfoam
which interFoam
interFoam -help | headPython is required only for the irregular PM wave generator.
Recommended Conda setup:
cd oc4-floatfoam
conda env create -f tools/environment.yml
conda activate oc4-floatfoam-pmPip fallback:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThe regular-wave case does not require Python.
Each case follows the same basic local workflow:
./mesh.sh
./run.sh
reconstructParFor Slurm runs:
./mesh.sh
sbatch submit.slurmIn the Slurm workflow, reconstruction is already included in submit.slurm.
Read the case-specific documentation before editing:
The repository tracks 0.orig/, not generated 0/. The mesh.sh script prepares 0/, applies setFields, builds the mesh, and decomposes the case for parallel solving.
The shipped setup is not a fully free six-DOF/moored model.
The active sixDoFRigidBodyMotion setup is constrained to:
- heave using
fixedLinein the vertical direction(0 0 1), - pitch using
fixedAxisabout the transverse axis(0 1 0).
Sway, surge, roll, and yaw are locked. The active restraint is a vertical linearSpring; no explicit mooring-line model is included.
This is intentional for head-sea heave/pitch response studies. If you want a fully moored six-DOF model, you must modify constant/dynamicMeshDict, update the restraints/mooring representation, and verify the mass properties, inertia tensor, centre of mass, and force/moment reference point.
The Python generator is used only for:
cases/irregular/constant/waveProperties
It is not used by the regular-wave case. The regular case uses OpenFOAM StokesII directly in:
cases/regular/constant/waveProperties
Generate the default PM realization:
cd cases/irregular
./prepare-waves.shChange sea-state inputs:
HS=5.49 TS=11.3 NCOMP=100 SEED=42 F_LO=0.5 F_HI=4.0 RAMP=4 ./prepare-waves.shOptional plot:
PLOT=1 ./prepare-waves.shMore detail is in tools/README.md.
Each case expects a local STL named:
constant/triSurface/float.stl
Stage this file manually before meshing — see geometry/README.md.
To test another semisubmersible STL:
cd cases/decay
cp /absolute/path/to/my-semisub.stl constant/triSurface/float.stl
./mesh.shMinimum changes for a new platform:
- Start with
cases/decay/. - Confirm the STL units are meters.
- Keep the patch name as
float, or update every patch reference. - Update the domain size, refinement boxes,
locationInMesh, and water initialization. - Update mass, centre of mass, inertia, restraints, and
forces.CofR. - Run decay first.
- Move to regular waves only after decay behaves correctly.
- Move to irregular waves last.
Full geometry guidance is in geometry/README.md.
The shipped runnable setup should be treated as the base semisubmersible case.
The hollow STL is included for geometry comparison, but a trustworthy hollow-physics run requires updating:
- body mass,
- centre of mass,
- moment of inertia,
- spring/restraint points,
- hydrostatic equilibrium,
- displaced volume assumptions,
forces.CofR,- local mesh refinement near hollow columns.
Geometry-only hollow mesh:
cd cases/regular
cp ../../geometry/float-hollow.stl constant/triSurface/float.stl
./mesh.shDo not treat this as a validated hollow-physics case until the physical properties are updated.
All cases write:
postProcessing/forces/
postProcessing/sixDoFRigidBodyState/
The irregular case also writes wave/interface-height and selected field-function-object outputs, depending on system/controlDict.
Quick checks:
find postProcessing -maxdepth 3 -type f | sort | head
grep -n "Courant Number" log.interFoam | tail
grep -n "sixDoFRigidBodyMotion" log.interFoam | headUseful outputs include:
- force and moment histories from the
forcesfunction object, - rigid-body displacement/rotation from
sixDoFRigidBodyState, - wave/interface measurements in the irregular case,
- solver logs for Courant number, residuals, and mesh-motion behavior.
Each case has a submit.slurm file. The intended workflow is:
cd cases/regular
module load openfoam
cp ../../geometry/float-base.stl constant/triSurface/float.stl
./mesh.sh
sbatch submit.slurmIn this workflow, submit.slurm runs the solver and reconstructs the parallel result.
Before submission, edit the Slurm resource lines for your cluster:
#SBATCH --nodes=
#SBATCH --ntasks-per-node=
#SBATCH --time=
#SBATCH --mem=
The total Slurm task count should match the decomposition used by the case.
If your cluster prefers srun instead of mpirun, replace the solver line in submit.slurm according to your local OpenFOAM/MPI module guidance.
Typical Slurm monitoring commands:
squeue -u $USER
tail -f oc4-regular.out
tail -f oc4-regular.errCheck that the shared geometry exists:
ls geometry/or, from a case directory:
ls ../../geometry/You must stage it before meshing:
cp ../../geometry/float-base.stl constant/triSurface/float.stlInspect the feature-extraction log:
cat log.surfaceFeatureExtractThen confirm the STL path and the entry in system/surfaceFeatureExtractDict.
Check:
grep -n "Courant Number" log.interFoam | tail
grep -n "Floating point exception" log.interFoam
grep -n "sixDoFRigidBodyMotion" log.interFoam | headCommon causes are poor mesh quality, excessive time step, wrong mass/inertia values, wrong centre of mass, or unstable restraint settings.
Confirm that interFoam actually started and that function objects are enabled in system/controlDict.
Edit:
cases/regular/constant/waveProperties
Do not use the PM generator for the regular case.
Regenerate the PM wave dictionary:
cd cases/irregular
./prepare-waves.shThen check:
head constant/wavePropertiesCheck forces.CofR, especially after changing geometry, centre of mass, or the STL reference coordinate system.
Suggested citation of my masters thesis:
@mastersthesis{nambiar2026modeling,
title={Modeling and Analysis of an OWC-Integrated Floating Offshore Wind Turbine Platform},
author={Nambiar, Rithik Ramachandran},
year={2026},
school={Iowa State University}
}Suggested repository citation:
Nambiar, R. R. (2026). oc4-floatfoam: OpenFOAM wave cases for floating semisubmersible simulations. GitHub repository. https://github.com/rithikrn/oc4-floatfoam
References:
- Robertson, A., Jonkman, J., Goupee, A., Coulling, A., and Luan, C. Definition of the Semisubmersible Floating System for Phase II of OC4. NREL/TP-5000-60601, 2014. DOI:
10.2172/1155123. - Pierson, W. J., Jr., and Moskowitz, L. A proposed spectral form for fully developed wind seas based on the similarity theory of S. A. Kitaigorodskii. Journal of Geophysical Research, 1964. DOI:
10.1029/JZ069i024p05181. - OpenFOAM / OpenCFD documentation for
interFoam, wave boundary conditions, dynamic mesh motion, function objects, andsixDoFRigidBodyMotion:https://doc.openfoam.com/.
This repository is distributed under the MIT License. See LICENSE.
Before a formal archival release, confirm that the STL geometry and any external data can be redistributed under the selected license.