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:
Will Bainbridge
2017-11-23 16:57:12 +00:00
parent 17954fc173
commit 0ea0b7c407
84 changed files with 581 additions and 699 deletions

View File

@ -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
@ -72,8 +72,8 @@ protected:
// Protected data
//- Solid thermo package
autoPtr<solidReactionThermo> solidThermo_;
//- Solid thermo
solidReactionThermo& solidThermo_;
public:
@ -82,29 +82,29 @@ public:
TypeName("basicSolidChemistryModel");
//- Thermo type
typedef solidReactionThermo reactionThermo;
//- Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
basicSolidChemistryModel,
fvMesh,
(const fvMesh& mesh, const word& phaseName),
(mesh, phaseName)
thermo,
(solidReactionThermo& thermo),
(thermo)
);
// Constructors
//- Construct from mesh
basicSolidChemistryModel(const fvMesh& mesh, const word& phaseName);
//- Construct from thermo
basicSolidChemistryModel(solidReactionThermo& thermo);
//- Selector
static autoPtr<basicSolidChemistryModel> New
(
const fvMesh& mesh,
const word& phaseName=word::null
);
static autoPtr<basicSolidChemistryModel> New(solidReactionThermo& thermo);
//- Destructor