Skip to content
Permalink
Browse files

combustionModel: Removed the deprecated "active" switch.

To switch-off combustion choose the "noCombustion" model selected with the name
"none" in the combustionProperties file:

combustionModel none;
  • Loading branch information...
Henry Weller
Henry Weller committed Jul 26, 2018
1 parent 932e017 commit d627582dd6b953b57547e292ec644597aff4d0df
Showing with 266 additions and 346 deletions.
  1. +67 −78 src/combustionModels/EDC/EDC.C
  2. +1 −4 src/combustionModels/FSD/FSD.C
  3. +20 −23 src/combustionModels/PaSR/PaSR.C
  4. +0 −2 src/combustionModels/combustionModel/combustionModel.C
  5. +0 −6 src/combustionModels/combustionModel/combustionModel.H
  6. +0 −6 src/combustionModels/combustionModel/combustionModelI.H
  7. +11 −15 src/combustionModels/diffusion/diffusion.C
  8. +10 −14 src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
  9. +20 −56 src/combustionModels/laminar/laminar.C
  10. +1 −3 src/combustionModels/noCombustion/noCombustion.C
  11. +98 −6 src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C
  12. +29 −0 src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H
  13. +0 −2 tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/constant/combustionProperties
  14. +0 −2 tutorials/combustion/fireFoam/LES/oppositeBurningPanels/constant/combustionProperties
  15. +0 −2 tutorials/combustion/fireFoam/LES/smallPoolFire2D/constant/combustionProperties
  16. +0 −2 tutorials/combustion/fireFoam/LES/smallPoolFire3D/constant/combustionProperties
  17. +0 −2 tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/constant/combustionProperties
  18. +0 −2 tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/constant/combustionProperties
  19. +0 −7 tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/constant/combustionProperties
  20. +0 −7 tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/constant/combustionProperties
  21. +0 −7 ...ials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS_GRI_TDAC/constant/combustionProperties
  22. +0 −7 tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI/constant/combustionProperties
  23. +0 −7 tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC/constant/combustionProperties
  24. +0 −3 tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/constant/gas/combustionProperties
  25. +0 −2 tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/combustionProperties
  26. +0 −7 tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/constant/combustionProperties
  27. +1 −9 tutorials/lagrangian/reactingParcelFoam/cylinder/constant/combustionProperties
  28. +1 −7 tutorials/lagrangian/reactingParcelFoam/filter/constant/combustionProperties
  29. +1 −7 tutorials/lagrangian/reactingParcelFoam/hotBoxes/constant/combustionProperties
  30. +1 −7 tutorials/lagrangian/reactingParcelFoam/parcelInBox/constant/combustionProperties
  31. +1 −7 tutorials/lagrangian/reactingParcelFoam/rivuletPanel/constant/combustionProperties
  32. +1 −7 tutorials/lagrangian/reactingParcelFoam/splashPanel/constant/combustionProperties
  33. +1 −7 tutorials/lagrangian/reactingParcelFoam/verticalChannel/constant/combustionProperties
  34. +1 −7 tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/constant/combustionProperties
  35. +1 −6 tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/constant/combustionProperties
  36. +0 −2 tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties
  37. +0 −8 ...e/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/combustionProperties.gas
@@ -82,95 +82,92 @@ Foam::combustionModels::EDC<ReactionThermo>::~EDC()
template<class ReactionThermo>
void Foam::combustionModels::EDC<ReactionThermo>::correct()
{
if (this->active())
{
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const volScalarField& epsilon = tepsilon();
tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const volScalarField& epsilon = tepsilon();

tmp<volScalarField> tmu(this->turbulence().mu());
const volScalarField& mu = tmu();
tmp<volScalarField> tmu(this->turbulence().mu());
const volScalarField& mu = tmu();

tmp<volScalarField> tk(this->turbulence().k());
const volScalarField& k = tk();
tmp<volScalarField> tk(this->turbulence().k());
const volScalarField& k = tk();

tmp<volScalarField> trho(this->rho());
const volScalarField& rho = trho();
tmp<volScalarField> trho(this->rho());
const volScalarField& rho = trho();

scalarField tauStar(epsilon.size(), 0);
scalarField tauStar(epsilon.size(), 0);

if (version_ == EDCversions::v2016)
{
tmp<volScalarField> ttc(this->chemistryPtr_->tc());
const volScalarField& tc = ttc();
if (version_ == EDCversions::v2016)
{
tmp<volScalarField> ttc(this->chemistryPtr_->tc());
const volScalarField& tc = ttc();

forAll(tauStar, i)
{
const scalar nu = mu[i]/(rho[i] + small);
forAll(tauStar, i)
{
const scalar nu = mu[i]/(rho[i] + small);

const scalar Da =
max(min(sqrt(nu/(epsilon[i] + small))/tc[i], 10), 1e-10);
const scalar Da =
max(min(sqrt(nu/(epsilon[i] + small))/tc[i], 10), 1e-10);

const scalar ReT = sqr(k[i])/(nu*epsilon[i] + small);
const scalar CtauI = min(C1_/(Da*sqrt(ReT + 1)), 2.1377);
const scalar ReT = sqr(k[i])/(nu*epsilon[i] + small);
const scalar CtauI = min(C1_/(Da*sqrt(ReT + 1)), 2.1377);

const scalar CgammaI =
max(min(C2_*sqrt(Da*(ReT + 1)), 5), 0.4082);
const scalar CgammaI =
max(min(C2_*sqrt(Da*(ReT + 1)), 5), 0.4082);

const scalar gammaL =
CgammaI*pow025(nu*epsilon[i]/(sqr(k[i]) + small));
const scalar gammaL =
CgammaI*pow025(nu*epsilon[i]/(sqr(k[i]) + small));

tauStar[i] = CtauI*sqrt(nu/(epsilon[i] + small));
tauStar[i] = CtauI*sqrt(nu/(epsilon[i] + small));

if (gammaL >= 1)
{
kappa_[i] = 1;
}
else
{
kappa_[i] =
max
if (gammaL >= 1)
{
kappa_[i] = 1;
}
else
{
kappa_[i] =
max
(
min
(
min
(
pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)),
1
),
0
);
}
pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)),
1
),
0
);
}
}
else
}
else
{
forAll(tauStar, i)
{
forAll(tauStar, i)
const scalar nu = mu[i]/(rho[i] + small);
const scalar gammaL =
Cgamma_*pow025(nu*epsilon[i]/(sqr(k[i]) + small));

tauStar[i] = Ctau_*sqrt(nu/(epsilon[i] + small));
if (gammaL >= 1)
{
kappa_[i] = 1;
}
else
{
const scalar nu = mu[i]/(rho[i] + small);
const scalar gammaL =
Cgamma_*pow025(nu*epsilon[i]/(sqr(k[i]) + small));

tauStar[i] = Ctau_*sqrt(nu/(epsilon[i] + small));
if (gammaL >= 1)
{
kappa_[i] = 1;
}
else
{
kappa_[i] =
max
kappa_[i] =
max
(
min
(
min
(
pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)),
1
),
0
);
}
pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)),
1
),
0
);
}
}

this->chemistryPtr_->solve(tauStar);
}

this->chemistryPtr_->solve(tauStar);
}


@@ -186,7 +183,7 @@ template<class ReactionThermo>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::EDC<ReactionThermo>::Qdot() const
{
tmp<volScalarField> tQdot
return tmp<volScalarField>
(
new volScalarField
(
@@ -199,17 +196,9 @@ Foam::combustionModels::EDC<ReactionThermo>::Qdot() const
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0)
kappa_*this->chemistryPtr_->Qdot()
)
);

if (this->active())
{
tQdot.ref() = kappa_*this->chemistryPtr_->Qdot();
}

return tQdot;
}


@@ -341,10 +341,7 @@ void FSD<ReactionThermo, ThermoType>::correct()
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);

if (this->active())
{
calculateSourceNorm();
}
calculateSourceNorm();
}


@@ -66,35 +66,32 @@ Foam::combustionModels::PaSR<ReactionThermo>::~PaSR()
template<class ReactionThermo>
void Foam::combustionModels::PaSR<ReactionThermo>::correct()
{
if (this->active())
{
laminar<ReactionThermo>::correct();
laminar<ReactionThermo>::correct();

tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const scalarField& epsilon = tepsilon();

tmp<volScalarField> tepsilon(this->turbulence().epsilon());
const scalarField& epsilon = tepsilon();
tmp<volScalarField> tmuEff(this->turbulence().muEff());
const scalarField& muEff = tmuEff();

tmp<volScalarField> tmuEff(this->turbulence().muEff());
const scalarField& muEff = tmuEff();
tmp<volScalarField> ttc(this->tc());
const scalarField& tc = ttc();

tmp<volScalarField> ttc(this->tc());
const scalarField& tc = ttc();
tmp<volScalarField> trho(this->rho());
const scalarField& rho = trho();

tmp<volScalarField> trho(this->rho());
const scalarField& rho = trho();
forAll(epsilon, i)
{
const scalar tk =
Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + small), 0));

forAll(epsilon, i)
if (tk > small)
{
kappa_[i] = tc[i]/(tc[i] + tk);
}
else
{
const scalar tk =
Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + small), 0));

if (tk > small)
{
kappa_[i] = tc[i]/(tc[i] + tk);
}
else
{
kappa_[i] = 1.0;
}
kappa_[i] = 1.0;
}
}
}
@@ -81,7 +81,6 @@ Foam::combustionModel::combustionModel
IOdictionary(createIOobject(thermo, combustionProperties)),
mesh_(thermo.p().mesh()),
turb_(turb),
active_(lookupOrDefault<Switch>("active", true)),
coeffs_(optionalSubDict(modelType + "Coeffs")),
modelType_(modelType)
{}
@@ -99,7 +98,6 @@ bool Foam::combustionModel::read()
{
if (regIOobject::read())
{
this->lookup("active") >> active_;
coeffs_ = optionalSubDict(modelType_ + "Coeffs");
return true;
}
@@ -77,9 +77,6 @@ protected:
//- Reference to the turbulence model
const compressibleTurbulenceModel& turb_;

//- Active
Switch active_;

//- Dictionary of the model
dictionary coeffs_;

@@ -138,9 +135,6 @@ public:
//- Return const access to phi
inline tmp<surfaceScalarField> phi() const;

//- Is combustion active?
inline const Switch& active() const;

//- Return const dictionary of the model
inline const dictionary& coeffs() const;

@@ -50,12 +50,6 @@ inline Foam::tmp<Foam::surfaceScalarField> Foam::combustionModel::phi() const
}


inline const Foam::Switch& Foam::combustionModel::active() const
{
return active_;
}


inline const Foam::dictionary& Foam::combustionModel::coeffs() const
{
return coeffs_;
@@ -69,25 +69,21 @@ void diffusion<ReactionThermo, ThermoType>::correct()
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);

if (this->active())
{
this->singleMixturePtr_->fresCorrect();
this->singleMixturePtr_->fresCorrect();

const label fuelI = this->singleMixturePtr_->fuelIndex();
const label fuelI = this->singleMixturePtr_->fuelIndex();

const volScalarField& YFuel =
this->thermo().composition().Y()[fuelI];
const volScalarField& YFuel = this->thermo().composition().Y()[fuelI];

if (this->thermo().composition().contains(oxidantName_))
{
const volScalarField& YO2 =
this->thermo().composition().Y(oxidantName_);
if (this->thermo().composition().contains(oxidantName_))
{
const volScalarField& YO2 =
this->thermo().composition().Y(oxidantName_);

this->wFuel_ ==
C_*this->turbulence().muEff()
*mag(fvc::grad(YFuel) & fvc::grad(YO2))
*pos0(YFuel)*pos0(YO2);
}
this->wFuel_ ==
C_*this->turbulence().muEff()
*mag(fvc::grad(YFuel) & fvc::grad(YO2))
*pos0(YFuel)*pos0(YO2);
}
}

@@ -67,25 +67,21 @@ void infinitelyFastChemistry<ReactionThermo, ThermoType>::correct()
this->wFuel_ ==
dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0);

if (this->active())
{
this->singleMixturePtr_->fresCorrect();
this->singleMixturePtr_->fresCorrect();

const label fuelI = this->singleMixturePtr_->fuelIndex();
const label fuelI = this->singleMixturePtr_->fuelIndex();

const volScalarField& YFuel =
this->thermo().composition().Y()[fuelI];
const volScalarField& YFuel = this->thermo().composition().Y()[fuelI];

const dimensionedScalar s = this->singleMixturePtr_->s();
const dimensionedScalar s = this->singleMixturePtr_->s();

if (this->thermo().composition().contains("O2"))
{
const volScalarField& YO2 = this->thermo().composition().Y("O2");
if (this->thermo().composition().contains("O2"))
{
const volScalarField& YO2 = this->thermo().composition().Y("O2");

this->wFuel_ ==
this->rho()/(this->mesh().time().deltaT()*C_)
*min(YFuel, YO2/s.value());
}
this->wFuel_ ==
this->rho()/(this->mesh().time().deltaT()*C_)
*min(YFuel, YO2/s.value());
}
}

0 comments on commit d627582

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