applications/solvers/combustion: Moved the inertSpecie functionality into basicSpecieMixture
and renamed defaultSpecie as its mass fraction is derived from the sum of the mass fractions of all other species and it need not be inert but must be present everywhere, e.g. N2 in air/fuel combustion which can be involved in the production of NOx. The previous name inertSpecie in thermophysicalProperties is supported for backward compatibility.
This commit is contained in:
@ -11,11 +11,10 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
{
|
||||
radiation->correct();
|
||||
combustion->correct();
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex && composition.active(i))
|
||||
if (composition.solve(i))
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
@ -38,14 +37,10 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
YiEqn.solve("Yi");
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
composition.normalise();
|
||||
|
||||
volScalarField& he = thermo.he();
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -8,15 +8,6 @@ SLGThermo slgThermo(mesh, thermo);
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.properties().lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo.properties())
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
Info<< "Creating field rho\n" << endl;
|
||||
volScalarField rho
|
||||
(
|
||||
|
||||
@ -11,11 +11,10 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
{
|
||||
reaction->correct();
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex && composition.active(i))
|
||||
if (composition.solve(i))
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
@ -36,12 +35,8 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
YiEqn.solve("Yi");
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
composition.normalise();
|
||||
}
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -8,15 +8,6 @@ thermo.validate(args.executable(), "h", "e");
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.properties().lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo.properties())
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -8,15 +8,6 @@ thermo.validate(args.executable(), "h", "e");
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.properties().lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo.properties())
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
|
||||
@ -111,7 +111,7 @@ License
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex && composition.active(i))
|
||||
if (composition.solve(i))
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
|
||||
@ -1,24 +1,9 @@
|
||||
{
|
||||
reaction.correct();
|
||||
|
||||
tmp<volScalarField> Yt(nullptr);
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
Yt = tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject("Yt", runTime.timeName(), mesh),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex && composition.active(i))
|
||||
if (composition.solve(i))
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
@ -38,15 +23,8 @@
|
||||
YiEqn.solve("Yi");
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt.ref() += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
composition.normalise();
|
||||
}
|
||||
|
||||
@ -8,21 +8,6 @@
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
label inertIndex = -1;
|
||||
if (Y.size())
|
||||
{
|
||||
const word inertSpecie(thermo.properties().lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo.properties())
|
||||
<< "Inert specie " << inertSpecie
|
||||
<< " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
inertIndex = composition.species()[inertSpecie];
|
||||
}
|
||||
|
||||
volScalarField& rho = rhoFluid[i];
|
||||
volVectorField& U = UFluid[i];
|
||||
surfaceScalarField& phi = phiFluid[i];
|
||||
|
||||
@ -17,24 +17,9 @@ if (Y.size())
|
||||
{
|
||||
combustion->correct();
|
||||
|
||||
tmp<volScalarField> Yt(nullptr);
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
Yt = tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject("Yt", runTime.timeName(), mesh),
|
||||
mesh,
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex && composition.active(i))
|
||||
if (composition.solve(i))
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
@ -57,15 +42,8 @@ if (Y.size())
|
||||
YEqn.solve("Yi");
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt.ref() += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
if (Y.size())
|
||||
{
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
composition.normalise();
|
||||
}
|
||||
|
||||
@ -1,18 +1,3 @@
|
||||
label inertIndex = -1;
|
||||
if (Y.size())
|
||||
{
|
||||
const word inertSpecie(thermo.properties().lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo.properties())
|
||||
<< "Inert specie " << inertSpecie
|
||||
<< " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
inertIndex = composition.species()[inertSpecie];
|
||||
}
|
||||
|
||||
const volScalarField& T = thermo.T();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm();
|
||||
|
||||
@ -11,11 +11,10 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
|
||||
{
|
||||
combustion->correct();
|
||||
volScalarField Yt(0.0*Y[0]);
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex && composition.active(i))
|
||||
if (composition.solve(i))
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
@ -36,12 +35,8 @@ tmp<fv::convectionScheme<scalar>> mvConvection
|
||||
YEqn.solve("Yi");
|
||||
|
||||
fvOptions.correct(Yi);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
composition.normalise();
|
||||
}
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
const label inertIndex(composition.species()[inertSpecie]);
|
||||
|
||||
@ -10,15 +10,6 @@ SLGThermo slgThermo(mesh, thermo);
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
const word inertSpecie(thermo.properties().lookup("inertSpecie"));
|
||||
if (!composition.species().found(inertSpecie))
|
||||
{
|
||||
FatalIOErrorIn(args.executable().c_str(), thermo.properties())
|
||||
<< "Inert specie " << inertSpecie << " not found in available species "
|
||||
<< composition.species()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
volScalarField rho
|
||||
|
||||
@ -52,24 +52,13 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::MultiComponentPhaseModel
|
||||
"residualAlpha",
|
||||
dimless,
|
||||
fluid.mesh().solverDict("Yi")
|
||||
),
|
||||
inertIndex_(-1)
|
||||
)
|
||||
{
|
||||
const word inertSpecie
|
||||
(
|
||||
this->thermo_->properties().lookupOrDefault("inertSpecie", word::null)
|
||||
);
|
||||
|
||||
if (inertSpecie != word::null)
|
||||
{
|
||||
inertIndex_ = this->thermo_->composition().species()[inertSpecie];
|
||||
}
|
||||
|
||||
PtrList<volScalarField>& Y = this->thermo_->composition().Y();
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (i != inertIndex_ && this->thermo_->composition().active(i))
|
||||
if (this->thermo_->composition().solve(i))
|
||||
{
|
||||
const label j = YActive_.size();
|
||||
YActive_.resize(j + 1);
|
||||
@ -91,42 +80,7 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::~MultiComponentPhaseModel()
|
||||
template<class BasePhaseModel>
|
||||
void Foam::MultiComponentPhaseModel<BasePhaseModel>::correctSpecies()
|
||||
{
|
||||
volScalarField Yt
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("Yt", this->name()),
|
||||
this->fluid().mesh().time().timeName(),
|
||||
this->fluid().mesh()
|
||||
),
|
||||
this->fluid().mesh(),
|
||||
dimensionedScalar(dimless, 0)
|
||||
);
|
||||
|
||||
PtrList<volScalarField>& Yi = YRef();
|
||||
|
||||
forAll(Yi, i)
|
||||
{
|
||||
if (i != inertIndex_)
|
||||
{
|
||||
Yi[i].max(0);
|
||||
Yt += Yi[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (inertIndex_ != -1)
|
||||
{
|
||||
Yi[inertIndex_] = scalar(1) - Yt;
|
||||
Yi[inertIndex_].max(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(Yi, i)
|
||||
{
|
||||
Yi[i] /= Yt;
|
||||
}
|
||||
}
|
||||
|
||||
this->thermo_->composition().normalise();
|
||||
BasePhaseModel::correctSpecies();
|
||||
}
|
||||
|
||||
|
||||
@ -59,9 +59,6 @@ protected:
|
||||
//- Residual phase fraction
|
||||
dimensionedScalar residualAlpha_;
|
||||
|
||||
//- Inert species index
|
||||
label inertIndex_;
|
||||
|
||||
//- Pointer list to active species
|
||||
UPtrList<volScalarField> YActive_;
|
||||
|
||||
|
||||
@ -69,8 +69,8 @@ void singleStepCombustion<ThermoType>:: massAndAirStoichRatios()
|
||||
const scalar Wu = mixture_.specieThermos()[fuelIndex_].W();
|
||||
|
||||
stoicRatio_ =
|
||||
(mixture_.specieThermos()[inertIndex_].W()
|
||||
* specieStoichCoeffs_[inertIndex_]
|
||||
(mixture_.specieThermos()[mixture_.defaultSpecie()].W()
|
||||
* specieStoichCoeffs_[mixture_.defaultSpecie()]
|
||||
+ mixture_.specieThermos()[O2Index].W()
|
||||
* mag(specieStoichCoeffs_[O2Index]))
|
||||
/ (Wu*mag(specieStoichCoeffs_[fuelIndex_]));
|
||||
@ -166,7 +166,6 @@ singleStepCombustion<ThermoType>::singleStepCombustion
|
||||
specieStoichCoeffs_(mixture_.species().size(), 0.0),
|
||||
Yprod0_(mixture_.species().size(), 0.0),
|
||||
fres_(Yprod0_.size()),
|
||||
inertIndex_(mixture_.species()[thermo.properties().lookup("inertSpecie")]),
|
||||
fuelIndex_(mixture_.species()[thermo.properties().lookup("fuel")]),
|
||||
specieProd_(Yprod0_.size(), 1),
|
||||
wFuel_
|
||||
@ -312,7 +311,7 @@ void singleStepCombustion<ThermoType>::fresCorrect()
|
||||
forAll(reaction.rhs(), i)
|
||||
{
|
||||
const label speciei = reaction.rhs()[i].index;
|
||||
if (speciei != inertIndex_)
|
||||
if (speciei != mixture_.defaultSpecie())
|
||||
{
|
||||
forAll(fres_[speciei], celli)
|
||||
{
|
||||
|
||||
@ -83,9 +83,6 @@ protected:
|
||||
//- List of components residual
|
||||
PtrList<volScalarField> fres_;
|
||||
|
||||
//- Inert specie index
|
||||
label inertIndex_;
|
||||
|
||||
//- Fuel specie index
|
||||
label fuelIndex_;
|
||||
|
||||
@ -157,9 +154,6 @@ public:
|
||||
//- Return the list of components residual
|
||||
inline tmp<volScalarField> fres(const label index) const;
|
||||
|
||||
//- Return the inert specie index
|
||||
inline label inertIndex() const;
|
||||
|
||||
//- Return the fuel specie index
|
||||
inline label fuelIndex() const;
|
||||
|
||||
|
||||
@ -90,13 +90,6 @@ inline tmp<volScalarField> singleStepCombustion<ThermoType>::fres
|
||||
}
|
||||
|
||||
|
||||
template<class ThermoType>
|
||||
inline label singleStepCombustion<ThermoType>::inertIndex() const
|
||||
{
|
||||
return inertIndex_;
|
||||
}
|
||||
|
||||
|
||||
template<class ThermoType>
|
||||
inline label singleStepCombustion<ThermoType>::fuelIndex() const
|
||||
{
|
||||
|
||||
@ -44,10 +44,37 @@ Foam::basicSpecieMixture::basicSpecieMixture
|
||||
)
|
||||
:
|
||||
basicMixture(thermoDict, mesh, phaseName),
|
||||
phaseName_(phaseName),
|
||||
species_(specieNames),
|
||||
defaultSpecie_
|
||||
(
|
||||
species_.size()
|
||||
? (
|
||||
thermoDict.found("inertSpecie")
|
||||
? thermoDict.lookup("inertSpecie")
|
||||
: thermoDict.lookup("defaultSpecie")
|
||||
)
|
||||
: word("undefined")
|
||||
),
|
||||
defaultSpecieIndex_(-1),
|
||||
active_(species_.size(), true),
|
||||
Y_(species_.size())
|
||||
{
|
||||
if (species_.size())
|
||||
{
|
||||
if (species_.found(defaultSpecie_))
|
||||
{
|
||||
defaultSpecieIndex_ = species_[defaultSpecie_];
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(thermoDict)
|
||||
<< "default specie " << defaultSpecie_
|
||||
<< " not found in available species " << species_
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
tmp<volScalarField> tYdefault;
|
||||
|
||||
forAll(species_, i)
|
||||
@ -85,7 +112,10 @@ Foam::basicSpecieMixture::basicSpecieMixture
|
||||
// Read Ydefault if not already read
|
||||
if (!tYdefault.valid())
|
||||
{
|
||||
word YdefaultName(IOobject::groupName("Ydefault", phaseName));
|
||||
const word YdefaultName
|
||||
(
|
||||
IOobject::groupName("Ydefault", phaseName)
|
||||
);
|
||||
|
||||
IOobject timeIO
|
||||
(
|
||||
@ -147,8 +177,72 @@ Foam::basicSpecieMixture::basicSpecieMixture
|
||||
}
|
||||
}
|
||||
|
||||
// Do not enforce constraint of sum of mass fractions to equal 1 here
|
||||
// - not applicable to all models
|
||||
correctMassFractions();
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicSpecieMixture::correctMassFractions()
|
||||
{
|
||||
if (species_.size())
|
||||
{
|
||||
tmp<volScalarField> tYt
|
||||
(
|
||||
volScalarField::New
|
||||
(
|
||||
IOobject::groupName("Yt", phaseName_),
|
||||
Y_[0],
|
||||
calculatedFvPatchScalarField::typeName
|
||||
)
|
||||
);
|
||||
volScalarField& Yt = tYt.ref();
|
||||
|
||||
for (label i=1; i<Y_.size(); i++)
|
||||
{
|
||||
Yt += Y_[i];
|
||||
}
|
||||
|
||||
if (mag(max(Yt).value()) < rootVSmall)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Sum of mass fractions is zero for species " << species()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
forAll(Y_, i)
|
||||
{
|
||||
Y_[i] /= Yt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicSpecieMixture::normalise()
|
||||
{
|
||||
if (species_.size())
|
||||
{
|
||||
tmp<volScalarField> tYt
|
||||
(
|
||||
volScalarField::New
|
||||
(
|
||||
IOobject::groupName("Yt", phaseName_),
|
||||
Y_[0].mesh(),
|
||||
dimensionedScalar(dimless, 0)
|
||||
)
|
||||
);
|
||||
volScalarField& Yt = tYt.ref();
|
||||
|
||||
forAll(Y_, i)
|
||||
{
|
||||
if (solve(i))
|
||||
{
|
||||
Y_[i].max(scalar(0));
|
||||
Yt += Y_[i];
|
||||
}
|
||||
}
|
||||
|
||||
Y_[defaultSpecieIndex_] = scalar(1) - Yt;
|
||||
Y_[defaultSpecieIndex_].max(scalar(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -59,9 +59,21 @@ protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Phase-name
|
||||
const word& phaseName_;
|
||||
|
||||
//- Table of specie names
|
||||
speciesTable species_;
|
||||
|
||||
//- The name of the default specie
|
||||
// The mass fraction of which is derived from the other species
|
||||
// rather than solved.
|
||||
// Also used as the carrier specie in multicomponent diffusion
|
||||
word defaultSpecie_;
|
||||
|
||||
//- The index of the default specie
|
||||
label defaultSpecieIndex_;
|
||||
|
||||
//- List of specie active flags
|
||||
mutable List<bool> active_;
|
||||
|
||||
@ -69,6 +81,12 @@ protected:
|
||||
PtrList<volScalarField> Y_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Scale the mass fractions to sum to 1
|
||||
void correctMassFractions();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Run time type information
|
||||
@ -103,6 +121,9 @@ public:
|
||||
//- Does the mixture include this specie?
|
||||
inline bool contains(const word& specieName) const;
|
||||
|
||||
//- Return the index of the default specie
|
||||
inline label defaultSpecie() const;
|
||||
|
||||
//- Return true for active species
|
||||
inline bool active(label speciei) const;
|
||||
|
||||
@ -115,6 +136,10 @@ public:
|
||||
//- Set speciei inactive
|
||||
inline void setInactive(label speciei) const;
|
||||
|
||||
//- Return true if the specie should be solved for
|
||||
// i.e. active and not the default specie
|
||||
inline bool solve(label speciei) const;
|
||||
|
||||
//- Return the mass-fraction fields
|
||||
inline PtrList<volScalarField>& Y();
|
||||
|
||||
@ -133,6 +158,11 @@ public:
|
||||
//- Return the const mass-fraction field for a specie given by name
|
||||
inline const volScalarField& Y(const word& specieName) const;
|
||||
|
||||
//- Normalise the mass fractions
|
||||
// by clipping positive
|
||||
// and deriving the default specie mass fraction from the other species
|
||||
void normalise();
|
||||
|
||||
|
||||
// Specie properties
|
||||
|
||||
|
||||
@ -35,6 +35,12 @@ inline bool Foam::basicSpecieMixture::contains(const word& specieName) const
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::basicSpecieMixture::defaultSpecie() const
|
||||
{
|
||||
return defaultSpecieIndex_;
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::basicSpecieMixture::active(label speciei) const
|
||||
{
|
||||
return active_[speciei];
|
||||
@ -61,6 +67,12 @@ inline void Foam::basicSpecieMixture::setInactive(label speciei) const
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::basicSpecieMixture::solve(label speciei) const
|
||||
{
|
||||
return speciei != defaultSpecieIndex_ && active_[speciei];
|
||||
}
|
||||
|
||||
|
||||
inline Foam::PtrList<Foam::volScalarField>& Foam::basicSpecieMixture::Y()
|
||||
{
|
||||
return Y_;
|
||||
|
||||
@ -104,31 +104,6 @@ Foam::multiComponentMixture<ThermoType>::readSpeciesComposition
|
||||
}
|
||||
|
||||
|
||||
template<class ThermoType>
|
||||
void Foam::multiComponentMixture<ThermoType>::correctMassFractions()
|
||||
{
|
||||
// Multiplication by 1.0 changes Yt patches to "calculated"
|
||||
volScalarField Yt("Yt", 1.0*Y_[0]);
|
||||
|
||||
for (label n=1; n<Y_.size(); n++)
|
||||
{
|
||||
Yt += Y_[n];
|
||||
}
|
||||
|
||||
if (mag(max(Yt).value()) < rootVSmall)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Sum of mass fractions is zero for species " << this->species()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
forAll(Y_, n)
|
||||
{
|
||||
Y_[n] /= Yt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class ThermoType>
|
||||
|
||||
@ -85,9 +85,6 @@ private:
|
||||
const speciesTable& speciesTable_
|
||||
) const;
|
||||
|
||||
//- Correct the mass fractions to sum to 1
|
||||
void correctMassFractions();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ setInertY()
|
||||
y=${1%.*}
|
||||
phase=${1#*.}
|
||||
[ $y != "none" ] && arg="-set $y" || arg="-remove"
|
||||
runApplication -a foamDictionary -entry inertSpecie $arg \
|
||||
runApplication -a foamDictionary -entry defaultSpecie $arg \
|
||||
constant/thermophysicalProperties.$phase
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ species
|
||||
C3H8O
|
||||
);
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
air
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@ species
|
||||
C3H8O
|
||||
);
|
||||
|
||||
inertSpecie H2O;
|
||||
defaultSpecie H2O;
|
||||
|
||||
H2O
|
||||
{
|
||||
|
||||
@ -18,7 +18,7 @@ setInertY()
|
||||
* ) arg="-set $y";;
|
||||
esac
|
||||
|
||||
runApplication -a foamDictionary -entry inertSpecie $arg \
|
||||
runApplication -a foamDictionary -entry defaultSpecie $arg \
|
||||
constant/thermophysicalProperties.$phase
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
energy sensibleInternalEnergy;
|
||||
}
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
species
|
||||
(
|
||||
|
||||
@ -26,6 +26,8 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,6 +26,8 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,6 +26,8 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,6 +26,8 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,6 +26,8 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -31,7 +31,7 @@ species
|
||||
air
|
||||
);
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
#include "include/thermo.air"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
fuel CH4;
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
fuel CH4;
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGasGRI"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGasGRI"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGas"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGas"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGas"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGasGRI"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGasGRI"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGasGRI"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
energy sensibleEnthalpy;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGas"
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -30,7 +30,7 @@ thermoType
|
||||
|
||||
newFormat yes;
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
specie specie;
|
||||
}
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
#include "thermo.compressibleGas"
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie N2;
|
||||
defaultSpecie N2;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
#include "speciesThermo"
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
liquids
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
energy sensibleInternalEnergy;
|
||||
}
|
||||
|
||||
inertSpecie AIR;
|
||||
defaultSpecie AIR;
|
||||
|
||||
#include "thermo.gas"
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
energy sensibleInternalEnergy;
|
||||
}
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
species
|
||||
(
|
||||
|
||||
@ -32,7 +32,7 @@ species
|
||||
H2O
|
||||
);
|
||||
|
||||
inertSpecie H2O;
|
||||
defaultSpecie H2O;
|
||||
|
||||
"(mixture|H2O)"
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@ species
|
||||
water
|
||||
);
|
||||
|
||||
inertSpecie air;
|
||||
defaultSpecie air;
|
||||
|
||||
"(mixture|air)"
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@ species
|
||||
water
|
||||
);
|
||||
|
||||
inertSpecie water;
|
||||
defaultSpecie water;
|
||||
|
||||
"(mixture|water)"
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
species (TiO2);
|
||||
|
||||
inertSpecie TiO2;
|
||||
defaultSpecie TiO2;
|
||||
|
||||
TiO2
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
energy sensibleEnthalpy;
|
||||
}
|
||||
|
||||
inertSpecie Ar;
|
||||
defaultSpecie Ar;
|
||||
|
||||
#include "$FOAM_CASE/constant/thermo.vapor"
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ thermoType
|
||||
|
||||
species (TiO2 TiO2_s);
|
||||
|
||||
inertSpecie TiO2;
|
||||
defaultSpecie TiO2;
|
||||
|
||||
TiO2
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ thermoType
|
||||
energy sensibleEnthalpy;
|
||||
}
|
||||
|
||||
inertSpecie Ar;
|
||||
defaultSpecie Ar;
|
||||
|
||||
#include "$FOAM_CASE/constant/thermo.vapor"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user