IHFoam Tutorial
IHFoam Tutorial
OpenFOAM case
floatingBody background
constant constant
system system
Regular waves interaction
OpenFOAM case with a floating body
floatingBody background
0
- alpha.water - zoneID
- p_rgh - k
- U - epislon
- pointDisplacement - nut
constant constant
- g - waveProperties
- transportProperties
- turbulenceProperties
- dynamicMeshDict
system system
- blockMeshDict - topoSetDict
- blockMeshDict
- setFieldsDict - decomposeParDict
- setFieldsDict
- fvSchemes - controlDict
- snappyHexMeshDict
- fvSolution
Regular waves interaction
with a floating body
0.8 m.
0.6 m.
0.6 m.
• Update the case to take into account the new geometry:
$ mkdir constant/triSurface
$ cp body.stl constant/triSurface/.
Regular waves interaction
with a floating body
• Using snappyHexMesh, as mesh generator to take the existing base mesh and remesh it to
fit the real geometry of the experiments.
- CastellatedMesh:
Mesh Refinement in prescribed regions.
Detection of the domain (surface and volume).
Removal of cells outside the domain.
- Snap:
Mesh morphing to follow the provided geometry.
Layer addition could also be done.
Regular waves interaction
with a floating body
• Refinement levels in OpenFOAM: increase in the refinement level reduces the cell size by half.
• Check if the floating object and the background mesh are in concordance before merging.
Use Paraview:
$ touch ih.foam && paraview
• Load background/ih.foam file and press “Apply”. (Remember to tick “Skip Zero Time”, as the
boundary conditions in the 0 folder have not been updated yet.). Load floatingBody/ih.foam too
and press “Apply”. Both meshes can be seen together.
atmosphere
outlet
2.0 m. inlet
ground
10.0 m.
Floating object
2.6 m.
Regular waves interaction
with a floating body
• Finally, merge both meshes to create the final and unique mesh:
$ mergeMeshes . ../floatingBody –overwrite
• Load the ih.foam file and press “Apply”. (Remember to tick “Skip Zero Time”, as the boundary
conditions in the 0 folder have not been updated yet.)
Regular waves interaction
with a floating body
• The final boundaries can be checked with Paraview (in the Mesh Regions dialog box) or they can
be checked in the constant/polyMesh/boundary file.
Regular waves interaction
with a floating body
• Once the final boundaries are known, update 0.org folder: VoF(alpha.water), velocity (U),
pressure (p_rgh), mesh ID (ZoneID) and cell motion (pointDisplacement).
• Therefore, the turbulent kinematic energy (k), the turbulent dissipation (epsilon) and the
turbulent viscosity (nut) variables must be defined and added to the 0.org folder:
Regular waves interaction
with a floating body
alpha.water: U: p_rgh:
Regular waves interaction
zoneID: pointDisplacement: with a floating body
Regular waves interaction
with a floating body
k epsilon nut
Regular waves interaction
with a floating body
• Using system/topoSet, generate a set of cells to define the different mesh zones: $ topoSet
• Open Paraview and plot the initial set-up to ensure eveything is correct:
$ paraview
Regular waves interaction
with a floating body
• Water and air properties are defined in: • Gravity is defined in:
$ more constant/transportProperties $ more constant/g
Motion solver
Regular waves interaction
with a floating body
Definition of the floating object and the zone within the
mesh moves as a rigid body, the zone where the mesh is
morphed and the zone with no morphing.
Numerical Schemes:
• In system/fvSchemes, is the file that sets the numerical scheme for the different terms.
Numerical Schemes: Laplacian terms, such as the diffusion term in the momentum
equation ( values between 0 and 1 to handle a non-orthogonal
mesh)
Algorithm control:
Algorithm control:
Algorithm control:
Algorithm control:
• Decompose case:
- system/decomposeParDict: if we want to run our simulation in parallel we can
decompose it using this file:
numberOfSubdomains: set the number of parts in which we are going to split
our domain.
n: it should be equal to the number of subdomains
• Run the command:
$ decomposePar
Regular waves interaction
with a floating body