39 void Foam::populationBalanceSystem::addDmdts
41 const diameterModels::populationBalanceModel::dmdtfTable& dmdtfs,
42 PtrList<volScalarField::Internal>& dmdts
45 forAll(populationBalances_, popBali)
54 const phaseInterface interface(fluid_, dmdtfIter.key());
63 void Foam::populationBalanceSystem::addDmdtUfs
66 HashPtrTable<fvVectorMatrix>& eqns
76 const phaseInterface interface(fluid_, dmdtfIter.key());
82 const phaseModel& phase1 = fluid_.phases()[interface.phase1().name()];
83 const phaseModel& phase2 = fluid_.phases()[interface.phase2().name()];
85 if (!phase1.stationary())
87 *eqns[phase1.name()] +=
88 dmdtf21*phase2.U()()() +
fvm::Sp(dmdtf12, phase1.URef());
91 if (!phase2.stationary())
93 *eqns[phase2.name()] -=
94 dmdtf12*phase1.U()()() +
fvm::Sp(dmdtf21, phase2.URef());
100 void Foam::populationBalanceSystem::addDmdtHefs
103 HashPtrTable<fvScalarMatrix>& eqns
114 const phaseInterface interface(fluid_, dmdtfIter.key());
120 const phaseModel& phase1 = interface.phase1();
121 const phaseModel& phase2 = interface.phase2();
122 const rhoFluidThermo& thermo1 = phase1.fluidThermo();
123 const rhoFluidThermo& thermo2 = phase2.fluidThermo();
132 *eqns[phase1.name()] +=
133 dmdtf*hs1 +
fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
134 *eqns[phase2.name()] -=
135 dmdtf*hs2 +
fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
138 *eqns[phase1.name()] += dmdtf21*(hs2 - hs1);
139 *eqns[phase2.name()] -= dmdtf12*(hs1 - hs2);
142 *eqns[phase1.name()] += dmdtf21*
K2 + dmdtf12*
K1;
143 *eqns[phase2.name()] -= dmdtf12*
K1 + dmdtf21*
K2;
148 void Foam::populationBalanceSystem::addDmdtYfs
151 HashPtrTable<fvScalarMatrix>& eqns
161 const phaseInterface interface(fluid_, dmdtfIter.key());
167 const phaseModel& phase1 = interface.phase1();
168 const phaseModel& phase2 = interface.phase2();
175 *eqns[Y1.name()] += dmdtf21*Y2 +
fvm::Sp(dmdtf12, Y1);
176 *eqns[Y2.name()] -= dmdtf12*Y1 +
fvm::Sp(dmdtf21, Y2);
190 populationBalances_()
192 if (fluid_.
found(
"populationBalances"))
196 fluid_.
lookup(
"populationBalances"),
200 populationBalances_.transfer(popBals);
218 forAll(populationBalances_, popBali)
220 addDmdts(populationBalances_[popBali].dmdtfs(), dmdts);
221 addDmdts(populationBalances_[popBali].expansionDmdtfs(), dmdts);
222 addDmdts(populationBalances_[popBali].modelSourceDmdtfs(), dmdts);
238 forAll(fluid_.movingPhases(), movingPhasei)
240 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
249 forAll(populationBalances_, popBali)
251 addDmdtUfs(populationBalances_[popBali].dmdtfs(), eqns);
252 addDmdtUfs(populationBalances_[popBali].expansionDmdtfs(), eqns);
253 addDmdtUfs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
263 return momentumTransfer();
276 forAll(fluid_.phases(), phasei)
278 const phaseModel& phase = fluid_.phases()[phasei];
287 forAll(populationBalances_, popBali)
289 addDmdtHefs(populationBalances_[popBali].dmdtfs(), eqns);
290 addDmdtHefs(populationBalances_[popBali].expansionDmdtfs(), eqns);
291 addDmdtHefs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
307 forAll(fluid_.multicomponentPhases(), multicomponentPhasei)
310 fluid_.multicomponentPhases()[multicomponentPhasei];
324 forAll(populationBalances_, popBali)
326 addDmdtYfs(populationBalances_[popBali].dmdtfs(), eqns);
327 addDmdtYfs(populationBalances_[popBali].expansionDmdtfs(), eqns);
328 addDmdtYfs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
337 forAll(populationBalances_, i)
339 populationBalances_[i].solve();
346 forAll(populationBalances_, i)
348 populationBalances_[i].correct();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
DimensionedField< Type, GeoMesh, PrimitiveField > Internal
Type of the internal field from which this GeometricField is derived.
A HashTable specialisation for hashing pointers.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
virtual const volScalarField & he() const =0
Enthalpy/Internal energy [J/kg].
Return a pointer to a new populationBalanceModel object created on.
HashPtrTable< volScalarField::Internal, phaseInterfaceKey, phaseInterfaceKey::hash > dmdtfTable
Table of interfacial mass transfer rates.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
virtual const rhoThermo & thermo() const =0
Return the thermophysical model.
virtual const PtrList< volScalarField > & Y() const =0
Return the species mass fractions.
virtual tmp< volVectorField > U() const =0
Return the velocity.
const word & name() const
Return the name of this phase.
Class to represent a system of phases.
Class which provides population balance functionality. Holds a number of population balances and prov...
void correct()
Correct the population balances.
autoPtr< HashPtrTable< fvVectorMatrix > > momentumTransferf()
Return the momentum transfer matrices for the face-based algorithm.
autoPtr< HashPtrTable< fvScalarMatrix > > specieTransfer() const
Return the specie transfer matrices.
autoPtr< HashPtrTable< fvScalarMatrix > > heatTransfer() const
Return the heat transfer matrices.
populationBalanceSystem(const phaseSystem &)
Construct from a phase system.
PtrList< volScalarField::Internal > dmdts() const
Return the mass transfer rates for each phase.
autoPtr< HashPtrTable< fvVectorMatrix > > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.
void solve()
Solve all population balance equations.
virtual ~populationBalanceSystem()
Destructor.
Calculate the matrix for implicit and explicit sources.
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
const dimensionSet dimEnergy
void addField(const label phasei, const word &name, tmp< GeoField > field, PtrList< GeoField > &fieldList)
fvMatrix< scalar > fvScalarMatrix
const dimensionSet dimTime
dimensionedScalar negPart(const dimensionedScalar &ds)
VolField< scalar > volScalarField
defineTypeNameAndDebug(combustionModel, 0)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimMass
const dimensionSet dimVelocity
dimensionedScalar posPart(const dimensionedScalar &ds)
PtrList< volScalarField > & Y