diff --git a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C index 320d70a9547d8f00db3f419b9f52af844e67dca7..6eac1e2b93cbe4f73c3b6acecb038247e3dacc5a 100644 --- a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C +++ b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C @@ -3,9 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2018 IH-Cantabria + \\/ M anipulation | Copyright (C) 2018 IH-Cantabria ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,7 +36,8 @@ const Foam::Enum<Foam::waveMakerPointPatchVectorField::motionTypes> Foam::waveMakerPointPatchVectorField::motionTypeNames ({ { motionTypes::piston, "piston" }, - { motionTypes::flap, "flap" } + { motionTypes::flap, "flap" }, + { motionTypes::solitary, "solitary" } }); @@ -60,9 +59,9 @@ const Foam::vector& Foam::waveMakerPointPatchVectorField::g() } -Foam::scalar Foam::waveMakerPointPatchVectorField::waveLength +Foam::scalar Foam::waveMakerPointPatchVectorField::waveLength ( - const scalar h, + const scalar h, const scalar T ) { @@ -104,7 +103,7 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField waveHeight_(0), wavePhase_(0), waveLength_(0), - rampTime_(0), + rampTime_(1), secondOrder_(false) {} @@ -117,7 +116,7 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField ) : fixedValuePointPatchField<vector>(p, iF, dict, false), - motionType_(motionTypeNames.get("motionType", dict)), + motionType_(motionTypeNames.lookup("motionType", dict)), n_(dict.get<vector>("n")), gHat_(Zero), initialDepth_(dict.get<scalar>("initialDepth")), @@ -216,7 +215,7 @@ void Foam::waveMakerPointPatchVectorField::updateCoeffs() if (secondOrder_) { - motionX += + motionX += sqr(waveHeight_)/(16*initialDepth_) *(3*cosh(kh)/pow3(sinh(kh)) - 2/m1) *sin(2*sigma*t); @@ -240,7 +239,7 @@ void Foam::waveMakerPointPatchVectorField::updateCoeffs() if (secondOrder_) { - motionX += + motionX += sqr(waveHeight_) /(32*initialDepth_)*(3*cosh(kh) /pow3(sinh(kh)) - 2/m1); @@ -250,6 +249,54 @@ void Foam::waveMakerPointPatchVectorField::updateCoeffs() break; } + case motionTypes::solitary: + { + const scalar kappa_ = sqrt(3.0/4.0*waveHeight_/(pow(initialDepth_,3))); + const scalar waveCelerity_ = sqrt(mag(g())*(initialDepth_+waveHeight_)); + const scalar stroke_ = sqrt(16.0*waveHeight_*initialDepth_/3.0); + wavePeriod_ = (2.0 / ( kappa_*waveCelerity_ ))*(3.8 + waveHeight_/ + initialDepth_); + + scalar motionX = 0; + const scalar error=0.001; + + if (onlyFirst==0) + { + tAux = -wavePeriod_/2.0 + (t-tOld); + } + else + { + tAux = tAuxOld + (t-tOld); + } + + //Newton-Rapshon + scalar theta1OF=0; + scalar theta2OF=0; + scalar er=10000; + while (er>error) + { + theta2OF = theta1OF - (theta1OF - kappa_*waveCelerity_*tAux + + (waveHeight_/initialDepth_)*tanh(theta1OF) ) + / ( 1.0 + (waveHeight_/initialDepth_)*(1.0/cosh(theta1OF))*(1.0/cosh(theta1OF))); + + er=fabs(theta1OF-theta2OF); + theta1OF=theta2OF; + } + + motionX = waveHeight_ / (kappa_*initialDepth_)*tanh(theta1OF) + stroke_/2.0; + + if (tAux != 0) + { + onlyFirst = 1; + } + + tOld = t; + tAuxOld = tAux; + + Field<vector>::operator=(n_*motionX); + + break; + } default: { FatalErrorInFunction @@ -257,7 +304,7 @@ void Foam::waveMakerPointPatchVectorField::updateCoeffs() << abort(FatalError); } } - + fixedValuePointPatchField<vector>::updateCoeffs(); } diff --git a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H index f5c14df56d506b6c36f5db97e5acc42c1ccc58b6..845c4f2bbb6ce195f3bfb244b881254de19a47fd 100644 --- a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H +++ b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H @@ -3,9 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2018 IH-Cantabria + \\/ M anipulation | Copyright (C) 2018 IH-Cantabria ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -42,7 +40,7 @@ Usage \verbatim leftwall { - type waveMaker; + type waveMaker; motionType flap; n (1 0 0); initialDepth 0.25; @@ -100,7 +98,8 @@ class waveMakerPointPatchVectorField enum motionTypes { piston, - flap + flap, + solitary }; //- Names for motion types @@ -141,6 +140,13 @@ class waveMakerPointPatchVectorField //- On/off second order calculation switch scalar secondOrder_; + //- Solitary time [-T/2, T/2] + scalar tOld = 0; + scalar tAux = 0; + scalar tAuxOld = 0; + + scalar onlyFirst = 0; + // Protected Member Functions diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/U b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/U new file mode 100644 index 0000000000000000000000000000000000000000..9e2a353e1e896c9045446d5a5929f1ad2cade6f5 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/U @@ -0,0 +1,77 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.7.x | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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 +{ + inlet + { + type movingWallVelocity; + value uniform (0 0 0); + } + + outlet + { + type waveVelocity; + value uniform (0 0 0); + } + + front1 + { + type empty; + } + back1 + { + type empty; + } + front2 + { + type empty; + } + back2 + { + type empty; + } + + ground1 + { + type fixedValue; + value uniform (0 0 0); + } + ground2 + { + type fixedValue; + value uniform (0 0 0); + } + + top1 + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + top2 + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/alpha.water b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/alpha.water new file mode 100644 index 0000000000000000000000000000000000000000..39de6b80f633b14c43957dbd59db57d744ceeeb5 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/alpha.water @@ -0,0 +1,74 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5-dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ 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 +{ + inlet + { + type zeroGradient; + } + + outlet + { + type zeroGradient; + } + + ground1 + { + type zeroGradient; + } + ground2 + { + type zeroGradient; + } + + front1 + { + type empty; + } + back1 + { + type empty; + } + + front2 + { + type empty; + } + back2 + { + type empty; + } + + top1 + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + top2 + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/p_rgh b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..217641cabc35a65d9f63af424b8754ddb65af55c --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/p_rgh @@ -0,0 +1,88 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5-dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ 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 +{ + inlet + { + type fixedFluxPressure; + value uniform 0; + } + + outlet + { + type fixedFluxPressure; + value uniform 0; + } + + ground1 + { + type fixedFluxPressure; + value uniform 0; + } + ground2 + { + type fixedFluxPressure; + value uniform 0; + } + + front1 + { + type empty; + } + back1 + { + type empty; + } + front2 + { + type empty; + } + back2 + { + type empty; + } + + top1 + { + type totalPressure; + U U; + phi phi; + rho rho; + psi none; + gamma 1; + p0 uniform 0; + value uniform 0; + } + top2 + { + type totalPressure; + U U; + phi phi; + rho rho; + psi none; + gamma 1; + p0 uniform 0; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/pointDisplacement b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/pointDisplacement new file mode 100644 index 0000000000000000000000000000000000000000..27a6d6275e597aa27a0a436a730d5a4f44d00169 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/0.orig/pointDisplacement @@ -0,0 +1,78 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.3.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + object pointDisplacement; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + ground1 + { + type zeroGradient; + } + ground2 + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type waveMaker; + value uniform (0 0 0); + + motionType solitary; + x0 (0 0 0); + n (1 0 0); + waveHeight 0.1; + initialDepth 0.2; + wavePeriod 1.0; + rampTime 1.0; + wavePhase 0; + } + back1 + { + type empty; + } + back2 + { + type empty; + } + front1 + { + type empty; + } + front2 + { + type empty; + } + outlet + { + type fixedValue; + value uniform (0 0 0); + } + top1 + { + type zeroGradient; + } + top2 + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/Allclean b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..e2f275d9fd6e6ba843f14fec57e2987e4c8607b3 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions + +cleanCase0 + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/Allrun b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..28bf991e627511713c3b915ac0d9998f068ce030 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory +. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions + +restore0Dir + +runApplication blockMesh + +runApplication decomposePar + +runParallel setFields + +runParallel $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..2179e85d38f755472b010929045979617dfb25bb --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/dynamicMeshDict @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.0.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicMotionSolverFvMesh; +motionSolverLibs ("libfvMotionSolvers.so"); + +solver displacementLaplacian; + +displacementLaplacianCoeffs +{ + diffusivity inverseDistance (inlet); +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/g b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..310f9caa4dde3409cc476a32682c08f10c42856a --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++-*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.1 | +| \\ / 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.0 0.0 -9.81 ); + +// ************************************************************************* // + diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..3633e43efb93a3465f8dd8f82d7406b15a32b058 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/transportProperties @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.3 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +water +{ + transportModel Newtonian; + nu [0 2 -1 0 0 0 0] 1e-06; + rho [1 -3 0 0 0 0 0] 1000; +} + +air +{ + transportModel Newtonian; + nu [0 2 -1 0 0 0 0] 1.48e-05; + rho [1 -3 0 0 0 0 0] 1; +} + +sigma [1 0 -2 0 0 0 0] 0.07; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..4450e7463bd4a68b624c2fb5a0c5539bed972369 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++-*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.1 | +| \\ / 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/multiphase/interFoam/laminar/waveMakerSolitary/constant/waveProperties b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/waveProperties new file mode 100644 index 0000000000000000000000000000000000000000..e46e7700b237c1c65229e2e5f83e26248080c0b9 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/constant/waveProperties @@ -0,0 +1,28 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object wavesProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +outlet +{ + alpha alpha.water; + + waveModel shallowWaterAbsorption; + + nPaddle 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..5d815358f90735d3ffab6b1e0c514b7cb21078e0 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/blockMeshDict @@ -0,0 +1,135 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + //mov + ( 0 0 0) + ( 4 0 0) + ( 4 0.008 0) + ( 0 0.008 0) + ( 0 0 0.6) + ( 4 0 0.6) + ( 4 0.008 0.6) + ( 0 0.008 0.6) + //static + ( 6 0 0) + ( 6 0.008 0) + ( 6 0.008 0.6) + ( 6 0 0.6) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (250 1 38) simpleGrading (1 1 1) + hex (1 8 9 2 5 11 10 6) (125 1 38) simpleGrading (1 1 1) +); +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (0 4 7 3) + ); + } + outlet + { + type patch; + faces + ( + (8 11 10 9) + ); + } + ground1 + { + type wall; + faces + ( + (0 1 2 3) + ); + } + ground2 + { + type wall; + faces + ( + (1 8 9 2) + ); + } + top1 + { + type patch; + faces + ( + (4 5 6 7) + ); + } + top2 + { + type patch; + faces + ( + (5 11 10 6) + ); + } + front1 + { + type empty; + faces + ( + (0 1 5 4) + ); + } + back1 + { + type empty; + faces + ( + (3 2 6 7) + ); + } + front2 + { + type empty; + faces + ( + (1 8 11 5) + ); + } + back2 + { + type empty; + faces + ( + (2 9 10 6) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // + diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/controlDict b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..9320dce969193b85569275bc02ae630a242c5746 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/controlDict @@ -0,0 +1,118 @@ +/*--------------------------------*- C++ -*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.1 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom latestTime; +startTime 0.0; +stopAt endTime; +endTime 10; +deltaT 0.01; +writeControl adjustableRunTime; +writeInterval 0.05; +purgeWrite 0; +writeFormat ascii; +writePrecision 6; +writeCompression off; +timeFormat general; +timePrecision 6; +runTimeModifiable yes; +adjustTimeStep yes; + +maxCo 0.65; +maxAlphaCo 0.65; +maxDeltaT 0.05; + +functions +{ + lineMOVING + { + type sets; + libs ("libsampling.so"); + enabled true; + writeControl writeTime; + outputInterval 1; + + interpolationScheme cellPoint; + setFormat raw; + sets + ( + line1 + { + type uniform; + axis distance; + start ( 1.33 0.004 0.0 ); + end ( 1.33 0.004 0.6 ); + nPoints 101; + } + line2 + { + type uniform; + axis distance; + start ( 3.33 0.004 0.0 ); + end ( 3.33 0.004 0.6 ); + nPoints 101; + } + + ); + fixedLocations false; + fields + ( + p p_rgh U alpha.water + ); + } + + lineFIXED + { + type sets; + libs ("libsampling.so"); + enabled true; + writeControl writeTime; + outputInterval 1; + + interpolationScheme cellPoint; + setFormat raw; + sets + ( + line3 + { + type uniform; + axis distance; + start ( 5.33 0.004 0.0 ); + end ( 5.33 0.004 0.6 ); + nPoints 101; + } + line4 + { + type uniform; + axis distance; + start ( 5.66 0.004 0.0 ); + end ( 5.66 0.004 0.6 ); + nPoints 101; + } + + ); + fixedLocations true; + fields + ( + p p_rgh U alpha.water + ); + } + +} + +// ************************************************************************* / diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/decomposeParDict b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..a4e660116ce72ed1d26c87d67922ca9cbd9cd6dd --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/decomposeParDict @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method hierarchical; + +hierarchicalCoeffs +{ + n (2 1 1); + delta 0.001; + order xyz; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..2393b1a94cb8e2c9f0868a0bc597eb260d4957ad --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/fvSchemes @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rhoPhi,U) Gauss linearUpwind grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss linear;; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(phi,nuTilda) Gauss upwind; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +wallDist +{ + method meshWave; +} + + +fluxRequired +{ + default no; + p_rgh; + pcorr; + alpha; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/fvSolution b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a5fa734772ec3c82cf1ae735cd568a2d6d052526 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/fvSolution @@ -0,0 +1,112 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + + "(cellDisplacement|cellDisplacementFinal)" + { + solver GAMG; + tolerance 1e-5; + relTol 0; + smoother GaussSeidel; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + "alpha.water.*" + { + nAlphaCorr 1; + nAlphaSubCycles 2; + alphaOuterCorrectors yes; + cAlpha 1; + + MULESCorr no; + nLimiterIter 3; + + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + } + "(pcorr|pcorrFinal)" + { + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0; + } + + p_rghFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + UFinal + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + nuTilda + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/setFieldsDict b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..f506419405ce5d137ac9b8fe1ec5a6da3f26e504 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerSolitary/system/setFieldsDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++-*----------------------------------*\\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.1.1 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.water 0 + volVectorFieldValue U (0 0 0) +); + +regions +( + boxToCell + { + box ( -10.000 -10.000 -10.000 ) ( 250.000 250.000 0.2 ); + fieldValues ( volScalarFieldValue alpha.water 1 ); + } +); +