28 #include "heatTransferModel.H" 34 template<
class BasePhaseSystem>
37 const phaseSystem::dmdtfTable& dmdtfs,
38 phaseSystem::heatTransferTable& eqns
67 const phasePairKey& key = dmdtfIter.key();
68 const phasePair& pair(this->phasePairs_[key]);
74 const phaseModel& phase1 = pair.phase1();
75 const phaseModel& phase2 = pair.phase2();
76 const rhoThermo& thermo1 = phase1.thermo();
77 const rhoThermo& thermo2 = phase2.thermo();
83 if (heatTransferModels_.found(key))
93 *eqns[phase1.name()] += dmdtf*hef1;
94 *eqns[phase2.name()] -= dmdtf*hef2;
101 *eqns[phase1.name()] += H1Fac*dmdtf*L;
102 *eqns[phase2.name()] += (1 - H1Fac)*dmdtf*L;
105 *eqns[phase1.name()] += dmdtf21*
K2 + dmdtf12*
K1;
106 *eqns[phase2.name()] -= dmdtf12*K1 + dmdtf21*
K2;
115 *eqns[phase1.name()] += dmdtf21*he2 +
fvm::Sp(dmdtf12, he1);
116 *eqns[phase2.name()] -= dmdtf12*he1 +
fvm::Sp(dmdtf21, he2);
119 *eqns[phase1.name()] += dmdtf21*
K2 + dmdtf12*
K1;
120 *eqns[phase2.name()] -= dmdtf12*K1 + dmdtf21*
K2;
126 template<
class BasePhaseSystem>
129 const phaseSystem::dmidtfTable& dmidtfs,
130 phaseSystem::heatTransferTable& eqns
137 const phasePairKey& key = dmidtfIter.key();
138 const phasePair& pair(this->phasePairs_[key]);
140 const phaseModel& phase1 = pair.phase1();
141 const phaseModel& phase2 = pair.phase2();
142 const rhoThermo& thermo1 = phase1.thermo();
143 const rhoThermo& thermo2 = phase2.thermo();
149 if (heatTransferModels_.found(key))
170 HashPtrTable<volScalarField>,
175 const word& member = dmidtfJter.key();
186 if (isA<rhoReactionThermo>(thermo1))
188 const basicSpecieMixture& composition1 =
193 composition1.species()[member],
201 composition1.Hf(composition1.species()[member])
205 if (isA<rhoReactionThermo>(thermo2))
207 const basicSpecieMixture& composition2 =
212 composition2.species()[member],
220 composition2.Hf(composition2.species()[member])
228 *eqns[phase1.name()] += dmidtf*hefi1;
229 *eqns[phase2.name()] -= dmidtf*hefi2;
232 *eqns[phase1.name()] += H1Fac*dmidtf*Li;
233 *eqns[phase2.name()] += (1 - H1Fac)*dmidtf*Li;
236 *eqns[phase1.name()] += dmidtf21*
K2 + dmidtf12*
K1;
237 *eqns[phase2.name()] -= dmidtf12*K1 + dmidtf21*
K2;
249 HashPtrTable<volScalarField>,
254 const word& member = dmidtfJter.key();
265 if (isA<rhoReactionThermo>(thermo1))
267 const basicSpecieMixture& composition1 =
272 composition1.species()[member],
278 if (isA<rhoReactionThermo>(thermo2))
280 const basicSpecieMixture& composition2 =
285 composition2.species()[member],
292 *eqns[phase1.name()] += dmidtf21*hei2 +
fvm::Sp(dmidtf12, he1);
293 *eqns[phase2.name()] -= dmidtf12*hei1 +
fvm::Sp(dmidtf21, he2);
296 *eqns[phase1.name()] += dmidtf21*
K2 + dmidtf12*
K1;
297 *eqns[phase2.name()] -= dmidtf12*K1 + dmidtf21*
K2;
306 template<
class BasePhaseSystem>
313 BasePhaseSystem(mesh)
315 this->generatePairsAndSubModels
325 heatTransferModelTable,
327 heatTransferModelIter
330 const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()];
332 if (!heatTransferModels_[pair].first().valid())
335 <<
"A heat transfer model for the " << pair.phase1().name()
336 <<
" side of the " << pair <<
" pair is not specified" 339 if (!heatTransferModels_[pair].second().valid())
342 <<
"A heat transfer model for the " << pair.phase2().name()
343 <<
" side of the " << pair <<
" pair is not specified" 351 heatTransferModelTable,
353 heatTransferModelIter
356 const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()];
369 this->
mesh().time().timeName(),
383 template<
class BasePhaseSystem>
391 template<
class BasePhaseSystem>
396 autoPtr<phaseSystem::heatTransferTable> eqnsPtr
405 const phaseModel& phase = this->phaseModels_[
phasei];
442 heatTransferModelTable,
444 heatTransferModelIter
447 const phasePair& pair
449 this->phasePairs_[heatTransferModelIter.key()]
452 const phaseModel& phase1 = pair.phase1();
453 const phaseModel& phase2 = pair.phase2();
465 *eqns[phase1.name()] +=
466 HEff*(phase2.thermo().T() - phase1.thermo().T())
467 + H1/Cpv1*he1 -
fvm::Sp(H1/Cpv1, he1);
468 *eqns[phase2.name()] +=
469 HEff*(phase1.thermo().T() - phase2.thermo().T())
470 + H2/Cpv2*he2 -
fvm::Sp(H2/Cpv2, he2);
477 template<
class BasePhaseSystem>
481 BasePhaseSystem::correctEnergyTransport();
487 template<
class BasePhaseSystem>
493 heatTransferModelTable,
495 heatTransferModelIter
498 const phasePair& pair = this->phasePairs_[heatTransferModelIter.key()];
500 const phaseModel& phase1 = pair.phase1();
501 const phaseModel& phase2 = pair.phase2();
512 Tf = (H1*T1 + H2*T2)/
max(H1 + H2, HSmall);
514 Info<<
"Tf." << pair.name()
515 <<
": min = " <<
min(Tf.primitiveField())
516 <<
", mean = " <<
average(Tf.primitiveField())
517 <<
", max = " <<
max(Tf.primitiveField())
523 template<
class BasePhaseSystem>
fvMatrix< scalar > fvScalarMatrix
#define forAll(list, i)
Loop across all elements in list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
basicSpecieMixture & composition
static int compare(const Pair< word > &a, const Pair< word > &b)
Compare Pairs.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashPtrTable< fvScalarMatrix > heatTransferTable
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
CGAL::Exact_predicates_exact_constructions_kernel K
dimensionedScalar posPart(const dimensionedScalar &ds)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void correctInterfaceThermo()
Correct the interface thermodynamics.
mixture thermo2().correctRho(psi2 *(p_rgh - p_rgh_0))
static word groupName(Name name, const word &group)
void addDmidtHef(const phaseSystem::dmidtfTable &dmidtfs, phaseSystem::heatTransferTable &eqns) const
Add energy transfer terms which result from specie mass transfers.
virtual void correctInterfaceThermo()
Correct the interface thermodynamics.
mixture thermo1().correctRho(psi1 *(p_rgh - p_rgh_0))
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void addDmdtHefs(const phaseSystem::dmdtfTable &dmdtfs, phaseSystem::heatTransferTable &eqns) const
Add energy transfer terms which result from bulk mass transfers.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const dimensionSet dimEnergy
virtual autoPtr< phaseSystem::heatTransferTable > heatTransfer() const
Return the heat transfer matrices.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
virtual ~TwoResistanceHeatTransferPhaseSystem()
Destructor.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
virtual void correctEnergyTransport()
Correct the energy transport e.g. alphat and Tf.
Calculate the matrix for implicit and explicit sources.
dimensionedScalar negPart(const dimensionedScalar &ds)
TwoResistanceHeatTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
virtual bool read()
Read base phaseProperties dictionary.