From b9b6eeb9ef15bfc4238e779a8462f52585f7e359 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 24 May 2023 20:49:11 +0100 Subject: [PATCH] tutorials/modules/incompressibleVoF/floatingObjectWaves: New tutorial case to demonstrate motion of a floating object due to waves without any mean flow, generated by the waveForcing fvModel using the waves specification in constant/waveProperties which is also used for the side boundary conditions. --- .../floatingObjectWaves/0/U.orig | 50 ++++++++++ .../floatingObjectWaves/0/alpha.water.orig | 50 ++++++++++ .../floatingObjectWaves/0/epsilon | 56 +++++++++++ .../incompressibleVoF/floatingObjectWaves/0/k | 50 ++++++++++ .../floatingObjectWaves/0/nut | 57 +++++++++++ .../floatingObjectWaves/0/p_rgh | 51 ++++++++++ .../floatingObjectWaves/0/pointDisplacement | 50 ++++++++++ .../floatingObjectWaves/Allrun | 21 ++++ .../constant/dynamicMeshDict | 79 +++++++++++++++ .../constant/dynamicMeshDict.sixDoF | 95 +++++++++++++++++++ .../floatingObjectWaves/constant/fvModels | 52 ++++++++++ .../floatingObjectWaves/constant/g | 21 ++++ .../constant/momentumTransport | 29 ++++++ .../constant/phaseProperties | 22 +++++ .../constant/physicalProperties.air | 24 +++++ .../constant/physicalProperties.water | 24 +++++ .../constant/waveProperties | 34 +++++++ .../floatingObjectWaves/system/blockMeshDict | 81 ++++++++++++++++ .../floatingObjectWaves/system/controlDict | 71 ++++++++++++++ .../system/controlDict.sixDoF | 63 ++++++++++++ .../system/decomposeParDict | 41 ++++++++ .../floatingObjectWaves/system/fvSchemes | 57 +++++++++++ .../floatingObjectWaves/system/fvSolution | 81 ++++++++++++++++ .../system/refineMeshDict.1 | 39 ++++++++ .../system/refineMeshDict.2 | 39 ++++++++ .../floatingObjectWaves/system/setFieldsDict | 32 +++++++ .../floatingObjectWaves/system/setWavesDict | 19 ++++ .../system/topoSetDict.floatingObject | 34 +++++++ .../system/topoSetDict.refineMesh | 28 ++++++ 29 files changed, 1350 insertions(+) create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/U.orig create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/alpha.water.orig create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/epsilon create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/k create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/nut create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/p_rgh create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/0/pointDisplacement create mode 100755 tutorials/modules/incompressibleVoF/floatingObjectWaves/Allrun create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/fvModels create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/g create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/momentumTransport create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/phaseProperties create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.air create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.water create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/waveProperties create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/blockMeshDict create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict.sixDoF create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/decomposeParDict create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSchemes create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSolution create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.1 create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.2 create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setFieldsDict create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setWavesDict create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.floatingObject create mode 100644 tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.refineMesh diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/U.orig b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/U.orig new file mode 100644 index 0000000000..b995d4dff7 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/U.orig @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type waveVelocity; + libs ("libwaves.so"); + } + + bottom + { + type noSlip; + } + + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + floatingObject + { + type movingWallVelocity; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/alpha.water.orig b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/alpha.water.orig new file mode 100644 index 0000000000..d9eb310257 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/alpha.water.orig @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object alpha.water.orig; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type waveAlpha; + libs ("libwaves.so"); + } + + bottom + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + + floatingObject + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/epsilon b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/epsilon new file mode 100644 index 0000000000..341e3f0980 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/epsilon @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type zeroGradient; + } + + bottom + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.1; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0.1; + } + + floatingObject + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/k b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/k new file mode 100644 index 0000000000..b41593b361 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/k @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type zeroGradient; + } + + bottom + { + type kqRWallFunction; + value uniform 0.1; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0.1; + } + + floatingObject + { + type kqRWallFunction; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/nut b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/nut new file mode 100644 index 0000000000..6c1cc2cd02 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/nut @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type calculated; + value uniform 0; + } + + bottom + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + + atmosphere + { + type calculated; + value uniform 0; + } + + floatingObject + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/p_rgh b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/p_rgh new file mode 100644 index 0000000000..05496cf625 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/p_rgh @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type fixedFluxPressure; + value uniform 0; + } + + bottom + { + type fixedFluxPressure; + value uniform 0; + } + + atmosphere + { + type prghTotalPressure; + p0 uniform 0; + } + + floatingObject + { + type fixedFluxPressure; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/pointDisplacement b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/pointDisplacement new file mode 100644 index 0000000000..0bd11dad21 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/0/pointDisplacement @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class pointVectorField; + location "0"; + object pointDisplacement; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + sides + { + type fixedValue; + value uniform (0 0 0); + } + + bottom + { + type fixedValue; + value uniform (0 0 0); + } + + atmosphere + { + type fixedValue; + value uniform (0 0 0); + } + + floatingObject + { + type calculated; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/Allrun b/tutorials/modules/incompressibleVoF/floatingObjectWaves/Allrun new file mode 100755 index 0000000000..a8c52959e4 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/Allrun @@ -0,0 +1,21 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh + +runApplication -s refineMesh.1 topoSet -dict topoSetDict.refineMesh +runApplication -s 2 refineMesh -dict refineMeshDict.1 -overwrite +runApplication -s refineMesh.2 topoSet -dict topoSetDict.refineMesh +runApplication -s 1 refineMesh -dict refineMeshDict.2 -overwrite + +runApplication -s floatingObject topoSet -dict topoSetDict.floatingObject +runApplication subsetMesh -overwrite c0 -patch floatingObject -noFields + +runApplication setWaves + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict new file mode 100644 index 0000000000..6b3458e0bd --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict @@ -0,0 +1,79 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +mover +{ + type motionSolver; + + libs ("libfvMeshMovers.so" "librigidBodyMeshMotion.so"); + + motionSolver rigidBodyMotion; + + rigidBodyMotionCoeffs + { + report on; + + solver + { + type Newmark; + } + + accelerationRelaxation 0.7; + + bodies + { + floatingObject + { + type cuboid; + parent root; + + // Cuboid dimensions + Lx 0.3; + Ly 0.2; + Lz 0.5; + + // Density of the cuboid + rho 500; + + // Cuboid mass + mass #calc "$rho*$Lx*$Ly*$Lz"; + L ($Lx $Ly $Lz); + centreOfMass (0 0 0.25); + transform (1 0 0 0 1 0 0 0 1) (0.5 0.45 0.1); + + joint + { + type composite; + joints + ( + { + type Py; + } + { + type Ry; + } + ); + } + + patches (floatingObject); + innerDistance 0.05; + outerDistance 0.35; + } + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF new file mode 100644 index 0000000000..294ca17904 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/dynamicMeshDict.sixDoF @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +mover +{ + type motionSolver; + + libs ("libfvMeshMovers.so" "libsixDoFRigidBodyMotion.so"); + + motionSolver sixDoFRigidBodyMotion; + + sixDoFRigidBodyMotionCoeffs + { + patches (floatingObject); + innerDistance 0.05; + outerDistance 0.35; + + centreOfMass (0.5 0.45 0.35); + + // Cuboid dimensions + Lx 0.3; + Ly 0.2; + Lz 0.5; + + // Density of the solid + rhoSolid 500; + + // Cuboid mass + mass #calc "$rhoSolid*$Lx*$Ly*$Lz"; + + // Cuboid moment of inertia about the centre of mass + momentOfInertia #codeStream + { + codeInclude + #{ + #include "diagTensor.H" + #}; + + code + #{ + scalar sqrLx = sqr($Lx); + scalar sqrLy = sqr($Ly); + scalar sqrLz = sqr($Lz); + os << + $mass + *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0; + #}; + }; + + report on; + accelerationRelaxation 0.7; + + solver + { + type Newmark; + } + + constraints + { + // fixedPoint + // { + // sixDoFRigidBodyMotionConstraint point; + // centreOfRotation (0.5 0.45 0.1); + // } + + fixedLine + { + sixDoFRigidBodyMotionConstraint line; + centreOfRotation (0.5 0.45 0.1); + direction (0 1 0); + } + + fixedAxis + { + sixDoFRigidBodyMotionConstraint axis; + axis (0 1 0); + } + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/fvModels b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/fvModels new file mode 100644 index 0000000000..24ad7bfbe6 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/fvModels @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object fvModels; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +forcing +{ + type waveForcing; + + libs ("libwaves.so"); + + liquidPhase water; + + origins + ( + (0 0.75 0.5) + (0 0.25 0.5) + (0.25 0 0.5) + (0.75 0 0.5) + ); + + directions + ( + ( 0 1 0) + ( 0 -1 0) + (-1 0 0) + ( 1 0 0) + ); + + scale + { + type halfCosineRamp; + start 0; + duration 0.5; + } + + lambda 25; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/g b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/g new file mode 100644 index 0000000000..a27ab85e41 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 -9.81); + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/momentumTransport b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/momentumTransport new file mode 100644 index 0000000000..7176244d83 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/momentumTransport @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; // RAS; + +RAS +{ + model kEpsilon; + + turbulence on; + + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/phaseProperties b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/phaseProperties new file mode 100644 index 0000000000..7794a33045 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/phaseProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +sigma 0; + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.air b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.air new file mode 100644 index 0000000000..fab7bde58b --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.air @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +viscosityModel constant; + +nu 1.48e-05; + +rho 1; + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.water b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.water new file mode 100644 index 0000000000..0b6a4f83ae --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/physicalProperties.water @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +viscosityModel constant; + +nu 1e-06; + +rho 998.2; + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/waveProperties b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/waveProperties new file mode 100644 index 0000000000..3d84a040d9 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/constant/waveProperties @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object waveProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +origin (0 0 0.5); + +direction (1 1 0); + +waves +( + Stokes5 + { + length 0.5; + amplitude 0.03; + phase 0; + angle 0; + } +); + +UMean (0 0 0); + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/blockMeshDict b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/blockMeshDict new file mode 100644 index 0000000000..ffbe7c300e --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/blockMeshDict @@ -0,0 +1,81 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (-0.5 -0.5 0) + ( 1.5 -0.5 0) + ( 1.5 1.5 0) + (-0.5 1.5 0) + (-0.5 -0.5 1) + ( 1.5 -0.5 1) + ( 1.5 1.5 1) + (-0.5 1.5 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (40 40 30) simpleGrading (1 1 1) +); + +boundary +( + sides + { + type patch; + faces + ( + (2 6 5 1) + (1 5 4 0) + (3 7 6 2) + (0 4 7 3) + ); + } + + bottom + { + type wall; + faces + ( + (0 3 2 1) + ); + } + + atmosphere + { + type patch; + faces + ( + (4 5 6 7) + ); + } + + floatingObject + { + type wall; + faces (); + } + + internal + { + type internal; + faces (); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict new file mode 100644 index 0000000000..edf8b160fa --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application foamRun; + +solver incompressibleVoF; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 4; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 12; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.5; +maxAlphaCo 0.5; +maxDeltaT 1; + +functions0 +{ + rigidBodyState + { + type rigidBodyState; + libs ("librigidBodyState.so"); + angleUnits degrees; + } +} + +DebugSwitches +{ + // Write the forcing and damping scale and force fields + // forcing 1; +} + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict.sixDoF b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict.sixDoF new file mode 100644 index 0000000000..c015baca8f --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/controlDict.sixDoF @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 6; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 12; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 1; +maxAlphaCo 1; +maxDeltaT 1; + +functions +{ + sixDoFRigidBodyState + { + type sixDoFRigidBodyState; + libs ("libsixDoFRigidBodyState.so"); + angleUnits degrees; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/decomposeParDict b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/decomposeParDict new file mode 100644 index 0000000000..2ff14bb90c --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/decomposeParDict @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 8; + +decomposer hierarchical; +distributor hierarchical; +// distributor zoltan; +// libs ("libzoltanDecomp.so"); + +hierarchicalCoeffs +{ + n (2 2 2); + order xyz; +} + +constraints +{ + refinementHistory + { + //- Decompose cells such that all cell originating from single cell + // end up on same processor + type refinementHistory; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSchemes b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSchemes new file mode 100644 index 0000000000..e8e636851a --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSchemes @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default CrankNicolson 0.9; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; +} + +divSchemes +{ + div(rhoPhi,U) Gauss linearUpwind limited; + + div(phi,alpha) Gauss interfaceCompression vanLeer 1; + + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSolution b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSolution new file mode 100644 index 0000000000..1249e8f16f --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/fvSolution @@ -0,0 +1,81 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.water.*" + { + nAlphaCorr 2; + nAlphaSubCycles 1; + + MULESCorr yes; + nLimiterIter 5; + alphaApplyPrevCorr yes; + + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + solver GAMG; + smoother DIC; + + tolerance 1e-3; + relTol 0; + } + + "p_rgh.*" + { + solver GAMG; + smoother DIC; + + tolerance 1e-8; + relTol 0; + } + + "(U|k|epsilon).*" + { + solver smoothSolver; + smoother GaussSeidel; + + tolerance 1e-6; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nOuterCorrectors 2; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + correctPhi yes; + moveMeshOuterCorrectors yes; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.1 b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.1 new file mode 100644 index 0000000000..09175828ab --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.1 @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object refineMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +set box; + +coordinateSystem global; + +globalCoeffs +{ + e1 (1 0 0); + e2 (0 1 0); +} + +directions +( + e1 e2 e3 +); + +useHexTopology true; + +geometricCut false; + +writeMesh false; + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.2 b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.2 new file mode 100644 index 0000000000..03d591a162 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/refineMeshDict.2 @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object refineMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +set box; + +coordinateSystem global; + +globalCoeffs +{ + e1 (1 0 0); + e2 (0 1 0); +} + +directions +( + e3 +); + +useHexTopology true; + +geometricCut false; + +writeMesh false; + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setFieldsDict b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setFieldsDict new file mode 100644 index 0000000000..9df86eb466 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setFieldsDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.water 0 +); + +regions +( + boxToCell + { + box (-100 -100 -100) (100 100 0.5); + fieldValues ( volScalarFieldValue alpha.water 1 ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setWavesDict b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setWavesDict new file mode 100644 index 0000000000..2e9d075c38 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/setWavesDict @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object setWavesDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +alpha alpha.water; + + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.floatingObject b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.floatingObject new file mode 100644 index 0000000000..aaa9ce7d20 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.floatingObject @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name c0; + type cellSet; + action new; + source boxToCell; + box (0.35 0.35 0.1) (0.65 0.55 0.6); + } + + { + name c0; + type cellSet; + action invert; + } +); + +// ************************************************************************* // diff --git a/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.refineMesh b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.refineMesh new file mode 100644 index 0000000000..4f8753a6f5 --- /dev/null +++ b/tutorials/modules/incompressibleVoF/floatingObjectWaves/system/topoSetDict.refineMesh @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name box; + type cellSet; + action new; + source boxToCell; + box (-100 -100 0.445) (100 100 0.58); + } +); + +// ************************************************************************* //