Skip to content

Commit 69a87c5

Browse files
author
Henry Weller
committed
reactingTwoPhaseEulerFoam: Added support for thermally-driven phase-change (boiling)
The interfacial temperature is assumed equal to the saturation temperature. Only a single species is considered volatile and the other species to not affect the mass-transfer.
1 parent 8e7c777 commit 69a87c5

File tree

7 files changed

+793
-288
lines changed

7 files changed

+793
-288
lines changed

applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.C

Lines changed: 0 additions & 264 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ License
2828
#include "BlendedInterfacialModel.H"
2929
#include "heatTransferModel.H"
3030
#include "massTransferModel.H"
31-
#include "interfaceCompositionModel.H"
3231

3332
#include "HashPtrTable.H"
3433

@@ -59,12 +58,6 @@ HeatAndMassTransferPhaseSystem
5958
massTransferModels_
6059
);
6160

62-
this->generatePairsAndSubModels
63-
(
64-
"interfaceComposition",
65-
interfaceCompositionModels_
66-
);
67-
6861
forAllConstIter
6962
(
7063
phaseSystem::phasePairTable,
@@ -332,263 +325,6 @@ Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::heatTransfer() const
332325
}
333326

334327

335-
template<class BasePhaseSystem>
336-
Foam::autoPtr<Foam::phaseSystem::massTransferTable>
337-
Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::massTransfer() const
338-
{
339-
// Create a mass transfer matrix for each species of each phase
340-
autoPtr<phaseSystem::massTransferTable> eqnsPtr
341-
(
342-
new phaseSystem::massTransferTable()
343-
);
344-
345-
phaseSystem::massTransferTable& eqns = eqnsPtr();
346-
347-
forAllConstIter
348-
(
349-
phaseSystem::phaseModelTable,
350-
this->phaseModels_,
351-
phaseModelIter
352-
)
353-
{
354-
const phaseModel& phase(phaseModelIter());
355-
356-
const PtrList<volScalarField>& Yi = phase.Y();
357-
358-
forAll(Yi, i)
359-
{
360-
eqns.insert
361-
(
362-
Yi[i].name(),
363-
new fvScalarMatrix(Yi[i], dimMass/dimTime)
364-
);
365-
}
366-
}
367-
368-
// Reset the interfacial mass flow rates
369-
forAllConstIter
370-
(
371-
phaseSystem::phasePairTable,
372-
this->phasePairs_,
373-
phasePairIter
374-
)
375-
{
376-
const phasePair& pair(phasePairIter());
377-
378-
if (pair.ordered())
379-
{
380-
continue;
381-
}
382-
383-
*dmdt_[pair] =
384-
*dmdtExplicit_[pair];
385-
386-
*dmdtExplicit_[pair] =
387-
dimensionedScalar("zero", dimDensity/dimTime, 0);
388-
}
389-
390-
// Sum up the contribution from each interface composition model
391-
forAllConstIter
392-
(
393-
interfaceCompositionModelTable,
394-
interfaceCompositionModels_,
395-
interfaceCompositionModelIter
396-
)
397-
{
398-
const interfaceCompositionModel& compositionModel
399-
(
400-
interfaceCompositionModelIter()
401-
);
402-
403-
const phasePair& pair
404-
(
405-
this->phasePairs_[interfaceCompositionModelIter.key()]
406-
);
407-
const phaseModel& phase = pair.phase1();
408-
const phaseModel& otherPhase = pair.phase2();
409-
const phasePairKey key(phase.name(), otherPhase.name());
410-
411-
const volScalarField& Tf(*Tf_[key]);
412-
413-
volScalarField& dmdtExplicit(*dmdtExplicit_[key]);
414-
volScalarField& dmdt(*dmdt_[key]);
415-
416-
scalar dmdtSign(Pair<word>::compare(dmdt_.find(key).key(), key));
417-
418-
const volScalarField K
419-
(
420-
massTransferModels_[key][phase.name()]->K()
421-
);
422-
423-
forAllConstIter
424-
(
425-
hashedWordList,
426-
compositionModel.species(),
427-
memberIter
428-
)
429-
{
430-
const word& member = *memberIter;
431-
432-
const word name
433-
(
434-
IOobject::groupName(member, phase.name())
435-
);
436-
437-
const word otherName
438-
(
439-
IOobject::groupName(member, otherPhase.name())
440-
);
441-
442-
const volScalarField KD
443-
(
444-
K*compositionModel.D(member)
445-
);
446-
447-
const volScalarField Yf
448-
(
449-
compositionModel.Yf(member, Tf)
450-
);
451-
452-
// Implicit transport through the phase
453-
*eqns[name] +=
454-
phase.rho()*KD*Yf
455-
- fvm::Sp(phase.rho()*KD, eqns[name]->psi());
456-
457-
// Sum the mass transfer rate
458-
dmdtExplicit += dmdtSign*phase.rho()*KD*Yf;
459-
dmdt -= dmdtSign*phase.rho()*KD*eqns[name]->psi();
460-
461-
// Explicit transport out of the other phase
462-
if (eqns.found(otherName))
463-
{
464-
*eqns[otherName] -=
465-
otherPhase.rho()*KD*compositionModel.dY(member, Tf);
466-
}
467-
}
468-
}
469-
470-
return eqnsPtr;
471-
}
472-
473-
474-
template<class BasePhaseSystem>
475-
void Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::correctThermo()
476-
{
477-
BasePhaseSystem::correctThermo();
478-
479-
// This loop solves for the interface temperatures, Tf, and updates the
480-
// interface composition models.
481-
//
482-
// The rate of heat transfer to the interface must equal the latent heat
483-
// consumed at the interface, i.e.:
484-
//
485-
// H1*(T1 - Tf) + H2*(T2 - Tf) == mDotL
486-
// == K*rho*(Yfi - Yi)*Li
487-
//
488-
// Yfi is likely to be a strong non-linear (typically exponential) function
489-
// of Tf, so the solution for the temperature is newton-accelerated
490-
491-
forAllConstIter
492-
(
493-
phaseSystem::phasePairTable,
494-
this->phasePairs_,
495-
phasePairIter
496-
)
497-
{
498-
const phasePair& pair(phasePairIter());
499-
500-
if (pair.ordered())
501-
{
502-
continue;
503-
}
504-
505-
const phasePairKey key12(pair.first(), pair.second(), true);
506-
const phasePairKey key21(pair.second(), pair.first(), true);
507-
508-
volScalarField H1(heatTransferModels_[pair][pair.first()]->K());
509-
volScalarField H2(heatTransferModels_[pair][pair.second()]->K());
510-
dimensionedScalar HSmall("small", heatTransferModel::dimK, SMALL);
511-
512-
volScalarField mDotL
513-
(
514-
IOobject
515-
(
516-
"mDotL",
517-
this->mesh().time().timeName(),
518-
this->mesh()
519-
),
520-
this->mesh(),
521-
dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0)
522-
);
523-
volScalarField mDotLPrime
524-
(
525-
IOobject
526-
(
527-
"mDotLPrime",
528-
this->mesh().time().timeName(),
529-
this->mesh()
530-
),
531-
this->mesh(),
532-
dimensionedScalar("zero", mDotL.dimensions()/dimTemperature, 0)
533-
);
534-
535-
volScalarField& Tf = *Tf_[pair];
536-
537-
// Add latent heats from forward and backward models
538-
if (interfaceCompositionModels_.found(key12))
539-
{
540-
interfaceCompositionModels_[key12]->addMDotL
541-
(
542-
massTransferModels_[pair][pair.first()]->K(),
543-
Tf,
544-
mDotL,
545-
mDotLPrime
546-
);
547-
}
548-
if (interfaceCompositionModels_.found(key21))
549-
{
550-
interfaceCompositionModels_[key21]->addMDotL
551-
(
552-
massTransferModels_[pair][pair.second()]->K(),
553-
Tf,
554-
mDotL,
555-
mDotLPrime
556-
);
557-
}
558-
559-
// Update the interface temperature by applying one step of newton's
560-
// method to the interface relation
561-
Tf -=
562-
(
563-
H1*(Tf - pair.phase1().thermo().T())
564-
+ H2*(Tf - pair.phase2().thermo().T())
565-
+ mDotL
566-
)
567-
/(
568-
max(H1 + H2 + mDotLPrime, HSmall)
569-
);
570-
571-
// Update the interface compositions
572-
if (interfaceCompositionModels_.found(key12))
573-
{
574-
interfaceCompositionModels_[key12]->update(Tf);
575-
}
576-
if (interfaceCompositionModels_.found(key21))
577-
{
578-
interfaceCompositionModels_[key21]->update(Tf);
579-
}
580-
581-
Tf.correctBoundaryConditions();
582-
583-
Info<< "Tf." << pair.name()
584-
<< ": min = " << min(Tf.internalField())
585-
<< ", mean = " << average(Tf.internalField())
586-
<< ", max = " << max(Tf.internalField())
587-
<< endl;
588-
}
589-
}
590-
591-
592328
template<class BasePhaseSystem>
593329
bool Foam::HeatAndMassTransferPhaseSystem<BasePhaseSystem>::read()
594330
{

applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/PhaseSystems/HeatAndMassTransferPhaseSystem/HeatAndMassTransferPhaseSystem.H

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ Class
2525
Foam::HeatAndMassTransferPhaseSystem
2626
2727
Description
28-
Class which models interfacial heat and mass transfer between a number of
29-
phases. Mass is transferred to or from a phase according to a composition
30-
model at the surface of another phase. Heat is transferred from a phase to
31-
an interfacial temperature. The interface temperature is calculated such
32-
that the net rate at which the heat is transferred to the interface is
33-
equal to the latent heat consumed by the mass transfer.
28+
Base class to support interfacial heat and mass transfer between a number
29+
of phases.
3430
3531
SourceFiles
3632
HeatAndMassTransferPhaseSystem.C
@@ -53,7 +49,6 @@ class BlendedInterfacialModel;
5349
class blendingMethod;
5450
class heatTransferModel;
5551
class massTransferModel;
56-
class interfaceCompositionModel;
5752

5853
/*---------------------------------------------------------------------------*\
5954
Class HeatAndMassTransferPhaseSystem Declaration
@@ -88,13 +83,6 @@ protected:
8883
phasePairKey::hash
8984
> massTransferModelTable;
9085

91-
typedef HashTable
92-
<
93-
autoPtr<interfaceCompositionModel>,
94-
phasePairKey,
95-
phasePairKey::hash
96-
> interfaceCompositionModelTable;
97-
9886

9987
// Protected data
10088

@@ -117,9 +105,6 @@ protected:
117105
//- Mass transfer models
118106
massTransferModelTable massTransferModels_;
119107

120-
//- Interface composition models
121-
interfaceCompositionModelTable interfaceCompositionModels_;
122-
123108

124109
public:
125110

@@ -151,10 +136,10 @@ public:
151136

152137
//- Return the mass transfer matrices
153138
virtual autoPtr<phaseSystem::massTransferTable>
154-
massTransfer() const;
139+
massTransfer() const = 0;
155140

156141
//- Correct the thermodynamics
157-
virtual void correctThermo();
142+
virtual void correctThermo() = 0;
158143

159144
//- Read base phaseProperties dictionary
160145
virtual bool read();

0 commit comments

Comments
 (0)