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))
78 mesh().time().constant(),
112 const fluidThermophysicalTransportModel& ttm =
116 fieldName == ttm.thermo().T().name()
118 : fieldName == ttm.thermo().he().name()
119 ? ttm.kappaEff()/ttm.thermo().Cpv()
120 : ttm.momentumTransport().rho()*ttm.momentumTransport().nuEff();
125 <<
"Dimensions of " << phi.name() <<
" not recognised"
128 return tmp<volScalarField>(
nullptr);
133 template <
class Type,
class AlphaFieldType>
134 void Foam::fv::volumeBlockage::addGeneralSupType
136 const AlphaFieldType&
alpha,
150 const word divScheme =
"div(" + phiName +
"," + eqn.psi().name() +
")";
151 eqn -= AByB*
fvm::div(phi, eqn.psi(), divScheme);
154 const word laplacianScheme =
155 "laplacian(" +
D.
name() +
"," + eqn.psi().name() +
")";
162 template<
class Type,
class AlphaFieldType>
163 void Foam::fv::volumeBlockage::addAlphaSupType
165 const AlphaFieldType&
alpha,
166 const VolField<Type>& field,
170 addGeneralSupType(
alpha, eqn);
174 template<
class AlphaFieldType>
175 void Foam::fv::volumeBlockage::addAlphaSupType
177 const AlphaFieldType&
alpha,
179 fvMatrix<scalar>& eqn
195 addGeneralSupType(
alpha, eqn);
200 template<
class AlphaFieldType>
201 void Foam::fv::volumeBlockage::addAlphaSupType
203 const AlphaFieldType&
alpha,
205 fvMatrix<vector>& eqn
217 const word
scheme(
"div(" + phiName +
"," + eqn.psi().name() +
")");
223 addGeneralSupType(
alpha, eqn);
229 void Foam::fv::volumeBlockage::addSupType
231 const VolField<Type>& field,
235 addAlphaSupType(geometricOneField(), field, eqn);
240 void Foam::fv::volumeBlockage::addSupType
243 const VolField<Type>& field,
247 addAlphaSupType(geometricOneField(), field, eqn);
252 void Foam::fv::volumeBlockage::addSupType
256 const VolField<Type>& field,
260 addAlphaSupType(
alpha, field, eqn);
269 const word& modelType,
275 phiName_(
word::null),
276 rhoName_(
word::null),
278 volumePhaseName_(
word::null)
318 bool Foam::
fv::volumeBlockage::movePoints()
340 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
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
SurfaceField< scalar > surfaceScalarField
const dimensionSet dimTime
const dimensionSet dimVolume
VolField< scalar > volScalarField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimMass
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))