52 void Foam::fv::massDiffusionLimitedPhaseChange::readCoeffs
54 const dictionary&
dict
57 const phaseInterface interface(phase1_, phase2_);
59 const dictionary& interfaceCompositionDict =
60 dict.subDict(
"interfaceComposition");
62 checkInterfacialModelsDict<sidedInterfaceCompositionModel>
65 interfaceCompositionDict
68 interfaceCompositionModel_.reset
77 const dictionary& diffusiveMassTransferDict =
78 dict.subDict(
"diffusiveMassTransfer");
80 checkBlendedInterfacialModelsDict<blendedSidedDiffusiveMassTransferModel>
83 diffusiveMassTransferDict
86 diffusiveMassTransferModel_.reset
92 blendingDict<blendedSidedDiffusiveMassTransferModel>
95 diffusiveMassTransferDict
100 nIter_ =
dict.lookupOrDefault<
label>(
"nIter", 1);
104 Foam::wordList Foam::fv::massDiffusionLimitedPhaseChange::getSpecies()
const
110 const phaseModel& phase = i ? phase2_ : phase1_;
112 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
114 species.insert(interfaceCompositionModel_->modelInThe(phase).species());
117 return species.toc();
121 void Foam::fv::massDiffusionLimitedPhaseChange::correctMDot()
const
127 const phaseModel& phase = i ? phase2_ : phase1_;
128 const label s = i ? +1 : -1;
130 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
132 const interfaceCompositionModel& phaseIcm =
133 interfaceCompositionModel_->modelInThe(phase);
135 forAll(phaseIcm.species(), phaseIcmSpeciei)
137 const word& specieName = phaseIcm.species()[phaseIcmSpeciei];
138 const label speciei = phaseIcm.thermo().species()[specieName];
143 mDotSus_[i][phaseIcmSpeciei]
144 + mDotSps_[i][phaseIcmSpeciei]*phaseIcm.thermo().Y()[speciei]
156 const word& modelType,
163 fluid_(solver_.fluid),
164 phase1_(fluid_.phases()[phaseNames().
first()]),
165 phase2_(fluid_.phases()[phaseNames().
second()]),
166 interfaceCompositionModel_(nullptr),
167 diffusiveMassTransferModel_(nullptr),
183 pressureEquationIndex_(-1),
204 const phaseModel& phase = i ? phase2_ : phase1_;
206 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
209 interfaceCompositionModel_->modelInThe(phase);
217 const word& specieName = phaseIcm.
species()[phaseIcmSpeciei];
269 solver_.heatTransfer.Hs(phase1_, phase2_);
287 const word& specieName = species()[mDoti];
299 const phaseModel& phase = i ? phase2_ : phase1_;
300 const label s = i ? +1 : -1;
302 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
305 interfaceCompositionModel_->modelInThe(phase);
309 const label phaseIcmSpeciei = phaseIcm.
species()[specieName];
315 mDotSus_[i][phaseIcmSpeciei]
316 + mDotSps_[i][phaseIcmSpeciei]*phaseIcm.
thermo().
Y()[speciei]
335 && (&
rho == &phase1_.rho() || &
rho == &phase2_.rho())
336 && &eqn.
psi() == &solver_.p_rgh
341 if (pressureEquationIndex_ == 0) correctMDot();
342 pressureEquationIndex_ ++;
357 const label index = this->index(phaseNames(),
alpha.group());
360 multicomponentThermos(
false,
false);
365 if (mcThermos.
valid()[index] && mcThermos[index].containsSpecie(specieName))
368 if (!species().
found(specieName))
return;
373 const phaseModel& phase = i ? phase2_ : phase1_;
375 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
378 interfaceCompositionModel_->modelInThe(phase);
382 const label phaseIcmSpeciei = phaseIcm.
species()[specieName];
388 mDotSus_[i][phaseIcmSpeciei]
389 +
fvm::Sp(mDotSps_[i][phaseIcmSpeciei], eqn.
psi());
394 mDotSus_[i][phaseIcmSpeciei]
395 + mDotSps_[i][phaseIcmSpeciei]*phaseIcm.
thermo().
Y()[speciei];
416 solver_.heatTransfer.Hs(phase1_, phase2_, scalar(0));
432 const phaseModel& phase = i ? phase2_ : phase1_;
434 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
436 KPtrs[i].set(diffusiveMassTransferModel_->KinThe(phase).ptr());
443 const phaseModel& phase = i ? phase2_ : phase1_;
445 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
448 interfaceCompositionModel_->modelInThe(phase);
454 const word& specieName = phaseIcm.
species()[phaseIcmSpeciei];
459 phaseIcm.
D(specieName).ptr()
465 for (
label iteri = 0; iteri < nIter_; ++ iteri)
477 name() +
":mDotLPrime",
485 const phaseModel& phase = i ? phase2_ : phase1_;
486 const label s = i ? +1 : -1;
488 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
491 interfaceCompositionModel_->modelInThe(phase);
495 const word& specieName = phaseIcm.
species()[phaseIcmSpeciei];
497 const label mDoti = species()[specieName];
501 phaseIcm.
Yf(specieName, vifToVf(Ts_))
505 phaseIcm.
YfPrime(specieName, vifToVf(Ts_))
512 *Ds[i][phaseIcmSpeciei]
516 mDotL.
ref() += rhoKDL*(Yf - phaseIcm.
thermo().
Y()[speciei]);
517 mDotLPrime.
ref() += rhoKDL*YfPrime;
524 (H1*(Ts_ - T1) + H2*(Ts_ - T2) + mDotL)
525 /(
max(H1 + H2 + mDotLPrime, HSmall));
526 infoField(
"Ts", Ts_);
531 const phaseModel& phase = i ? phase2_ : phase1_;
533 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
536 interfaceCompositionModel_->modelInThe(phase);
538 phaseIcm.
update(vifToVf(Ts_));
545 const phaseModel& phase = i ? phase2_ : phase1_;
547 if (!interfaceCompositionModel_->haveModelInThe(phase))
continue;
550 interfaceCompositionModel_->modelInThe(phase);
554 const word& specieName = phaseIcm.
species()[phaseIcmSpeciei];
558 KPtrs[i]()*Ds[i][phaseIcmSpeciei]
563 phaseIcm.
Yf(specieName, vifToVf(Ts_))
566 mDotSus_[i][phaseIcmSpeciei] = phase.
rho()()*KD*Yf;
567 mDotSps_[i][phaseIcmSpeciei] = -phase.
rho()()*KD;
572 pressureEquationIndex_ = 0;
576 infoField(
"mDot", mDot_);
586 readCoeffs(coeffs(
dict));
587 reSetSpecies(getSpecies());
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh, PrimitiveField > > New(const word &name, const GeoMesh &mesh, const dimensionSet &, const PrimitiveField< Type > &)
Return a temporary field constructed from name, mesh,.
tmp< DimensionedField< Type, GeoMesh, Field > > T() const
Return the field transpose (only defined for second rank tensors)
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static word member(const word &name)
Return member (name without the extension)
void size(const label)
Override size to be inconsistent with allocated storage.
An ordered pair of two objects of type <Type> with first() and second() elements.
const Type & second() const
Return second.
const Type & first() const
Return first.
Class containing a pair of thermo references. Handles down-casting to more specific thermo types by c...
const Pair< bool > & valid() const
Access the validity flags.
static autoPtr< blendedSidedDiffusiveMassTransferModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const word & name() const
Return const reference to name.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Finite volume model abstract base class.
static const dictionary & coeffs(const word &modelType, const dictionary &)
Return the coefficients sub-dictionary for a given model type.
const fvMesh & mesh() const
Return const access to the mesh database.
const word & name() const
Return const access to the source name.
Model for mass-diffusion rate limited phase change between two phases.
virtual tmp< DimensionedField< scalar, fvMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
virtual void correct()
Correct the fvModel.
virtual tmp< DimensionedField< scalar, fvMesh > > mDot() const
Return the mass transfer rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< scalar > &eqn) const
Override the pressure equation to trigger correction of the.
virtual tmp< DimensionedField< scalar, fvMesh > > Tchange() const
Return the temperature at which the phases are considered to be.
massDiffusionLimitedPhaseChange(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
const Pair< word > & phaseNames() const
Return the names of the phases.
virtual void addSup(fvMatrix< scalar > &eqn) const
Add a source term to a field-less proxy equation.
Base class for phase change models.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Override the energy equation to add the phase change heat, or.
void setSpecies(const word &name, const word &modelType, const wordList &species)
Set the names of the transferring species.
bool found(const word &) const
Does the list contain the specified name.
static const dimensionSet dimK
Coefficient dimensions.
Generic base class for interface composition models. These models describe the composition in phase 1...
tmp< volScalarField > D(const word &speciesName) const
Mass diffusivity.
virtual tmp< volScalarField > Yf(const word &speciesName, const volScalarField &Tf) const =0
Interface mass fraction.
virtual void update(const volScalarField &Tf)=0
Update the composition.
const rhoFluidMulticomponentThermo & thermo() const
Return the thermo.
const hashedWordList & species() const
Return the transferring species names.
virtual tmp< volScalarField > YfPrime(const word &speciesName, const volScalarField &Tf) const =0
The interface mass fraction derivative w.r.t. temperature.
virtual const speciesTable & species() const =0
Return the table of species.
virtual PtrList< volScalarField > & Y()=0
Access the mass-fraction fields.
virtual const volScalarField & rho() const =0
Return the density field.
static autoPtr< sidedInterfaceCompositionModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface)
Abstract base class for run-time selectable region solvers.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
word capitalise() const
Return the word with the first letter capitalised.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Calculate the matrix for implicit and explicit sources.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const VolField< Type > &)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
UPtrList< const dictionary > modelSubDicts(const dictionary &dict, const wordHashSet &ignoreKeys=wordHashSet())
const dimensionSet & dimVolume
labelList second(const UList< labelPair > &p)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
UPtrList< const dictionary > blendedModelSubDicts(const dictionary &dict, const wordHashSet &ignoreKeys=wordHashSet())
labelList first(const UList< labelPair > &p)
const dimensionSet & dimTime
const dimensionSet & dimDensity
const T & NullObjectRef()
Return const reference to the nullObject of type T.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
HashSet wordHashSet
A HashSet with word keys.
const dimensionSet & dimEnergy
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
const dimensionSet & dimTemperature
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
fluidMulticomponentThermo & thermo