Skip to content
Permalink
Browse files

semiPermeableBaffle: Added mole-fraction and partial-pressure input o…

…ptions

The semiPermeableBaffleMassFraction boundary condition can now calculate
the mass flux as proportional to the difference in mole fraction or
partial pressure. A mass fraction difference driven transfer is also
still possible. An additional keyword, "input" has been added which is
used to select the variable used to calculate the transfer. An example
specification is as follows:

    baffle
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     membranePipe;
        c               0.1;
        input           massFraction;
        value           uniform 0;
    }

In order to facilitate this, a "W" method to get the molar mass on a
patch has been added to the thermodynamics. To avoid name-clashes,
methods that generate per-species molar masses have been renamed "Wi".

This work was supported by Georg Skillas, at Evonik
  • Loading branch information...
Will Bainbridge
Will Bainbridge committed Jul 6, 2018
1 parent e0cf970 commit 20653ee01e2238bad521568ebba6109d5614b4b5
Showing with 272 additions and 86 deletions.
  1. +11 −0 applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
  2. +3 −0 applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H
  3. +22 −0 ...vers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C
  4. +3 −0 ...vers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H
  5. +2 −2 ...m/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C
  6. +1 −1 ...e/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.C
  7. +2 −2 ...on/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C
  8. +2 −2 ...ian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C
  9. +2 −2 ...n/coalCombustion/submodels/surfaceReactionModel/COxidationIntrinsicRate/COxidationIntrinsicRate.C
  10. +2 −2 ...urfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C
  11. +2 −2 ...n/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C
  12. +1 −1 src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C
  13. +4 −4 src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C
  14. +1 −1 src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C
  15. +1 −1 ...lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C
  16. +1 −1 ...an/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C
  17. +1 −1 ...els/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C
  18. +1 −1 ...surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C
  19. +129 −9 ...FvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C
  20. +44 −10 ...FvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H
  21. +1 −27 .../derivedFvPatchFields/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C
  22. +0 −8 .../derivedFvPatchFields/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.H
  23. +3 −0 src/thermophysicalModels/basic/basicThermo/basicThermo.H
  24. +19 −0 src/thermophysicalModels/basic/heThermo/heThermo.C
  25. +3 −0 src/thermophysicalModels/basic/heThermo/heThermo.H
  26. +2 −2 ...diation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C
  27. +2 −2 ...diation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C
  28. +2 −2 src/thermophysicalModels/reactionThermo/functionObjects/moleFractions/moleFractions.C
  29. +1 −1 src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C
  30. +1 −1 src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H
  31. +1 −1 src/thermophysicalModels/reactionThermo/mixtures/basicSpecieMixture/basicSpecieMixture.H
  32. +2 −0 tutorials/combustion/reactingFoam/RAS/membrane/0/CH4.orig
@@ -313,6 +313,17 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::W() const
}


Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::W
(
const label patchi
) const
{
return
alpha1().boundaryField()[patchi]*thermo1_->W(patchi)
+ alpha2().boundaryField()[patchi]*thermo1_->W(patchi);
}


Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureThermo::nu() const
{
return mu()/(alpha1()*thermo1_->rho() + alpha2()*thermo2_->rho());
@@ -248,6 +248,9 @@ public:
//- Molecular weight [kg/kmol]
virtual tmp<volScalarField> W() const;

//- Molecular weight for patch [kg/kmol]
virtual tmp<scalarField> W(const label patchi) const;


// Fields derived from transport state variables

@@ -551,6 +551,28 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::W() const
}


Foam::tmp<Foam::scalarField> Foam::multiphaseMixtureThermo::W
(
const label patchi
) const
{
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();

tmp<scalarField> tW
(
phasei().boundaryField()[patchi]*phasei().thermo().W(patchi)
);

for (++phasei; phasei != phases_.end(); ++phasei)
{
tW.ref() +=
phasei().boundaryField()[patchi]*phasei().thermo().W(patchi);
}

return tW;
}


Foam::tmp<Foam::volScalarField> Foam::multiphaseMixtureThermo::nu() const
{
return mu()/rho();
@@ -379,6 +379,9 @@ public:
//- Molecular weight [kg/kmol]
virtual tmp<volScalarField> W() const;

//- Molecular weight for patch [kg/kmol]
virtual tmp<scalarField> W(const label patchi) const;


// Fields derived from transport state variables

@@ -165,7 +165,7 @@ update
(
"W",
dimMass/dimMoles,
this->thermo_.composition().W(species1Index_)
this->thermo_.composition().Wi(species1Index_)
)
);

@@ -177,7 +177,7 @@ update
(
"W",
dimMass/dimMoles,
this->thermo_.composition().W(species2Index_)
this->thermo_.composition().Wi(species2Index_)
)
);

@@ -36,7 +36,7 @@ wRatioByP() const
(
"W",
dimMass/dimMoles,
this->thermo_.composition().W(saturatedIndex_)
this->thermo_.composition().Wi(saturatedIndex_)
);

return Wi/this->thermo_.W()/this->thermo_.p();
@@ -52,8 +52,8 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
CsLocalId_ = owner.composition().localId(idSolid, "C");

// Set local copies of thermo properties
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WO2_ = owner.thermo().carrier().Wi(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;

HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
@@ -52,8 +52,8 @@ Foam::COxidationHurtMitchell<CloudType>::COxidationHurtMitchell
ashLocalId_ = owner.composition().localId(idSolid, "ash", true);

// Set local copies of thermo properties
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WO2_ = owner.thermo().carrier().Wi(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;

HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
@@ -58,8 +58,8 @@ Foam::COxidationIntrinsicRate<CloudType>::COxidationIntrinsicRate
CsLocalId_ = owner.composition().localId(idSolid, "C");

// Set local copies of thermo properties
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WO2_ = owner.thermo().carrier().Wi(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;

HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
@@ -53,8 +53,8 @@ COxidationKineticDiffusionLimitedRate
CsLocalId_ = owner.composition().localId(idSolid, "C");

// Set local copies of thermo properties
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WO2_ = owner.thermo().carrier().Wi(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;

HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
@@ -65,8 +65,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
CsLocalId_ = owner.composition().localId(idSolid, "C");

// Set local copies of thermo properties
WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WO2_ = owner.thermo().carrier().Wi(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_);
WC_ = WCO2 - WO2_;

HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
@@ -581,7 +581,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
{
const label id = composition.localToCarrierId(GAS, i);
const scalar Cp = composition.carrier().Cp(id, td.pc(), Ts);
const scalar W = composition.carrier().W(id);
const scalar W = composition.carrier().Wi(id);
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);

// Dab calc'd using API vapour mass diffusivity function
@@ -127,7 +127,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
const label cid = composition.localToCarrierId(idPhase, i);

const scalar Cp = composition.carrier().Cp(cid, td.pc(), Tsdash);
const scalar W = composition.carrier().W(cid);
const scalar W = composition.carrier().Wi(cid);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);

const scalar Dab =
@@ -311,7 +311,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues

forAll(Xinf, i)
{
Xinf[i] = thermo.carrier().Y(i)[this->cell()]/thermo.carrier().W(i);
Xinf[i] = thermo.carrier().Y(i)[this->cell()]/thermo.carrier().Wi(i);
}
Xinf /= sum(Xinf);

@@ -333,7 +333,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
const scalar Csi = Cs[i] + Xsff*Xinf[i]*CsTot;

Xs[i] = (2.0*Csi + Xinf[i]*CsTot)/3.0;
Ys[i] = Xs[i]*thermo.carrier().W(i);
Ys[i] = Xs[i]*thermo.carrier().Wi(i);
}
Xs /= sum(Xs);
Ys /= sum(Ys);
@@ -348,7 +348,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues

forAll(Ys, i)
{
const scalar W = thermo.carrier().W(i);
const scalar W = thermo.carrier().Wi(i);
const scalar sqrtW = sqrt(W);
const scalar cbrtW = cbrt(W);

@@ -245,7 +245,7 @@ Foam::scalarField Foam::CompositionModel<CloudType>::X
forAll(Y, i)
{
label cid = props.carrierIds()[i];
X[i] = Y[i]/thermo_.carrier().W(cid);
X[i] = Y[i]/thermo_.carrier().Wi(cid);
WInv += X[i];
}
break;
@@ -43,7 +43,7 @@ Foam::tmp<Foam::scalarField> Foam::LiquidEvaporation<CloudType>::calcXc
{
Xc[i] =
this->owner().thermo().carrier().Y()[i][celli]
/this->owner().thermo().carrier().W(i);
/this->owner().thermo().carrier().Wi(i);
}

return Xc/sum(Xc);
@@ -43,7 +43,7 @@ Foam::tmp<Foam::scalarField> Foam::LiquidEvaporationBoil<CloudType>::calcXc
{
Xc[i] =
this->owner().thermo().carrier().Y()[i][celli]
/this->owner().thermo().carrier().W(i);
/this->owner().thermo().carrier().Wi(i);
}

return Xc/sum(Xc);
@@ -124,7 +124,7 @@ void standardPhaseChange::correctModel
);

// Molecular weight of vapour [kg/kmol]
const scalar Wvap = thermo.carrier().W(vapId);
const scalar Wvap = thermo.carrier().Wi(vapId);

// Molecular weight of liquid [kg/kmol]
const scalar Wliq = filmThermo.W();
@@ -179,7 +179,7 @@ void waxSolventEvaporation::correctModel
);

// Molecular weight of vapour [kg/kmol]
const scalar Wvap = thermo.carrier().W(vapId);
const scalar Wvap = thermo.carrier().Wi(vapId);

const scalar Wwax = Wwax_.value();
const scalar Wsolvent = Wsolvent_.value();

0 comments on commit 20653ee

Please sign in to comment.
You can’t perform that action at this time.