diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/U b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/U new file mode 100644 index 0000000000..807aefc3a3 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/U @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + freeSurface + { + type pressureInletOutletParSlipVelocity; + value uniform (0 0 0); + } + walls + { + type fixedValue; + value uniform (0 0 0); + } + floatingObject + { + type oscillatingFixedValue; + refValue uniform (0 1 0); + offset (0 -1 0); + amplitude table + ( + ( 0 0) + ( 10 0.025) + (1000 0.025) + ); + frequency constant 1; + value uniform (0 0 0); + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/p b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/p new file mode 100644 index 0000000000..cf1239e637 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/p @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + freeSurface + { + type calculated; + value uniform 0; + } + walls + { + type calculated; + value uniform 0; + } + floatingObject + { + type calculated; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/p_gh b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/p_gh new file mode 100644 index 0000000000..192fa2fa28 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/0.org/p_gh @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p_gh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + freeSurface + { + type waveSurfacePressure; + value uniform 0; + } + walls + { + type zeroGradient; + } + floatingObject + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/Allclean b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/Allclean new file mode 100755 index 0000000000..922d2c701e --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf 0 +rm -rf poolHeight poolHeight_vs_time diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/Allrun b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/Allrun new file mode 100755 index 0000000000..12efff4e49 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/Allrun @@ -0,0 +1,17 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Set application name +application=`getApplication` + +runApplication blockMesh +runApplication topoSet +runApplication subsetMesh -overwrite c0 -patch floatingObject +cp -r 0.org 0 > /dev/null 2>&1 + +runApplication $application + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/freeSurfaceProperties b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/freeSurfaceProperties new file mode 100644 index 0000000000..cfd96c3f31 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/freeSurfaceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object freeSurfaceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +freeSurfacePatch freeSurface; + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/g b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/g new file mode 100644 index 0000000000..4fea433a00 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/polyMesh/blockMeshDict b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..991f37048f --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/polyMesh/blockMeshDict @@ -0,0 +1,82 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0 0 0) + (10 0 0) + (10 1 0) + ( 0 1 0) + ( 0 0 0.1) + (10 0 0.1) + (10 1 0.1) + ( 0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (200 20 1) simpleGrading (10 0.1 1) +); + +edges +( +); + +boundary +( + freeSurface + { + type wall; + faces + ( + (3 7 6 2) + ); + } + walls + { + type wall; + faces + ( + (0 4 7 3) + (2 6 5 1) + (1 5 4 0) + ); + } + floatingObject + { + type wall; + faces + ( + ); + } + frontAndBack + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/polyMesh/boundary b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/polyMesh/boundary new file mode 100644 index 0000000000..0ba68e5850 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + freeSurface + { + type wall; + nFaces 181; + startFace 7429; + } + walls + { + type wall; + nFaces 240; + startFace 7610; + } + floatingObject + { + type wall; + nFaces 37; + startFace 7850; + } + frontAndBack + { + type empty; + nFaces 7658; + startFace 7887; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/transportProperties b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/transportProperties new file mode 100644 index 0000000000..834adb631e --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/transportProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [0 2 -1 0 0 0 0] 1e-06; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/turbulenceProperties b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/turbulenceProperties new file mode 100644 index 0000000000..d0a0998654 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/extractHeightData b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/extractHeightData new file mode 100755 index 0000000000..68255734cd --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/extractHeightData @@ -0,0 +1,2 @@ +awk '{print $1 " " $4}' poolHeight/0/faceSource.dat > poolHeight_vs_time + diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/controlDict b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/controlDict new file mode 100644 index 0000000000..b132ad4a03 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/controlDict @@ -0,0 +1,91 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application potentialFreeSurfaceFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 20; + +deltaT 0.001; + +writeControl adjustableRunTime; + +writeInterval 0.02; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.4; + +maxDeltaT 1; + +functions +{ + forces + { + type forces; + functionObjectLibs ("libforces.so"); + outputControl outputTime; + outputInterval 1; + patches (floatingObject); + pName p; + UName U; + rhoName rhoInf; + log true; + rhoInf 1000; + CofR (0 0 0); + } + + poolHeight + { + type faceSource; + functionObjectLibs ("libfieldFunctionObjects.so"); + enabled true; + outputControl timeStep; + timeInteval 1; + log true; + valueOutput false; + source faceZone; + sourceName f0; + operation areaAverage; + fields + ( + zeta + ); + + } +}; + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/fvSchemes b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/fvSchemes new file mode 100644 index 0000000000..c97212ec27 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/fvSchemes @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; + grad(U) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(U) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p_gh; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/fvSolution b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/fvSolution new file mode 100644 index 0000000000..7fa78e5e4a --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/fvSolution @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p_gh + { + solver GAMG; + tolerance 1e-7; + relTol 0.1; + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + maxIter 100; + } + + p_ghFinal + { + $p_gh; + tolerance 1e-7; + relTol 0; + } + + U + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-7; + relTol 0.1; + } + + UFinal + { + $U; + tolerance 1e-7; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict new file mode 100644 index 0000000000..247344a877 --- /dev/null +++ b/tutorials/incompressible/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name c0; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (0.1 0.8 -100) (0.4 100 100); + } + } + + { + name c0; + type cellSet; + action invert; + } + + { + name f0; + type faceSet; + action new; + source patchToFace; + sourceInfo + { + name freeSurface; + } + } + + { + name f0; + type faceSet; + action subset; + source boxToFace; + sourceInfo + { + box (-100 0.9 -100) (0.2 100 100); + } + } + + { + name f0; + type faceZoneSet; + action new; + source setToFaceZone; + sourceInfo + { + faceSet f0; + } + } +); + +// ************************************************************************* //