combustionModels: Changed the construction order
The combustion and chemistry models no longer select and own the
thermodynamic model; they hold a reference instead. The construction of
the combustion and chemistry models has been changed to require a
reference to the thermodyanmics, rather than the mesh and a phase name.
At the solver-level the thermo, turbulence and combustion models are now
selected in sequence. The cyclic dependency between the three models has
been resolved, and the raw-pointer based post-construction step for the
combustion model has been removed.
The old solver-level construction sequence (typically in createFields.H)
was as follows:
autoPtr<combustionModels::psiCombustionModel> combustion
(
combustionModels::psiCombustionModel::New(mesh)
);
psiReactionThermo& thermo = combustion->thermo();
// Create rho, U, phi, etc...
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New(rho, U, phi, thermo)
);
combustion->setTurbulence(*turbulence);
The new sequence is:
autoPtr<psiReactionThermo> thermo(psiReactionThermo::New(mesh));
// Create rho, U, phi, etc...
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New(rho, U, phi, *thermo)
);
autoPtr<combustionModels::psiCombustionModel> combustion
(
combustionModels::psiCombustionModel::New(*thermo, *turbulence)
);
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,19 +32,18 @@ License
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(basicSolidChemistryModel, 0);
|
||||
defineRunTimeSelectionTable(basicSolidChemistryModel, fvMesh);
|
||||
defineRunTimeSelectionTable(basicSolidChemistryModel, thermo);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::basicSolidChemistryModel::basicSolidChemistryModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& phaseName
|
||||
solidReactionThermo& thermo
|
||||
)
|
||||
:
|
||||
basicChemistryModel(mesh, phaseName),
|
||||
solidThermo_(solidReactionThermo::New(mesh, phaseName))
|
||||
basicChemistryModel(thermo),
|
||||
solidThermo_(thermo)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user