Commit 1e7f8941 authored by henry's avatar henry
Browse files

New interDyMFoam tutorial: sloshing in a ship's tank

parent 95e7ba2a
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
front
{
type empty;
}
back
{
type empty;
}
walls
{
type movingWallVelocity;
value uniform (0 0 0);
}
pipe
{
type movingWallVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object gamma.0;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
front
{
type empty;
}
back
{
type empty;
}
walls
{
type zeroGradient;
}
pipe
{
type zeroGradient;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object pd;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
front
{
type empty;
}
back
{
type empty;
}
walls
{
type zeroGradient;
}
pipe
{
type zeroGradient;
}
}
// ************************************************************************* //
#!/bin/sh
foamCleanTutorials cases
rm -rf 0/gamma.gz probes wallPressure pRefProbe
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
runApplication blockMesh
cp 0/gamma.org 0/gamma
runApplication setFields
runApplication interDyMFoam
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// RASModel kEpsilon;
RASModel laminar;
turbulence off;
laminarCoeffs
{
}
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphaEps 0.76923;
}
RNGkEpsilonCoeffs
{
Cmu 0.0845;
C1 1.42;
C2 1.68;
alphak 1.39;
alphaEps 1.39;
eta0 4.38;
beta 0.012;
}
NonlinearKEShihCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76932;
A1 1.25;
A2 1000;
Ctau1 -4;
Ctau2 13;
Ctau3 -2;
alphaKsi 0.9;
}
LienCubicKECoeffs
{
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76923;
A1 1.25;
A2 1000;
Ctau1 -4;
Ctau2 13;
Ctau3 -2;
alphaKsi 0.9;
}
QZetaCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphaZeta 0.76923;
anisotropic no;
}
LaunderSharmaKECoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphaEps 0.76923;
}
LamBremhorstKECoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphaEps 0.76923;
}
LienCubicKELowReCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76923;
A1 1.25;
A2 1000;
Ctau1 -4;
Ctau2 13;
Ctau3 -2;
alphaKsi 0.9;
Am 0.016;
Aepsilon 0.263;
Amu 0.00222;
}
LienLeschzinerLowReCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
alphak 1;
alphaEps 0.76923;
Am 0.016;
Aepsilon 0.263;
Amu 0.00222;
}
LRRCoeffs
{
Cmu 0.09;
Clrr1 1.8;
Clrr2 0.6;
C1 1.44;
C2 1.92;
Cs 0.25;
Ceps 0.15;
alphaEps 0.76923;
}
LaunderGibsonRSTMCoeffs
{
Cmu 0.09;
Clg1 1.8;
Clg2 0.6;
C1 1.44;
C2 1.92;
C1Ref 0.5;
C2Ref 0.3;
Cs 0.25;
Ceps 0.15;
alphaEps 0.76923;
alphaR 1.22;
}
SpalartAllmarasCoeffs
{
alphaNut 1.5;
Cb1 0.1355;
Cb2 0.622;
Cw2 0.3;
Cw3 2;
Cv1 7.1;
Cv2 5.0;
}
wallFunctionCoeffs
{
kappa 0.4187;
E 9;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object motionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh solidBodyMotionFvMesh;
solidBodyMotionFvMeshCoeffs
{
solidBodyMotionFunction SDA;
SDACoeffs
{
// Centre of gravity
CofG (0 0 0);
// Model scale ratio
lamda 50;
// Max roll amplitude [rad]
rollAmax 0.22654;
// Min roll amplitude [rad]
rollAmin 0.10472;
// Heave amplitude [m]
heaveA 3.79;
// Sway amplitude [m]
swayA 2.34;
// Damping Coefficient [-]
Q 2.00;
// Time Period for liquid [sec]
Tp 13.93;
// Natural Period of Ship [sec]
Tpn 11.93;
// Reference time step [sec]
dTi 0.059;
// Incr. in Tp/unit 'dTi'[-]
dTp -0.001;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object environmentalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
g g [0 1 -2 0 0 0 0] (0 0 -9.81);
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// General m4 macros
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// User-defined parameters
convertToMeters 1;
// Length of tank (x-direction)
// Breadth of tank (y-direction)
// Depth of tank (z-direction)
// Depth to the top (height) of lower chamfer
// Height of upper chamfer
// Angle of lower chamfer to the horizontal
// Angle of upper chamfer to the horizontal
// Centre of gravity in y-direction
// Centre of gravity in z-direction
// Number of cells in the length (1 for 2D)
// Number of cells in the breadth
// Number of cells in the height of the lower champfer
// Number of cells in the height between the chamfers
// Number of cells in the height of the upper champfer
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Derived parameters
// Breadth to the top (height) of lower chamfer
// Breadth of upper chamfer
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Parametric description
vertices
(
(-0.5 -15 -10.0) // Vertex bllcb = 0
(-0.5 -20 -5) // Vertex bllc = 1
(-0.5 -20 10) // Vertex bluc = 2
(-0.5 -10 20) // Vertex bluct = 3
(-0.5 15 -10.0) // Vertex brlcb = 4
(-0.5 20 -5) // Vertex brlc = 5
(-0.5 20 10) // Vertex bruc = 6
(-0.5 10 20) // Vertex bruct = 7
(0.5 -15 -10.0) // Vertex fllcb = 8
(0.5 -20 -5) // Vertex fllc = 9
(0.5 -20 10) // Vertex fluc = 10
(0.5 -10 20) // Vertex fluct = 11
(0.5 15 -10.0) // Vertex frlcb = 12
(0.5 20 -5) // Vertex frlc = 13
(0.5 20 10) // Vertex fruc = 14
(0.5 10 20) // Vertex fruct = 15
);
blocks
(
// block0
hex (0 4 5 1 8 12 13 9)
(40 6 1)
simpleGrading (1 1 1)
// block1
hex (1 5 6 2 9 13 14 10)
(40 16 1)
simpleGrading (1 1 1)
// block2
hex (2 6 7 3 10 14 15 11)
(40 12 1)
simpleGrading (1 1 1)
);
patches
(
patch walls
(
(0 4 12 8)
(4 5 13 12)
(5 6 14 13)
(6 7 15 14)
(7 3 11 15)
(3 2 10 11)
(2 1 9 10)
(1 0 8 9)
)
empty front
(
(8 12 13 9)
(9 13 14 10)
(10 14 15 11)
)
empty back
(
(0 1 5 4)
(1 2 6 5)
(2 3 7 6)
)
);
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// General m4 macros
changecom(//)changequote([,])
define(calc, [esyscmd(perl -e 'use Math::Trig; use POSIX; printf ($1)')])
define(VCOUNT, 0)
define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])
define(hex2D, hex (b$1 b$2 b$3 b$4 f$1 f$2 f$3 f$4))
define(quad2D, (b$1 b$2 f$2 f$1))
define(frontQuad, (f$1 f$2 f$3 f$4))
define(backQuad, (b$1 b$4 b$3 b$2))
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// User-defined parameters
convertToMeters 1;
define(l, 1.0) // Length of tank (x-direction)
define(b, 40) // Breadth of tank (y-direction)
define(h, 30) // Depth of tank (z-direction)
define(hlc, 5) // Depth to the top (height) of lower chamfer
define(huc, 10) // Height of upper chamfer
define(thetalc, 45) // Angle of lower chamfer to the horizontal
define(thetauc, 45) // Angle of upper chamfer to the horizontal
define(CofGy, calc(b/2.0)) // Centre of gravity in y-direction
define(CofGz, 10.0) // Centre of gravity in z-direction
define(Nl, 1) // Number of cells in the length (1 for 2D)
define(Nb, 40) // Number of cells in the breadth
define(Nhlc, 6) // Number of cells in the height of the lower champfer
define(Nh, 16) // Number of cells in the height between the chamfers
define(Nhuc, 12) // Number of cells in the height of the upper champfer
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Derived parameters
define(blc, calc(hlc/tan(deg2rad(thetalc)))) // Breadth to the top (height) of lower chamfer
define(buc, calc(huc/tan(deg2rad(thetauc)))) // Breadth of upper chamfer
define(Yl, -CofGy)
define(Yllc, calc(Yl + blc))
define(Yluc, calc(Yl + buc))
define(Yr, calc(Yl + b))
define(Yrlc, calc(Yr - blc))
define(Yruc, calc(Yr - buc))
define(Zb, -CofGz)
define(Zlc, calc(Zb + hlc))
define(Zt, calc(Zb + h))
define(Zuc, calc(Zt - huc))
define(Xf, calc(l/2.0))
define(Xb, calc(Xf - l))
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Parametric description
vertices
(