diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files
index 9a1b74d2c5..aa7cecc9d8 100644
--- a/src/finiteVolume/Make/files
+++ b/src/finiteVolume/Make/files
@@ -217,6 +217,7 @@ $(derivedFvPatchFields)/interfaceCompression/interfaceCompressionFvPatchScalarFi
$(derivedFvPatchFields)/pressure/pressureFvPatchScalarField.C
$(derivedFvPatchFields)/PrghPressure/prghPressureFvPatchScalarFields.C
$(derivedFvPatchFields)/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.C
+$(derivedFvPatchFields)/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.C
fvsPatchFields = fields/fvsPatchFields
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchField.C
new file mode 100644
index 0000000000..46fe9bce0d
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchField.C
@@ -0,0 +1,128 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2021 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "fixedValueInletOutletFvPatchField.H"
+#include "volFields.H"
+#include "surfaceFields.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::fixedValueInletOutletFvPatchField::fixedValueInletOutletFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF),
+ phiName_("phi")
+{}
+
+
+template
+Foam::fixedValueInletOutletFvPatchField::fixedValueInletOutletFvPatchField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict,
+ const bool valueRequired
+)
+:
+ fixedValueFvPatchField(p, iF, dict, valueRequired),
+ phiName_(dict.lookupOrDefault("phi", "phi"))
+{}
+
+
+template
+Foam::fixedValueInletOutletFvPatchField::fixedValueInletOutletFvPatchField
+(
+ const fixedValueInletOutletFvPatchField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper,
+ const bool mappingRequired
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper, mappingRequired),
+ phiName_(ptf.phiName_)
+{}
+
+
+template
+Foam::fixedValueInletOutletFvPatchField::fixedValueInletOutletFvPatchField
+(
+ const fixedValueInletOutletFvPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(ptf, iF),
+ phiName_(ptf.phiName_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+Foam::tmp>
+Foam::fixedValueInletOutletFvPatchField::valueInternalCoeffs
+(
+ const tmp&
+) const
+{
+ // Behave as a fixed value patch where there is inflow, and fixed gradient
+ // patch where there is outflow
+ const scalarField& phi =
+ this->patch().template
+ lookupPatchField(phiName_);
+ return (1 - pos0(phi))*Zero + pos0(phi)*pTraits::one;
+}
+
+
+template
+Foam::tmp>
+Foam::fixedValueInletOutletFvPatchField::valueBoundaryCoeffs
+(
+ const tmp&
+) const
+{
+ // Behave as a fixed value patch where there is inflow, and fixed gradient
+ // patch where there is outflow
+ const scalarField& phi =
+ this->patch().template
+ lookupPatchField(phiName_);
+ const Field pif(this->patchInternalField());
+ return (1 - pos0(phi))**this + pos0(phi)*(*this - pif);
+}
+
+
+template
+void Foam::fixedValueInletOutletFvPatchField::write(Ostream& os) const
+{
+ fixedValueFvPatchField::write(os);
+ writeEntryIfDifferent(os, "phi", "phi", phiName_);
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchField.H
new file mode 100644
index 0000000000..fd1892bcd2
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchField.H
@@ -0,0 +1,184 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2021 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 .
+
+Class
+ Foam::fixedValueInletOutletFvPatchField
+
+Description
+ This boundary condition sets a fixed value. When the flow direction is
+ inwards this acts exactly like a fixed value condition. In the presence of
+ outflow, however, this condition approximates the fixed value constraint in
+ advective terms by fixing the gradient instead.
+
+ This condition is not likely to be used on its own. It is more suitable as
+ a base class for conditions that need to specify the value of a field even
+ when the flow reverses.
+
+Usage
+ \table
+ Property | Description | Required | Default value
+ phi | Name of the flux field | no | phi
+ \endtable
+
+ Example of the boundary condition specification:
+ \verbatim
+
+ {
+ type fixedValueInletOutlet;
+ phi phi;
+ value 0;
+ }
+ \endverbatim
+
+See also
+ Foam::fixedValueFvPatchField
+
+SourceFiles
+ fixedValueInletOutletFvPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValueInletOutletFvPatchField_H
+#define fixedValueInletOutletFvPatchField_H
+
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class fixedValueInletOutletFvPatchField Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class fixedValueInletOutletFvPatchField
+:
+ public fixedValueFvPatchField
+{
+ // Private Data
+
+ //- Name of the flux field
+ const word phiName_;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("fixedValueInletOutlet");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ fixedValueInletOutletFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ fixedValueInletOutletFvPatchField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&,
+ const bool valueRequired=true
+ );
+
+ //- Construct by mapping given fixedValueInletOutletFvPatchField
+ // onto a new patch
+ fixedValueInletOutletFvPatchField
+ (
+ const fixedValueInletOutletFvPatchField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&,
+ const bool mappingRequired=true
+ );
+
+ //- Disallow copy without setting internal field reference
+ fixedValueInletOutletFvPatchField
+ (
+ const fixedValueInletOutletFvPatchField&
+ ) = delete;
+
+ //- Copy constructor setting internal field reference
+ fixedValueInletOutletFvPatchField
+ (
+ const fixedValueInletOutletFvPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp> clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp>
+ (
+ new fixedValueInletOutletFvPatchField(*this, iF)
+ );
+ }
+
+
+ // Member Functions
+
+ // Evaluation functions
+
+ //- Return the matrix diagonal coefficients corresponding to the
+ // evaluation of the value of this patchField with given weights
+ virtual tmp> valueInternalCoeffs
+ (
+ const tmp&
+ ) const;
+
+ //- Return the matrix source coefficients corresponding to the
+ // evaluation of the value of this patchField with given weights
+ virtual tmp> valueBoundaryCoeffs
+ (
+ const tmp&
+ ) const;
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+ #include "fixedValueInletOutletFvPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.C
new file mode 100644
index 0000000000..d0501d72eb
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.C
@@ -0,0 +1,43 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2021 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "fixedValueInletOutletFvPatchFields.H"
+#include "volMesh.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+makePatchFields(fixedValueInletOutlet);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.H
new file mode 100644
index 0000000000..3eb3ce6037
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFields.H
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2021 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValueInletOutletFvPatchFields_H
+#define fixedValueInletOutletFvPatchFields_H
+
+#include "fixedValueInletOutletFvPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeFieldTypedefs(fixedValueInletOutlet);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFieldsFwd.H
new file mode 100644
index 0000000000..4397c33b90
--- /dev/null
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedValueInletOutlet/fixedValueInletOutletFvPatchFieldsFwd.H
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Copyright (C) 2021 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fixedValueInletOutletFvPatchFieldsFwd_H
+#define fixedValueInletOutletFvPatchFieldsFwd_H
+
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class fixedValueInletOutletFvPatchField;
+
+makePatchTypeFieldTypedefs(fixedValueInletOutlet);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/waves/Make/files b/src/waves/Make/files
index 6ade756a0f..7905f16b5e 100644
--- a/src/waves/Make/files
+++ b/src/waves/Make/files
@@ -11,7 +11,6 @@ waveSuperpositions/waveAtmBoundaryLayerSuperposition/waveAtmBoundaryLayerSuperpo
derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C
derivedFvPatchFields/waveInletOutlet/waveInletOutletFvPatchFields.C
-derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.C
derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libwaves
diff --git a/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C b/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C
index 16f85848e3..ed7a6f64e0 100644
--- a/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C
+++ b/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -24,11 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "waveAlphaFvPatchScalarField.H"
-#include "wavePressureFvPatchScalarField.H"
-#include "waveVelocityFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
#include "levelSet.H"
-#include "surfaceFields.H"
#include "volFields.H"
#include "fvMeshSubset.H"
@@ -40,15 +37,9 @@ Foam::waveAlphaFvPatchScalarField::waveAlphaFvPatchScalarField
const DimensionedField& iF
)
:
- mixedFvPatchScalarField(p, iF),
- UName_("U"),
- liquid_(true),
- inletOutlet_(true)
-{
- refValue() = Zero;
- refGrad() = Zero;
- valueFraction() = 0;
-}
+ fixedValueInletOutletFvPatchField(p, iF),
+ liquid_(true)
+{}
Foam::waveAlphaFvPatchScalarField::waveAlphaFvPatchScalarField
@@ -58,23 +49,23 @@ Foam::waveAlphaFvPatchScalarField::waveAlphaFvPatchScalarField
const dictionary& dict
)
:
- mixedFvPatchScalarField(p, iF),
- UName_(dict.lookupOrDefault("U", "U")),
- liquid_(dict.lookupOrDefault("liquid", true)),
- inletOutlet_(dict.lookupOrDefault("inletOutlet", true))
+ fixedValueInletOutletFvPatchField(p, iF, dict, false),
+ liquid_(dict.lookupOrDefault("liquid", true))
{
if (dict.found("value"))
{
- fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
+ fixedValueInletOutletFvPatchField::operator==
+ (
+ scalarField("value", dict, p.size())
+ );
}
else
{
- fvPatchScalarField::operator=(patchInternalField());
+ fixedValueInletOutletFvPatchField::operator==
+ (
+ patchInternalField()
+ );
}
-
- refValue() = *this;
- refGrad() = Zero;
- valueFraction() = 0;
}
@@ -86,10 +77,8 @@ Foam::waveAlphaFvPatchScalarField::waveAlphaFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
- mixedFvPatchScalarField(ptf, p, iF, mapper),
- UName_(ptf.UName_),
- liquid_(ptf.liquid_),
- inletOutlet_(ptf.inletOutlet_)
+ fixedValueInletOutletFvPatchField(ptf, p, iF, mapper),
+ liquid_(ptf.liquid_)
{}
@@ -99,18 +88,42 @@ Foam::waveAlphaFvPatchScalarField::waveAlphaFvPatchScalarField
const DimensionedField& iF
)
:
- mixedFvPatchScalarField(ptf, iF),
- UName_(ptf.UName_),
- liquid_(ptf.liquid_),
- inletOutlet_(ptf.inletOutlet_)
+ fixedValueInletOutletFvPatchField(ptf, iF),
+ liquid_(ptf.liquid_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-Foam::tmp Foam::waveAlphaFvPatchScalarField::alpha() const
+const Foam::fvMeshSubset&
+Foam::waveAlphaFvPatchScalarField::faceCellSubset() const
+{
+ const fvMesh& mesh = patch().boundaryMesh().mesh();
+ const label timeIndex = mesh.time().timeIndex();
+
+ if
+ (
+ !faceCellSubset_.valid()
+ || (mesh.changing() && faceCellSubsetTimeIndex_ != timeIndex)
+ )
+ {
+ faceCellSubset_.reset(new fvMeshSubset(mesh));
+ faceCellSubset_->setCellSubset(patch().faceCells());
+ faceCellSubsetTimeIndex_ = timeIndex;
+
+ // Ask for the tetBasePtIs to trigger all processors to build them.
+ // Without this, processors that do not contain this patch will
+ // generate a comms mismatch.
+ faceCellSubset_->subMesh().tetBasePtIs();
+ }
+
+ return faceCellSubset_();
+}
+
+
+Foam::tmp
+Foam::waveAlphaFvPatchScalarField::alpha(const scalar t) const
{
- const scalar t = db().time().timeOutputValue();
const waveSuperposition& waves = waveSuperposition::New(db());
return
@@ -124,17 +137,12 @@ Foam::tmp Foam::waveAlphaFvPatchScalarField::alpha() const
}
-Foam::tmp Foam::waveAlphaFvPatchScalarField::alphan() const
+Foam::tmp
+Foam::waveAlphaFvPatchScalarField::alphan(const scalar t) const
{
- const scalar t = db().time().timeOutputValue();
const waveSuperposition& waves = waveSuperposition::New(db());
- const waveVelocityFvPatchVectorField& Up =
- refCast
- (
- patch().lookupPatchField(UName_)
- );
- const fvMeshSubset& subset = Up.faceCellSubset();
+ const fvMeshSubset& subset = faceCellSubset();
const fvMesh& meshs = subset.subMesh();
const label patchis = findIndex(subset.patchMap(), patch().index());
@@ -175,52 +183,11 @@ void Foam::waveAlphaFvPatchScalarField::updateCoeffs()
return;
}
- const fvPatchVectorField& Up =
- patch().lookupPatchField(UName_);
+ const scalar t = db().time().timeOutputValue();
- if (!isA(Up))
- {
- FatalErrorInFunction
- << "The corresponding condition for the velocity "
- << "field " << UName_ << " on patch " << patch().name()
- << " is not of type " << waveVelocityFvPatchVectorField::typeName
- << exit(FatalError);
- }
+ operator==(alpha(t));
- const waveVelocityFvPatchVectorField& Uwp =
- refCast(Up);
-
- const fvPatchScalarField& pp =
- patch().lookupPatchField(Uwp.pName());
-
- if (isA(pp))
- {
- const scalarField alpha(this->alpha()), alphan(this->alphan());
- const scalarField out(pos0(Uwp.U() & patch().Sf()));
-
- valueFraction() = out;
- refValue() = alpha;
- refGrad() = (alpha - alphan)*patch().deltaCoeffs();
- }
- else
- {
- refValue() = alpha();
-
- if (inletOutlet_)
- {
- const scalarField& phip =
- patch().lookupPatchField("phi");
- const scalarField out(pos0(phip));
-
- valueFraction() = 1 - out;
- }
- else
- {
- valueFraction() = 1;
- }
- }
-
- mixedFvPatchScalarField::updateCoeffs();
+ fixedValueInletOutletFvPatchField::updateCoeffs();
}
@@ -229,9 +196,7 @@ void Foam::waveAlphaFvPatchScalarField::write
Ostream& os
) const
{
- mixedFvPatchScalarField::write(os);
- writeEntryIfDifferent(os, "U", "U", UName_);
- writeEntryIfDifferent(os, "inletOutlet", true, inletOutlet_);
+ fixedValueInletOutletFvPatchField::write(os);
writeEntryIfDifferent(os, "liquid", true, liquid_);
}
@@ -240,7 +205,11 @@ void Foam::waveAlphaFvPatchScalarField::write
namespace Foam
{
- makePatchTypeField(fvPatchScalarField, waveAlphaFvPatchScalarField);
+ makePatchTypeField
+ (
+ fvPatchScalarField,
+ waveAlphaFvPatchScalarField
+ );
}
// ************************************************************************* //
diff --git a/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H b/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H
index 51d4e5aa19..78c4136f0e 100644
--- a/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H
+++ b/src/waves/derivedFvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.H
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -30,27 +30,11 @@ Description
wave modelling parameters are obtained from a centrally registered
waveSuperposition class.
- Flow reversal will occur in the event that the amplitude of the velocity
- oscillation is greater than the mean flow. This triggers special handling,
- the form of which depends on the inletOutlet flag and whether a wave
- pressure condition is being used.
-
- If a wave pressure condition is not being used, the inletOutlet switches
- between a fixedValue and an inletOutlet condition, with the value given by
- the wave model. If fixedValue, the result may be more accurate, but it
- might also be unstable.
-
- If a wave pressure condition is being used, then the normal phase fraction
- condition becomes fixedGradient on outlet faces. This gradient is
- calculated numerically by evaluating the wave model on both the patch face
- and the adjacent cell.
-
Usage
\table
- Property | Description | Req'd? | Default
- U | name of the velocity field | no | U
- liquid | is the alpha field that of the liquid | no | true
- inletOutlet | does the condition behave like inletOutlet | no | true
+ Property | Description | Req'd? | Default
+ phi | Name of the flux field | no | phi
+ liquid | Is the alpha field that of the liquid? | no | true
\endtable
Example of the boundary condition specification:
@@ -58,9 +42,8 @@ Usage
{
type waveAlpha;
- U U;
+ phi phi;
liquid true;
- inletOutlet true;
}
\endverbatim
@@ -75,31 +58,34 @@ SourceFiles
#ifndef waveAlphaFvPatchScalarField_H
#define waveAlphaFvPatchScalarField_H
-#include "mixedFvPatchFields.H"
+#include "fixedValueInletOutletFvPatchFields.H"
+#include "waveSuperposition.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
+class fvMeshSubset;
+
/*---------------------------------------------------------------------------*\
Class waveAlphaFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class waveAlphaFvPatchScalarField
:
- public mixedFvPatchScalarField
+ public fixedValueInletOutletFvPatchField
{
// Private Data
- //- Name of the velocity field
- const word UName_;
-
//- Is this alpha field that of the liquid under the wave?
const Switch liquid_;
- //- Act as an inlet/outlet patch?
- const Switch inletOutlet_;
+ //- Mesh subset corresponding to the patch adjacent cells
+ mutable autoPtr faceCellSubset_;
+
+ //- Time index for keeping the subset up to date
+ mutable label faceCellSubsetTimeIndex_;
public:
@@ -125,7 +111,8 @@ public:
const dictionary&
);
- //- Construct by mapping given mixedTypeFvPatchField onto a new patch
+ //- Construct by mapping given fixedValueTypeFvPatchField onto a new
+ // patch
waveAlphaFvPatchScalarField
(
const waveAlphaFvPatchScalarField&,
@@ -170,15 +157,19 @@ public:
return liquid_;
}
+ //- Access the face-cell subset
+ const fvMeshSubset& faceCellSubset() const;
+
// Evaluation functions
- //- Return the current modelled phase fraction field
- tmp alpha() const;
+ //- Return the current modelled phase fraction field on the patch
+ // faces at the given time
+ tmp alpha(const scalar t) const;
//- Return the current modelled phase fraction field in the
- // neighbour cell
- tmp alphan() const;
+ // neighbour cells at the given time
+ tmp alphan(const scalar t) const;
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
diff --git a/src/waves/derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.C b/src/waves/derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.C
deleted file mode 100644
index d1a439d79b..0000000000
--- a/src/waves/derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.C
+++ /dev/null
@@ -1,236 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2017-2020 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 .
-
-\*---------------------------------------------------------------------------*/
-
-#include "wavePressureFvPatchScalarField.H"
-#include "waveVelocityFvPatchVectorField.H"
-#include "addToRunTimeSelectionTable.H"
-#include "levelSet.H"
-#include "volFields.H"
-#include "fvMeshSubset.H"
-
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-
-Foam::wavePressureFvPatchScalarField::wavePressureFvPatchScalarField
-(
- const fvPatch& p,
- const DimensionedField& iF
-)
-:
- mixedFvPatchScalarField(p, iF),
- UName_("U"),
- rhoName_("rho")
-{
- refValue() = Zero;
- refGrad() = Zero;
- valueFraction() = Zero;
-}
-
-
-Foam::wavePressureFvPatchScalarField::wavePressureFvPatchScalarField
-(
- const fvPatch& p,
- const DimensionedField& iF,
- const dictionary& dict
-)
-:
- mixedFvPatchScalarField(p, iF),
- UName_(dict.lookupOrDefault("U", "U")),
- rhoName_(dict.lookupOrDefault("rho", "rho"))
-{
- if (dict.found("value"))
- {
- fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
- }
- else
- {
- fvPatchScalarField::operator=(patchInternalField());
- }
-
- refValue() = *this;
- refGrad() = Zero;
- valueFraction() = Zero;
-}
-
-
-Foam::wavePressureFvPatchScalarField::wavePressureFvPatchScalarField
-(
- const wavePressureFvPatchScalarField& ptf,
- const fvPatch& p,
- const DimensionedField& iF,
- const fvPatchFieldMapper& mapper
-)
-:
- mixedFvPatchScalarField(ptf, p, iF, mapper),
- UName_(ptf.UName_),
- rhoName_(ptf.rhoName_)
-{}
-
-
-Foam::wavePressureFvPatchScalarField::wavePressureFvPatchScalarField
-(
- const wavePressureFvPatchScalarField& ptf,
- const DimensionedField& iF
-)
-:
- mixedFvPatchScalarField(ptf, iF),
- UName_(ptf.UName_),
- rhoName_(ptf.rhoName_)
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-Foam::tmp Foam::wavePressureFvPatchScalarField::p() const
-{
- const scalar t = db().time().timeOutputValue();
- const waveSuperposition& waves = waveSuperposition::New(db());
-
- return
- levelSetAverage
- (
- patch(),
- waves.height(t, patch().Cf()),
- waves.height(t, patch().patch().localPoints()),
- waves.pGas(t, patch().Cf())(),
- waves.pGas(t, patch().patch().localPoints())(),
- waves.pLiquid(t, patch().Cf())(),
- waves.pLiquid(t, patch().patch().localPoints())()
- );
-}
-
-
-Foam::tmp Foam::wavePressureFvPatchScalarField::pn() const
-{
- const scalar t = db().time().timeOutputValue();
- const waveSuperposition& waves = waveSuperposition::New(db());
- const waveVelocityFvPatchVectorField& Up =
- refCast
- (
- patch().lookupPatchField(UName_)
- );
-
- const fvMeshSubset& subset = Up.faceCellSubset();
- const fvMesh& meshs = subset.subMesh();
- const label patchis = findIndex(subset.patchMap(), patch().index());
-
- const scalarField ps
- (
- levelSetAverage
- (
- meshs,
- waves.height(t, meshs.cellCentres())(),
- waves.height(t, meshs.points())(),
- waves.pGas(t, meshs.cellCentres())(),
- waves.pGas(t, meshs.points())(),
- waves.pLiquid(t, meshs.cellCentres())(),
- waves.pLiquid(t, meshs.points())()
- )
- );
-
- tmp tResult(new scalarField(patch().size()));
- scalarField& result = tResult.ref();
-
- if (patchis != -1)
- {
- forAll(meshs.boundary()[patchis], is)
- {
- const label fs = is + meshs.boundary()[patchis].patch().start();
- const label cs = meshs.boundary()[patchis].faceCells()[is];
- const label f = subset.faceMap()[fs];
- const label i = patch().patch().whichFace(f);
- result[i] = ps[cs];
- }
- }
-
- return tResult;
-}
-
-
-void Foam::wavePressureFvPatchScalarField::updateCoeffs()
-{
- if (updated())
- {
- return;
- }
-
- const fvPatchVectorField& Up =
- patch().lookupPatchField(UName_);
-
- if (!isA(Up))
- {
- FatalErrorInFunction
- << "The corresponding condition for the velocity "
- << "field " << UName_ << " on patch " << patch().name()
- << " is not of type " << waveVelocityFvPatchVectorField::typeName
- << exit(FatalError);
- }
-
- const waveVelocityFvPatchVectorField& Uwp =
- refCast(Up);
-
- if (Uwp.pName() != internalField().name())
- {
- FatalErrorInFunction
- << "The corresponding condition for the velocity "
- << "field " << UName_ << " on patch " << patch().name()
- << " does not have the pressure set to " << internalField().name()
- << exit(FatalError);
- }
-
- const scalarField p(this->p()), pn(this->pn());
- const scalarField out(pos0(Uwp.U() & patch().Sf()));
-
- valueFraction() = out;
- refValue() = p;
- refGrad() = (p - pn)*patch().deltaCoeffs();
-
- if (internalField().dimensions() == dimPressure)
- {
- const fvPatchField& rhop =
- patch().lookupPatchField(rhoName_);
- refValue() *= rhop;
- refGrad() *= rhop;
- }
-
- mixedFvPatchScalarField::updateCoeffs();
-}
-
-
-void Foam::wavePressureFvPatchScalarField::write(Ostream& os) const
-{
- mixedFvPatchScalarField::write(os);
- writeEntryIfDifferent(os, "U", "U", UName_);
- writeEntryIfDifferent(os, "rho", "rho", rhoName_);
-}
-
-
-// * * * * * * * * * * * * * * Build Macro Function * * * * * * * * * * * * //
-
-namespace Foam
-{
- makePatchTypeField(fvPatchScalarField, wavePressureFvPatchScalarField);
-}
-
-// ************************************************************************* //
diff --git a/src/waves/derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.H b/src/waves/derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.H
deleted file mode 100644
index 5417145058..0000000000
--- a/src/waves/derivedFvPatchFields/wavePressure/wavePressureFvPatchScalarField.H
+++ /dev/null
@@ -1,185 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2017-2020 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 .
-
-Class
- Foam::wavePressureFvPatchScalarField
-
-Description
- This boundary condition provides a wavePressure condition. This sets the
- pressure to a value specified by a superposition of wave models. All the
- wave modelling parameters are obtained from a centrally registered
- waveSuperposition class.
-
- This functions like an outletInlet condition. Faces on which the flow is
- leaving the domain have a value set by the wave model. Faces on which the
- flow is entering the domain have the gradient set. This gradient is
- calculated numerically by evaluating the wave model on both the patch face
- and the adjacent cell.
-
- Use of this boundary condition triggers a consistent behaviour in the
- corresponding velocity and phase-fraction conditions.
-
-Usage
- \table
- Property | Description | Req'd? | Default
- U | name of the velocity field | no | U
- rho | name of the density field | no | rho
- \endtable
-
- Example of the boundary condition specification:
- \verbatim
-
- {
- type wavePressure;
- U U;
- rho rho;
- }
- \endverbatim
-
-See also
- Foam::waveSuperposition
-
-SourceFiles
- wavePressureFvPatchScalarField.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef wavePressureFvPatchScalarField_H
-#define wavePressureFvPatchScalarField_H
-
-#include "mixedFvPatchFields.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-/*---------------------------------------------------------------------------*\
- Class wavePressureFvPatchScalarField Declaration
-\*---------------------------------------------------------------------------*/
-
-class wavePressureFvPatchScalarField
-:
- public mixedFvPatchScalarField
-{
- // Private Data
-
- //- Name of the velocity field
- const word UName_;
-
- //- Name of the density field
- const word rhoName_;
-
-
-public:
-
- //- Runtime type information
- TypeName("wavePressure");
-
-
- // Constructors
-
- //- Construct from patch and internal field
- wavePressureFvPatchScalarField
- (
- const fvPatch&,
- const DimensionedField&
- );
-
- //- Construct from patch, internal field and dictionary
- wavePressureFvPatchScalarField
- (
- const fvPatch&,
- const DimensionedField&,
- const dictionary&
- );
-
- //- Construct by mapping given mixedTypeFvPatchField
- // onto a new patch
- wavePressureFvPatchScalarField
- (
- const wavePressureFvPatchScalarField&,
- const fvPatch&,
- const DimensionedField&,
- const fvPatchFieldMapper&
- );
-
- //- Disallow copy without setting internal field reference
- wavePressureFvPatchScalarField
- (
- const wavePressureFvPatchScalarField&
- ) = delete;
-
- //- Copy constructor setting internal field reference
- wavePressureFvPatchScalarField
- (
- const wavePressureFvPatchScalarField&,
- const DimensionedField&
- );
-
- //- Construct and return a clone setting internal field reference
- virtual tmp clone
- (
- const DimensionedField& iF
- ) const
- {
- return tmp
- (
- new wavePressureFvPatchScalarField
- (
- *this,
- iF
- )
- );
- }
-
-
- // Member Functions
-
- // Evaluation functions
-
- //- Return the current modelled pressure field on the patch faces
- tmp p() const;
-
- //- Return the current modelled pressure field in the neighbour cell
- tmp pn() const;
-
- //- 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/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.C b/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.C
index 2bcc4f55c8..d3161ae947 100644
--- a/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.C
+++ b/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "waveVelocityFvPatchVectorField.H"
-#include "wavePressureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "levelSet.H"
#include "volFields.H"
@@ -38,17 +37,8 @@ Foam::waveVelocityFvPatchVectorField::waveVelocityFvPatchVectorField
const DimensionedField& iF
)
:
- directionMixedFvPatchVectorField(p, iF),
- phiName_("phi"),
- pName_("p"),
- inletOutlet_(true),
- faceCellSubset_(nullptr),
- faceCellSubsetTimeIndex_(-1)
-{
- refValue() = Zero;
- refGrad() = Zero;
- valueFraction() = Zero;
-}
+ fixedValueInletOutletFvPatchField(p, iF)
+{}
Foam::waveVelocityFvPatchVectorField::waveVelocityFvPatchVectorField
@@ -58,25 +48,22 @@ Foam::waveVelocityFvPatchVectorField::waveVelocityFvPatchVectorField
const dictionary& dict
)
:
- directionMixedFvPatchVectorField(p, iF),
- phiName_(dict.lookupOrDefault("phi", "phi")),
- pName_(dict.lookupOrDefault("p", "p")),
- inletOutlet_(dict.lookupOrDefault("inletOutlet", true)),
- faceCellSubset_(nullptr),
- faceCellSubsetTimeIndex_(-1)
+ fixedValueInletOutletFvPatchField(p, iF, dict, false)
{
if (dict.found("value"))
{
- fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
+ fixedValueInletOutletFvPatchField::operator==
+ (
+ vectorField("value", dict, p.size())
+ );
}
else
{
- fvPatchVectorField::operator=(patchInternalField());
+ fixedValueInletOutletFvPatchField::operator==
+ (
+ patchInternalField()
+ );
}
-
- refValue() = *this;
- refGrad() = Zero;
- valueFraction() = Zero;
}
@@ -88,12 +75,7 @@ Foam::waveVelocityFvPatchVectorField::waveVelocityFvPatchVectorField
const fvPatchFieldMapper& mapper
)
:
- directionMixedFvPatchVectorField(ptf, p, iF, mapper),
- phiName_(ptf.phiName_),
- pName_(ptf.pName_),
- inletOutlet_(ptf.inletOutlet_),
- faceCellSubset_(nullptr),
- faceCellSubsetTimeIndex_(-1)
+ fixedValueInletOutletFvPatchField(ptf, p, iF, mapper)
{}
@@ -103,12 +85,7 @@ Foam::waveVelocityFvPatchVectorField::waveVelocityFvPatchVectorField
const DimensionedField& iF
)
:
- directionMixedFvPatchVectorField(ptf, iF),
- phiName_(ptf.phiName_),
- pName_(ptf.pName_),
- inletOutlet_(ptf.inletOutlet_),
- faceCellSubset_(nullptr),
- faceCellSubsetTimeIndex_(-1)
+ fixedValueInletOutletFvPatchField(ptf, iF)
{}
@@ -140,9 +117,9 @@ Foam::waveVelocityFvPatchVectorField::faceCellSubset() const
}
-Foam::tmp Foam::waveVelocityFvPatchVectorField::U() const
+Foam::tmp
+Foam::waveVelocityFvPatchVectorField::U(const scalar t) const
{
- const scalar t = db().time().timeOutputValue();
const waveSuperposition& waves = waveSuperposition::New(db());
return
@@ -159,9 +136,9 @@ Foam::tmp Foam::waveVelocityFvPatchVectorField::U() const
}
-Foam::tmp Foam::waveVelocityFvPatchVectorField::Un() const
+Foam::tmp
+Foam::waveVelocityFvPatchVectorField::Un(const scalar t) const
{
- const scalar t = db().time().timeOutputValue();
const waveSuperposition& waves = waveSuperposition::New(db());
const fvMeshSubset& subset = faceCellSubset();
@@ -208,74 +185,11 @@ void Foam::waveVelocityFvPatchVectorField::updateCoeffs()
return;
}
- const fvPatchScalarField& pp =
- patch().lookupPatchField(pName_);
+ const scalar t = db().time().timeOutputValue();
- if (isA(pp))
- {
- const vectorField U(this->U()), Un(this->Un());
- const scalarField out(pos0(U & patch().Sf()));
+ operator==(U(t));
- // Where inflow, set all velocity components to values specified by the
- // wave model. Where outflow, set the tangential values and the normal
- // gradient.
- valueFraction() = symmTensor::I - out*sqr(patch().nf());
- refValue() = U;
- refGrad() = (U - Un)*patch().deltaCoeffs();
- }
- else
- {
- const vectorField U(this->U());
-
- if (inletOutlet_)
- {
- const scalarField& phip =
- patch().lookupPatchField(phiName_);
- const scalarField out(pos0(phip));
-
- // Where inflow, fix all velocity components to values specified by
- // the wave model.
- refValue() = (1 - out)*U;
- valueFraction() = (1 - out)*symmTensor::I;
-
- // Where outflow, set the normal component of the velocity to a
- // value consistent with phi, but scale it to get the volumetric
- // flow rate specified by the wave model. Tangential components are
- // extrapolated.
- const scalar QPhip = gSum(out*phip);
- const scalar QWave = gSum(out*(U & patch().Sf()));
- const vectorField nBySf(patch().Sf()/sqr(patch().magSf()));
- if (QPhip > vSmall)
- {
- refValue() += out*(QWave/QPhip)*phip*nBySf;
- }
- else
- {
- refValue() += out*QWave*nBySf;
- }
- valueFraction() += out*sqr(patch().nf());
- }
- else
- {
- refValue() = U;
- valueFraction() = symmTensor::I;
- }
- }
-
- directionMixedFvPatchVectorField::updateCoeffs();
- directionMixedFvPatchVectorField::evaluate();
-}
-
-
-void Foam::waveVelocityFvPatchVectorField::write
-(
- Ostream& os
-) const
-{
- directionMixedFvPatchVectorField::write(os);
- writeEntryIfDifferent(os, "phi", "phi", phiName_);
- writeEntryIfDifferent(os, "p", "p", pName_);
- writeEntryIfDifferent(os, "inletOutlet", true, inletOutlet_);
+ fixedValueInletOutletFvPatchField::updateCoeffs();
}
diff --git a/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H b/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H
index d85499b72e..93adee045d 100644
--- a/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H
+++ b/src/waves/derivedFvPatchFields/waveVelocity/waveVelocityFvPatchVectorField.H
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
- \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -30,39 +30,10 @@ Description
wave modelling parameters are obtained from a centrally registered
waveSuperposition class.
- Flow reversal will occur in the event that the amplitude of the velocity
- oscillation is greater than the mean flow. This triggers special handling,
- the form of which depends on the inletOutlet flag and whether a wave
- pressure condition is being used.
-
- If a wave pressure condition is not being used, and inletOutlet is false,
- then this is a standard fixed value condition, with the value supplied by
- the wave model. If flow reversal occurs this state may be unstable. The
- corresponding pressure condition should be fixedFluxPressure.
-
- If a wave pressure condition is not being used, and inletOutlet is true or
- not specified then the proportion of the patch over which the flow is
- reversed functions in a manner similar to the flowRateOutletVelocity
- condition; i.e., the velocity is extrapolated and then scaled to match the
- required outlet flow rate. Numerically, this is still a fixedValue
- constraint on the normal velocity, just one which tends to avoid
- instability. Again, the corresponding pressure condition should be
- fixedFluxPressure.
-
- If a wave pressure condition is being used, then the normal velocity
- condition becomes fixedGradient on outlet faces. This gradient is
- calculated numerically by evaluating the wave model on both the patch face
- and the adjacent cell. The pressure boundary in this case should be a
- wavePressure condition. This will do the opposite; it will fix the pressure
- value on outlet faces, and the gradient otherwise.
-
Usage
\table
- Property | Description | Req'd? | Default
- phi | Name of the flux field | no | phi
- p | Name of the pressure field | no | p
- inletOutlet | does the condition behave like inletOutlet | no | true
- ramp | ramping function for the mean flow speed | no | None
+ Property | Description | Req'd? | Default
+ phi | Name of the flux field | no | phi
\endtable
Example of the boundary condition specification:
@@ -71,9 +42,6 @@ Usage
{
type waveVelocity;
phi phi;
- p p;
- inletOutlet yes;
- ramp constant 1;
}
\endverbatim
@@ -88,7 +56,7 @@ SourceFiles
#ifndef waveVelocityFvPatchVectorField_H
#define waveVelocityFvPatchVectorField_H
-#include "directionMixedFvPatchFields.H"
+#include "fixedValueInletOutletFvPatchFields.H"
#include "waveSuperposition.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -104,19 +72,10 @@ class fvMeshSubset;
class waveVelocityFvPatchVectorField
:
- public directionMixedFvPatchVectorField
+ public fixedValueInletOutletFvPatchField
{
// Private Data
- //- Name of the flux field
- const word phiName_;
-
- //- Name of the pressure field
- const word pName_;
-
- //- Act as an inlet/outlet patch?
- const Switch inletOutlet_;
-
//- Mesh subset corresponding to the patch adjacent cells
mutable autoPtr faceCellSubset_;
@@ -186,12 +145,6 @@ public:
// Access
- //- Access the name of the pressure field
- const word& pName() const
- {
- return pName_;
- }
-
//- Access the face-cell subset
const fvMeshSubset& faceCellSubset() const;
@@ -199,17 +152,15 @@ public:
// Evaluation functions
//- Return the current modelled velocity field on the patch faces
- tmp U() const;
+ // at the given time
+ tmp U(const scalar t) const;
- //- Return the current modelled velocity field in the neighbour cell
- tmp Un() const;
+ //- Return the current modelled velocity field in the neighbour
+ // cells at the given time
+ tmp Un(const scalar t) const;
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
-
-
- //- Write
- virtual void write(Ostream&) const;
};
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/U.orig b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/U.orig
new file mode 100644
index 0000000000..e15549a19b
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/U.orig
@@ -0,0 +1,43 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volVectorField;
+ location "0";
+ object U;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 1 -1 0 0 0 0];
+
+internalField uniform (0 0 0);
+
+boundaryField
+{
+ bottom
+ {
+ type noSlip;
+ }
+ "(top|inlet)"
+ {
+ type waveVelocity;
+ }
+ outlet
+ {
+ type pressureInletOutletVelocity;
+ value $internalField;
+ }
+ "(front|back)"
+ {
+ type symmetryPlane;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/alpha.orig b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/alpha.orig
new file mode 100644
index 0000000000..bf5d162e1e
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/alpha.orig
@@ -0,0 +1,38 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volScalarField;
+ location "0";
+ object alpha;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 0 0 0 0 0 0];
+
+internalField uniform 1;
+
+boundaryField
+{
+ bottom
+ {
+ type zeroGradient;
+ }
+ "(top|inlet|outlet)"
+ {
+ type waveAlpha;
+ }
+ "(front|back)"
+ {
+ type symmetryPlane;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/epsilon b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/epsilon
new file mode 100644
index 0000000000..10e3111c25
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/epsilon
@@ -0,0 +1,41 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format binary;
+ class volScalarField;
+ location "0";
+ object epsilon;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 2 -3 0 0 0 0];
+
+internalField uniform 1.4e-6;
+
+boundaryField
+{
+ bottom
+ {
+ type epsilonWallFunction;
+ value $internalField;
+ }
+ "(top|inlet|outlet)"
+ {
+ type inletOutlet;
+ value $internalField;
+ inletValue $internalField;
+ }
+ "(front|back)"
+ {
+ type symmetryPlane;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/k b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/k
new file mode 100644
index 0000000000..562d56a1ee
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/k
@@ -0,0 +1,41 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format binary;
+ class volScalarField;
+ location "0";
+ object k;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 2 -2 0 0 0 0];
+
+internalField uniform 1.4e-4;
+
+boundaryField
+{
+ bottom
+ {
+ type kqRWallFunction;
+ value $internalField;
+ }
+ "(top|inlet|outlet)"
+ {
+ type inletOutlet;
+ value $internalField;
+ inletValue $internalField;
+ }
+ "(front|back)"
+ {
+ type symmetryPlane;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/nut b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/nut
new file mode 100644
index 0000000000..0215cd1772
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/nut
@@ -0,0 +1,40 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volScalarField;
+ location "0";
+ object nut;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 2 -1 0 0 0 0];
+
+internalField uniform 0;
+
+boundaryField
+{
+ bottom
+ {
+ type nutkWallFunction;
+ value uniform 0;
+ }
+ "(top|inlet|outlet)"
+ {
+ type calculated;
+ value $internalField;
+ }
+ "(front|back)"
+ {
+ type symmetryPlane;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/p b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/p
new file mode 100644
index 0000000000..fb1f71a0a5
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/0/p
@@ -0,0 +1,43 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volScalarField;
+ location "0";
+ object p;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 2 -2 0 0 0 0];
+
+internalField uniform 0;
+
+boundaryField
+{
+ bottom
+ {
+ type fixedFluxPressure;
+ }
+ "(top|inlet)"
+ {
+ type fixedFluxExtrapolatedPressure;
+ }
+ outlet
+ {
+ type entrainmentPressure;
+ p0 $internalField;
+ value $internalField;
+ }
+ "(front|back)"
+ {
+ type symmetryPlane;
+ }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/Allrun b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/Allrun
new file mode 100755
index 0000000000..c1148532b0
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/Allrun
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cd ${0%/*} || exit 1
+
+. $WM_PROJECT_DIR/bin/tools/RunFunctions
+
+runApplication blockMesh
+runApplication setWaves
+runApplication decomposePar
+
+runParallel $(getApplication)
+
+runApplication reconstructPar -newTimes
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/g b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/g
new file mode 100644
index 0000000000..a27ab85e41
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/g
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ 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/incompressible/pimpleFoam/RAS/waveSubSurface/constant/momentumTransport b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/momentumTransport
new file mode 100644
index 0000000000..5fb375d515
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/momentumTransport
@@ -0,0 +1,27 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object momentumTransport;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+simulationType RAS;
+
+RAS
+{
+ RASModel kEpsilon;
+ turbulence on;
+ printCoeffs on;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/physicalProperties b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/physicalProperties
new file mode 100644
index 0000000000..7e37e31919
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/physicalProperties
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object physicalProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+transportModel Newtonian;
+
+nu [0 2 -1 0 0 0 0] 1e-05;
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/waveProperties b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/waveProperties
new file mode 100644
index 0000000000..93131eab7d
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/constant/waveProperties
@@ -0,0 +1,38 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object waveProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+origin (0 0 2.7);
+
+direction (1 0 0);
+
+UMean (0 0 0);
+
+waves
+(
+ Stokes5
+ {
+ length 5.64;
+ amplitude 0.3;
+ phase 0.8;
+ angle 0;
+ depth 2.7;
+ }
+);
+
+scale table ((18 1) (24 0));
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/blockMeshDict
new file mode 100644
index 0000000000..2a76e28238
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/blockMeshDict
@@ -0,0 +1,96 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object blockMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+convertToMeters 1;
+
+vertices
+(
+ (0 -1.8 0) (0 1.8 0) (0 1.8 2) (0 -1.8 2)
+ (12 -1.8 0) (12 1.8 0) (12 1.8 2) (12 -1.8 2)
+ (24 -1.8 0) (24 1.8 0) (24 1.8 2) (24 -1.8 2)
+);
+
+blocks
+(
+ hex (0 1 2 3 4 5 6 7) (20 24 72) simpleGrading (1 4 1)
+ hex (4 5 6 7 8 9 10 11) (20 24 24) simpleGrading (1 4 6)
+);
+
+edges
+(
+);
+
+boundary
+(
+ top
+ {
+ type patch;
+ faces
+ (
+ (2 3 7 6)
+ (6 7 11 10)
+ );
+ }
+ inlet
+ {
+ type patch;
+ faces
+ (
+ (0 1 2 3)
+ );
+ }
+ outlet
+ {
+ type patch;
+ faces
+ (
+ (8 9 10 11)
+ );
+ }
+ bottom
+ {
+ type wall;
+ faces
+ (
+ (0 1 5 4)
+ (4 5 9 8)
+ );
+ }
+ front
+ {
+ type symmetryPlane;
+ faces
+ (
+ (0 4 7 3)
+ (4 8 11 7)
+ );
+ }
+ back
+ {
+ type symmetryPlane;
+ faces
+ (
+ (1 5 6 2)
+ (5 9 10 6)
+ );
+ }
+);
+
+mergePatchPairs
+(
+);
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/controlDict b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/controlDict
new file mode 100644
index 0000000000..36c8c301f9
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/controlDict
@@ -0,0 +1,88 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+application pimpleFoam;
+
+startFrom startTime;
+
+startTime 0;
+
+stopAt endTime;
+
+endTime 100;
+
+deltaT 0.01;
+
+writeControl adjustableRunTime;
+
+writeInterval 1;
+
+purgeWrite 0;
+
+writeFormat ascii;
+
+writePrecision 10;
+
+writeCompression off;
+
+timeFormat general;
+
+timePrecision 6;
+
+runTimeModifiable yes;
+
+adjustTimeStep no;
+
+maxCo 1;
+
+libs
+(
+ "libwaves.so"
+);
+
+functions
+{
+ readG
+ {
+ libs ("libutilityFunctionObjects.so");
+ type coded;
+ name readG;
+ enabled yes;
+ executeControl none;
+ codeRead
+ #{
+ if (!mesh().template foundObject("g"))
+ {
+ Info<< "\nReading g" << endl;
+ uniformDimensionedVectorField* g =
+ new uniformDimensionedVectorField
+ (
+ IOobject
+ (
+ "g",
+ mesh().time().constant(),
+ mesh(),
+ IOobject::MUST_READ,
+ IOobject::NO_WRITE
+ )
+ );
+ g->store();
+ }
+ #};
+ }
+};
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/decomposeParDict b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/decomposeParDict
new file mode 100644
index 0000000000..36786cd219
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/decomposeParDict
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object decomposeParDict;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+numberOfSubdomains 4;
+
+method hierarchical;
+
+hierarchicalCoeffs
+{
+ n (4 1 1);
+ delta 0.001;
+ order xyz;
+}
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/fvSchemes b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/fvSchemes
new file mode 100644
index 0000000000..4dd01b59ef
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/fvSchemes
@@ -0,0 +1,58 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object fvSchemes;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ddtSchemes
+{
+ default Euler;
+}
+
+gradSchemes
+{
+ default Gauss linear;
+}
+
+divSchemes
+{
+ default none;
+ div(phi,U) Gauss linearUpwind grad(U);
+ div((nuEff*dev2(T(grad(U))))) Gauss linear;
+ div(U) Gauss linear;
+ div(phi,epsilon) Gauss limitedLinear 1;
+ div(phi,k) Gauss limitedLinear 1;
+}
+
+laplacianSchemes
+{
+ default Gauss linear corrected;
+}
+
+interpolationSchemes
+{
+ default linear;
+}
+
+snGradSchemes
+{
+ default corrected;
+}
+
+patchDist
+{
+ method meshWave;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/fvSolution b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/fvSolution
new file mode 100644
index 0000000000..c102e04c2a
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/fvSolution
@@ -0,0 +1,58 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object fvSolution;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+solvers
+{
+ p
+ {
+ solver PCG;
+ preconditioner DIC;
+ tolerance 1e-9;
+ relTol 0.01;
+ }
+
+ pFinal
+ {
+ $p;
+ relTol 0;
+ }
+
+ "(U|k|epsilon)"
+ {
+ solver PBiCGStab;
+ preconditioner DILU;
+ tolerance 1e-6;
+ relTol 0.1;
+ }
+
+ "(U|k|epsilon)Final"
+ {
+ $U;
+ relTol 0;
+ }
+}
+
+PIMPLE
+{
+ nNonOrthogonalCorrectors 0;
+ nOuterCorrectors 2;
+ nCorrectors 1;
+ pRefCell 0;
+ pRefValue 0;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/setWavesDict b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/setWavesDict
new file mode 100644
index 0000000000..eb42648709
--- /dev/null
+++ b/tutorials/incompressible/pimpleFoam/RAS/waveSubSurface/system/setWavesDict
@@ -0,0 +1,20 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object setWavesDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+alpha alpha;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/0/U.orig b/tutorials/multiphase/interFoam/laminar/wave3D/0/U.orig
new file mode 100644
index 0000000000..843439f974
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/0/U.orig
@@ -0,0 +1,41 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volVectorField;
+ location "0";
+ object U;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 1 -1 0 0 0 0];
+
+internalField uniform (0 0 0);
+
+boundaryField
+{
+ #includeEtc "caseDicts/setConstraintTypes"
+
+ "(inlet|inletSide)"
+ {
+ type waveVelocity;
+ }
+ top
+ {
+ type pressureInletOutletVelocity;
+ value uniform (0 0 0);
+ }
+ bottom
+ {
+ type noSlip;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/0/alpha.water.orig b/tutorials/multiphase/interFoam/laminar/wave3D/0/alpha.water.orig
new file mode 100644
index 0000000000..2c7c2c43d8
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/0/alpha.water.orig
@@ -0,0 +1,42 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volScalarField;
+ location "0";
+ object alpha.water;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [0 0 0 0 0 0 0];
+
+internalField uniform 0;
+
+boundaryField
+{
+ #includeEtc "caseDicts/setConstraintTypes"
+
+ "(inlet|inletSide)"
+ {
+ type waveAlpha;
+ }
+ top
+ {
+ type inletOutlet;
+ inletValue uniform 0;
+ value uniform 0;
+ }
+ bottom
+ {
+ type zeroGradient;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/0/p_rgh b/tutorials/multiphase/interFoam/laminar/wave3D/0/p_rgh
new file mode 100644
index 0000000000..5238ec72d5
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/0/p_rgh
@@ -0,0 +1,42 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class volScalarField;
+ location "0";
+ object p_rgh;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+dimensions [1 -1 -2 0 0 0 0];
+
+internalField uniform 0;
+
+boundaryField
+{
+ #includeEtc "caseDicts/setConstraintTypes"
+
+ "(inlet|inletSide)"
+ {
+ type fixedFluxPressure;
+ value uniform 0;
+ }
+ top
+ {
+ type entrainmentPressure;
+ p0 uniform 0;
+ }
+ bottom
+ {
+ type fixedFluxPressure;
+ value uniform 0;
+ }
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/Allrun b/tutorials/multiphase/interFoam/laminar/wave3D/Allrun
new file mode 100755
index 0000000000..6e3e9ecbbb
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/Allrun
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+cd ${0%/*} || exit 1
+
+. $WM_PROJECT_DIR/bin/tools/RunFunctions
+
+runApplication blockMesh
+
+for i in 1 2
+do
+ runApplication -s XY$i topoSet -dict topoSetDictXY$i
+ runApplication -s XY$i refineMesh -dict refineMeshDictXY -overwrite
+done
+
+for i in 1 2 3 4
+do
+ runApplication -s Z$i topoSet -dict topoSetDictZ$i
+ runApplication -s Z$i refineMesh -dict refineMeshDictZ -overwrite
+done
+
+runApplication setWaves
+
+runApplication decomposePar
+
+runParallel $(getApplication)
+
+runApplication reconstructPar -newTimes
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/constant/g b/tutorials/multiphase/interFoam/laminar/wave3D/constant/g
new file mode 100644
index 0000000000..a27ab85e41
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/constant/g
@@ -0,0 +1,21 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ 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/wave3D/constant/momentumTransport b/tutorials/multiphase/interFoam/laminar/wave3D/constant/momentumTransport
new file mode 100644
index 0000000000..8278c989ec
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/constant/momentumTransport
@@ -0,0 +1,20 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object momentumTransport;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+simulationType laminar;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/constant/phaseProperties b/tutorials/multiphase/interFoam/laminar/wave3D/constant/phaseProperties
new file mode 100644
index 0000000000..7794a33045
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/constant/phaseProperties
@@ -0,0 +1,22 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object phaseProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+phases (water air);
+
+sigma 0;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/constant/physicalProperties.air b/tutorials/multiphase/interFoam/laminar/wave3D/constant/physicalProperties.air
new file mode 100644
index 0000000000..fab7bde58b
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/constant/physicalProperties.air
@@ -0,0 +1,24 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object physicalProperties.air;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+viscosityModel constant;
+
+nu 1.48e-05;
+
+rho 1;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/constant/physicalProperties.water b/tutorials/multiphase/interFoam/laminar/wave3D/constant/physicalProperties.water
new file mode 100644
index 0000000000..e9b9d7dc4e
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/constant/physicalProperties.water
@@ -0,0 +1,24 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object physicalProperties.water;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+viscosityModel constant;
+
+nu 1e-06;
+
+rho 1000;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/constant/waveProperties b/tutorials/multiphase/interFoam/laminar/wave3D/constant/waveProperties
new file mode 100644
index 0000000000..5eb7e6f885
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/constant/waveProperties
@@ -0,0 +1,39 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "constant";
+ object waveProperties;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+origin (0 0 0);
+
+direction (1 0 0);
+
+waves
+(
+ Airy
+ {
+ length 300;
+ amplitude 2.5;
+ phase 0;
+ angle 0.5235987755982988;
+ }
+);
+
+UMean (0 0 0);
+
+scale table ((1200 1) (1800 0));
+
+crossScale table ((-1800 0) (-1200 1) (1200 1) (1800 0));
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/wave3D/system/blockMeshDict
new file mode 100644
index 0000000000..af6cf9995a
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/blockMeshDict
@@ -0,0 +1,112 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object blockMeshDict;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+convertToMeters 1;
+
+vertices
+(
+ ( 0 0 -300) (1200 0 -300) (2700 0 -300)
+ ( 0 1200 -300) (1200 1200 -300) (2700 1200 -300)
+ ( 0 2700 -300) (1200 2700 -300) (2700 2700 -300)
+
+ ( 0 0 300) (1200 0 300) (2700 0 300)
+ ( 0 1200 300) (1200 1200 300) (2700 1200 300)
+ ( 0 2700 300) (1200 2700 300) (2700 2700 300)
+);
+
+blocks
+(
+ hex (0 1 4 3 9 10 13 12) (67 67 40) simpleGrading (1 1 1)
+ hex (1 2 5 4 10 11 14 13) (27 67 40) simpleGrading (8 1 1)
+ hex (3 4 7 6 12 13 16 15) (67 27 40) simpleGrading (1 8 1)
+ hex (4 5 8 7 13 14 17 16) (27 27 40) simpleGrading (8 8 1)
+);
+
+edges
+(
+);
+
+defaultPatch
+{
+ name frontAndBack;
+ type empty;
+}
+
+boundary
+(
+ inlet
+ {
+ type patch;
+ faces
+ (
+ (0 3 12 9)
+ (3 6 15 12)
+ );
+ }
+ inletSide
+ {
+ type patch;
+ faces
+ (
+ (0 1 10 9)
+ (1 2 11 10)
+ );
+ }
+ outletSide
+ {
+ type symmetryPlane;
+ faces
+ (
+ (6 7 16 15)
+ (7 8 17 16)
+ );
+ }
+ outlet
+ {
+ type symmetryPlane; //patch;
+ faces
+ (
+ (2 5 14 11)
+ (5 8 17 14)
+ );
+ }
+ bottom
+ {
+ type wall;
+ faces
+ (
+ (0 1 4 3)
+ (1 2 5 4)
+ (3 4 7 6)
+ (4 5 8 7)
+ );
+ }
+ top
+ {
+ type patch;
+ faces
+ (
+ (9 10 13 12)
+ (10 11 14 13)
+ (12 13 16 15)
+ (13 14 17 16)
+ );
+ }
+);
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/controlDict b/tutorials/multiphase/interFoam/laminar/wave3D/system/controlDict
new file mode 100644
index 0000000000..b37aabbb53
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/controlDict
@@ -0,0 +1,65 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object controlDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+application interFoam;
+
+startFrom startTime;
+
+startTime 0;
+
+stopAt endTime;
+
+endTime 100;
+
+deltaT 0.05;
+
+writeControl adjustableRunTime;
+
+writeInterval 1;
+
+purgeWrite 0;
+
+writeFormat binary;
+
+writePrecision 6;
+
+writeCompression off;
+
+timeFormat general;
+
+timePrecision 6;
+
+runTimeModifiable yes;
+
+adjustTimeStep no;
+
+maxCo 1;
+
+maxAlphaCo 1;
+
+maxDeltaT 1;
+
+libs
+(
+ "libwaves.so"
+);
+
+functions
+{
+ #includeFunc isoSurface(isoField=alpha.water, isoValue=0.5, fields=())
+}
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/decomposeParDict b/tutorials/multiphase/interFoam/laminar/wave3D/system/decomposeParDict
new file mode 100644
index 0000000000..1da174ce03
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/decomposeParDict
@@ -0,0 +1,28 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object decomposeParDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+numberOfSubdomains 18;
+
+method hierarchical;
+
+hierarchicalCoeffs
+{
+ n (3 3 2);
+ order xyz;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/wave3D/system/fvSchemes
new file mode 100644
index 0000000000..5e33d8cdd8
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/fvSchemes
@@ -0,0 +1,61 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object fvSchemes;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+ddtSchemes
+{
+ /*
+ default CrankNicolson ocCoeff
+ {
+ type scale;
+ scale linearRamp;
+ duration 1.0;
+ value 0.9;
+ };
+ */
+
+ default Euler;
+}
+
+gradSchemes
+{
+ default Gauss linear;
+}
+
+divSchemes
+{
+ div(rhoPhi,U) Gauss linearUpwindV grad(U);
+ div(phi,alpha) Gauss interfaceCompression vanLeer 1;
+
+ div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
+}
+
+laplacianSchemes
+{
+ default Gauss linear corrected;
+}
+
+interpolationSchemes
+{
+ default linear;
+}
+
+snGradSchemes
+{
+ default corrected;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/fvSolution b/tutorials/multiphase/interFoam/laminar/wave3D/system/fvSolution
new file mode 100644
index 0000000000..02b1ef3045
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/fvSolution
@@ -0,0 +1,90 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object fvSolution;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+solvers
+{
+ "alpha.water.*"
+ {
+ nAlphaCorr 2;
+ nAlphaSubCycles 1;
+
+ MULESCorr yes;
+ nLimiterIter 3;
+ alphaApplyPrevCorr yes;
+
+ solver smoothSolver;
+ smoother symGaussSeidel;
+ tolerance 1e-8;
+ relTol 0;
+ minIter 1;
+ }
+
+ pcorr
+ {
+ solver GAMG;
+ smoother DIC;
+ tolerance 1e-4;
+ relTol 0.01;
+ }
+
+ pcorrFinal
+ {
+ $pcorr;
+ relTol 0;
+ };
+
+
+ p_rgh
+ {
+ solver GAMG;
+ smoother DIC;
+ tolerance 1e-7;
+ relTol 0.001;
+ }
+
+ p_rghFinal
+ {
+ $p_rgh;
+ relTol 0;
+ }
+
+ "U.*"
+ {
+ solver smoothSolver;
+ smoother symGaussSeidel;
+ tolerance 1e-7;
+ relTol 0;
+ }
+}
+
+PIMPLE
+{
+ momentumPredictor yes;
+ nOuterCorrectors 1;
+ nCorrectors 3;
+ nNonOrthogonalCorrectors 0;
+}
+
+relaxationFactors
+{
+ equations
+ {
+ ".*" 1;
+ }
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/refineMeshDictXY b/tutorials/multiphase/interFoam/laminar/wave3D/system/refineMeshDictXY
new file mode 100644
index 0000000000..b62a26c791
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/refineMeshDictXY
@@ -0,0 +1,40 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object refineMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+set box;
+
+coordinateSystem global;
+
+globalCoeffs
+{
+ e1 (1 0 0);
+ e2 (0 1 0);
+}
+
+directions
+(
+ e1
+ e2
+);
+
+useHexTopology true;
+
+geometricCut false;
+
+writeMesh false;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/refineMeshDictZ b/tutorials/multiphase/interFoam/laminar/wave3D/system/refineMeshDictZ
new file mode 100644
index 0000000000..03d591a162
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/refineMeshDictZ
@@ -0,0 +1,39 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object refineMeshDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+set box;
+
+coordinateSystem global;
+
+globalCoeffs
+{
+ e1 (1 0 0);
+ e2 (0 1 0);
+}
+
+directions
+(
+ e3
+);
+
+useHexTopology true;
+
+geometricCut false;
+
+writeMesh false;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/setWavesDict b/tutorials/multiphase/interFoam/laminar/wave3D/system/setWavesDict
new file mode 100644
index 0000000000..8b97762316
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/setWavesDict
@@ -0,0 +1,20 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object setWavesDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+alpha alpha.water;
+
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictXY1 b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictXY1
new file mode 100644
index 0000000000..3255be70ec
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictXY1
@@ -0,0 +1,28 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object topoSetDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+actions
+(
+ {
+ name box;
+ type cellSet;
+ action new;
+ source boxToCell;
+ box (-1e6 -1e6 -40) (1300 1300 40);
+ }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictXY2 b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictXY2
new file mode 100644
index 0000000000..23088be4de
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictXY2
@@ -0,0 +1,28 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object topoSetDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+actions
+(
+ {
+ name box;
+ type cellSet;
+ action new;
+ source boxToCell;
+ box (-1e6 -1e6 -30) (1200 1200 30);
+ }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ1 b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ1
new file mode 100644
index 0000000000..0f0c987a5c
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ1
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object topoSetDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+actions
+(
+ {
+ name box;
+ type cellSet;
+ action new;
+ source boxToCell;
+ //box (-1e6 -1e6 -40) (1500 1500 40);
+ box (-1e6 -1e6 -40) (1e6 1e6 40);
+ }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ2 b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ2
new file mode 100644
index 0000000000..f8d895f681
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ2
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object topoSetDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+actions
+(
+ {
+ name box;
+ type cellSet;
+ action new;
+ source boxToCell;
+ //box (-1e6 -1e6 -30) (1400 1400 30);
+ box (-1e6 -1e6 -30) (1e6 1e6 30);
+ }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ3 b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ3
new file mode 100644
index 0000000000..5f365cc32a
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ3
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object topoSetDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+actions
+(
+ {
+ name box;
+ type cellSet;
+ action new;
+ source boxToCell;
+ //box (-1e6 -1e6 -20) (1300 1300 20);
+ box (-1e6 -1e6 -20) (1e6 1e6 20);
+ }
+);
+
+// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ4 b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ4
new file mode 100644
index 0000000000..720610e415
--- /dev/null
+++ b/tutorials/multiphase/interFoam/laminar/wave3D/system/topoSetDictZ4
@@ -0,0 +1,29 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration | Website: https://openfoam.org
+ \\ / A nd | Version: dev
+ \\/ M anipulation |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ format ascii;
+ class dictionary;
+ location "system";
+ object topoSetDict;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+actions
+(
+ {
+ name box;
+ type cellSet;
+ action new;
+ source boxToCell;
+ //box (-1e6 -1e6 -10) (1200 1200 10);
+ box (-1e6 -1e6 -10) (1e6 1e6 10);
+ }
+);
+
+// ************************************************************************* //