49 void Foam::fv::waveForcing::readCoeffs(
const dictionary&
dict)
51 if (
dict.found(
"lambdaCoeff"))
53 lambdaCoeff_ =
dict.lookup<scalar>(
"lambdaCoeff");
55 lambdaBoundaryCoeff_ =
56 dict.lookupOrDefault<scalar>(
"lambdaBoundaryCoeff", 0);
60 Info<<
" Volume average region length "
61 << regionLength_.value() <<
endl;
72 return tmp<volScalarField::Internal>(scale_());
77 Foam::fv::waveForcing::forceCoeff()
const
84 waves_.maxWaveSpeed(
mesh().time().deltaTValue())
87 lambda_ = lambdaCoeff_*waveSpeed/regionLength_;
88 lambdaBoundary_ = lambdaBoundaryCoeff_*waveSpeed/regionLength_;
100 const word& modelType,
107 lambdaBoundaryCoeff_(0),
108 regionLength_(
"regionLength",
dimLength, 0),
110 liquidPhaseName_(
dict.lookup<
word>(
"liquidPhase")),
111 alphaName_(
IOobject::groupName(
"alpha", liquidPhaseName_)),
112 UName_(
dict.lookupOrDefault<
word>(
"U",
"U")),
124 return {alphaName_, UName_};
139 eqn += forceCoeff*alphaWaves_();
151 if (
U.name() == UName_ && &
U == &eqn.
psi())
156 eqn += forceCoeff*Uwaves_();
236 readCoeffs(coeffs(
dict));
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Mesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const Type & value() const
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Finite volume model abstract base class.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
Base fvModel for forcing functions.
void writeForceFields() const
Optionally write the forcing fields:
virtual bool read(const dictionary &dict)
Read dictionary.
virtual tmp< volScalarField::Internal > forceCoeff() const
Return the force coefficient.
void readLambda(const dictionary &dict)
Read the forcing coefficients.
dimensionedScalar regionLength() const
Calculate and return the volume average forcing region length.
virtual tmp< volScalarField::Internal > scale() const
Return the scale distribution.
This fvModel applies forcing to the liquid phase-fraction field and all components of the vector fiel...
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void correct()
Correct the wave forcing coefficients.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void addSup(const volScalarField &alpha, fvMatrix< scalar > &eqn) const
Source term to VoF phase-fraction equation.
waveForcing(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
virtual const pointField & points() const
Return raw points.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const vectorField & cellCentres() const
A class for managing temporary objects.
A wrapper around a list of wave models. Superimposes the modelled values of elevation and velocity....
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the matrix for implicit and explicit sources.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar h
Planck constant.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< VolField< Type > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
tmp< scalarField > levelSetFraction(const fvMesh &mesh, const scalarField &levelC, const scalarField &levelP, const bool above)
Calculate the volume-fraction that a level set occupies. This gives the.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
const dimensionSet dimLength
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimVelocity
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< Field< Type > > levelSetAverage(const fvMesh &mesh, const scalarField &levelC, const scalarField &levelP, const Field< Type > &positiveC, const Field< Type > &positiveP, const Field< Type > &negativeC, const Field< Type > &negativeP)
Calculate the average value of two fields, one on each side of a level set.