40 void Foam::populationBalanceSystem::addDmdts
42 const populationBalanceModel::dmdtfTable& dmdtfs,
43 PtrList<volScalarField::Internal>& dmdts
48 const phaseInterface interface(fluid_, dmdtfIter.key());
56 void Foam::populationBalanceSystem::addDmdtUfs
59 HashPtrTable<fvVectorMatrix>& eqns
69 const phaseInterface interface(fluid_, dmdtfIter.key());
75 const phaseModel& phase1 = fluid_.phases()[interface.phase1().name()];
76 const phaseModel& phase2 = fluid_.phases()[interface.phase2().name()];
78 if (!phase1.stationary())
80 eqns[phase1.name()] +=
81 dmdtf21*phase2.U()()() +
fvm::Sp(dmdtf12, phase1.URef());
84 if (!phase2.stationary())
86 eqns[phase2.name()] -=
87 dmdtf12*phase1.U()()() +
fvm::Sp(dmdtf21, phase2.URef());
93 void Foam::populationBalanceSystem::addDmdtHefs
96 HashPtrTable<fvScalarMatrix>& eqns
102 const phaseInterface interface(fluid_, dmdtfIter.key());
108 const phaseModel& phase1 = interface.phase1();
109 const phaseModel& phase2 = interface.phase2();
110 const rhoFluidThermo& thermo1 = phase1.fluidThermo();
111 const rhoFluidThermo& thermo2 = phase2.fluidThermo();
120 eqns[phase1.name()] +=
121 dmdtf*hs1 +
fvm::Sp(dmdtf12, he1) - dmdtf12*he1;
122 eqns[phase2.name()] -=
123 dmdtf*hs2 +
fvm::Sp(dmdtf21, he2) - dmdtf21*he2;
126 eqns[phase1.name()] += dmdtf21*(hs2 - hs1);
127 eqns[phase2.name()] -= dmdtf12*(hs1 - hs2);
130 eqns[phase1.name()] += dmdtf21*
K2 + dmdtf12*
K1;
131 eqns[phase2.name()] -= dmdtf12*
K1 + dmdtf21*
K2;
136 void Foam::populationBalanceSystem::addDmdtYfs
139 HashPtrTable<fvScalarMatrix>& eqns
144 const phaseInterface interface(fluid_, dmdtfIter.key());
150 const phaseModel& phase1 = interface.phase1();
151 const phaseModel& phase2 = interface.phase2();
158 eqns[Y1.name()] += dmdtf21*Y2 +
fvm::Sp(dmdtf12, Y1);
159 eqns[Y2.name()] -= dmdtf12*Y1 +
fvm::Sp(dmdtf21, Y2);
173 populationBalances_()
182 if (!isA<diameterModels::populationBalance>(diameter))
continue;
184 populationBalanceNameSet.
insert
186 refCast<const diameterModels::populationBalance>
194 const wordList populationBalanceNames = populationBalanceNameSet.
toc();
195 populationBalances_.resize(populationBalanceNames.
size());
196 forAll(populationBalances_, popBali)
198 populationBalances_.set
220 forAll(populationBalances_, popBali)
222 addDmdts(populationBalances_[popBali].dmdtfs(), dmdts);
223 addDmdts(populationBalances_[popBali].expansionDmdtfs(), dmdts);
224 addDmdts(populationBalances_[popBali].modelSourceDmdtfs(), dmdts);
240 forAll(fluid_.movingPhases(), movingPhasei)
242 const phaseModel& phase = fluid_.movingPhases()[movingPhasei];
251 forAll(populationBalances_, popBali)
253 addDmdtUfs(populationBalances_[popBali].dmdtfs(), eqns);
254 addDmdtUfs(populationBalances_[popBali].expansionDmdtfs(), eqns);
255 addDmdtUfs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
265 return momentumTransfer();
278 forAll(fluid_.phases(), phasei)
280 const phaseModel& phase = fluid_.phases()[phasei];
289 forAll(populationBalances_, popBali)
291 addDmdtHefs(populationBalances_[popBali].dmdtfs(), eqns);
292 addDmdtHefs(populationBalances_[popBali].expansionDmdtfs(), eqns);
293 addDmdtHefs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
309 forAll(fluid_.multicomponentPhases(), multicomponentPhasei)
312 fluid_.multicomponentPhases()[multicomponentPhasei];
326 forAll(populationBalances_, popBali)
328 addDmdtYfs(populationBalances_[popBali].dmdtfs(), eqns);
329 addDmdtYfs(populationBalances_[popBali].expansionDmdtfs(), eqns);
330 addDmdtYfs(populationBalances_[popBali].modelSourceDmdtfs(), eqns);
339 forAll(populationBalances_, i)
341 populationBalances_[i].solve();
348 forAll(populationBalances_, i)
350 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.
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
List< Key > toc() const
Return the table of contents.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
void size(const label)
Override size to be inconsistent with allocated storage.
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].
Abstract base-class for dispersed-phase particle diameter models.
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.
const phaseModelList & phases() const
Return the phase models.
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
HashPtrTable< volScalarField::Internal, phaseInterfaceKey, phaseInterfaceKey::hash > dmdtfTable
Table of interfacial mass transfer rates.
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 & dimMass
void addField(const label phasei, const word &name, tmp< GeoField > field, PtrList< GeoField > &fieldList)
fvMatrix< scalar > fvScalarMatrix
dimensionedScalar negPart(const dimensionedScalar &ds)
const dimensionSet & dimVelocity
const dimensionSet & dimTime
VolField< scalar > volScalarField
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet & dimEnergy
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
dimensionedScalar posPart(const dimensionedScalar &ds)
PtrList< volScalarField > & Y