mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
simplifying i-o for chemistry models + thermo
This commit is contained in:
@ -113,7 +113,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
rho = thermo->rho();
|
||||
rho = thermo.rho();
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
||||
@ -33,10 +33,12 @@ License
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::ODEChemistryModel<CompType, ThermoType>::ODEChemistryModel
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& compTypeName,
|
||||
const word& thermoTypeName
|
||||
)
|
||||
:
|
||||
CompType(mesh),
|
||||
CompType(mesh, thermoTypeName),
|
||||
|
||||
ODE(),
|
||||
|
||||
@ -55,7 +57,15 @@ Foam::ODEChemistryModel<CompType, ThermoType>::ODEChemistryModel
|
||||
nSpecie_(Y_.size()),
|
||||
nReaction_(reactions_.size()),
|
||||
|
||||
solver_(chemistrySolver<CompType, ThermoType>::New(*this)),
|
||||
solver_
|
||||
(
|
||||
chemistrySolver<CompType, ThermoType>::New
|
||||
(
|
||||
*this,
|
||||
compTypeName,
|
||||
thermoTypeName
|
||||
)
|
||||
),
|
||||
|
||||
RR_(nSpecie_)
|
||||
{
|
||||
|
||||
@ -110,7 +110,12 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
ODEChemistryModel(const fvMesh& mesh);
|
||||
ODEChemistryModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& compTypeName,
|
||||
const word& thermoTypeName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -57,9 +57,7 @@ Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh)
|
||||
mesh.nCells(),
|
||||
readScalar(lookup("initialChemicalTimeStep"))
|
||||
)
|
||||
{
|
||||
Info<< "basicChemistryModel(const fvMesh&)" << endl;
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,6 +34,8 @@ Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New
|
||||
)
|
||||
{
|
||||
word psiChemistryModelType;
|
||||
word thermoTypeName;
|
||||
word userSel;
|
||||
|
||||
// Enclose the creation of the chemistrtyProperties to ensure it is
|
||||
// deleted before the chemistrtyProperties is created otherwise the
|
||||
@ -51,25 +53,41 @@ Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New
|
||||
)
|
||||
);
|
||||
|
||||
chemistryPropertiesDict.lookup("psiChemistryModel") >>
|
||||
psiChemistryModelType;
|
||||
chemistryPropertiesDict.lookup("psiChemistryModel") >> userSel;
|
||||
|
||||
// construct chemistry model type name by inserting first template
|
||||
// argument
|
||||
label tempOpen = userSel.find('<');
|
||||
label tempClose = userSel.find('>');
|
||||
|
||||
word className = userSel(0, tempOpen);
|
||||
thermoTypeName = userSel(tempOpen + 1, tempClose - tempOpen - 1);
|
||||
|
||||
psiChemistryModelType =
|
||||
className + '<' + typeName + ',' + thermoTypeName + '>';
|
||||
}
|
||||
|
||||
Info<< "Selecting psiChemistryModel " << psiChemistryModelType << endl;
|
||||
Info<< "Selecting psiChemistryModel " << userSel << endl;
|
||||
|
||||
fvMeshConstructorTable::iterator cstrIter =
|
||||
fvMeshConstructorTablePtr_->find(psiChemistryModelType);
|
||||
|
||||
if (cstrIter == fvMeshConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("psiChemistryModelBase::New(const mesh&)")
|
||||
<< "Unknown psiChemistryModel type " << psiChemistryModelType
|
||||
<< nl << nl << "Valid psiChemistryModel types are:" << nl
|
||||
<< fvMeshConstructorTablePtr_->toc() << nl
|
||||
<< exit(FatalError);
|
||||
wordList models = fvMeshConstructorTablePtr_->toc();
|
||||
forAll(models, i)
|
||||
{
|
||||
models[i] = models[i].replace(typeName + ',', "");
|
||||
}
|
||||
|
||||
return autoPtr<psiChemistryModel>(cstrIter()(mesh));
|
||||
FatalErrorIn("psiChemistryModelBase::New(const mesh&)")
|
||||
<< "Unknown psiChemistryModel type " << userSel
|
||||
<< nl << nl << "Valid psiChemistryModel types are:" << nl
|
||||
<< models << nl << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<psiChemistryModel>
|
||||
(cstrIter()(mesh, typeName, thermoTypeName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,10 +38,14 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::psiChemistryModel::psiChemistryModel(const fvMesh& mesh)
|
||||
Foam::psiChemistryModel::psiChemistryModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& thermoTypeName
|
||||
)
|
||||
:
|
||||
basicChemistryModel(mesh),
|
||||
thermo_(hCombustionThermo::New(mesh))
|
||||
thermo_(hCombustionThermo::NewType(mesh, thermoTypeName))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -89,16 +89,18 @@ public:
|
||||
psiChemistryModel,
|
||||
fvMesh,
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& compTypeName,
|
||||
const word& thermoTypeName
|
||||
),
|
||||
(mesh)
|
||||
(mesh, compTypeName, thermoTypeName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
psiChemistryModel(const fvMesh& mesh);
|
||||
psiChemistryModel(const fvMesh& mesh, const word& thermoTypeName);
|
||||
|
||||
|
||||
//- Selector
|
||||
|
||||
@ -34,6 +34,8 @@ Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New
|
||||
)
|
||||
{
|
||||
word rhoChemistryModelType;
|
||||
word thermoTypeName;
|
||||
word userSel;
|
||||
|
||||
// Enclose the creation of the chemistrtyProperties to ensure it is
|
||||
// deleted before the chemistrtyProperties is created otherwise the
|
||||
@ -51,25 +53,41 @@ Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New
|
||||
)
|
||||
);
|
||||
|
||||
chemistryPropertiesDict.lookup("rhoChemistryModel") >>
|
||||
rhoChemistryModelType;
|
||||
chemistryPropertiesDict.lookup("rhoChemistryModelType") >> userSel;
|
||||
|
||||
// construct chemistry model type name by inserting first template
|
||||
// argument
|
||||
label tempOpen = userSel.find('<');
|
||||
label tempClose = userSel.find('>');
|
||||
|
||||
word className = userSel(0, tempOpen);
|
||||
thermoTypeName = userSel(tempOpen + 1, tempClose - tempOpen - 1);
|
||||
|
||||
rhoChemistryModelType =
|
||||
className + '<' + typeName + ',' + thermoTypeName + '>';
|
||||
}
|
||||
|
||||
Info<< "Selecting rhoChemistryModel " << rhoChemistryModelType << endl;
|
||||
Info<< "Selecting rhoChemistryModel " << userSel << endl;
|
||||
|
||||
fvMeshConstructorTable::iterator cstrIter =
|
||||
fvMeshConstructorTablePtr_->find(rhoChemistryModelType);
|
||||
|
||||
if (cstrIter == fvMeshConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("rhoChemistryModelBase::New(const mesh&)")
|
||||
<< "Unknown rhoChemistryModel type " << rhoChemistryModelType
|
||||
<< nl << nl << "Valid rhoChemistryModel types are:" << nl
|
||||
<< fvMeshConstructorTablePtr_->toc() << nl
|
||||
<< exit(FatalError);
|
||||
wordList models = fvMeshConstructorTablePtr_->toc();
|
||||
forAll(models, i)
|
||||
{
|
||||
models[i] = models[i].replace(typeName + ',', "");
|
||||
}
|
||||
|
||||
return autoPtr<rhoChemistryModel>(cstrIter()(mesh));
|
||||
FatalErrorIn("rhoChemistryModelBase::New(const mesh&)")
|
||||
<< "Unknown rhoChemistryModel type " << userSel
|
||||
<< nl << nl << "Valid rhoChemistryModel types are:" << nl
|
||||
<< models << nl << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<rhoChemistryModel>
|
||||
(cstrIter()(mesh, typeName, thermoTypeName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,10 +38,14 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rhoChemistryModel::rhoChemistryModel(const fvMesh& mesh)
|
||||
Foam::rhoChemistryModel::rhoChemistryModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& thermoTypeName
|
||||
)
|
||||
:
|
||||
basicChemistryModel(mesh),
|
||||
thermo_(hReactionThermo::New(mesh))
|
||||
thermo_(hReactionThermo::NewType(mesh, thermoTypeName))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -89,16 +89,18 @@ public:
|
||||
rhoChemistryModel,
|
||||
fvMesh,
|
||||
(
|
||||
const fvMesh& mesh
|
||||
const fvMesh& mesh,
|
||||
const word& compTypeName,
|
||||
const word& thermoTypeName
|
||||
),
|
||||
(mesh)
|
||||
(mesh, compTypeName, thermoTypeName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
rhoChemistryModel(const fvMesh& mesh);
|
||||
rhoChemistryModel(const fvMesh& mesh, const word& thermoTypeName);
|
||||
|
||||
|
||||
//- Selector
|
||||
|
||||
@ -33,11 +33,12 @@ License
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::EulerImplicit<CompType, ThermoType>::EulerImplicit
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
)
|
||||
:
|
||||
chemistrySolver<CompType, ThermoType>(model),
|
||||
coeffsDict_(model.subDict(typeName + "Coeffs")),
|
||||
chemistrySolver<CompType, ThermoType>(model, modelName),
|
||||
coeffsDict_(model.subDict(modelName + "Coeffs")),
|
||||
cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))),
|
||||
equil_(coeffsDict_.lookup("equilibriumRateLimiter"))
|
||||
{}
|
||||
|
||||
@ -75,7 +75,11 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
EulerImplicit(ODEChemistryModel<CompType, ThermoType>& chemistry);
|
||||
EulerImplicit
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -34,10 +34,12 @@ namespace Foam
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::chemistrySolver<CompType, ThermoType>::chemistrySolver
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
)
|
||||
:
|
||||
model_(model)
|
||||
model_(model),
|
||||
name_(modelName)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -65,6 +65,9 @@ protected:
|
||||
//- Reference to the chemistry model
|
||||
ODEChemistryModel<CompType, ThermoType>& model_;
|
||||
|
||||
//- Name of the chemistry solver
|
||||
const word name_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -79,22 +82,29 @@ public:
|
||||
chemistrySolver,
|
||||
dictionary,
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
),
|
||||
(model)
|
||||
(model, modelName)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
chemistrySolver(ODEChemistryModel<CompType, ThermoType>& model);
|
||||
chemistrySolver
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<chemistrySolver> New
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& compTypeName,
|
||||
const word& thermoTypeName
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -32,27 +32,48 @@ template<class CompType, class ThermoType>
|
||||
Foam::autoPtr<Foam::chemistrySolver<CompType, ThermoType> >
|
||||
Foam::chemistrySolver<CompType, ThermoType>::New
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& compTypeName,
|
||||
const word& thermoTypeName
|
||||
)
|
||||
{
|
||||
word chemistrySolverType(model.CompType::lookup("chemistrySolver"));
|
||||
word modelName(model.lookup("chemistrySolver"));
|
||||
|
||||
word chemistrySolverType =
|
||||
modelName + '<' + compTypeName + ',' + thermoTypeName + '>';
|
||||
|
||||
Info<< "Selecting chemistrySolver " << modelName << endl;
|
||||
|
||||
typename dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(chemistrySolverType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
wordList models = dictionaryConstructorTablePtr_->toc();
|
||||
forAll(models, i)
|
||||
{
|
||||
models[i] = models[i].replace
|
||||
(
|
||||
"chemistrySolver::New(const dictionary&, const ODEChemistryModel&)"
|
||||
) << "Unknown chemistrySolver type " << chemistrySolverType
|
||||
<< nl << nl
|
||||
<< "Valid chemistrySolver types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->toc() << nl
|
||||
<< exit(FatalError);
|
||||
'<' + compTypeName + ',' + thermoTypeName + '>',
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
return autoPtr<chemistrySolver<CompType, ThermoType> >(cstrIter()(model));
|
||||
FatalErrorIn
|
||||
(
|
||||
"chemistrySolver::New"
|
||||
"("
|
||||
"const ODEChemistryModel&, "
|
||||
"const word&, "
|
||||
"const word&"
|
||||
")"
|
||||
) << "Unknown chemistrySolver type " << modelName
|
||||
<< nl << nl << "Valid chemistrySolver types are:" << nl
|
||||
<< models << nl << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<chemistrySolver<CompType, ThermoType> >
|
||||
(cstrIter()(model, modelName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,11 +32,12 @@ License
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::ode<CompType, ThermoType>::ode
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
)
|
||||
:
|
||||
chemistrySolver<CompType, ThermoType>(model),
|
||||
coeffsDict_(model.subDict(typeName + "Coeffs")),
|
||||
chemistrySolver<CompType, ThermoType>(model, modelName),
|
||||
coeffsDict_(model.subDict(modelName + "Coeffs")),
|
||||
solverName_(coeffsDict_.lookup("ODESolver")),
|
||||
odeSolver_(ODESolver::New(solverName_, model)),
|
||||
eps_(readScalar(coeffsDict_.lookup("eps"))),
|
||||
|
||||
@ -78,7 +78,11 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
ode(ODEChemistryModel<CompType, ThermoType>& model);
|
||||
ode
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -32,11 +32,12 @@ License
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::sequential<CompType, ThermoType>::sequential
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
)
|
||||
:
|
||||
chemistrySolver<CompType, ThermoType>(model),
|
||||
coeffsDict_(model.subDict(typeName + "Coeffs")),
|
||||
chemistrySolver<CompType, ThermoType>(model, modelName),
|
||||
coeffsDict_(model.subDict(modelName + "Coeffs")),
|
||||
cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))),
|
||||
equil_(coeffsDict_.lookup("equilibriumRateLimiter"))
|
||||
{}
|
||||
|
||||
@ -78,7 +78,11 @@ public:
|
||||
|
||||
|
||||
//- Construct from components
|
||||
sequential(ODEChemistryModel<CompType, ThermoType>& model);
|
||||
sequential
|
||||
(
|
||||
ODEChemistryModel<CompType, ThermoType>& model,
|
||||
const word& modelName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
|
||||
@ -86,9 +86,18 @@ public:
|
||||
hCombustionThermo(const fvMesh&);
|
||||
|
||||
|
||||
//- Selector
|
||||
// Selectors
|
||||
|
||||
//- Standard selection based on fvMesh
|
||||
static autoPtr<hCombustionThermo> New(const fvMesh&);
|
||||
|
||||
//- Select and check that package contains 'thermoType'
|
||||
static autoPtr<hCombustionThermo> NewType
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& thermoType
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~hCombustionThermo();
|
||||
|
||||
@ -75,4 +75,66 @@ Foam::autoPtr<Foam::hCombustionThermo> Foam::hCombustionThermo::New
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::hCombustionThermo> Foam::hCombustionThermo::NewType
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& thermoType
|
||||
)
|
||||
{
|
||||
word hCombustionThermoTypeName;
|
||||
|
||||
// Enclose the creation of the thermophysicalProperties to ensure it is
|
||||
// deleted before the turbulenceModel is created otherwise the dictionary
|
||||
// is entered in the database twice
|
||||
{
|
||||
IOdictionary thermoDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
thermoDict.lookup("thermoType") >> hCombustionThermoTypeName;
|
||||
|
||||
if (hCombustionThermoTypeName.find(thermoType) == string::npos)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"autoPtr<hCombustionThermo> hCombustionThermo::NewType"
|
||||
"("
|
||||
"const fvMesh&, "
|
||||
"const word&"
|
||||
")"
|
||||
) << "Inconsistent thermo package selected:" << nl << nl
|
||||
<< hCombustionThermoTypeName << nl << nl << "Please select a "
|
||||
<< "thermo package based on " << thermoType << nl << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Selecting thermodynamics package " << hCombustionThermoTypeName
|
||||
<< endl;
|
||||
|
||||
fvMeshConstructorTable::iterator cstrIter =
|
||||
fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName);
|
||||
|
||||
if (cstrIter == fvMeshConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("hCombustionThermo::New(const fvMesh&)")
|
||||
<< "Unknown hCombustionThermo type "
|
||||
<< hCombustionThermoTypeName << nl << nl
|
||||
<< "Valid hCombustionThermo types are:" << nl
|
||||
<< fvMeshConstructorTablePtr_->toc() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<hCombustionThermo>(cstrIter()(mesh));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -86,9 +86,18 @@ public:
|
||||
hReactionThermo(const fvMesh&);
|
||||
|
||||
|
||||
//- Selector
|
||||
// Selectors
|
||||
|
||||
//- Standard selection based on fvMesh
|
||||
static autoPtr<hReactionThermo> New(const fvMesh&);
|
||||
|
||||
//- Select and check that package contains 'thermoType'
|
||||
static autoPtr<hReactionThermo> NewType
|
||||
(
|
||||
const fvMesh&,
|
||||
const word& thermoType
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~hReactionThermo();
|
||||
|
||||
@ -75,4 +75,66 @@ Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::New
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::NewType
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& thermoType
|
||||
)
|
||||
{
|
||||
word hReactionThermoTypeName;
|
||||
|
||||
// Enclose the creation of the thermophysicalProperties to ensure it is
|
||||
// deleted before the turbulenceModel is created otherwise the dictionary
|
||||
// is entered in the database twice
|
||||
{
|
||||
IOdictionary thermoDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermophysicalProperties",
|
||||
mesh.time().constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
thermoDict.lookup("thermoType") >> hReactionThermoTypeName;
|
||||
|
||||
if (hReactionThermoTypeName.find(thermoType) == string::npos)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"autoPtr<hReactionThermo> hReactionThermo::NewType"
|
||||
"("
|
||||
"const fvMesh&, "
|
||||
"const word&"
|
||||
")"
|
||||
) << "Inconsistent thermo package selected:" << nl << nl
|
||||
<< hReactionThermoTypeName << nl << nl << "Please select a "
|
||||
<< "thermo package based on " << thermoType << nl << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Selecting thermodynamics package " << hReactionThermoTypeName
|
||||
<< endl;
|
||||
|
||||
fvMeshConstructorTable::iterator cstrIter =
|
||||
fvMeshConstructorTablePtr_->find(hReactionThermoTypeName);
|
||||
|
||||
if (cstrIter == fvMeshConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("hReactionThermo::New(const fvMesh&)")
|
||||
<< "Unknown hReactionThermo type "
|
||||
<< hReactionThermoTypeName << nl << nl
|
||||
<< "Valid hReactionThermo types are:" << nl
|
||||
<< fvMeshConstructorTablePtr_->toc() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<hReactionThermo>(cstrIter()(mesh));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -15,11 +15,13 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
psiChemistryModel ODEChemistryModel<gasThermoPhysics>;
|
||||
|
||||
chemistry on;
|
||||
|
||||
turbulentReaction on;
|
||||
|
||||
chemistrySolver ODE;
|
||||
chemistrySolver ode;
|
||||
|
||||
initialChemicalTimeStep 1e-07;
|
||||
|
||||
@ -34,7 +36,7 @@ EulerImplicitCoeffs
|
||||
equilibriumRateLimiter off;
|
||||
}
|
||||
|
||||
ODECoeffs
|
||||
odeCoeffs
|
||||
{
|
||||
ODESolver SIBS;
|
||||
eps 0.05;
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hMixtureThermo<reactingMixture>;
|
||||
thermoType hPsiMixtureThermo<reactingMixture<gasThermoPhysics>>;
|
||||
|
||||
chemistryReader foamChemistryReader;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user