30 #include "surfaceInterpolate.H"
48 "volumeFractionSource"
56 void Foam::fv::volumeBlockage::readCoeffs(
const dictionary&
dict)
58 phiName_ =
dict.lookupOrDefault<word>(
"phi",
"phi");
59 rhoName_ =
dict.lookupOrDefault<word>(
"rho",
"rho");
60 UName_ =
dict.lookupOrDefault<word>(
"U",
"U");
62 volumePhaseName_ =
dict.lookup<word>(
"volumePhase");
70 if (!
mesh().foundObject<volScalarField>(alphaName))
113 const fluidThermophysicalTransportModel& ttm =
117 fieldName == ttm.thermo().T().name()
119 : fieldName == ttm.thermo().he().name()
120 ? ttm.kappaEff()/ttm.thermo().Cpv()
121 : ttm.momentumTransport().rho()*ttm.momentumTransport().nuEff();
126 <<
"Dimensions of " << phi.name() <<
" not recognised"
129 return tmp<volScalarField>(
nullptr);
134 template <
class Type,
class AlphaFieldType>
135 void Foam::fv::volumeBlockage::addGeneralSupType
137 const AlphaFieldType&
alpha,
151 const word divScheme =
"div(" + phiName +
"," + eqn.psi().name() +
")";
152 eqn -= AByB*
fvm::div(phi, eqn.psi(), divScheme);
155 const word laplacianScheme =
156 "laplacian(" +
D.
name() +
"," + eqn.psi().name() +
")";
163 template<
class Type,
class AlphaFieldType>
164 void Foam::fv::volumeBlockage::addAlphaSupType
166 const AlphaFieldType&
alpha,
167 const VolField<Type>& field,
171 addGeneralSupType(
alpha, eqn);
175 template<
class AlphaFieldType>
176 void Foam::fv::volumeBlockage::addAlphaSupType
178 const AlphaFieldType&
alpha,
180 fvMatrix<scalar>& eqn
196 addGeneralSupType(
alpha, eqn);
201 template<
class AlphaFieldType>
202 void Foam::fv::volumeBlockage::addAlphaSupType
204 const AlphaFieldType&
alpha,
206 fvMatrix<vector>& eqn
218 const word
scheme(
"div(" + phiName +
"," + eqn.psi().name() +
")");
224 addGeneralSupType(
alpha, eqn);
230 void Foam::fv::volumeBlockage::addSupType
232 const VolField<Type>& field,
236 addAlphaSupType(geometricOneField(), field, eqn);
241 void Foam::fv::volumeBlockage::addSupType
244 const VolField<Type>& field,
248 addAlphaSupType(geometricOneField(), field, eqn);
253 void Foam::fv::volumeBlockage::addSupType
257 const VolField<Type>& field,
261 addAlphaSupType(
alpha, field, eqn);
270 const word& modelType,
276 phiName_(
word::null),
277 rhoName_(
word::null),
279 volumePhaseName_(
word::null)
319 bool Foam::
fv::volumeBlockage::movePoints()
341 readCoeffs(coeffs(
dict));
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
word group() const
Return group (extension part of name)
word member() const
Return member (name without the extension)
static word groupName(Name name, const word &group)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const word & name() const
Return const reference to name.
Mesh data needed to do the Finite Volume discretisation.
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.
virtual bool read(const dictionary &dict)
Read source dictionary.
This fvModel adds transport terms into the equations to account for the presence of a constant volume...
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
volumeBlockage(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
virtual ~volumeBlockage()
Destructor.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type and name.
const Type & lookupType(const word &group=word::null) const
Lookup and return the object of the given Type.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IMPLEMENT_FV_MODEL_ADD_FIELD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_FIELD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_RHO_FIELD_SUP(Type, modelType)
Calculate the divergence of the given field.
Calculate the matrix for the divergence of the given field and flux.
Calculate the matrix for the laplacian of the field.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
compressibleMomentumTransportModel momentumTransportModel
const dimensionSet dimless
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
addBackwardCompatibleToRunTimeSelectionTable(fvConstraint, fixedTemperature, dictionary, fixedTemperatureConstraint, "fixedTemperatureConstraint")
static tmp< surfaceInterpolationScheme< Type > > scheme(const surfaceScalarField &faceFlux, Istream &schemeData)
Return weighting factors for scheme given from Istream.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const VolField< Type > &vf, const word &name)
static const coefficient D("D", dimTemperature, 257.14)
static const coefficient B("B", dimless, 18.678)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
VolField< vector > volVectorField
const dimensionSet & dimMass
SurfaceField< scalar > surfaceScalarField
FOR_ALL_FIELD_TYPES(makeDimensionedPointFieldFunctions)
const dimensionSet & dimVolume
const dimensionSet & dimTime
VolField< scalar > volScalarField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))