32 template<
class PsiFieldType>
38 const PsiFieldType&
psi
52 if (
Su.valid() &&
Sp.valid())
54 return (
Su.S() +
Sp.S()*
psi)/mesh_.time().deltaT()/mesh_.V();
58 return Su.S()/mesh_.time().deltaT()/mesh_.V();
62 return Sp.S()*
psi/mesh_.time().deltaT()/mesh_.V();
69 name_ +
"&" + psiName,
170 ? residual(dims, psi_.name(), psi_)
211 #define CARRIER_EQN_SCALAR_OPERATOR(Op, EqOp) \
213 template<class Type> \
214 Foam::tmp<Foam::CarrierEqn<Type>> Foam::operator Op \
216 const CarrierEqn<Type>& eqn, \
217 const dimensionedScalar& s \
220 return tmp<CarrierEqn<Type>>(eqn) Op s; \
223 template<class Type> \
224 Foam::tmp<Foam::CarrierEqn<Type>> Foam::operator Op \
226 const tmp<CarrierEqn<Type>>& tEqn, \
227 const dimensionedScalar& s \
230 tmp<CarrierEqn<Type>> tResult(new CarrierEqn<Type>(tEqn)); \
232 tResult.ref().Su EqOp s; \
233 tResult.ref().Sp EqOp s; \
238 #define CARRIER_COMMUTATIVE_SCALAR_EQN_OPERATOR(Op, EqOp) \
240 template<class Type> \
241 Foam::tmp<Foam::CarrierEqn<Type>> Foam::operator Op \
243 const dimensionedScalar& s, \
244 const CarrierEqn<Type>& eqn \
250 template<class Type> \
251 Foam::tmp<Foam::CarrierEqn<Type>> Foam::operator Op \
253 const dimensionedScalar& s, \
254 const tmp<CarrierEqn<Type>>& tEqn \
267 #undef CARRIER_EQN_SCALAR_OPERATOR
268 #undef CARRIER_COMMUTATIVE_SCALAR_EQN_OPERATOR
285 fvEqn.
diag() += cEqn.
Sp.
S().primitiveField()/deltaT.
value();
313 fvEqn.
diag() -= cEqn.
Sp.
S().primitiveField()/deltaT.
value();
#define CARRIER_COMMUTATIVE_SCALAR_EQN_OPERATOR(Op, EqOp)
#define CARRIER_EQN_SCALAR_OPERATOR(Op, EqOp)
Class to store a coefficient of a carrier equation.
bool valid() const
Determine whether this coefficient has values or not.
const DimensionedField< Type, fvMesh > & S() const
Access the field.
Non-templated base class for carrier equations.
Class to store the coefficients of a term in a carrier equation.
CarrierCoeff< scalar, true > Sp
Implicit coefficient.
void operator+=(const LagrangianEqn< Type > &lEqn)
Addition assignment.
void operator-=(const LagrangianEqn< Type > &lEqn)
Subtraction assignment.
CarrierEqn(const VolField< Type > &psi)
Construct for a field.
void clear()
Clear the coefficient values.
CarrierCoeff< Type, false > Su
Explicit coefficient.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
tmp< LagrangianCoeff< scalar, true > > allDiagonalSp() const
Return the combined time and non-time implicit diagonal.
tmp< LagrangianCoeff< Type, false > > allDiagonalSu() const
Return the combined time and non-time explicit diagonal.
Dimension set for the base types.
const Type & value() const
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const dimensionSet & dimensions() const
Mesh data needed to do the Finite Volume discretisation.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
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)
const volScalarField & psi
const char *const group
Group name for atomic constants.
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
const dimensionSet & dimVolume
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
const dimensionSet & dimTime
const T & NullObjectRef()
Return const reference to the nullObject of type T.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
void operator+=(fvMatrix< Type > &fvEqn, const CarrierEqn< Type > &cEqn)
Add to a finite-volume equation.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void operator-=(fvMatrix< Type > &fvEqn, const CarrierEqn< Type > &cEqn)
Subtract from a finite-volume equation.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.