From 6e1e854cbccba8b22f8721273572e000b7b98638 Mon Sep 17 00:00:00 2001 From: Gabriel Barajas <gabriel.barajas@unican.es> Date: Thu, 15 Nov 2018 08:29:54 +0000 Subject: [PATCH] INT: Initial commit of new wave-maker BCs based on mesh motion waveMakerFlap: creates waves using a flapping motion waveMakerPiston: creates waves using a piston motion --- .../waveMakerFlapPointPatchVectorField.C | 250 ++++++++++++++++++ .../waveMakerFlapPointPatchVectorField.H | 179 +++++++++++++ .../waveMakerPistonPointPatchVectorField.C | 238 +++++++++++++++++ .../waveMakerPistonPointPatchVectorField.H | 179 +++++++++++++ .../interFoam/laminar/waveMakerFlap/0.org/U | 59 +++++ .../laminar/waveMakerFlap/0.org/alpha.water | 55 ++++ .../laminar/waveMakerFlap/0.org/p_rgh | 65 +++++ .../waveMakerFlap/0.org/pointDisplacement | 72 +++++ .../waveMakerFlap/constant/dynamicMeshDict | 29 ++ .../laminar/waveMakerFlap/constant/g | 22 ++ .../constant/transportProperties | 37 +++ .../constant/turbulenceProperties | 20 ++ .../waveMakerFlap/constant/waveProperties | 28 ++ .../waveMakerFlap/system/blockMeshDict | 111 ++++++++ .../laminar/waveMakerFlap/system/controlDict | 139 ++++++++++ .../laminar/waveMakerFlap/system/fvSchemes | 64 +++++ .../laminar/waveMakerFlap/system/fvSolution | 98 +++++++ .../waveMakerFlap/system/setFieldsDict | 33 +++ .../interFoam/laminar/waveMakerPiston/0.org/U | 59 +++++ .../laminar/waveMakerPiston/0.org/alpha.water | 55 ++++ .../laminar/waveMakerPiston/0.org/p_rgh | 65 +++++ .../waveMakerPiston/0.org/pointDisplacement | 72 +++++ .../waveMakerPiston/constant/dynamicMeshDict | 29 ++ .../laminar/waveMakerPiston/constant/g | 22 ++ .../constant/transportProperties | 37 +++ .../constant/turbulenceProperties | 20 ++ .../waveMakerPiston/constant/waveProperties | 28 ++ .../waveMakerPiston/system/blockMeshDict | 111 ++++++++ .../waveMakerPiston/system/controlDict | 139 ++++++++++ .../laminar/waveMakerPiston/system/fvSchemes | 64 +++++ .../laminar/waveMakerPiston/system/fvSolution | 97 +++++++ .../waveMakerPiston/system/setFieldsDict | 33 +++ 32 files changed, 2509 insertions(+) create mode 100644 src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.C create mode 100644 src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.H create mode 100644 src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.C create mode 100644 src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.H create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/U create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/alpha.water create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/p_rgh create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/pointDisplacement create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/dynamicMeshDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/g create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/transportProperties create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/turbulenceProperties create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/waveProperties create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/blockMeshDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/controlDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/fvSchemes create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/fvSolution create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/setFieldsDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/U create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/alpha.water create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/p_rgh create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/pointDisplacement create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/dynamicMeshDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/g create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/transportProperties create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/turbulenceProperties create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/waveProperties create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/blockMeshDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/controlDict create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/fvSchemes create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/fvSolution create mode 100644 tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/setFieldsDict diff --git a/src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.C b/src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.C new file mode 100644 index 00000000000..71e1c6806ad --- /dev/null +++ b/src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.C @@ -0,0 +1,250 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "waveMakerFlapPointPatchVectorField.H" +#include "mathematicalConstants.H" +#include "pointPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "Time.H" +#include "polyMesh.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::waveMakerFlapPointPatchVectorField:: +waveMakerFlapPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchField<vector>(p, iF), + initialDepth_(0.0), + wavePeriod_(0.0), + waveHeigth_(0.0), + waveLength_(0.0), + wavePhase_(0.0), + waveNumber_(0.0), + rampTime_(0.0), + g_(Zero), + secondOrder_(false) +{} + + +Foam::waveMakerFlapPointPatchVectorField:: +waveMakerFlapPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const dictionary& dict +) +: + fixedValuePointPatchField<vector>(p, iF, dict), + initialDepth_(readScalar(dict.lookup("initialDepth"))), + wavePeriod_(readScalar(dict.lookup("wavePeriod"))), + waveHeigth_(readScalar(dict.lookup("waveHeigth"))), + waveLength_(readScalar(dict.lookup("waveLength"))), + wavePhase_(readScalar(dict.lookup("wavePhase"))), + waveNumber_(readScalar(dict.lookup("waveNumber"))), + rampTime_(readScalar(dict.lookup("rampTime"))), + g_(dict.lookup("g")), + secondOrder_(dict.lookupOrDefault<bool>("secondOrder",false)) +{ + if (!dict.found("value")) + { + updateCoeffs(); + } +} + + +Foam::waveMakerFlapPointPatchVectorField:: +waveMakerFlapPointPatchVectorField +( + const waveMakerFlapPointPatchVectorField& ptf, + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const pointPatchFieldMapper& mapper +) +: + fixedValuePointPatchField<vector>(ptf, p, iF, mapper), + initialDepth_(ptf.initialDepth_), + wavePeriod_(ptf.wavePeriod_), + waveHeigth_(ptf.waveHeigth_), + waveLength_(ptf.waveLength_), + wavePhase_(ptf.wavePhase_), + waveNumber_(ptf.waveNumber_), + rampTime_(ptf.rampTime_), + g_(ptf.g_), + secondOrder_(ptf.secondOrder_) +{} + + +Foam::waveMakerFlapPointPatchVectorField:: +waveMakerFlapPointPatchVectorField +( + const waveMakerFlapPointPatchVectorField& ptf, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchField<vector>(ptf, iF), + initialDepth_(ptf.initialDepth_), + wavePeriod_(ptf.wavePeriod_), + waveHeigth_(ptf.waveHeigth_), + waveLength_(ptf.waveLength_), + wavePhase_(ptf.wavePhase_), + waveNumber_(ptf.waveNumber_), + rampTime_(ptf.rampTime_), + g_(ptf.g_), + secondOrder_(ptf.secondOrder_) +{} + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::scalar Foam::waveMakerFlapPointPatchVectorField::waveLength +( + const scalar h, + const scalar T +) +{ + const scalar L0 = mag(g_)*T*T/(constant::mathematical::twoPi); + scalar L = L0; + + for(int i=1; i<=100; i++) + { + L = L0*tanh(constant::mathematical::twoPi*h/L); + } + return L; +} + +Foam::scalar Foam::waveMakerFlapPointPatchVectorField::timeCoeff +( + const scalar t +) const +{ + return max(0, min(t/rampTime_, 1)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::waveMakerFlapPointPatchVectorField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + const polyMesh& mesh = this->internalField().mesh()(); + const Time& t = mesh.time(); + + // Time ramp weight + const scalar tCoeff = timeCoeff(t.value()); + + vectorField localPoints_ = this->patch().localPoints(); + vectorField waveBoardMotion_ = 0.0*localPoints_; + + waveLength_ = waveLength (initialDepth_, wavePeriod_); + + const scalar waveK = constant::mathematical::twoPi/waveLength_; + const scalar sigma_ = (2.0*constant::mathematical::pi) / wavePeriod_; + + //First order + if (secondOrder_== false) + { + forAll (localPoints_, labelP) + { + scalar waveBoardStroke_ = (sinh(2.0*waveK*initialDepth_) + + 2.0*waveK*initialDepth_) + / (4.0*sinh(waveK*initialDepth_)) + * (1.0 / ( sinh(waveK*initialDepth_) + + (1.0-cosh(waveK*initialDepth_)) + / (waveK*initialDepth_) ) ) * waveHeigth_; + + waveBoardMotion_[labelP].component(0) = tCoeff + * (1.0+(localPoints_[labelP].component(2)-initialDepth_) + / (initialDepth_))*(waveBoardStroke_/2.0)*sin(sigma_*t.value()); + } + + Field<vector>::operator= + ( + waveBoardMotion_ + ); + } + else if ( secondOrder_ == true) + { + scalar m1_; + forAll (localPoints_, labelP) + { + m1_ = ((4.0*sinh(waveK*initialDepth_)) + / (sinh(2.0*waveK*initialDepth_)+2.0*waveK*initialDepth_)) + * ( sinh(waveK*initialDepth_) + 1.0/(waveK*initialDepth_) + * (1.0-cosh(waveK*initialDepth_))); + + waveBoardMotion_[labelP].component(0) = waveHeigth_/(2.0*m1_)*sin(sigma_*t.value()) + + pow(waveHeigth_,2)/(16.0*initialDepth_)*(3.0*cosh(waveK*initialDepth_) + / pow(sinh(waveK*initialDepth_),3) -2.0/m1_)*sin(2.0*sigma_*t.value()); + + waveBoardMotion_[labelP].component(0) = tCoeff + * (1.0+(localPoints_[labelP].component(2)-initialDepth_) + / (initialDepth_)) * waveBoardMotion_[labelP].component(0); + } + + Field<vector>::operator= + ( + waveBoardMotion_ + ); + } + + fixedValuePointPatchField<vector>::updateCoeffs(); +} + + +void Foam::waveMakerFlapPointPatchVectorField::write(Ostream& os) const +{ + pointPatchField<vector>::write(os); + os.writeEntry("initialDepth", initialDepth_); + os.writeEntry("wavePeriod", wavePeriod_); + os.writeEntry("waveHeigth", waveHeigth_); + os.writeEntry("waveLength", waveLength_); + os.writeEntry("wavePhase", wavePhase_); + os.writeEntry("waveNumber", waveNumber_); + os.writeEntry("rampTime", rampTime_); + os.writeEntry("g", g_); + os.writeEntry("secondOrder", secondOrder_); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePointPatchTypeField + ( + pointPatchVectorField, + waveMakerFlapPointPatchVectorField + ); +} + +// ************************************************************************* // diff --git a/src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.H b/src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.H new file mode 100644 index 00000000000..689048d10ac --- /dev/null +++ b/src/waveModels/derivedFvPatchFields/waveMakerFlap/waveMakerFlapPointPatchVectorField.H @@ -0,0 +1,179 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::waveMakerFlapPointPatchVectorField + +Description + Foam::waveMakerFlapPointPatchVectorField + +SourceFiles + waveMakerFlapPointPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef waveMakerFlapPointPatchVectorField_H +#define waveMakerFlapPointPatchVectorField_H + +#include "fixedValuePointPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class waveMakerFlapPointPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class waveMakerFlapPointPatchVectorField +: + public fixedValuePointPatchField<vector> +{ + // Private data + + //inital water depth + scalar initialDepth_; + + //wave period + scalar wavePeriod_; + + //wave heigth + scalar waveHeigth_; + + //wavelength + scalar waveLength_; + + //wave phase + scalar wavePhase_; + + //wave number + scalar waveNumber_; + + //ramp time + scalar rampTime_; + + // gravity vector + vector g_; + + //on/off second order generation + scalar secondOrder_; + + // Protected Member Functions + + // Dispersion equation + virtual scalar waveLength(const scalar h, const scalar T); + + //- Return the time scaling coefficient + virtual scalar timeCoeff(const scalar t) const; + +public: + + //- Runtime type information + TypeName("waveMakerFlap"); + + + // Constructors + + //- Construct from patch and internal field + waveMakerFlapPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct from patch, internal field and dictionary + waveMakerFlapPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const dictionary& + ); + + //- Construct by mapping given patchField<vector> onto a new patch + waveMakerFlapPointPatchVectorField + ( + const waveMakerFlapPointPatchVectorField&, + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const pointPatchFieldMapper& + ); + + //- Construct and return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return autoPtr<pointPatchField<vector>> + ( + new waveMakerFlapPointPatchVectorField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + waveMakerFlapPointPatchVectorField + ( + const waveMakerFlapPointPatchVectorField&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual autoPtr<pointPatchField<vector>> clone + ( + const DimensionedField<vector, pointMesh>& iF + ) const + { + return autoPtr<pointPatchField<vector>> + ( + new waveMakerFlapPointPatchVectorField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.C b/src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.C new file mode 100644 index 00000000000..7eb2346fe4e --- /dev/null +++ b/src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.C @@ -0,0 +1,238 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "waveMakerPistonPointPatchVectorField.H" +#include "mathematicalConstants.H" +#include "pointPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "Time.H" +#include "polyMesh.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::waveMakerPistonPointPatchVectorField:: +waveMakerPistonPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchField<vector>(p, iF), + initialDepth_(0.0), + wavePeriod_(0.0), + waveHeigth_(0.0), + waveLength_(0.0), + wavePhase_(0.0), + waveNumber_(0.0), + rampTime_(0.0), + g_(Zero), + secondOrder_(false) +{} + + +Foam::waveMakerPistonPointPatchVectorField:: +waveMakerPistonPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const dictionary& dict +) +: + fixedValuePointPatchField<vector>(p, iF, dict), + initialDepth_(readScalar(dict.lookup("initialDepth"))), + wavePeriod_(readScalar(dict.lookup("wavePeriod"))), + waveHeigth_(readScalar(dict.lookup("waveHeigth"))), + waveLength_(readScalar(dict.lookup("waveLength"))), + wavePhase_(readScalar(dict.lookup("wavePhase"))), + waveNumber_(readScalar(dict.lookup("waveNumber"))), + rampTime_(readScalar(dict.lookup("rampTime"))), + g_(dict.lookup("g")), + secondOrder_(dict.lookupOrDefault<bool>("secondOrder",false)) +{ + if (!dict.found("value")) + { + updateCoeffs(); + } +} + + +Foam::waveMakerPistonPointPatchVectorField:: +waveMakerPistonPointPatchVectorField +( + const waveMakerPistonPointPatchVectorField& ptf, + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const pointPatchFieldMapper& mapper +) +: + fixedValuePointPatchField<vector>(ptf, p, iF, mapper), + initialDepth_(ptf.initialDepth_), + wavePeriod_(ptf.wavePeriod_), + waveHeigth_(ptf.waveHeigth_), + waveLength_(ptf.waveLength_), + wavePhase_(ptf.wavePhase_), + waveNumber_(ptf.waveNumber_), + rampTime_(ptf.rampTime_), + g_(ptf.g_), + secondOrder_(ptf.secondOrder_) +{} + + +Foam::waveMakerPistonPointPatchVectorField:: +waveMakerPistonPointPatchVectorField +( + const waveMakerPistonPointPatchVectorField& ptf, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchField<vector>(ptf, iF), + initialDepth_(ptf.initialDepth_), + wavePeriod_(ptf.wavePeriod_), + waveHeigth_(ptf.waveHeigth_), + waveLength_(ptf.waveLength_), + wavePhase_(ptf.wavePhase_), + waveNumber_(ptf.waveNumber_), + rampTime_(ptf.rampTime_), + g_(ptf.g_), + secondOrder_(ptf.secondOrder_) +{} + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::scalar Foam::waveMakerPistonPointPatchVectorField::waveLength +( + const scalar h, + const scalar T +) +{ + const scalar L0 = mag(g_)*T*T/(constant::mathematical::twoPi); + scalar L = L0; + + for(int i=1; i<=100; i++) + { + L = L0*tanh(constant::mathematical::twoPi*h/L); + } + return L; +} + +Foam::scalar Foam::waveMakerPistonPointPatchVectorField::timeCoeff +( + const scalar t +) const +{ + return max(0, min(t/rampTime_, 1)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::waveMakerPistonPointPatchVectorField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + const polyMesh& mesh = this->internalField().mesh()(); + const Time& t = mesh.time(); + + // Time ramp weight + const scalar tCoeff = timeCoeff(t.value()); + + vectorField localPoints_ = this->patch().localPoints(); + vectorField auxPoints = 0.0*localPoints_; + + waveLength_ = waveLength (initialDepth_, wavePeriod_); + + const scalar waveK = constant::mathematical::twoPi/waveLength_; + + vector waveBoardMotion_(0,0,0); + const scalar sigma_ = (2.0*constant::mathematical::pi) / wavePeriod_; + + //first order + if ( secondOrder_ == false) + { + scalar waveBoardStroke_ = (sinh(2.0*waveK*initialDepth_) + + 2.0*waveK*initialDepth_) + / (2.0*(cosh(2.0*waveK*initialDepth_) + - 1.0)) * waveHeigth_; + waveBoardMotion_.component(0)= tCoeff*(waveBoardStroke_/2.0) + * sin(sigma_*t.value()); + + Field<vector>::operator= + ( + waveBoardMotion_ + ); + } + //second order + else if ( secondOrder_ == true) + { + scalar m1_ = (2.0*(cosh(2.0*waveK*initialDepth_)-1.0)) + / (sinh(2.0*waveK*initialDepth_) + + 2.0*waveK*initialDepth_); + waveBoardMotion_.component(0) = tCoeff * (waveHeigth_/(2.0*m1_) + * sin(sigma_*t.value()) + pow(waveHeigth_,2) + / (32.0*initialDepth_)*(3.0*cosh(waveK*initialDepth_) + / pow(sinh(waveK*initialDepth_),3)-2.0/m1_) + * sin(2.0*sigma_*t.value())); + + Field<vector>::operator= + ( + waveBoardMotion_ + ); + } + + fixedValuePointPatchField<vector>::updateCoeffs(); +} + + +void Foam::waveMakerPistonPointPatchVectorField::write(Ostream& os) const +{ + pointPatchField<vector>::write(os); + os.writeEntry("initialDepth", initialDepth_); + os.writeEntry("wavePeriod", wavePeriod_); + os.writeEntry("waveHeigth", waveHeigth_); + os.writeEntry("waveLength", waveLength_); + os.writeEntry("wavePhase", wavePhase_); + os.writeEntry("waveNumber", waveNumber_); + os.writeEntry("rampTime", rampTime_); + os.writeEntry("g", g_); + os.writeEntry("secondOrder", secondOrder_); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePointPatchTypeField + ( + pointPatchVectorField, + waveMakerPistonPointPatchVectorField + ); +} + +// ************************************************************************* // diff --git a/src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.H b/src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.H new file mode 100644 index 00000000000..1929821fb7f --- /dev/null +++ b/src/waveModels/derivedFvPatchFields/waveMakerPiston/waveMakerPistonPointPatchVectorField.H @@ -0,0 +1,179 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::waveMakerPistonPointPatchVectorField + +Description + Foam::waveMakerPistonPointPatchVectorField + +SourceFiles + waveMakerPistonPointPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef waveMakerPistonPointPatchVectorField_H +#define waveMakerPistonPointPatchVectorField_H + +#include "fixedValuePointPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class waveMakerPistonPointPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class waveMakerPistonPointPatchVectorField +: + public fixedValuePointPatchField<vector> +{ + // Private data + + //inital water depth + scalar initialDepth_; + + //wave period + scalar wavePeriod_; + + //wave heigth + scalar waveHeigth_; + + //wavelength + scalar waveLength_; + + //wave phase + scalar wavePhase_; + + //wave number + scalar waveNumber_; + + //ramp time + scalar rampTime_; + + // gravity vector + vector g_; + + //on/off second order generation + scalar secondOrder_; + + // Protected Member Functions + + // Dispersion equation + virtual scalar waveLength(const scalar h, const scalar T); + + //- Return the time scaling coefficient + virtual scalar timeCoeff(const scalar t) const; + +public: + + //- Runtime type information + TypeName("waveMakerPiston"); + + + // Constructors + + //- Construct from patch and internal field + waveMakerPistonPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct from patch, internal field and dictionary + waveMakerPistonPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const dictionary& + ); + + //- Construct by mapping given patchField<vector> onto a new patch + waveMakerPistonPointPatchVectorField + ( + const waveMakerPistonPointPatchVectorField&, + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const pointPatchFieldMapper& + ); + + //- Construct and return a clone + virtual autoPtr<pointPatchField<vector>> clone() const + { + return autoPtr<pointPatchField<vector>> + ( + new waveMakerPistonPointPatchVectorField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + waveMakerPistonPointPatchVectorField + ( + const waveMakerPistonPointPatchVectorField&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual autoPtr<pointPatchField<vector>> clone + ( + const DimensionedField<vector, pointMesh>& iF + ) const + { + return autoPtr<pointPatchField<vector>> + ( + new waveMakerPistonPointPatchVectorField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/U b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/U new file mode 100644 index 00000000000..1130305105b --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/U @@ -0,0 +1,59 @@ +/*--------------------------------*- 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 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 empty; + } + front + { + type empty; + } + rightwall + { + type waveVelocity; + value uniform (0 0 0); + } + top + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/alpha.water b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/alpha.water new file mode 100644 index 00000000000..0d6c1ef5e63 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/alpha.water @@ -0,0 +1,55 @@ +/*--------------------------------*- 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type zeroGradient; + } + front + { + type empty; + } + back + { + type empty; + } + leftwall + { + type zeroGradient; + } + rightwall + { + type zeroGradient; + } + top + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/p_rgh b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/p_rgh new file mode 100644 index 00000000000..69f34699f7c --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/p_rgh @@ -0,0 +1,65 @@ +/*--------------------------------*- 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 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 empty; + } + back + { + type empty; + } + 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/waveMakerFlap/0.org/pointDisplacement b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/pointDisplacement new file mode 100644 index 00000000000..820a34f33d6 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/0.org/pointDisplacement @@ -0,0 +1,72 @@ +/*--------------------------------*- 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type fixedValue; + value uniform (0 0 0); + } + leftwall + { + type waveMakerFlap; + value uniform (0 0 0); + + waveBoardStroke 0.0; + waveHeigth 0.06; + g (0 0 -9.81); + initialDepth 0.25; + wavePeriod 2.0; + + rampTime 2.0; + waveLength 0; + wavePhase 0; + + waveNumber 0.0; + secondOrder false; + + + } + back + { + type empty; + } + front + { + type empty; + } + rightwall + { + type fixedValue; + value uniform (0 0 0); + } + top + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/dynamicMeshDict new file mode 100644 index 00000000000..221b2e62629 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/dynamicMeshDict @@ -0,0 +1,29 @@ +/*--------------------------------*- 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 (leftwall); +} + +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/g b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/g new file mode 100644 index 00000000000..d6dea987563 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/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.org | +| \\/ 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/waveMakerFlap/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/transportProperties new file mode 100644 index 00000000000..43a98e9c59e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/transportProperties @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / 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 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/waveMakerFlap/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/turbulenceProperties new file mode 100644 index 00000000000..115a9830c11 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / 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 turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/waveProperties b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/constant/waveProperties new file mode 100644 index 00000000000..2e959d65523 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +rightwall +{ + alpha alpha.water; + + waveModel shallowWaterAbsorption; + + nPaddle 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/blockMeshDict new file mode 100644 index 00000000000..ab6ee28211e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/blockMeshDict @@ -0,0 +1,111 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.7.1 | +| \\ / 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.01 0) + (2 0.01 0) + (2 0.01 0.7) + (0 0.01 0.7) + (4 0 0) + (4 0 0.7) + (4 0.01 0.7) + (4 0.01 0) +); + +blocks +( + hex (0 1 5 4 3 2 6 7) (200 1 140) simpleGrading (1 1 1) + hex (1 8 11 5 2 9 10 6) (200 1 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 empty; + faces + ( + (0 1 2 3) + (1 8 9 2) + ); + } + back + { + type empty; + 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/waveMakerFlap/system/controlDict b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/controlDict new file mode 100644 index 00000000000..c6345fb7632 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/controlDict @@ -0,0 +1,139 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interDyMFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 40; + +deltaT 0.005; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.65; +maxAlphaCo 0.65; +maxDeltaT 0.05; + +functions +{ + line + { + type sets; + libs ("libsampling.so"); + 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/waveMakerFlap/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/fvSchemes new file mode 100644 index 00000000000..bfd3a817e58 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- 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 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/waveMakerFlap/system/fvSolution b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/fvSolution new file mode 100644 index 00000000000..56004f9d3e9 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/fvSolution @@ -0,0 +1,98 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / 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 3; + cAlpha 1; + } + + "(pcorr|pcorrFinal)" + { + solver PCG; + preconditioner DIC; + tolerance 1e-10; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-08; + relTol 0; + } + + nuTilda + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-03; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + nAlphaCorr 1; + nAlphaSubCycles 2; + cAlpha 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/setFieldsDict b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/setFieldsDict new file mode 100644 index 00000000000..fbf256400fe --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerFlap/system/setFieldsDict @@ -0,0 +1,33 @@ +/*--------------------------------*- 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 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/waveMakerPiston/0.org/U b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/U new file mode 100644 index 00000000000..1130305105b --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/U @@ -0,0 +1,59 @@ +/*--------------------------------*- 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 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 empty; + } + front + { + type empty; + } + rightwall + { + type waveVelocity; + value uniform (0 0 0); + } + top + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/alpha.water b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/alpha.water new file mode 100644 index 00000000000..0d6c1ef5e63 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/alpha.water @@ -0,0 +1,55 @@ +/*--------------------------------*- 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type zeroGradient; + } + front + { + type empty; + } + back + { + type empty; + } + leftwall + { + type zeroGradient; + } + rightwall + { + type zeroGradient; + } + top + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/p_rgh b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/p_rgh new file mode 100644 index 00000000000..69f34699f7c --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/p_rgh @@ -0,0 +1,65 @@ +/*--------------------------------*- 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 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 empty; + } + back + { + type empty; + } + 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/waveMakerPiston/0.org/pointDisplacement b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/pointDisplacement new file mode 100644 index 00000000000..f3eb7ddba3a --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/0.org/pointDisplacement @@ -0,0 +1,72 @@ +/*--------------------------------*- 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 +{ + bottom1 + { + type zeroGradient; + } + bottom2 + { + type fixedValue; + value uniform (0 0 0); + } + leftwall + { + type waveMakerPiston; + value uniform (0 0 0); + + waveBoardStroke 0; + waveHeigth 0.06; + g (0 0 -9.81); + waterDepthRef 0.25; + initialDepth 0.25; + + wavePeriod 2.0; + + rampTime 2.0; + waveLength 0; + wavePhase 0; + + waveNumber 0.0; + secondOrder false; + } + back + { + type empty; + } + front + { + type empty; + } + rightwall + { + type fixedValue; + value uniform (0 0 0); + } + top + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/dynamicMeshDict new file mode 100644 index 00000000000..221b2e62629 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/dynamicMeshDict @@ -0,0 +1,29 @@ +/*--------------------------------*- 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 (leftwall); +} + +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/g b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/g new file mode 100644 index 00000000000..d6dea987563 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/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.org | +| \\/ 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/waveMakerPiston/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/transportProperties new file mode 100644 index 00000000000..43a98e9c59e --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/transportProperties @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / 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 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/waveMakerPiston/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/turbulenceProperties new file mode 100644 index 00000000000..115a9830c11 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / 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 turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/waveProperties b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/constant/waveProperties new file mode 100644 index 00000000000..2e959d65523 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +rightwall +{ + alpha alpha.water; + + waveModel shallowWaterAbsorption; + + nPaddle 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/blockMeshDict new file mode 100644 index 00000000000..f4fdd4a279c --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/blockMeshDict @@ -0,0 +1,111 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.7.1 | +| \\ / 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.01 0) + (2 0.01 0) + (2 0.01 0.7) + (0 0.01 0.7) + (4 0 0) + (4 0 0.7) + (4 0.01 0.7) + (4 0.01 0) +); + +blocks +( + hex (0 1 5 4 3 2 6 7) (100 1 140) simpleGrading (1 1 1) + hex (1 8 11 5 2 9 10 6) (300 1 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 empty; + faces + ( + (0 1 2 3) + (1 8 9 2) + ); + } + back + { + type empty; + 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/waveMakerPiston/system/controlDict b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/controlDict new file mode 100644 index 00000000000..c6345fb7632 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/controlDict @@ -0,0 +1,139 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interDyMFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 40; + +deltaT 0.005; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.65; +maxAlphaCo 0.65; +maxDeltaT 0.05; + +functions +{ + line + { + type sets; + libs ("libsampling.so"); + 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/waveMakerPiston/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/fvSchemes new file mode 100644 index 00000000000..bfd3a817e58 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/fvSchemes @@ -0,0 +1,64 @@ +/*--------------------------------*- 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 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/waveMakerPiston/system/fvSolution b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/fvSolution new file mode 100644 index 00000000000..c25fef42d7d --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/fvSolution @@ -0,0 +1,97 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / 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 3; + cAlpha 1; + } + + "(pcorr|pcorrFinal)" + { + solver PCG; + preconditioner DIC; + tolerance 1e-10; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-08; + relTol 0; + } + + nuTilda + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-03; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + nAlphaCorr 1; + nAlphaSubCycles 2; + cAlpha 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/setFieldsDict b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/setFieldsDict new file mode 100644 index 00000000000..fbf256400fe --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/waveMakerPiston/system/setFieldsDict @@ -0,0 +1,33 @@ +/*--------------------------------*- 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 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 ); + } +); + + +// ************************************************************************* // -- GitLab