39 void Foam::populationBalanceSystem::addDmdts
41 const diameterModels::populationBalanceModel::dmdtfTable& dmdtfs,
42 PtrList<volScalarField::Internal>& dmdts
52 const phaseInterface interface(fluid_, dmdtfIter.key());
60 void Foam::populationBalanceSystem::addDmdtUfs
63 HashPtrTable<fvVectorMatrix>& eqns
73 const phaseInterface interface(fluid_, dmdtfIter.key());
79 const phaseModel& phase1 = fluid_.phases()[interface.phase1().name()];
80 const phaseModel& phase2 = fluid_.phases()[interface.phase2().name()];
82 if (!phase1.stationary())
84 *eqns[phase1.name()] +=
85 dmdtf21*phase2.U()()() +
fvm::Sp(dmdtf12, phase1.URef());
88 if (!phase2.stationary())
90 *eqns[phase2.name()] -=
91 dmdtf12*phase1.U()()() +
fvm::Sp(dmdtf21, phase2.URef());
97 void Foam::populationBalanceSystem::addDmdtHefs
100 HashPtrTable<fvScalarMatrix>& eqns
111 const phaseInterface interface(fluid_, dmdtfIter.key());
117 const phaseModel& phase1 = interface.phase1();
118 const phaseModel& phase2 = interface.phase2();
119 const rhoFluidThermo& thermo1 = phase1.fluidThermo();
120 const rhoFluidThermo& thermo2 = phase2.fluidThermo();
129 *eqns[phase1.name()] +=
130 dmdtf*hs1 +
fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
131 *eqns[phase2.name()] -=
132 dmdtf*hs2 +
fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
135 *eqns[phase1.name()] += dmdtf21*(hs2 - hs1);
136 *eqns[phase2.name()] -= dmdtf12*(hs1 - hs2);
139 *eqns[phase1.name()] += dmdtf21*
K2 + dmdtf12*
K1;
140 *eqns[phase2.name()] -= dmdtf12*
K1 + dmdtf21*
K2;
145 void Foam::populationBalanceSystem::addDmdtYfs
148 HashPtrTable<fvScalarMatrix>& eqns
158 const phaseInterface interface(fluid_, dmdtfIter.key());
164 const phaseModel& phase1 = interface.phase1();
165 const phaseModel& phase2 = interface.phase2();
172 *eqns[Y1.name()] += dmdtf21*Y2 +
fvm::Sp(dmdtf12, Y1);
173 *eqns[Y2.name()] -= dmdtf12*Y1 +
fvm::Sp(dmdtf21, Y2);
187 populationBalances_()
189 if (fluid_.
found(
"populationBalances"))
193 fluid_.
lookup(
"populationBalances"),
197 populationBalances_.transfer(popBals);
215 forAll(populationBalances_, popBali)
217 addDmdts(populationBalances_[popBali].dmdtfs(), dmdts);
218 addDmdts(populationBalances_[popBali].expansionDmdtfs(), dmdts);
219 addDmdts(populationBalances_[popBali].modelSourceDmdtfs(), dmdts);
235 forAll(fluid_.movingPhases(), movingPhasei)
237 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
246 forAll(populationBalances_, popBali)
248 addDmdtUfs(populationBalances_[popBali].dmdtfs(), eqns);
249 addDmdtUfs(populationBalances_[popBali].expansionDmdtfs(), eqns);
250 addDmdtUfs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
260 return momentumTransfer();
273 forAll(fluid_.phases(), phasei)
275 const phaseModel& phase = fluid_.phases()[phasei];
284 forAll(populationBalances_, popBali)
286 addDmdtHefs(populationBalances_[popBali].dmdtfs(), eqns);
287 addDmdtHefs(populationBalances_[popBali].expansionDmdtfs(), eqns);
288 addDmdtHefs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
304 forAll(fluid_.multicomponentPhases(), multicomponentPhasei)
307 fluid_.multicomponentPhases()[multicomponentPhasei];
321 forAll(populationBalances_, popBali)
323 addDmdtYfs(populationBalances_[popBali].dmdtfs(), eqns);
324 addDmdtYfs(populationBalances_[popBali].expansionDmdtfs(), eqns);
325 addDmdtYfs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
334 forAll(populationBalances_, i)
336 populationBalances_[i].solve();
343 forAll(populationBalances_, i)
345 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