diff --git a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C index 301c1e2b21f2ee7701f48bf9b4272a5b7bc3ec4b..409768101ca9573f4c6961c64416f854e2f25dec 100644 --- a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C +++ b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.C @@ -33,6 +33,10 @@ License #include "Time.H" #include "gravityMeshObject.H" +#include "polyMesh.H" +#include "surfaceFields.H" +#include "volFields.H" + // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // const Foam::Enum<Foam::waveMakerPointPatchVectorField::motionTypes> @@ -89,6 +93,48 @@ Foam::scalar Foam::waveMakerPointPatchVectorField::timeCoeff } +void Foam::waveMakerPointPatchVectorField::initialiseGeometry() +{ + // Global patch extents + const vectorField& Cp = this->patch().localPoints(); + const vectorField CpLocal(Cp); + boundBox bb(CpLocal, true); + + const scalar xMin = bb.min().x(); + const scalar xMax = bb.max().x(); + const scalar yMin = bb.min().y(); + const scalar yMax = bb.max().y(); + zSpan_ = bb.max().z() - bb.min().z(); + + zMinGb_ = bb.min().z(); + reduce(zMinGb_, minOp<scalar>()); + + // Global x, y positions of the paddle centres + xPaddle_.setSize(nPaddle_, 0); + yPaddle_.setSize(nPaddle_, 0); + const scalar xMid = xMin + 0.5*(xMax - xMin); + const scalar paddleDy = (yMax - yMin)/scalar(nPaddle_); + + for (label paddlei = 0; paddlei < nPaddle_; ++paddlei) + { + xPaddle_[paddlei] = xMid; + yPaddle_[paddlei] = paddlei*paddleDy + yMin + 0.5*paddleDy; + } + + // Local face centres + x_ = this->patch().localPoints().component(0); + y_ = this->patch().localPoints().component(1); + z_ = this->patch().localPoints().component(2); + + // Local point-to-paddle addressing + pointToPaddle_.setSize(this->patch().size(), -1); + + forAll(pointToPaddle_, ppi) + { + pointToPaddle_[ppi] = floor((y_[ppi] - yMin)/(paddleDy+0.01*paddleDy)); + } +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField @@ -105,10 +151,11 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField wavePeriod_(0), waveHeight_(0), wavePhase_(0), - waveLength_(0), + waveAngle_(0), startTime_(0), rampTime_(1), - secondOrder_(false) + secondOrder_(false), + nPaddle_(0) {} @@ -127,29 +174,43 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField wavePeriod_(dict.get<scalar>("wavePeriod")), waveHeight_(dict.get<scalar>("waveHeight")), wavePhase_(dict.get<scalar>("wavePhase")), - waveLength_(this->waveLength(initialDepth_, wavePeriod_)), + waveAngle_(dict.get<scalar>("waveAngle")), startTime_ ( - dict.lookupOrDefault<scalar> + dict.getOrDefault<scalar> ( "startTime", db().time().startTime().value() ) ), rampTime_(dict.get<scalar>("rampTime")), - secondOrder_(dict.lookupOrDefault<bool>("secondOrder", false)) + secondOrder_(dict.getOrDefault<bool>("secondOrder", false)), + nPaddle_(dict.getOrDefault<label>("nPaddle", 1)) { // Create the co-ordinate system if (mag(n_) < SMALL) { FatalIOErrorInFunction(dict) - << "Patch normal direction vector is not set. 'n' = " << n_ + << "Patch normal direction vector is not set. 'n' = " << n_ << exit(FatalIOError); } - n_ /= mag(n_); + n_.normalise(); gHat_ = (g() - n_*(n_&g())); - gHat_ /= mag(gHat_); + if (mag(gHat_) < SMALL) + { + FatalIOErrorInFunction(dict) + << "Patch normal and gravity directions must not be aligned. " + << "'n' = " << n_ << " 'g' = " << g() + << exit(FatalIOError); + } + gHat_.normalise(); + + waveAngle_ *= constant::mathematical::pi/180; + + initialiseGeometry(); + + waterDepthRef_.setSize(nPaddle_, -1); if (!dict.found("value")) { @@ -174,10 +235,11 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField wavePeriod_(ptf.wavePeriod_), waveHeight_(ptf.waveHeight_), wavePhase_(ptf.wavePhase_), - waveLength_(ptf.waveLength_), + waveAngle_(ptf.waveAngle_), startTime_(ptf.startTime_), rampTime_(ptf.rampTime_), - secondOrder_(ptf.secondOrder_) + secondOrder_(ptf.secondOrder_), + nPaddle_(ptf.nPaddle_) {} @@ -195,10 +257,11 @@ Foam::waveMakerPointPatchVectorField::waveMakerPointPatchVectorField wavePeriod_(ptf.wavePeriod_), waveHeight_(ptf.waveHeight_), wavePhase_(ptf.wavePhase_), - waveLength_(ptf.waveLength_), + waveAngle_(ptf.waveAngle_), startTime_(ptf.startTime_), rampTime_(ptf.rampTime_), - secondOrder_(ptf.secondOrder_) + secondOrder_(ptf.secondOrder_), + nPaddle_(ptf.nPaddle_) {} @@ -211,86 +274,160 @@ void Foam::waveMakerPointPatchVectorField::updateCoeffs() return; } + if (firstTime == 0) + { + // Set the reference water depth + if (initialDepth_ != 0 ) + { + forAll(waterDepthRef_,paddlei) + { + waterDepthRef_[paddlei] = initialDepth_; + } + } + else + { + FatalErrorInFunction + << "initialDepth is not set. Please update " + << abort(FatalError); + } + + + Info << " WaterDepth at the wavepaddles = " << waterDepthRef_ << endl; + firstTime = 1; + } + const scalar t = db().time().value() - startTime_; - const scalar waveK = constant::mathematical::twoPi/waveLength_; - const scalar sigma = constant::mathematical::twoPi/wavePeriod_; + scalarField waveLength_(nPaddle_,-1); + + scalarField waveK(nPaddle_, -1); + scalarField waveKx(nPaddle_, -1); + scalarField waveKy(nPaddle_, -1); - const scalar kh = waveK*initialDepth_; + forAll(waveK, pointi) + { + waveLength_[pointi] = waveLength(waterDepthRef_[pointi], wavePeriod_); + + waveK[pointi] = constant::mathematical::twoPi/waveLength_[pointi]; + waveKx[pointi] = waveK[pointi]*cos(waveAngle_); + waveKy[pointi] = waveK[pointi]*sin(waveAngle_); + } + const scalar sigma = 2*constant::mathematical::pi/wavePeriod_; switch (motionType_) { case motionTypes::flap: { - const scalar m1 = - 4*sinh(kh)/(sinh(2*kh) + 2*kh)*(sinh(kh) + (1 - cosh(kh))/kh); - - scalar motionX = 0.5*waveHeight_/m1*sin(sigma*t); + const pointField& points = patch().localPoints(); + scalarField motionX(patch().localPoints().size(), -1); - if (secondOrder_) + forAll(points, pointi) { - motionX += - sqr(waveHeight_)/(16*initialDepth_) - *(3*cosh(kh)/pow3(sinh(kh)) - 2/m1) - *sin(2*sigma*t); - } + const label paddlei = pointToPaddle_[pointi]; - const pointField& points = patch().localPoints(); - const scalarField dz(-(points & gHat_) - initialDepth_); + const scalar phaseTot = + waveKx[paddlei]*xPaddle_[paddlei] + + waveKy[paddlei]*yPaddle_[paddlei]; + + const scalar depthRef = waterDepthRef_[paddlei]; + const scalar kh = waveK[paddlei]*depthRef; + const scalar pz = points[pointi].component(2); + + const scalar m1 = + (4*sinh(kh)/(sinh(2*kh) + 2*kh)) + * (sinh(kh) + 1/kh*(1 - cosh(kh))); + + const scalar boardStroke = waveHeight_/m1; - Field<vector>::operator= - ( - n_*timeCoeff(t)*motionX*(1 + dz/initialDepth_) - ); + motionX[pointi] = 0.5*boardStroke*sin(phaseTot - sigma*t); + + if (secondOrder_) + { + motionX[pointi] += + sqr(waveHeight_)/(16*depthRef) + * (3*cosh(kh)/pow3(sinh(kh)) - 2/m1) + * sin(phaseTot - 2*sigma*t); + + } + + motionX[pointi] *= 1.0 + (pz - zMinGb_ - depthRef)/depthRef; + + } + + Field<vector>::operator=(timeCoeff(t)*n_*motionX); break; } case motionTypes::piston: { - const scalar m1 = 2*(cosh(2*kh) - 1)/(sinh(2*kh) + 2*kh); - - scalar motionX = 0.5*waveHeight_/m1*sin(sigma*t); + const pointField& points = patch().localPoints(); + scalarField motionX(patch().localPoints().size(), -1); - if (secondOrder_) + forAll(points, pointi) { - motionX += - sqr(waveHeight_) - /(32*initialDepth_)*(3*cosh(kh) - /pow3(sinh(kh)) - 2/m1); + const label paddlei = pointToPaddle_[pointi]; + + const scalar phaseTot = + waveKx[paddlei]*xPaddle_[paddlei] + + waveKy[paddlei]*yPaddle_[paddlei]; + + const scalar depthRef = waterDepthRef_[paddlei]; + const scalar kh = waveK[paddlei]*depthRef; + const scalar m1 = 2*(cosh(2*kh) - 1.0)/(sinh(2*kh) + 2*kh); + const scalar boardStroke = waveHeight_/m1; + + motionX[pointi] = 0.5*boardStroke*sin(phaseTot - sigma*t); + + if (secondOrder_) + { + motionX[pointi] += + + sqr(waveHeight_) + / (32*depthRef)*(3*cosh(kh)/pow3(sinh(kh)) - 2.0/m1) + * sin(phaseTot - 2*sigma*t); + } } - Field<vector>::operator=(n_*timeCoeff(t)*motionX); + Field<vector>::operator=(timeCoeff(t)*n_*motionX); break; } case motionTypes::solitary: { - const scalar kappa = sqrt(0.75*waveHeight_/(pow3(initialDepth_))); - const scalar waveCelerity = - sqrt(mag(g())*(initialDepth_ + waveHeight_)); - const scalar stroke = sqrt(16.0*waveHeight_*initialDepth_/3.0); - const scalar hr = waveHeight_/initialDepth_; - wavePeriod_ = (2.0/(kappa*waveCelerity))*(3.8 + hr); - const scalar tSolitary = -0.5*wavePeriod_ + t; - - // Newton-Rapshon - scalar theta1 = 0; - scalar theta2 = 0; - scalar er = 10000; - const scalar error = 0.001; - while (er > error) + const pointField& points = patch().localPoints(); + scalarField motionX(patch().localPoints().size(), -1); + const scalar magG = mag(g()); + + forAll(points, pointi) { - theta2 = - theta1 - - (theta1 - kappa*waveCelerity*tSolitary + hr*tanh(theta1)) - /(1.0 + hr*(1.0/cosh(theta1))*(1.0/cosh(theta1))); + const label paddlei = pointToPaddle_[pointi]; + const scalar depthRef = waterDepthRef_[paddlei]; + + const scalar kappa = sqrt(0.75*waveHeight_/pow3(depthRef)); + const scalar celerity = sqrt(magG*(depthRef + waveHeight_)); + const scalar stroke = sqrt(16*waveHeight_*depthRef/3.0); + const scalar hr = waveHeight_/depthRef; + wavePeriod_ = 2.0/(kappa*celerity)*(3.8 + hr); + const scalar tSolitary = -0.5*wavePeriod_ + t; + + // Newton-Raphson + scalar theta1 = 0; + scalar theta2 = 0; + scalar er = 10000; + const scalar error = 0.001; + while (er > error) + { + theta2 = + theta1 + - (theta1 - kappa*celerity*tSolitary + hr*tanh(theta1)) + /(1.0 + hr*(1.0/cosh(theta1))*(1.0/cosh(theta1))); er = mag(theta1 - theta2); theta1 = theta2; - } + } - scalar motionX = - waveHeight_/(kappa*initialDepth_)*tanh(theta1) + 0.5*stroke; + motionX[pointi] = + waveHeight_/(kappa*depthRef)*tanh(theta1) + 0.5*stroke; + } Field<vector>::operator=(n_*motionX); @@ -304,7 +441,6 @@ void Foam::waveMakerPointPatchVectorField::updateCoeffs() } } - fixedValuePointPatchField<vector>::updateCoeffs(); } @@ -318,9 +454,11 @@ void Foam::waveMakerPointPatchVectorField::write(Ostream& os) const os.writeEntry("wavePeriod", wavePeriod_); os.writeEntry("waveHeight", waveHeight_); os.writeEntry("wavePhase", wavePhase_); + os.writeEntry("waveAngle", waveAngle_); os.writeEntry("startTime", startTime_); os.writeEntry("rampTime", rampTime_); os.writeEntry("secondOrder", secondOrder_); + os.writeEntry("nPaddle", nPaddle_); writeEntry("value", os); } diff --git a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H index 2b0030c92edf8155ebcde627b409721afcbbb50f..618132607ece4f485cc68800ced7ae450b20e3c1 100644 --- a/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H +++ b/src/waveModels/derivedPointPatchFields/waveMaker/waveMakerPointPatchVectorField.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018-2019 IH-Cantabria - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -136,6 +136,9 @@ class waveMakerPointPatchVectorField //- Wave phase scalar wavePhase_; + //- Wave angle + scalar waveAngle_; + //- Wave length scalar waveLength_; @@ -148,6 +151,54 @@ class waveMakerPointPatchVectorField //- On/off second order calculation switch scalar secondOrder_; + //- Number of wave paddles + label nPaddle_; + + //- Rotation tensor from global to local system + tensor Rgl_; + + //- Rotation tensor from local to global system + tensor Rlg_; + + //- Paddle x co-ordinates / [m] + scalarField xPaddle_; + + //- Paddle y co-ordinates / [m] + scalarField yPaddle_; + + //- Addressing from point patch index to paddle index + labelList pointToPaddle_; + + //- Addressing from patch face index to paddle index + labelList faceToPaddle_; + + //- Patch face centre x co-ordinates / [m] + scalarField x_; + + //- Patch face centre y co-ordinates / [m] + scalarField y_; + + //- Patch face centre z co-ordinates / [m] + scalarField z_; + + //- Overall (point) span in z-direction / [m] + scalar zSpan_; + + //- Minimum z (point) height per patch face / [m] + scalarField zMin_; + + //- Global Minimum z (point) / [m] + scalar zMinGb_; + + //- Maximum z (point) height per patch face / [m] + scalarField zMax_; + + //- Calculated water depth at the patch + scalarField waterDepthRef_; + + // + scalar firstTime = 0; + // Protected Member Functions @@ -160,6 +211,9 @@ class waveMakerPointPatchVectorField //- Return the time scaling coefficient virtual scalar timeCoeff(const scalar t) const; + //- Initialise + virtual void initialiseGeometry(); + public: diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/U b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/U new file mode 100644 index 0000000000000000000000000000000000000000..889a15f316d37fa9145ecd50e1305cad3af91a54 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/U @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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 +{ + bottom1 + { + type fixedValue; + value uniform (0 0 0); + } + bottom2 + { + type fixedValue; + value uniform (0 0 0); + } + leftwall + { + type movingWallVelocity; + value uniform (0 0 0); + } + back + { + type slip; + } + front + { + type slip; + } + rightwall + { + type waveVelocity; + value uniform (0 0 0); + } + top + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/alpha.water b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/alpha.water new file mode 100644 index 0000000000000000000000000000000000000000..b6b745201170de81a0e96af4e6430c41f78d5aaf --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/alpha.water @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type zeroGradient; + } + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + leftwall + { + type zeroGradient; + } + rightwall + { + type zeroGradient; + } + top + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/p_rgh b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..9840026cbc1368093a48234e2d3d871d9b57521e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/p_rgh @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + bottom1 + { + type fixedFluxPressure; + value uniform 0; + } + bottom2 + { + type fixedFluxPressure; + value uniform 0; + } + front + { + type fixedFluxPressure; + value uniform 0; + } + back + { + type fixedFluxPressure; + value uniform 0; + } + leftwall + { + type fixedFluxPressure; + value uniform 0; + } + rightwall + { + type fixedFluxPressure; + value uniform 0; + } + top + { + 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/waves/waveMakerMultiPaddleFlap/0.orig/pointDisplacement b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/pointDisplacement new file mode 100644 index 0000000000000000000000000000000000000000..a8ffaa4ccd7aeba2e9dedc111b53dbf727897024 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/0.orig/pointDisplacement @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type fixedValue; + value uniform (0 0 0); + } + leftwall + { + type waveMaker; + value uniform (0 0 0); + + motionType flap; + x0 (0 0 0); + n (1 0 0); + waveHeight 0.06; + initialDepth 0.25; + wavePeriod 2.0; + rampTime 2.0; + wavePhase 0; + + nPaddle 4; + waveAngle 45; + } + back + { + type zeroGradient; + } + front + { + type zeroGradient; + } + rightwall + { + type fixedValue; + value uniform (0 0 0); + } + top + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/Allclean b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..e2f275d9fd6e6ba843f14fec57e2987e4c8607b3 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/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/waves/waveMakerMultiPaddleFlap/Allrun b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..28bf991e627511713c3b915ac0d9998f068ce030 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/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/waves/waveMakerMultiPaddleFlap/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..df1488daa15aac5495a065c89848e1007b84a995 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/dynamicMeshDict @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicMotionSolverFvMesh; +motionSolverLibs ("libfvMotionSolvers.so"); + +solver displacementLaplacian; + +displacementLaplacianCoeffs +{ + diffusivity inverseDistance (leftwall); +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/g b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..2a0e091fcfc37ab04dd809daf9ea30e30f068203 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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 -9.81 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..0b410ab971be20391ffc2b3be8b4758454104a2b --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/transportProperties @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +water +{ + transportModel Newtonian; + nu 1e-06; + rho 1000; +} + +air +{ + transportModel Newtonian; + nu 1.48e-05; + rho 1; +} + +sigma 0.07; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..04190a72d650e35ad10e2e5d702a70839cf7e8ad --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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/waves/waveMakerMultiPaddleFlap/constant/waveProperties b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/waveProperties new file mode 100644 index 0000000000000000000000000000000000000000..50f94afde4d8f1c0da814e2712d982d98fb71cba --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/constant/waveProperties @@ -0,0 +1,28 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object wavesProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +rightwall +{ + alpha alpha.water; + + waveModel shallowWaterAbsorption; + + nPaddle 4; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..b0ca7b5c036162360e252c8ae8a6b3f6075d98ae --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/blockMeshDict @@ -0,0 +1,111 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices +( + (0 0 0) + (2 0 0) + (2 0 0.7) + (0 0 0.7) + (0 0.32 0) + (2 0.32 0) + (2 0.32 0.7) + (0 0.32 0.7) + (4 0 0) + (4 0 0.7) + (4 0.32 0.7) + (4 0.32 0) +); + +blocks +( + hex (0 1 5 4 3 2 6 7) (100 16 140) simpleGrading (1 1 1) + hex (1 8 11 5 2 9 10 6) (100 16 140) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + bottom1 + { + type wall; + faces + ( + (0 1 5 4) + ); + } + bottom2 + { + type wall; + faces + ( + (1 8 11 5) + ); + } + front + { + type patch; + faces + ( + (0 1 2 3) + (1 8 9 2) + ); + } + back + { + type patch; + faces + ( + (4 5 6 7) + (5 11 10 6) + ); + } + leftwall + { + type patch; + faces + ( + (0 4 7 3) + ); + } + rightwall + { + type patch; + faces + ( + (8 11 10 9) + ); + } + top + { + type wall; + faces + ( + (3 2 6 7) + (2 9 10 6) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/controlDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..ef4dd88993f25bae096f2c548b706243baf35674 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/controlDict @@ -0,0 +1,139 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10; + +deltaT 0.005; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +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 +{ + line + { + type sets; + libs (sampling); + enabled true; + writeControl writeTime; + + interpolationScheme cellPoint; + setFormat raw; + + sets + ( + s1 + { + type uniform; + axis distance; + start ( 0.5 0.005 0.0 ); + end ( 0.5 0.005 0.7 ); + nPoints 1001; + } + + s2 + { + type uniform; + axis distance; + start ( 1.0 0.005 0.0 ); + end ( 1.0 0.005 0.7 ); + nPoints 1001; + } + + s3 + { + type uniform; + axis distance; + start ( 1.5 0.005 0.0 ); + end ( 1.5 0.005 0.7 ); + nPoints 1001; + } + + s4 + { + type uniform; + axis distance; + start ( 2.0 0.005 0.0 ); + end ( 2.0 0.005 0.7 ); + nPoints 1001; + } + + s5 + { + type uniform; + axis distance; + start ( 2.5 0.005 0.0 ); + end ( 2.5 0.005 0.7 ); + nPoints 1001; + } + + s6 + { + type uniform; + axis distance; + start ( 3.0 0.005 0.0 ); + end ( 3.0 0.005 0.7 ); + nPoints 1001; + } + + s7 + { + type uniform; + axis distance; + start ( 4.0 0.005 0.0 ); + end ( 4.0 0.005 0.7 ); + nPoints 1001; + } + ); + + fixedLocations false; + + fields (alpha.water); + } +} + + +// ************************************************************************* / diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/decomposeParDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..287e342bd60abedaef884408c9d8e9d270936a49 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/decomposeParDict @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method simple; + +coeffs +{ + n (2 1 1); +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..be5fa52998f2846fd55daebe09d35ca215b9d711 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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; +} + +divSchemes +{ + div(rhoPhi,U) Gauss linearUpwind grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(phi,nuTilda) Gauss upwind; + div((muEff*dev(T(grad(U))))) Gauss linear; + 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; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/fvSolution b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a93ca8651a75a7cbe898559f886d67ba8e24b29f --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/fvSolution @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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 3; + cAlpha 1; + } + + "(pcorr|pcorrFinal)" + { + solver GAMG; + tolerance 1e-5; + relTol 0; + smoother DICGaussSeidel; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + } + + p_rgh + { + $pcorr; + tolerance 1e-07; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 3; + nNonOrthogonalCorrectors 0; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/setFieldsDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..a535d8bfd93c8f9641ae598cb644cfff925d318e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddleFlap/system/setFieldsDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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 +); + +regions +( + boxToCell + { + box ( -100 -100 -1 ) ( 100.0 100.0 0.25 ); + fieldValues ( volScalarFieldValue alpha.water 1 ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/U b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/U new file mode 100644 index 0000000000000000000000000000000000000000..889a15f316d37fa9145ecd50e1305cad3af91a54 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/U @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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 +{ + bottom1 + { + type fixedValue; + value uniform (0 0 0); + } + bottom2 + { + type fixedValue; + value uniform (0 0 0); + } + leftwall + { + type movingWallVelocity; + value uniform (0 0 0); + } + back + { + type slip; + } + front + { + type slip; + } + rightwall + { + type waveVelocity; + value uniform (0 0 0); + } + top + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/alpha.water b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/alpha.water new file mode 100644 index 0000000000000000000000000000000000000000..b6b745201170de81a0e96af4e6430c41f78d5aaf --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/alpha.water @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type zeroGradient; + } + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + leftwall + { + type zeroGradient; + } + rightwall + { + type zeroGradient; + } + top + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/p_rgh b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..9840026cbc1368093a48234e2d3d871d9b57521e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/p_rgh @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + bottom1 + { + type fixedFluxPressure; + value uniform 0; + } + bottom2 + { + type fixedFluxPressure; + value uniform 0; + } + front + { + type fixedFluxPressure; + value uniform 0; + } + back + { + type fixedFluxPressure; + value uniform 0; + } + leftwall + { + type fixedFluxPressure; + value uniform 0; + } + rightwall + { + type fixedFluxPressure; + value uniform 0; + } + top + { + 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/waves/waveMakerMultiPaddlePiston/0.orig/pointDisplacement b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/pointDisplacement new file mode 100644 index 0000000000000000000000000000000000000000..a677518be74c5347a4edd3052b49e0aa21304405 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/0.orig/pointDisplacement @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type fixedValue; + value uniform (0 0 0); + } + leftwall + { + type waveMaker; + value uniform (0 0 0); + + motionType piston; + x0 (0 0 0); + n (1 0 0); + waveHeight 0.06; + initialDepth 0.25; + wavePeriod 2.0; + rampTime 2.0; + wavePhase 0; + + nPaddle 4; + waveAngle 45; + } + back + { + type zeroGradient; + } + front + { + type zeroGradient; + } + rightwall + { + type fixedValue; + value uniform (0 0 0); + } + top + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/Allclean b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..e2f275d9fd6e6ba843f14fec57e2987e4c8607b3 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/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/waves/waveMakerMultiPaddlePiston/Allrun b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..28bf991e627511713c3b915ac0d9998f068ce030 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/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/waves/waveMakerMultiPaddlePiston/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..df1488daa15aac5495a065c89848e1007b84a995 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/dynamicMeshDict @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicMotionSolverFvMesh; +motionSolverLibs ("libfvMotionSolvers.so"); + +solver displacementLaplacian; + +displacementLaplacianCoeffs +{ + diffusivity inverseDistance (leftwall); +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/g b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..2a0e091fcfc37ab04dd809daf9ea30e30f068203 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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 -9.81 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..0b410ab971be20391ffc2b3be8b4758454104a2b --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/transportProperties @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +water +{ + transportModel Newtonian; + nu 1e-06; + rho 1000; +} + +air +{ + transportModel Newtonian; + nu 1.48e-05; + rho 1; +} + +sigma 0.07; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..04190a72d650e35ad10e2e5d702a70839cf7e8ad --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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/waves/waveMakerMultiPaddlePiston/constant/waveProperties b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/waveProperties new file mode 100644 index 0000000000000000000000000000000000000000..50f94afde4d8f1c0da814e2712d982d98fb71cba --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/constant/waveProperties @@ -0,0 +1,28 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object wavesProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +rightwall +{ + alpha alpha.water; + + waveModel shallowWaterAbsorption; + + nPaddle 4; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..b0ca7b5c036162360e252c8ae8a6b3f6075d98ae --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/blockMeshDict @@ -0,0 +1,111 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices +( + (0 0 0) + (2 0 0) + (2 0 0.7) + (0 0 0.7) + (0 0.32 0) + (2 0.32 0) + (2 0.32 0.7) + (0 0.32 0.7) + (4 0 0) + (4 0 0.7) + (4 0.32 0.7) + (4 0.32 0) +); + +blocks +( + hex (0 1 5 4 3 2 6 7) (100 16 140) simpleGrading (1 1 1) + hex (1 8 11 5 2 9 10 6) (100 16 140) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + bottom1 + { + type wall; + faces + ( + (0 1 5 4) + ); + } + bottom2 + { + type wall; + faces + ( + (1 8 11 5) + ); + } + front + { + type patch; + faces + ( + (0 1 2 3) + (1 8 9 2) + ); + } + back + { + type patch; + faces + ( + (4 5 6 7) + (5 11 10 6) + ); + } + leftwall + { + type patch; + faces + ( + (0 4 7 3) + ); + } + rightwall + { + type patch; + faces + ( + (8 11 10 9) + ); + } + top + { + type wall; + faces + ( + (3 2 6 7) + (2 9 10 6) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/controlDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..ef4dd88993f25bae096f2c548b706243baf35674 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/controlDict @@ -0,0 +1,139 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10; + +deltaT 0.005; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +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 +{ + line + { + type sets; + libs (sampling); + enabled true; + writeControl writeTime; + + interpolationScheme cellPoint; + setFormat raw; + + sets + ( + s1 + { + type uniform; + axis distance; + start ( 0.5 0.005 0.0 ); + end ( 0.5 0.005 0.7 ); + nPoints 1001; + } + + s2 + { + type uniform; + axis distance; + start ( 1.0 0.005 0.0 ); + end ( 1.0 0.005 0.7 ); + nPoints 1001; + } + + s3 + { + type uniform; + axis distance; + start ( 1.5 0.005 0.0 ); + end ( 1.5 0.005 0.7 ); + nPoints 1001; + } + + s4 + { + type uniform; + axis distance; + start ( 2.0 0.005 0.0 ); + end ( 2.0 0.005 0.7 ); + nPoints 1001; + } + + s5 + { + type uniform; + axis distance; + start ( 2.5 0.005 0.0 ); + end ( 2.5 0.005 0.7 ); + nPoints 1001; + } + + s6 + { + type uniform; + axis distance; + start ( 3.0 0.005 0.0 ); + end ( 3.0 0.005 0.7 ); + nPoints 1001; + } + + s7 + { + type uniform; + axis distance; + start ( 4.0 0.005 0.0 ); + end ( 4.0 0.005 0.7 ); + nPoints 1001; + } + ); + + fixedLocations false; + + fields (alpha.water); + } +} + + +// ************************************************************************* / diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/decomposeParDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..287e342bd60abedaef884408c9d8e9d270936a49 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/decomposeParDict @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 2; + +method simple; + +coeffs +{ + n (2 1 1); +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..be5fa52998f2846fd55daebe09d35ca215b9d711 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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; +} + +divSchemes +{ + div(rhoPhi,U) Gauss linearUpwind grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(phi,nuTilda) Gauss upwind; + div((muEff*dev(T(grad(U))))) Gauss linear; + 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; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/fvSolution b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a93ca8651a75a7cbe898559f886d67ba8e24b29f --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/fvSolution @@ -0,0 +1,80 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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 3; + cAlpha 1; + } + + "(pcorr|pcorrFinal)" + { + solver GAMG; + tolerance 1e-5; + relTol 0; + smoother DICGaussSeidel; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + } + + p_rgh + { + $pcorr; + tolerance 1e-07; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 3; + nNonOrthogonalCorrectors 0; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/setFieldsDict b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..a535d8bfd93c8f9641ae598cb644cfff925d318e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waves/waveMakerMultiPaddlePiston/system/setFieldsDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / 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 +); + +regions +( + boxToCell + { + box ( -100 -100 -1 ) ( 100.0 100.0 0.25 ); + fieldValues ( volScalarFieldValue alpha.water 1 ); + } +); + + +// ************************************************************************* //