30 #include "surfaceInterpolate.H"
53 void Foam::fv::volumeFractionSource::readCoeffs()
67 if (!mesh().foundObject<volScalarField>(alphaName))
75 mesh().time().constant(),
109 const fluidThermophysicalTransportModel& ttm =
110 mesh().lookupType<fluidThermophysicalTransportModel>();
113 fieldName == ttm.thermo().T().name()
115 : fieldName == ttm.thermo().he().name()
116 ? ttm.kappaEff()/ttm.thermo().Cpv()
117 : ttm.momentumTransport().rho()*ttm.momentumTransport().nuEff();
122 <<
"Dimensions of " << phi.name() <<
" not recognised"
125 return tmp<volScalarField>(
nullptr);
130 template <
class Type,
class AlphaFieldType>
131 void Foam::fv::volumeFractionSource::addGeneralSup
133 const AlphaFieldType&
alpha,
135 const word& fieldName
148 const word divScheme =
"div(" + phiName +
"," + eqn.psi().name() +
")";
149 eqn -= AByB*
fvm::div(phi, eqn.psi(), divScheme);
152 const word laplacianScheme =
153 "laplacian(" +
D.
name() +
"," + eqn.psi().name() +
")";
160 template<
class Type,
class AlphaFieldType>
161 void Foam::fv::volumeFractionSource::addAlphaSupType
163 const AlphaFieldType&
alpha,
165 const word& fieldName
168 addGeneralSup(
alpha, eqn, fieldName);
172 template<
class AlphaFieldType>
173 void Foam::fv::volumeFractionSource::addAlphaSupType
175 const AlphaFieldType&
alpha,
176 fvMatrix<scalar>& eqn,
177 const word& fieldName
193 addGeneralSup(
alpha, eqn, fieldName);
198 template<
class AlphaFieldType>
199 void Foam::fv::volumeFractionSource::addAlphaSupType
201 const AlphaFieldType&
alpha,
202 fvMatrix<vector>& eqn,
203 const word& fieldName
215 const word
scheme(
"div(" + phiName +
"," + eqn.psi().name() +
")");
221 addGeneralSup(
alpha, eqn, fieldName);
227 void Foam::fv::volumeFractionSource::addSupType
230 const word& fieldName
233 addAlphaSupType(geometricOneField(), eqn, fieldName);
238 void Foam::fv::volumeFractionSource::addSupType
242 const word& fieldName
245 addAlphaSupType(geometricOneField(), eqn, fieldName);
250 void Foam::fv::volumeFractionSource::addSupType
255 const word& fieldName
258 addAlphaSupType(
alpha, eqn, fieldName);
267 const word& modelType,
273 phiName_(
word::null),
274 rhoName_(
word::null),
276 volumePhaseName_(
word::null)
312 fv::volumeFractionSource
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
static const Foam::dimensionedScalar D("D", Foam::dimTemperature, 257.14)
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 keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const word & name() const
Return const reference to name.
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
const dictionary & coeffs() const
Return dictionary.
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 bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual ~volumeFractionSource()
Destructor.
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.
volumeFractionSource(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
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.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IMPLEMENT_FV_MODEL_ADD_RHO_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_SUP(Type, modelType)
#define IMPLEMENT_FV_MODEL_ADD_ALPHA_RHO_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)
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)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
SurfaceField< scalar > surfaceScalarField
FOR_ALL_FIELD_TYPES(DefineContiguousFvWallLocationDataType)
const dimensionSet dimTime
const dimensionSet dimVolume
VolField< scalar > volScalarField
const dimensionSet dimMass
word name(const complex &)
Return a string representation of a complex.
autoPtr< incompressible::momentumTransportModel > turbulence(incompressible::momentumTransportModel::New(U, phi, viscosity))