TDACChemistryModel: Added support for multiphase
Patch contributed by Timo Niemi, VTT. Resolves patch request https://bugs.openfoam.org/view.php?id=2753
This commit is contained in:
@ -54,7 +54,7 @@ Foam::TDACChemistryModel<CompType, ThermoType>::TDACChemistryModel
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"TabulationResults",
|
||||
IOobject::groupName("TabulationResults", phaseName),
|
||||
this->time().timeName(),
|
||||
this->mesh(),
|
||||
IOobject::NO_READ,
|
||||
@ -75,7 +75,7 @@ Foam::TDACChemistryModel<CompType, ThermoType>::TDACChemistryModel
|
||||
|
||||
forAll(specieComp_, i)
|
||||
{
|
||||
specieComp_[i] = specComp[this->Y()[i].name()];
|
||||
specieComp_[i] = specComp[this->Y()[i].member()];
|
||||
}
|
||||
|
||||
mechRed_ = chemistryReductionMethod<CompType, ThermoType>::New
|
||||
|
||||
@ -45,12 +45,12 @@ template<class CompType, class ThermoType>
|
||||
inline Foam::autoPtr<Foam::OFstream>
|
||||
Foam::TDACChemistryModel<CompType, ThermoType>::logFile(const word& name) const
|
||||
{
|
||||
mkDir(this->mesh().time().path()/"TDAC");
|
||||
mkDir(this->mesh().time().path()/"TDAC"/this->group());
|
||||
return autoPtr<OFstream>
|
||||
(
|
||||
new OFstream
|
||||
(
|
||||
this->mesh().time().path()/"TDAC"/name
|
||||
this->mesh().time().path()/"TDAC"/this->group()/name
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -91,7 +91,7 @@ Foam::chemistryReductionMethods::DAC<CompType, ThermoType>::DAC
|
||||
dictionary initSet = this->coeffsDict_.subDict("initialSet");
|
||||
for (label i=0; i<chemistry.nSpecie(); i++)
|
||||
{
|
||||
if (initSet.found(chemistry.Y()[i].name()))
|
||||
if (initSet.found(chemistry.Y()[i].member()))
|
||||
{
|
||||
searchInitSet_[j++] = i;
|
||||
}
|
||||
@ -160,23 +160,23 @@ Foam::chemistryReductionMethods::DAC<CompType, ThermoType>::DAC
|
||||
Info<< "element not considered"<<endl;
|
||||
}
|
||||
}
|
||||
if (this->chemistry_.Y()[i].name() == CO2Name_)
|
||||
if (this->chemistry_.Y()[i].member() == CO2Name_)
|
||||
{
|
||||
CO2Id_ = i;
|
||||
}
|
||||
else if (this->chemistry_.Y()[i].name() == COName_)
|
||||
else if (this->chemistry_.Y()[i].member() == COName_)
|
||||
{
|
||||
COId_ = i;
|
||||
}
|
||||
else if (this->chemistry_.Y()[i].name() == HO2Name_)
|
||||
else if (this->chemistry_.Y()[i].member() == HO2Name_)
|
||||
{
|
||||
HO2Id_ = i;
|
||||
}
|
||||
else if (this->chemistry_.Y()[i].name() == H2OName_)
|
||||
else if (this->chemistry_.Y()[i].member() == H2OName_)
|
||||
{
|
||||
H2OId_ = i;
|
||||
}
|
||||
else if (this->chemistry_.Y()[i].name() == NOName_)
|
||||
else if (this->chemistry_.Y()[i].member() == NOName_)
|
||||
{
|
||||
NOId_ = i;
|
||||
}
|
||||
@ -230,7 +230,7 @@ Foam::chemistryReductionMethods::DAC<CompType, ThermoType>::DAC
|
||||
fuelSpeciesProp_[i] = readScalar(fuelDict.lookup(fuelSpecies_[i]));
|
||||
for (label j=0; j<this->nSpecie_; j++)
|
||||
{
|
||||
if (this->chemistry_.Y()[j].name() == fuelSpecies_[i])
|
||||
if (this->chemistry_.Y()[j].member() == fuelSpecies_[i])
|
||||
{
|
||||
fuelSpeciesID_[i] = j;
|
||||
break;
|
||||
@ -496,8 +496,8 @@ void Foam::chemistryReductionMethods::DAC<CompType, ThermoType>::reduceMechanism
|
||||
// Complete combustion products are not considered
|
||||
if
|
||||
(
|
||||
this->chemistry_.Y()[i].name() == "CO2"
|
||||
|| this->chemistry_.Y()[i].name() == "H2O"
|
||||
this->chemistry_.Y()[i].member() == "CO2"
|
||||
|| this->chemistry_.Y()[i].member() == "H2O"
|
||||
)
|
||||
{
|
||||
continue;
|
||||
@ -505,7 +505,7 @@ void Foam::chemistryReductionMethods::DAC<CompType, ThermoType>::reduceMechanism
|
||||
Na[0] += sC_[i]*c[i];
|
||||
Na[1] += sH_[i]*c[i];
|
||||
Na[2] += sO_[i]*c[i];
|
||||
if (sC_[i]>nbCLarge_ || this->chemistry_.Y()[i].name() == "O2")
|
||||
if (sC_[i]>nbCLarge_ || this->chemistry_.Y()[i].member() == "O2")
|
||||
{
|
||||
Nal[0] += sC_[i]*c[i];
|
||||
Nal[1] += sH_[i]*c[i];
|
||||
|
||||
@ -41,7 +41,7 @@ Foam::chemistryReductionMethods::DRG<CompType, ThermoType>::DRG
|
||||
dictionary initSet = this->coeffsDict_.subDict("initialSet");
|
||||
for (label i=0; i<chemistry.nSpecie(); i++)
|
||||
{
|
||||
if (initSet.found(chemistry.Y()[i].name()))
|
||||
if (initSet.found(chemistry.Y()[i].member()))
|
||||
{
|
||||
searchInitSet_[j++] = i;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ Foam::chemistryReductionMethods::DRGEP<CompType, ThermoType>::DRGEP
|
||||
dictionary initSet = this->coeffsDict_.subDict("initialSet");
|
||||
for (label i=0; i<chemistry.nSpecie(); i++)
|
||||
{
|
||||
if (initSet.found(chemistry.Y()[i].name()))
|
||||
if (initSet.found(chemistry.Y()[i].member()))
|
||||
{
|
||||
searchInitSet_[j++]=i;
|
||||
}
|
||||
@ -651,8 +651,8 @@ reduceMechanism
|
||||
{
|
||||
Info<< "Badly Conditioned rAB : " << rAB
|
||||
<< "species involved : "
|
||||
<<this->chemistry_.Y()[u].name() << ","
|
||||
<< this->chemistry_.Y()[otherSpec].name()
|
||||
<<this->chemistry_.Y()[u].member() << ","
|
||||
<< this->chemistry_.Y()[otherSpec].member()
|
||||
<< endl;
|
||||
rAB=1.0;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,7 +43,7 @@ Foam::chemistryReductionMethods::PFA<CompType, ThermoType>::PFA
|
||||
|
||||
for (label i=0; i<chemistry.nSpecie(); i++)
|
||||
{
|
||||
if (initSet.found(chemistry.Y()[i].name()))
|
||||
if (initSet.found(chemistry.Y()[i].member()))
|
||||
{
|
||||
searchInitSet_[j++] = i;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,7 @@ Foam::chemistryReductionMethod<CompType, ThermoType>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
IOobject::groupName("thermophysicalProperties",dict.group()),
|
||||
dict.db().time().constant(),
|
||||
dict.db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
|
||||
@ -84,7 +84,7 @@ Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::ISAT
|
||||
scalar otherScaleFactor = readScalar(scaleDict.lookup("otherSpecies"));
|
||||
for (label i=0; i<Ysize; i++)
|
||||
{
|
||||
if (!scaleDict.found(this->chemistry_.Y()[i].name()))
|
||||
if (!scaleDict.found(this->chemistry_.Y()[i].member()))
|
||||
{
|
||||
scaleFactor_[i] = otherScaleFactor;
|
||||
}
|
||||
@ -93,7 +93,7 @@ Foam::chemistryTabulationMethods::ISAT<CompType, ThermoType>::ISAT
|
||||
scaleFactor_[i] =
|
||||
readScalar
|
||||
(
|
||||
scaleDict.lookup(this->chemistry_.Y()[i].name())
|
||||
scaleDict.lookup(this->chemistry_.Y()[i].member())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ bool Foam::chemPointISAT<CompType, ThermoType>::inEOA(const scalarField& phiq)
|
||||
}
|
||||
else
|
||||
{
|
||||
propName = chemistry_.Y()[maxIndex].name();
|
||||
propName = chemistry_.Y()[maxIndex].member();
|
||||
}
|
||||
Info<< "Direction maximum impact to error in ellipsoid: "
|
||||
<< propName << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -40,7 +40,7 @@ Foam::chemistryTabulationMethod<CompType, ThermoType>::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
IOobject::groupName("thermophysicalProperties",dict.group()),
|
||||
dict.db().time().constant(),
|
||||
dict.db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
|
||||
Reference in New Issue
Block a user