TUT: discInConstantPorousFlow/porousDamBreak: new tutorials for interIsoFoam

TUT: create verificationAndValidation/multiphase
     directory and migrate StefanProblem into this
This commit is contained in:
Johan Roenby
2021-12-10 16:19:58 +00:00
committed by Andrew Heather
parent b7af3ff891
commit 5fa2bc030d
91 changed files with 1876 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (1 0 0.5);
boundaryField
{
rim
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
rim
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
rim
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object porosity;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
rim
{
type zeroGradient;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
#------------------------------------------------------------------------------

View File

@ -0,0 +1,34 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication setAlphaField
runApplication setFields
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
# restart
latestTime=$(foamListTimes -latestTime)
mv -f "$latestTime" "$latestTime".bak
rm -rf processor*
runParallel -s decompose redistributePar -decompose -latestTime
runParallel -s 2 $(getApplication)
runParallel -s reconstruct redistributePar -reconstruct -latestTime
#------------------------------------------------------------------------------

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 -9.81 0 );
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object porosityProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
porosityEnabled true;
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu 0;
rho 1000;
}
air
{
transportModel Newtonian;
nu 0;
rho 1;
}
sigma 0;
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
L 5;
nx 100;
y1 -0.05;
y2 0.05;
ny 1;
H 3;
nz 60;
vertices
(
(0 $y1 0)
($L $y1 0)
($L $y2 0)
(0 $y2 0)
(0 $y1 $H)
($L $y1 $H)
($L $y2 $H)
(0 $y2 $H)
);
blocks
(
hex (0 1 2 3 4 5 6 7) ($nx $ny $nz) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
rim
{
type patch;
faces
(
(4 5 6 7)
(0 4 7 3)
(1 2 6 5)
(0 3 2 1)
);
}
front
{
type empty;
faces
(
(0 1 5 4)
);
}
back
{
type empty;
faces
(
(2 3 7 6)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interIsoFoam;
startFrom latestTime;
startTime 0.0;
stopAt endTime;
endTime 2.5;
writeControl adjustable;
writeInterval 0.1;
deltaT 1e-3;
purgeWrite 0;
writeFormat ascii;
writePrecision 14;
writeCompression off;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable no;
adjustTimeStep yes;
maxCo 1e6;
maxAlphaCo 0.5;
maxDeltaT 1e6;
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss limitedLinearV 1;
div((muEff*dev(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha1;
}
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.*"
{
isoFaceTol 1e-8;
surfCellTol 1e-8;
nAlphaBounds 3;
snapTol 0;
clip false;
cAlpha 1; // Read but not used by interIsoFoam
nAlphaSubCycles 1;
reconstructionScheme plicRDF; // isoAlpha
}
}
PIMPLE
{
frozenFlow yes;
momentumPredictor no;
nCorrectors -1;
nNonOrthogonalCorrectors -1;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setAlphaFieldDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
field alpha.water;
type cylinder;
radius 0.25;
direction (0 1 0);
origin (0.5 0 0.5);
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue porosity 1
);
regions
(
boxToCell
{
box (1 -0.05 0) (4 0.05 3);
fieldValues
(
volScalarFieldValue porosity 0.5
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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
{
leftWall
{
type slip;
}
rightWall
{
type slip;
}
lowerWall
{
type slip;
}
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
{
type fixedFluxPressure;
value $internalField;
}
rightWall
{
type fixedFluxPressure;
value $internalField;
}
lowerWall
{
type fixedFluxPressure;
value $internalField;
}
atmosphere
{
type totalPressure;
p0 uniform 0;
U U;
phi phi;
rho rho;
gamma 1;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object porosity;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
leftWall
{
type calculated;
value $internalField;
}
rightWall
{
type calculated;
value $internalField;
}
lowerWall
{
type calculated;
value $internalField;
}
atmosphere
{
type calculated;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,10 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase0
rm -rf plots
#------------------------------------------------------------------------------

View File

@ -0,0 +1,18 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication setFields
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructPar
#------------------------------------------------------------------------------

View File

@ -0,0 +1,15 @@
The experimental surface elevation data is taken from:
Liu, P. L. F., Lin, P., Chang, K. A., & Sakakiyama, T. (1999).
Numerical modeling of wave interaction with porous structures.
Journal of waterway, port, coastal, and ocean engineering,
125(6), 322-330.
DOI:10.1061/(ASCE)0733-950X(1999)125:6(322)
Calibtration of porosity model is taken from:
Jensen, B., Jacobsen, N. G., & Christensen, E. D. (2014).
Investigations on the porous media equations and resistance
coefficients for coastal structures.
Coastal Engineering, 84, 56-72.
DOI:10.1016/j.coastaleng.2013.11.004

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 -9.81 0 );
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object porosityProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
porosityModel JensenEtAl2014;
porosityEnabled true;
JensenEtAl2014Coeffs
{
alpha 500;
beta 2;
gamma_p 0.34;
d50 0.0159;
KC 128;
}
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu 1e-06;
rho 1000;
CrossPowerLawCoeffs
{
nu0 1e-06;
nuInf 1e-06;
m 1;
n 0;
}
BirdCarreauCoeffs
{
nu0 0.0142515;
nuInf 1e-06;
k 99.6;
n 0.1003;
}
}
air
{
transportModel Newtonian;
nu 1.48e-05;
rho 1;
CrossPowerLawCoeffs
{
nu0 1e-06;
nuInf 1e-06;
m 1;
n 0;
}
BirdCarreauCoeffs
{
nu0 0.0142515;
nuInf 1e-06;
k 99.6;
n 0.1003;
}
}
sigma 0.0;
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
7.9884293e-03 2.3783940e-01
1.4152038e-01 2.3656941e-01
2.6403141e-01 2.3751989e-01
2.9446561e-01 2.5622366e-02
4.4247866e-01 2.5525707e-02
5.9726868e-01 2.3758999e-02
7.2911834e-01 2.3611326e-02
8.8481641e-01 2.5230361e-02

View File

@ -0,0 +1,37 @@
5.9850936e-03 1.5916900e-01
3.0896857e-02 1.6130042e-01
5.4978374e-02 1.6662897e-01
8.1476736e-02 1.7142466e-01
1.0879230e-01 1.7462179e-01
1.3612091e-01 1.7622035e-01
1.6267144e-01 1.7462179e-01
1.9002613e-01 1.7302323e-01
2.1657665e-01 1.7142466e-01
2.4230997e-01 1.7142466e-01
2.6080579e-01 1.7142466e-01
2.9298983e-01 1.6929324e-01
3.2276571e-01 1.6662897e-01
3.4934666e-01 1.6130042e-01
3.7833576e-01 1.5650473e-01
4.0573392e-01 1.4957762e-01
4.3154983e-01 1.3945338e-01
4.5576175e-01 1.2879628e-01
4.8157331e-01 1.1920490e-01
5.0901059e-01 1.0748210e-01
5.3724335e-01 9.6825001e-02
5.6228986e-01 8.2437924e-02
5.8405451e-01 7.6043667e-02
5.9618655e-01 6.7517992e-02
6.0368051e-01 3.6079563e-02
6.2228066e-01 2.3291050e-02
6.4791400e-01 3.5546709e-02
6.7684659e-01 3.7678128e-02
7.0262338e-01 3.2349580e-02
7.3075615e-01 3.3948145e-02
7.5647643e-01 3.5546709e-02
7.8301826e-01 3.5013854e-02
8.1116408e-01 3.5013854e-02
8.3689739e-01 3.5013854e-02
8.6101803e-01 3.5546709e-02
8.7464974e-01 4.0342401e-02
8.8909430e-01 4.4072384e-02

View File

@ -0,0 +1,35 @@
5.8811938e-03 1.6469094e-01
3.0404499e-02 1.5908419e-01
5.8299590e-02 1.5629131e-01
8.2811111e-02 1.5462081e-01
1.0984937e-01 1.5576360e-01
1.3688089e-01 1.5915569e-01
1.6307073e-01 1.6142256e-01
1.9010225e-01 1.6481464e-01
2.1629041e-01 1.6764383e-01
2.4163351e-01 1.7047246e-01
2.6106631e-01 1.7161015e-01
2.9486329e-01 1.7331981e-01
3.2444344e-01 1.7221503e-01
3.5066526e-01 1.6379781e-01
3.7518351e-01 1.5987802e-01
4.0394386e-01 1.5033786e-01
4.2932568e-01 1.4023312e-01
4.5555087e-01 1.3069126e-01
4.8430616e-01 1.2283806e-01
5.1223155e-01 1.0992341e-01
5.3423317e-01 9.9816396e-02
5.6638718e-01 8.5779944e-02
5.9432941e-01 6.7242091e-02
6.0199547e-01 4.7003657e-02
6.1811203e-01 2.6770898e-02
6.4682019e-01 3.4662678e-02
6.7384666e-01 3.9741721e-02
7.0089334e-01 3.8072917e-02
7.3048358e-01 3.3594213e-02
7.5581659e-01 3.9796762e-02
7.8286158e-01 3.8690278e-02
8.0820131e-01 4.2643545e-02
8.3269095e-01 4.8283206e-02
8.7326517e-01 4.4374199e-02
8.8676410e-01 5.1693445e-02

View File

@ -0,0 +1,35 @@
2.7780288e-03 1.5500783e-01
3.0080524e-02 1.5830090e-01
5.3368301e-02 1.6104615e-01
8.1471323e-02 1.6488094e-01
1.0881913e-01 1.6007116e-01
1.3454776e-01 1.5741908e-01
1.6109806e-01 1.5152740e-01
1.8843379e-01 1.4887838e-01
2.1575743e-01 1.4839012e-01
2.4067344e-01 1.4735709e-01
2.5755399e-01 1.4630878e-01
2.9288592e-01 1.5069751e-01
3.2417896e-01 1.5885993e-01
3.4911915e-01 1.5350538e-01
3.7325881e-01 1.4760911e-01
4.0140714e-01 1.4334105e-01
4.2715087e-01 1.3798802e-01
4.5532942e-01 1.2831806e-01
4.8268629e-01 1.2188771e-01
5.1087691e-01 1.1005698e-01
5.3424927e-01 9.7676907e-02
5.6243688e-01 8.6386373e-02
5.9469660e-01 6.5380055e-02
5.9962966e-01 4.5402185e-02
6.1579426e-01 2.8686839e-02
6.4550437e-01 3.2524684e-02
6.7517522e-01 4.3385000e-02
6.9931790e-01 3.6948541e-02
7.2821238e-01 4.2945618e-02
7.5390174e-01 4.7316016e-02
7.7959412e-01 5.1146224e-02
8.0611723e-01 5.0116247e-02
8.3182472e-01 5.1245504e-02
8.6153786e-01 5.4543159e-02
8.8562616e-01 5.7830122e-02

View File

@ -0,0 +1,35 @@
3.1001323e-03 1.5564864e-01
2.6706790e-02 1.5674495e-01
5.3591439e-02 1.5405769e-01
8.2104549e-02 1.5137143e-01
1.0817497e-01 1.4868365e-01
1.3584977e-01 1.5032331e-01
1.6026765e-01 1.5196094e-01
1.9039718e-01 1.5143890e-01
2.1645555e-01 1.5091434e-01
2.4089450e-01 1.4876635e-01
2.6124424e-01 1.4986063e-01
2.9382549e-01 1.4771772e-01
3.2231452e-01 1.4935788e-01
3.4922325e-01 1.4234419e-01
3.7448546e-01 1.3857431e-01
4.0298653e-01 1.3805126e-01
4.2989827e-01 1.3049677e-01
4.5517252e-01 1.2456367e-01
4.8374583e-01 1.1106138e-01
5.0901105e-01 1.0675069e-01
5.3920981e-01 9.3790204e-02
5.6777710e-01 8.1369510e-02
5.9474604e-01 6.3539779e-02
5.9161855e-01 4.0283256e-02
6.1444409e-01 3.5430242e-02
6.5018895e-01 5.0054223e-02
6.7539396e-01 5.6559576e-02
6.9981184e-01 5.8197202e-02
7.2585818e-01 5.9835842e-02
7.5519756e-01 5.4986886e-02
7.7883733e-01 5.0134379e-02
8.0569790e-01 5.1773527e-02
8.3420800e-01 4.9628074e-02
8.5698537e-01 5.3427895e-02
8.8304074e-01 5.3444129e-02

View File

@ -0,0 +1,32 @@
5.2798921e-03 1.3924308e-01
3.2971213e-02 1.3931988e-01
5.7485005e-02 1.4097217e-01
8.2772901e-02 1.4473901e-01
1.0810776e-01 1.4269687e-01
1.3495240e-01 1.4963664e-01
1.6343490e-01 1.4971563e-01
1.8795723e-01 1.5031174e-01
2.1644827e-01 1.4933456e-01
2.4096206e-01 1.5098685e-01
2.5913787e-01 1.5367776e-01
2.9152078e-01 1.6063289e-01
3.2556716e-01 1.5755871e-01
3.7235781e-01 1.4395784e-01
4.0326935e-01 1.3717826e-01
4.3022499e-01 1.3038770e-01
4.5717635e-01 1.2412523e-01
4.8018463e-01 1.1626752e-01
5.1113032e-01 1.0526322e-01
5.3492123e-01 9.8463882e-02
5.6190675e-01 8.7976696e-02
5.9287806e-01 7.3803856e-02
6.2938336e-01 6.0174465e-02
6.7208150e-01 6.3461493e-02
7.0063657e-01 5.4562965e-02
7.2755806e-01 5.1997122e-02
7.5364140e-01 5.5238070e-02
7.7735547e-01 5.7944346e-02
8.0665050e-01 5.5385086e-02
8.3435036e-01 5.4405706e-02
8.6202034e-01 5.7122953e-02
8.8259530e-01 5.6651915e-02

View File

@ -0,0 +1,23 @@
5.0465829e-03 2.1632856e-01
3.2523911e-02 2.1698594e-01
5.6544347e-02 2.1533346e-01
8.2276021e-02 2.1311125e-01
1.1144738e-01 2.1147423e-01
1.3631483e-01 2.0867455e-01
1.6291073e-01 2.0702980e-01
1.9120066e-01 2.0309066e-01
2.1518667e-01 1.9798884e-01
2.4346513e-01 1.9289992e-01
2.6063488e-01 1.9295148e-01
2.9329754e-01 1.9707366e-01
3.0788609e-01 1.9654260e-01
3.2409410e-01 1.8624359e-01
3.4968238e-01 1.6964916e-01
3.7600294e-01 1.4040976e-01
4.0048608e-01 9.9092553e-02
4.2772824e-01 7.6179509e-02
4.5681929e-01 6.6494055e-02
4.8046689e-01 2.7473821e-02
5.9204155e-01 2.4934515e-02
7.2510708e-01 2.5334102e-02
8.8221025e-01 2.5805871e-02

View File

@ -0,0 +1,35 @@
4.3837883e-03 1.4858069e-01
2.8543528e-02 1.4801292e-01
5.5388049e-02 1.4744849e-01
8.2209496e-02 1.4269969e-01
1.0995224e-01 1.4273413e-01
1.3767850e-01 1.3977975e-01
1.6184484e-01 1.4040751e-01
1.8601446e-01 1.4163304e-01
2.1733692e-01 1.4167193e-01
2.4060832e-01 1.4229859e-01
2.6207009e-01 1.3933642e-01
2.9518570e-01 1.3997530e-01
3.2382996e-01 1.4120639e-01
3.5335267e-01 1.3944975e-01
3.7572585e-01 1.3947753e-01
4.0075415e-01 1.3412874e-01
4.3024390e-01 1.2639445e-01
4.5435749e-01 1.1745795e-01
4.8385713e-01 1.1151696e-01
5.1157680e-01 1.0736704e-01
5.3479546e-01 9.8429431e-02
5.6246569e-01 8.5313016e-02
5.8479602e-01 7.7569832e-02
5.9637733e-01 6.8020015e-02
6.0971884e-01 5.3092524e-02
6.4464407e-01 5.7320221e-02
6.7062663e-01 6.2732339e-02
7.0105086e-01 6.2172350e-02
7.2880349e-01 6.4000092e-02
7.5295993e-01 6.2834559e-02
7.7979127e-01 5.9879061e-02
8.0752413e-01 5.8120206e-02
8.3439172e-01 6.1740136e-02
8.6122306e-01 5.8784637e-02
8.8361601e-01 6.2399012e-02

View File

@ -0,0 +1,36 @@
3.3608434e-03 1.4226281e-01
2.8841609e-02 1.4114131e-01
5.3468809e-02 1.4058766e-01
8.3190358e-02 1.4003704e-01
1.0697301e-01 1.3891453e-01
1.3413386e-01 1.4006743e-01
1.5877007e-01 1.3837708e-01
1.8764256e-01 1.3782596e-01
2.1398591e-01 1.3499993e-01
2.3859057e-01 1.3728800e-01
2.6067961e-01 1.3559614e-01
2.9461940e-01 1.3845813e-01
3.2093570e-01 1.3904218e-01
3.4981270e-01 1.3792271e-01
3.7447146e-01 1.3339063e-01
4.0421104e-01 1.3056662e-01
4.2890587e-01 1.2148777e-01
4.5525823e-01 1.1752505e-01
4.8248670e-01 1.1015275e-01
5.0885260e-01 1.0448499e-01
5.3777919e-01 9.7113709e-02
5.6333659e-01 8.6330322e-02
5.8462617e-01 7.8386135e-02
5.9320241e-01 6.7592618e-02
6.0346775e-01 5.7936806e-02
6.2211096e-01 6.2494722e-02
6.4843177e-01 6.2510425e-02
6.7390352e-01 6.2525621e-02
6.9850818e-01 6.4813697e-02
7.2822522e-01 6.4831426e-02
7.5202139e-01 6.2003877e-02
7.8005384e-01 6.0315554e-02
8.0719666e-01 6.3741842e-02
8.3517501e-01 6.8873677e-02
8.6063774e-01 7.0025566e-02
8.8523789e-01 7.2881988e-02

View File

@ -0,0 +1,27 @@
6.8135446e-03 1.8646487e-01
2.8986129e-02 1.8492275e-01
5.5909981e-02 1.8662369e-01
8.4417590e-02 1.8564001e-01
1.1213332e-01 1.8626762e-01
1.3668154e-01 1.8634703e-01
1.6281351e-01 1.8696952e-01
1.9052924e-01 1.9028687e-01
2.1666122e-01 1.9467500e-01
2.4200131e-01 2.0605390e-01
2.6100639e-01 2.0503948e-01
2.9584902e-01 2.0784194e-01
3.2514850e-01 1.9717774e-01
3.5207236e-01 1.8058842e-01
3.7741245e-01 1.5861448e-01
4.0354443e-01 1.3987080e-01
4.3046828e-01 1.1413634e-01
4.5897589e-01 9.2710604e-02
4.8510786e-01 8.2574108e-02
5.1044796e-01 6.3827866e-02
5.3895557e-01 5.5312902e-02
5.6667130e-01 4.4105631e-02
5.9201139e-01 3.3966573e-02
6.1735149e-01 2.6517260e-02
6.4744285e-01 2.5000757e-02
7.2663065e-01 2.3643076e-02
8.8421438e-01 2.4152846e-02

View File

@ -0,0 +1,32 @@
4.7123238e-03 1.7133527e-01
2.9527747e-02 1.7194679e-01
5.5143668e-02 1.7363225e-01
8.3161081e-02 1.7532505e-01
1.0877700e-01 1.8022502e-01
1.3519342e-01 1.8566318e-01
1.6241034e-01 1.8842503e-01
1.8802626e-01 1.8368149e-01
2.1604367e-01 1.8108828e-01
2.4326059e-01 1.8117138e-01
2.6167203e-01 1.8176335e-01
2.9449243e-01 1.8454231e-01
3.2331034e-01 1.9266656e-01
3.5292875e-01 1.7775597e-01
3.7694367e-01 1.6336402e-01
4.0656208e-01 1.5006069e-01
4.2897601e-01 1.3459236e-01
4.5379144e-01 1.1805985e-01
4.8020785e-01 1.0367524e-01
5.0902577e-01 8.9833713e-02
5.3624268e-01 7.4915794e-02
5.6105811e-01 5.9990543e-02
5.8347204e-01 4.9879716e-02
5.9628000e-01 3.7596556e-02
6.2269641e-01 3.1783955e-02
6.4751184e-01 3.3466974e-02
6.7552925e-01 2.9802264e-02
7.0274617e-01 3.0421115e-02
7.2916259e-01 2.7823017e-02
7.5718000e-01 2.5229808e-02
8.0761134e-01 2.2705034e-02
8.8766110e-01 2.5628199e-02

View File

@ -0,0 +1,33 @@
4.3310059e-03 1.8911544e-01
2.8112618e-02 1.8858363e-01
5.6161886e-02 1.8074297e-01
8.1660033e-02 1.7402430e-01
1.1140624e-01 1.6674849e-01
1.3774224e-01 1.6396941e-01
1.6406680e-01 1.6512883e-01
1.8954209e-01 1.6628714e-01
2.1841777e-01 1.6632458e-01
2.4220265e-01 1.6466748e-01
2.6173784e-01 1.6413017e-01
2.9568964e-01 1.7092591e-01
3.5088663e-01 1.7324805e-01
3.7725856e-01 1.5809085e-01
4.0531763e-01 1.4687434e-01
4.3082557e-01 1.3677981e-01
4.5718444e-01 1.2612375e-01
4.8439095e-01 1.1603142e-01
5.1162524e-01 9.6374183e-02
5.3712338e-01 8.9655510e-02
5.8134173e-01 7.0582934e-02
5.9671215e-01 4.1908006e-02
6.1799491e-01 2.4493627e-02
6.4854957e-01 3.1284970e-02
6.7572342e-01 3.2445488e-02
7.0545166e-01 3.1358741e-02
7.2922674e-01 3.3077497e-02
7.5641529e-01 2.9174237e-02
7.8358261e-01 3.2585323e-02
8.0822330e-01 2.8678759e-02
8.3625951e-01 2.5339242e-02
8.6343989e-01 2.4249191e-02
8.8297018e-01 2.5399800e-02

View File

@ -0,0 +1,62 @@
#!/bin/bash
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
plot_results() {
image="plots/surface_compare.png"
gnuplot<<EOF
reset
set terminal pngcairo font "helvetica,20" size 60.0in,70.0in
set grid
set xrange [0:1]
set yrange [0:0.25]
set xlabel "x [m]"
set ylabel "y [m]"
set output "$image"
set style rect fc lt -1 fs solid 0.15 noborder
set object 1 rect from 0.29, graph 0 to 0.59, graph 1
array exp_data[10] = \
['4', '6', '8', '10', '12', '14', '16', '18', '20', '22']
array time[10] = \
['0.4', '0.6', '0.8', '1', '1.2', '1.4', '1.6', '1.8', '2', '2.2']
set multiplot \
layout 5,2 \
title "Free surface elevation y vs horizontal position x" \
font "helvetica,42"
do for[k=1:10] {
set title "t = ".time[k]." [s]"
plot \
"postProcessing/freeSurface/".time[k]."/alpha.water_freeSurface.raw" \
w points pt 7 ps 2 lc rgb "red" t "OpenFOAM", \
"experimentalData/data_".exp_data[k].".dat" \
w points pt 7 ps 3 lc rgb "black" t "Liu et al."
}
unset multiplot
EOF
}
#------------------------------------------------------------------------------
# Requires gnuplot
command -v gnuplot >/dev/null || {
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
exit 1
}
#------------------------------------------------------------------------------
dirPlots="plots"
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
plot_results
#------------------------------------------------------------------------------

View File

@ -0,0 +1,86 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 0.01;
vertices
(
//x y z
(0 0 0)
(30 0 0)
(59 0 0)
(89.2 0 0)
(0 37 0)
(30 37 0)
(59 37 0)
(89.2 37 0)
(0 58 0)
(30 58 0)
(59 58 0)
(89.2 58 0)
(0 0 0.1)
(30 0 0.1)
(59 0 0.1)
(89.2 0 0.1)
(0 37 0.1)
(30 37 0.1)
(59 37 0.1)
(89.2 37 0.1)
(0 58 0.1)
(30 58 0.1)
(59 58 0.1)
(89.2 58 0.1)
);
blocks
(
hex (0 1 5 4 12 13 17 16) (75 93 1) simpleGrading (1 1 1)
hex (1 2 6 5 13 14 18 17) porosity (73 93 1) simpleGrading (1 1 1)
hex (2 3 7 6 14 15 19 18) (76 93 1) simpleGrading (1 1 1)
hex (4 5 9 8 16 17 21 20) (75 53 1) simpleGrading (1 1 1)
hex (5 6 10 9 17 18 22 21) (73 53 1) simpleGrading (1 1 1)
hex (6 7 11 10 18 19 23 22) (76 53 1) simpleGrading (1 1 1)
);
patches
(
wall leftWall
(
(0 12 16 4)
(4 16 20 8)
)
wall rightWall
(
(3 15 19 7)
(7 19 23 11)
)
wall lowerWall
(
(0 1 13 12)
(1 2 14 13)
(2 3 15 14)
)
patch atmosphere
(
(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
)
);
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interIsoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 4;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.05;
purgeWrite 0;
writeFormat ascii;
writePrecision 16;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.4;
maxAlphaCo 0.4;
maxDeltaT 1;
functions
{
freeSurface
{
type surfaces;
libs (sampling);
interpolationScheme cell;
writeControl writeTime;
writeInterval 1;
surfaceFormat raw;
fields
(
alpha.water
);
surfaces
(
freeSurface
{
type isoSurfaceCell;
isoField alpha.water;
isoValue 0.5;
interpolate false;
regularise false;
}
alpha_001
{
type isoSurfaceCell;
isoField alpha.water;
isoValue 0.01;
interpolate false;
regularise false;
}
alpha_099
{
type isoSurfaceCell;
isoField alpha.water;
isoValue 0.99;
interpolate false;
regularise false;
}
);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method simple;
coeffs
{
n (2 2 1);
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(U) Gauss linear;
grad(alpha1) Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss limitedLinearV 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha.water;
}
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.water.*"
{
isoFaceTol 1e-6;
surfCellTol 1e-6;
nAlphaBounds 3;
snapTol 1e-12;
clip true;
reconstructionScheme isoAlpha;
nAlphaSubCycles 1;
cAlpha 1; // Read by interIsoFoam but not used
}
pcorr
{
solver PCG;
preconditioner DIC;
tolerance 1e-7;
relTol 0;
}
pcorrFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-7;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-7;
relTol 0.0;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-8;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
UFinal
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
}
equations
{
".*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.water 0
volScalarFieldValue porosity 1
);
regions
(
boxToCell
{
box (0 0 -1) (0.281 0.24 1);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
boxToCell
{
box (0.281 0 -1) (0.892 0.022 1);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
boxToCell
{
box (0.30 0 -1) (0.59 0.3 1);
fieldValues
(
volScalarFieldValue porosity 0.49
);
}
);
// ************************************************************************* //