From 0ea0b7c407b6675cfc676b3d3b5d64d7ada30636 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 23 Nov 2017 16:57:12 +0000 Subject: [PATCH] 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 combustion ( combustionModels::psiCombustionModel::New(mesh) ); psiReactionThermo& thermo = combustion->thermo(); // Create rho, U, phi, etc... autoPtr turbulence ( compressible::turbulenceModel::New(rho, U, phi, thermo) ); combustion->setTurbulence(*turbulence); The new sequence is: autoPtr thermo(psiReactionThermo::New(mesh)); // Create rho, U, phi, etc... autoPtr turbulence ( compressible::turbulenceModel::New(rho, U, phi, *thermo) ); autoPtr combustion ( combustionModels::psiCombustionModel::New(*thermo, *turbulence) ); --- .../combustion/chemFoam/createFields.H | 12 +++--- .../combustion/fireFoam/createFields.H | 21 ++++------ .../combustion/reactingFoam/createFields.H | 23 +++++------ .../rhoReactingBuoyantFoam/createFields.H | 19 ++++----- .../rhoReactingFoam/createFields.H | 18 ++++----- .../coalChemistryFoam/createFields.H | 18 ++++----- .../reactingParcelFoam/createFields.H | 18 ++++----- .../simpleReactingParcelFoam/createFields.H | 18 ++++----- .../lagrangian/sprayFoam/createFields.H | 18 ++++----- .../MovingPhaseModel/MovingPhaseModel.H | 8 +++- .../ReactingPhaseModel/ReactingPhaseModel.C | 40 ++----------------- .../ThermoPhaseModel/ThermoPhaseModel.C | 34 ++++++---------- .../ThermoPhaseModel/ThermoPhaseModel.H | 10 ++--- .../phaseModel/phaseModel/phaseModels.C | 40 +++++++++---------- src/combustionModels/EDC/EDC.C | 18 ++++----- src/combustionModels/EDC/EDC.H | 6 +-- src/combustionModels/FSD/FSD.C | 28 ++++++------- src/combustionModels/FSD/FSD.H | 8 ++-- src/combustionModels/PaSR/PaSR.C | 18 ++++----- src/combustionModels/PaSR/PaSR.H | 6 +-- .../combustionModel/combustionModel.C | 26 +++++------- .../combustionModel/combustionModel.H | 20 ++++------ .../combustionModel/combustionModelI.H | 22 +--------- src/combustionModels/diffusion/diffusion.C | 18 ++++----- src/combustionModels/diffusion/diffusion.H | 8 ++-- .../infinitelyFastChemistry.C | 20 +++++----- .../infinitelyFastChemistry.H | 8 ++-- src/combustionModels/laminar/laminar.C | 10 ++--- src/combustionModels/laminar/laminar.H | 8 ++-- .../noCombustion/noCombustion.C | 10 ++--- .../noCombustion/noCombustion.H | 8 ++-- .../psiChemistryCombustion.C | 18 ++++++--- .../psiChemistryCombustion.H | 8 ++-- .../psiCombustionModel/psiCombustionModel.C | 10 ++--- .../psiCombustionModel/psiCombustionModel.H | 25 ++++++------ .../psiCombustionModelNew.C | 16 ++++---- .../psiThermoCombustion/psiThermoCombustion.C | 14 +++---- .../psiThermoCombustion/psiThermoCombustion.H | 10 ++--- .../rhoChemistryCombustion.C | 12 +++--- .../rhoChemistryCombustion.H | 8 ++-- .../rhoCombustionModel/rhoCombustionModel.C | 10 ++--- .../rhoCombustionModel/rhoCombustionModel.H | 25 ++++++------ .../rhoCombustionModelNew.C | 16 ++++---- .../rhoThermoCombustion/rhoThermoCombustion.C | 14 +++---- .../rhoThermoCombustion/rhoThermoCombustion.H | 10 ++--- .../singleStepCombustion.C | 16 ++++---- .../singleStepCombustion.H | 8 ++-- .../zoneCombustion/zoneCombustion.C | 24 ++++------- .../zoneCombustion/zoneCombustion.H | 12 +++--- .../pyrolysisModels/noPyrolysis/noPyrolysis.C | 13 ++++-- .../pyrolysisModels/noPyrolysis/noPyrolysis.H | 8 ++-- .../reactingOneDim/reactingOneDim.C | 40 +++++++++---------- .../reactingOneDim/reactingOneDim.H | 6 +-- .../TDACChemistryModel/TDACChemistryModel.C | 21 +++++----- .../TDACChemistryModel/TDACChemistryModel.H | 8 +--- .../basicChemistryModel/basicChemistryModel.C | 22 +++++----- .../basicChemistryModel/basicChemistryModel.H | 14 ++++--- .../basicChemistryModelTemplates.C | 35 ++++++++-------- .../chemistryModel/chemistryModel.C | 11 +++-- .../chemistryModel/chemistryModel.H | 5 ++- .../psiChemistryModel/psiChemistryModel.C | 19 ++++----- .../psiChemistryModel/psiChemistryModel.H | 26 ++++++------ .../psiChemistryModel/psiChemistryModelI.H | 6 +-- .../rhoChemistryModel/rhoChemistryModel.C | 19 ++++----- .../rhoChemistryModel/rhoChemistryModel.H | 26 ++++++------ .../rhoChemistryModel/rhoChemistryModelI.H | 6 +-- .../EulerImplicit/EulerImplicit.C | 5 +-- .../EulerImplicit/EulerImplicit.H | 6 +-- .../chemistrySolver/chemistrySolver.C | 7 ++-- .../chemistrySolver/chemistrySolver.H | 6 +-- .../makeChemistrySolverTypes.H | 6 +-- .../noChemistrySolver/noChemistrySolver.C | 7 ++-- .../noChemistrySolver/noChemistrySolver.H | 4 +- .../chemistryModel/chemistrySolver/ode/ode.C | 10 ++--- .../chemistryModel/chemistrySolver/ode/ode.H | 6 +-- .../basicSolidChemistryModel.C | 11 +++-- .../basicSolidChemistryModel.H | 26 ++++++------ .../basicSolidChemistryModelI.H | 6 +-- .../basicSolidChemistryModelNew.C | 31 +++++++------- .../pyrolysisChemistryModel.C | 35 ++++++++-------- .../pyrolysisChemistryModel.H | 6 +-- .../solidChemistryModel/solidChemistryModel.C | 18 ++++----- .../solidChemistryModel/solidChemistryModel.H | 6 +-- .../makeSolidChemistrySolverType.H | 4 +- 84 files changed, 581 insertions(+), 699 deletions(-) diff --git a/applications/solvers/combustion/chemFoam/createFields.H b/applications/solvers/combustion/chemFoam/createFields.H index 8b35089fc..bcd8e733b 100644 --- a/applications/solvers/combustion/chemFoam/createFields.H +++ b/applications/solvers/combustion/chemFoam/createFields.H @@ -23,14 +23,14 @@ #include "createBaseFields.H" - Info<< nl << "Reading thermophysicalProperties" << endl; - autoPtr pChemistry(psiChemistryModel::New(mesh)); - - psiChemistryModel& chemistry = pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + Info<< "Reading thermophysical properties\n" << endl; + autoPtr pThermo(psiReactionThermo::New(mesh)); + psiReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h"); + autoPtr pChemistry(psiChemistryModel::New(thermo)); + psiChemistryModel& chemistry = pChemistry(); + volScalarField rho ( IOobject diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 5678f1d4e..35048d915 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -1,16 +1,6 @@ -Info<< "Creating combustion model\n" << endl; - -autoPtr combustion -( - combustionModels::psiCombustionModel::New - ( - mesh - ) -); - Info<< "Reading thermophysical properties\n" << endl; - -psiReactionThermo& thermo = combustion->thermo(); +autoPtr pThermo(psiReactionThermo::New(mesh)); +psiReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); SLGThermo slgThermo(mesh, thermo); @@ -74,8 +64,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the combustion model -combustion->setTurbulence(turbulence()); +Info<< "Creating combustion model\n" << endl; +autoPtr combustion +( + combustionModels::psiCombustionModel::New(thermo, turbulence()) +); #include "readGravitationalAcceleration.H" diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 41e1c21b3..7b10733c2 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -1,13 +1,8 @@ #include "createRDeltaT.H" -Info<< "Creating reaction model\n" << endl; - -autoPtr reaction -( - combustionModels::psiCombustionModel::New(mesh) -); - -psiReactionThermo& thermo = reaction->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(psiReactionThermo::New(mesh)); +psiReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); basicMultiComponentMixture& composition = thermo.composition(); @@ -18,8 +13,7 @@ if (!composition.species().found(inertSpecie)) { FatalIOErrorIn(args.executable().c_str(), thermo) << "Inert specie " << inertSpecie << " not found in available species " - << composition.species() - << exit(FatalIOError); + << composition.species() << exit(FatalIOError); } volScalarField rho @@ -47,7 +41,6 @@ volVectorField U mesh ); - volScalarField& p = thermo.p(); #include "compressibleCreatePhi.H" @@ -68,9 +61,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the reaction model -reaction->setTurbulence(turbulence()); - +Info<< "Creating reaction model\n" << endl; +autoPtr reaction +( + combustionModels::psiCombustionModel::New(thermo, turbulence()) +); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H index 7ca350f08..624f7e504 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H @@ -1,13 +1,8 @@ #include "createRDeltaT.H" -Info<< "Creating reaction model\n" << endl; - -autoPtr reaction -( - combustionModels::rhoCombustionModel::New(mesh) -); - -rhoReactionThermo& thermo = reaction->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(rhoReactionThermo::New(mesh)); +rhoReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); basicMultiComponentMixture& composition = thermo.composition(); @@ -67,9 +62,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the reaction model -reaction->setTurbulence(turbulence()); - +Info<< "Creating reaction model\n" << endl; +autoPtr reaction +( + combustionModels::rhoCombustionModel::New(thermo, turbulence()) +); #include "readGravitationalAcceleration.H" #include "readhRef.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H index a06562619..2e23afe90 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H @@ -1,13 +1,8 @@ #include "createRDeltaT.H" -Info<< "Creating reaction model\n" << endl; - -autoPtr reaction -( - combustionModels::rhoCombustionModel::New(mesh) -); - -rhoReactionThermo& thermo = reaction->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(rhoReactionThermo::New(mesh)); +rhoReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); basicMultiComponentMixture& composition = thermo.composition(); @@ -69,8 +64,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the reaction model -reaction->setTurbulence(turbulence()); +Info<< "Creating reaction model\n" << endl; +autoPtr reaction +( + combustionModels::rhoCombustionModel::New(thermo, turbulence()) +); Info<< "Creating field dpdt\n" << endl; diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index b861c8dd0..423ac3e17 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -2,14 +2,9 @@ #include "readGravitationalAcceleration.H" -Info<< "Creating combustion model\n" << endl; - -autoPtr combustion -( - combustionModels::psiCombustionModel::New(mesh) -); - -psiReactionThermo& thermo = combustion->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(psiReactionThermo::New(mesh)); +psiReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); SLGThermo slgThermo(mesh, thermo); @@ -112,8 +107,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the combustion model -combustion->setTurbulence(turbulence()); +Info<< "Creating combustion model\n" << endl; +autoPtr combustion +( + combustionModels::psiCombustionModel::New(thermo, turbulence()) +); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index cf0e899b8..03d5f36e0 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -1,13 +1,8 @@ #include "createRDeltaT.H" -Info<< "Creating combustion model\n" << endl; - -autoPtr combustion -( - combustionModels::rhoCombustionModel::New(mesh) -); - -rhoReactionThermo& thermo = combustion->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(rhoReactionThermo::New(mesh)); +rhoReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); SLGThermo slgThermo(mesh, thermo); @@ -68,8 +63,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the combustion model -combustion->setTurbulence(turbulence()); +Info<< "Creating combustion model\n" << endl; +autoPtr combustion +( + combustionModels::rhoCombustionModel::New(thermo, turbulence()) +); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H index 3dfecc143..3bbf4fa20 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H @@ -1,13 +1,8 @@ #include "readGravitationalAcceleration.H" -Info<< "Creating combustion model\n" << endl; - -autoPtr combustion -( - combustionModels::rhoCombustionModel::New(mesh) -); - -rhoReactionThermo& thermo = combustion->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(rhoReactionThermo::New(mesh)); +rhoReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); SLGThermo slgThermo(mesh, thermo); @@ -91,8 +86,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the combustion model -combustion->setTurbulence(turbulence()); +Info<< "Creating combustion model\n" << endl; +autoPtr combustion +( + combustionModels::rhoCombustionModel::New(thermo, turbulence()) +); Info<< "Creating multi-variate interpolation scheme\n" << endl; multivariateSurfaceInterpolationScheme::fieldTable fields; diff --git a/applications/solvers/lagrangian/sprayFoam/createFields.H b/applications/solvers/lagrangian/sprayFoam/createFields.H index 203e7a7d3..9920dd7ca 100644 --- a/applications/solvers/lagrangian/sprayFoam/createFields.H +++ b/applications/solvers/lagrangian/sprayFoam/createFields.H @@ -1,13 +1,8 @@ #include "readGravitationalAcceleration.H" -Info<< "Creating combustion model\n" << endl; - -autoPtr combustion -( - combustionModels::psiCombustionModel::New(mesh) -); - -psiReactionThermo& thermo = combustion->thermo(); +Info<< "Reading thermophysical properties\n" << endl; +autoPtr pThermo(psiReactionThermo::New(mesh)); +psiReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); SLGThermo slgThermo(mesh, thermo); @@ -91,8 +86,11 @@ autoPtr turbulence ) ); -// Set the turbulence into the combustion model -combustion->setTurbulence(turbulence()); +Info<< "Creating combustion model\n" << endl; +autoPtr combustion +( + combustionModels::psiCombustionModel::New(thermo, turbulence()) +); Info<< "Creating field dpdt\n" << endl; volScalarField dpdt diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H index 864a6b425..7a120b200 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/MovingPhaseModel/MovingPhaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,7 +63,9 @@ class MovingPhaseModel : public BasePhaseModel { - // Private data +protected: + + // Protected data //- Velocity field volVectorField U_; @@ -94,6 +96,8 @@ class MovingPhaseModel tmp DbyA_; +private: + // Private static member functions //- Calculate and return the flux field diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C index aef23273f..adea05a4e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ReactingPhaseModel/ReactingPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,26 +37,9 @@ Foam::ReactingPhaseModel::ReactingPhaseModel const label index ) : - BasePhaseModel(fluid, phaseName, index, false), - reaction_ - ( - ReactionType::New - ( - fluid.mesh(), - combustionModel::combustionPropertiesName, - this->name() - ) - ) -{ - this->thermo_ = &reaction_->thermo(); - - this->thermo_->validate - ( - IOobject::groupName(phaseModel::typeName, this->name()), - "h", - "e" - ); -} + BasePhaseModel(fluid, phaseName, index), + reaction_(ReactionType::New(this->thermo_(), this->turbulence_())) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -71,21 +54,6 @@ Foam::ReactingPhaseModel::~ReactingPhaseModel() template void Foam::ReactingPhaseModel::correctThermo() { - reaction_->setTurbulence - ( - const_cast - ( - this->mesh().template lookupObject - ( - IOobject::groupName - ( - turbulenceModel::propertiesName, - this->name() - ) - ) - ) - ); - BasePhaseModel::correctThermo(); reaction_->correct(); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C index 2367cda41..7755afec2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,28 +41,18 @@ Foam::ThermoPhaseModel::ThermoPhaseModel ( const phaseSystem& fluid, const word& phaseName, - const label index, - const bool createThermo + const label index ) : - BasePhaseModel(fluid, phaseName, index) + BasePhaseModel(fluid, phaseName, index), + thermo_(ThermoType::New(fluid.mesh(), this->name())) { - if (createThermo) - { - thermoPtr_.set - ( - ThermoType::New(fluid.mesh(), this->name()).ptr() - ); - - thermo_ = thermoPtr_.ptr(); - - thermo_->validate - ( - IOobject::groupName(phaseModel::typeName, this->name()), - "h", - "e" - ); - } + thermo_->validate + ( + IOobject::groupName(phaseModel::typeName, this->name()), + "h", + "e" + ); } @@ -79,7 +69,7 @@ template const Foam::rhoThermo& Foam::ThermoPhaseModel::thermo() const { - return *thermo_; + return thermo_(); } @@ -87,7 +77,7 @@ template Foam::rhoThermo& Foam::ThermoPhaseModel::thermo() { - return *thermo_; + return thermo_(); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H index 56289cbf7..3f65910d2 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/ThermoPhaseModel/ThermoPhaseModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,10 +62,7 @@ protected: // Protected data //- Thermophysical model - autoPtr thermoPtr_; - - //- Thermophysical model - ThermoType* thermo_; + autoPtr thermo_; public: @@ -76,8 +73,7 @@ public: ( const phaseSystem& fluid, const word& phaseName, - const label index, - const bool createThermo = true + const label index ); diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C index 45fe19295..b5a631339 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,13 +45,13 @@ License namespace Foam { typedef - MovingPhaseModel + AnisothermalPhaseModel < - AnisothermalPhaseModel + PurePhaseModel < - PurePhaseModel + InertPhaseModel < - InertPhaseModel + MovingPhaseModel < ThermoPhaseModel > @@ -69,13 +69,13 @@ namespace Foam ); typedef - MovingPhaseModel + IsothermalPhaseModel < - IsothermalPhaseModel + PurePhaseModel < - PurePhaseModel + InertPhaseModel < - InertPhaseModel + MovingPhaseModel < ThermoPhaseModel > @@ -93,13 +93,13 @@ namespace Foam ); typedef - MovingPhaseModel + AnisothermalPhaseModel < - AnisothermalPhaseModel + MultiComponentPhaseModel < - MultiComponentPhaseModel + InertPhaseModel < - InertPhaseModel + MovingPhaseModel < ThermoPhaseModel > @@ -117,17 +117,17 @@ namespace Foam ); typedef - MovingPhaseModel + AnisothermalPhaseModel < - AnisothermalPhaseModel + MultiComponentPhaseModel < - MultiComponentPhaseModel + ReactingPhaseModel < - ReactingPhaseModel + MovingPhaseModel < - ThermoPhaseModel, - combustionModels::rhoCombustionModel - > + ThermoPhaseModel + >, + combustionModels::rhoCombustionModel > > > diff --git a/src/combustionModels/EDC/EDC.C b/src/combustionModels/EDC/EDC.C index 64d822ee5..e629547cc 100644 --- a/src/combustionModels/EDC/EDC.C +++ b/src/combustionModels/EDC/EDC.C @@ -31,12 +31,12 @@ template Foam::combustionModels::EDC::EDC ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - laminar(modelType, mesh, combustionProperties, phaseName), + laminar(modelType, thermo, turb, combustionProperties), version_ ( EDCversionNames @@ -58,13 +58,13 @@ Foam::combustionModels::EDC::EDC ( IOobject ( - IOobject::groupName(typeName + ":kappa", phaseName), - mesh.time().timeName(), - mesh, + this->thermo().phasePropertyName(typeName + ":kappa"), + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), - mesh, + this->mesh(), dimensionedScalar("kappa", dimless, 0) ) {} @@ -192,7 +192,7 @@ Foam::combustionModels::EDC::Qdot() const ( IOobject ( - IOobject::groupName(typeName + ":Qdot", this->phaseName_), + this->thermo().phasePropertyName(typeName + ":Qdot"), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/combustionModels/EDC/EDC.H b/src/combustionModels/EDC/EDC.H index d9ed191f9..478c8aea7 100644 --- a/src/combustionModels/EDC/EDC.H +++ b/src/combustionModels/EDC/EDC.H @@ -170,9 +170,9 @@ public: EDC ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& type, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index 609e3cd45..b50281fb1 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,17 +40,17 @@ template FSD::FSD ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : singleStepCombustion ( modelType, - mesh, - combustionProperties, - phaseName + thermo, + turb, + combustionProperties ), reactionRateFlameArea_ ( @@ -65,7 +65,7 @@ FSD::FSD ( IOobject ( - IOobject::groupName("ft", phaseName), + this->thermo().phasePropertyName("ft"), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -101,9 +101,9 @@ void FSD::calculateSourceNorm() const label fuelI = this->singleMixturePtr_->fuelIndex(); - const volScalarField& YFuel = this->thermoPtr_->composition().Y()[fuelI]; + const volScalarField& YFuel = this->thermo().composition().Y()[fuelI]; - const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2"); + const volScalarField& YO2 = this->thermo().composition().Y("O2"); const dimensionedScalar s = this->singleMixturePtr_->s(); @@ -152,7 +152,7 @@ void FSD::calculateSourceNorm() ( IOobject ( - IOobject::groupName("Pc", this->phaseName_), + this->thermo().phasePropertyName("Pc"), U.time().timeName(), U.db(), IOobject::NO_READ, @@ -171,7 +171,7 @@ void FSD::calculateSourceNorm() ( IOobject ( - IOobject::groupName("omegaFuelBar", this->phaseName_), + this->thermo().phasePropertyName("omegaFuelBar"), U.time().timeName(), U.db(), IOobject::NO_READ, @@ -302,7 +302,7 @@ void FSD::calculateSourceNorm() ( IOobject ( - IOobject::groupName("products", this->phaseName_), + this->thermo().phasePropertyName("products"), U.time().timeName(), U.db(), IOobject::NO_READ, @@ -318,7 +318,7 @@ void FSD::calculateSourceNorm() forAll(productsIndex, j) { label specieI = productsIndex[j]; - const volScalarField& Yp = this->thermoPtr_->composition().Y()[specieI]; + const volScalarField& Yp = this->thermo().composition().Y()[specieI]; products += Yp; } diff --git a/src/combustionModels/FSD/FSD.H b/src/combustionModels/FSD/FSD.H index 2f0ceb747..3fb7d555a 100644 --- a/src/combustionModels/FSD/FSD.H +++ b/src/combustionModels/FSD/FSD.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -139,9 +139,9 @@ public: FSD ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index 6358104a9..9bbf8f582 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -31,24 +31,24 @@ template Foam::combustionModels::PaSR::PaSR ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - laminar(modelType, mesh, combustionProperties, phaseName), + laminar(modelType, thermo, turb, combustionProperties), Cmix_(readScalar(this->coeffs().lookup("Cmix"))), kappa_ ( IOobject ( - IOobject::groupName(typeName + ":kappa", phaseName), - mesh.time().timeName(), - mesh, + thermo.phasePropertyName(typeName + ":kappa"), + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), - mesh, + this->mesh(), dimensionedScalar("kappa", dimless, 0) ) {} @@ -116,7 +116,7 @@ Foam::combustionModels::PaSR::Qdot() const ( new volScalarField ( - IOobject::groupName(typeName + ":Qdot", this->phaseName_), + this->thermo().phasePropertyName(typeName + ":Qdot"), kappa_*laminar::Qdot() ) ); diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H index 480f4ce19..0ac549c1e 100644 --- a/src/combustionModels/PaSR/PaSR.H +++ b/src/combustionModels/PaSR/PaSR.H @@ -87,9 +87,9 @@ public: PaSR ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/combustionModel/combustionModel.C b/src/combustionModels/combustionModel/combustionModel.C index 1ed899200..e9a25d053 100644 --- a/src/combustionModels/combustionModel/combustionModel.C +++ b/src/combustionModels/combustionModel/combustionModel.C @@ -43,40 +43,34 @@ const Foam::word Foam::combustionModel::combustionPropertiesName Foam::combustionModel::combustionModel ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + basicThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : IOdictionary ( IOobject ( - IOobject::groupName(combustionProperties, phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName(combustionProperties), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ), - turbulencePtr_(), - mesh_(mesh), + mesh_(thermo.p().mesh()), + turb_(turb), active_(lookupOrDefault("active", true)), coeffs_(optionalSubDict(modelType + "Coeffs")), - modelType_(modelType), - phaseName_(phaseName) + modelType_(modelType) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::combustionModel::~combustionModel() -{ - if (turbulencePtr_) - { - turbulencePtr_ = 0; - } -} +{} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // diff --git a/src/combustionModels/combustionModel/combustionModel.H b/src/combustionModels/combustionModel/combustionModel.H index 9845dad4f..8c3b085db 100644 --- a/src/combustionModels/combustionModel/combustionModel.H +++ b/src/combustionModels/combustionModel/combustionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,12 +64,12 @@ protected: // Protected data - //- Reference to the turbulence model - compressibleTurbulenceModel* turbulencePtr_; - //- Reference to the mesh database const fvMesh& mesh_; + //- Reference to the turbulence model + const compressibleTurbulenceModel& turb_; + //- Active Switch active_; @@ -79,9 +79,6 @@ protected: //- Model type const word modelType_; - //- Phase name - const word phaseName_; - public: @@ -98,9 +95,9 @@ public: combustionModel ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties=combustionPropertiesName, - const word& phaseName=word::null + basicThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties=combustionPropertiesName ); @@ -113,9 +110,6 @@ public: //- Return const access to the mesh database inline const fvMesh& mesh() const; - //- Set turbulence - inline void setTurbulence(compressibleTurbulenceModel& turbModel); - //- Return access to turbulence inline const compressibleTurbulenceModel& turbulence() const; diff --git a/src/combustionModels/combustionModel/combustionModelI.H b/src/combustionModels/combustionModel/combustionModelI.H index 135dbe403..8ddfc5d39 100644 --- a/src/combustionModels/combustionModel/combustionModelI.H +++ b/src/combustionModels/combustionModel/combustionModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,16 +34,7 @@ inline const Foam::fvMesh& Foam::combustionModel::mesh() const inline const Foam::compressibleTurbulenceModel& Foam::combustionModel::turbulence() const { - if (!turbulencePtr_) - { - FatalErrorInFunction - << "turbulencePtr_ is empty. Please use " - << "combustionModel::setTurbulence " - << "(compressibleTurbulenceModel& )" - << abort(FatalError); - } - - return *turbulencePtr_; + return turb_; } @@ -65,15 +56,6 @@ inline const Foam::Switch& Foam::combustionModel::active() const } -inline void Foam::combustionModel::setTurbulence -( - compressibleTurbulenceModel& turbModel -) -{ - turbulencePtr_ = &turbModel; -} - - inline const Foam::dictionary& Foam::combustionModel::coeffs() const { return coeffs_; diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C index c5a3ee9ea..7ba33ebe3 100644 --- a/src/combustionModels/diffusion/diffusion.C +++ b/src/combustionModels/diffusion/diffusion.C @@ -37,17 +37,17 @@ template diffusion::diffusion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : singleStepCombustion ( modelType, - mesh, - combustionProperties, - phaseName + thermo, + turb, + combustionProperties ), C_(readScalar(this->coeffs().lookup("C"))), oxidantName_(this->coeffs().template lookupOrDefault("oxidant", "O2")) @@ -76,12 +76,12 @@ void diffusion::correct() const label fuelI = this->singleMixturePtr_->fuelIndex(); const volScalarField& YFuel = - this->thermoPtr_->composition().Y()[fuelI]; + this->thermo().composition().Y()[fuelI]; - if (this->thermoPtr_->composition().contains(oxidantName_)) + if (this->thermo().composition().contains(oxidantName_)) { const volScalarField& YO2 = - this->thermoPtr_->composition().Y(oxidantName_); + this->thermo().composition().Y(oxidantName_); this->wFuel_ == C_*this->turbulence().muEff() diff --git a/src/combustionModels/diffusion/diffusion.H b/src/combustionModels/diffusion/diffusion.H index 3fffb21f7..5590afec9 100644 --- a/src/combustionModels/diffusion/diffusion.H +++ b/src/combustionModels/diffusion/diffusion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,9 +85,9 @@ public: diffusion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C index 49c0d60e3..f2dc14acf 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,17 +36,17 @@ template infinitelyFastChemistry::infinitelyFastChemistry ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : singleStepCombustion ( modelType, - mesh, - combustionProperties, - phaseName + thermo, + turb, + combustionProperties ), C_(readScalar(this->coeffs().lookup("C"))) {} @@ -74,13 +74,13 @@ void infinitelyFastChemistry::correct() const label fuelI = this->singleMixturePtr_->fuelIndex(); const volScalarField& YFuel = - this->thermoPtr_->composition().Y()[fuelI]; + this->thermo().composition().Y()[fuelI]; const dimensionedScalar s = this->singleMixturePtr_->s(); - if (this->thermoPtr_->composition().contains("O2")) + if (this->thermo().composition().contains("O2")) { - const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2"); + const volScalarField& YO2 = this->thermo().composition().Y("O2"); this->wFuel_ == this->rho()/(this->mesh().time().deltaT()*C_) diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H index 864438e4b..15c051540 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,9 +82,9 @@ public: infinitelyFastChemistry ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/laminar/laminar.C b/src/combustionModels/laminar/laminar.C index b33f302b1..b4ec3df3d 100644 --- a/src/combustionModels/laminar/laminar.C +++ b/src/combustionModels/laminar/laminar.C @@ -33,12 +33,12 @@ template Foam::combustionModels::laminar::laminar ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - Type(modelType, mesh, combustionProperties, phaseName), + Type(modelType, thermo, turb, combustionProperties), integrateReactionRate_ ( this->coeffs().lookupOrDefault("integrateReactionRate", true) @@ -144,7 +144,7 @@ Foam::combustionModels::laminar::Qdot() const ( IOobject ( - IOobject::groupName(typeName + ":Qdot", this->phaseName_), + this->thermo().phasePropertyName(typeName + ":Qdot"), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/combustionModels/laminar/laminar.H b/src/combustionModels/laminar/laminar.H index 41b00799c..ba8a99cea 100644 --- a/src/combustionModels/laminar/laminar.H +++ b/src/combustionModels/laminar/laminar.H @@ -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 @@ -87,9 +87,9 @@ public: laminar ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/noCombustion/noCombustion.C b/src/combustionModels/noCombustion/noCombustion.C index 4101ed61c..b74bc1cc9 100644 --- a/src/combustionModels/noCombustion/noCombustion.C +++ b/src/combustionModels/noCombustion/noCombustion.C @@ -32,12 +32,12 @@ template Foam::combustionModels::noCombustion::noCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - CombThermoType(modelType, mesh, phaseName) + CombThermoType(modelType, thermo, turb) {} @@ -81,7 +81,7 @@ Foam::combustionModels::noCombustion::Qdot() const ( IOobject ( - IOobject::groupName(typeName + ":Qdot", this->phaseName_), + this->thermo().phasePropertyName(typeName + ":Qdot"), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/combustionModels/noCombustion/noCombustion.H b/src/combustionModels/noCombustion/noCombustion.H index 27783065c..2bf36719a 100644 --- a/src/combustionModels/noCombustion/noCombustion.H +++ b/src/combustionModels/noCombustion/noCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,9 +71,9 @@ public: noCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C index 032a06323..a4966c425 100644 --- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C +++ b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,13 +30,19 @@ License Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - psiCombustionModel(modelType, mesh, combustionProperties, phaseName), - chemistryPtr_(psiChemistryModel::New(mesh, phaseName)) + psiCombustionModel + ( + modelType, + thermo, + turb, + combustionProperties + ), + chemistryPtr_(psiChemistryModel::New(thermo)) {} diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H index 6da449665..c9059f10a 100644 --- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H +++ b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,9 +79,9 @@ public: psiChemistryCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C index 36d78166b..c51749bd6 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,12 +41,12 @@ namespace combustionModels Foam::combustionModels::psiCombustionModel::psiCombustionModel ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - combustionModel(modelType, mesh, combustionProperties, phaseName) + combustionModel(modelType, thermo, turb, combustionProperties) {} diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H index ae4a75c41..621b3a02c 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,7 +68,8 @@ class psiCombustionModel public: - typedef psiReactionThermo ReactionThermo; + //- Thermo type + typedef psiReactionThermo reactionThermo; //- Runtime type information @@ -83,11 +84,11 @@ public: dictionary, ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ), - (modelType, mesh, combustionProperties, phaseName) + (modelType, thermo, turb, combustionProperties) ); @@ -97,18 +98,18 @@ public: psiCombustionModel ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); //- Selector static autoPtr New ( - const fvMesh& mesh, - const word& combustionProperties=combustionPropertiesName, - const word& phaseName=word::null + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties=combustionPropertiesName ); diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C index 6c06cf881..508b06af5 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,9 +30,9 @@ License Foam::autoPtr Foam::combustionModels::psiCombustionModel::New ( - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) { const word combModelName @@ -41,9 +41,9 @@ Foam::combustionModels::psiCombustionModel::New ( IOobject ( - IOobject::groupName(combustionProperties, phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName(combustionProperties), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -70,7 +70,7 @@ Foam::combustionModels::psiCombustionModel::New return autoPtr ( - cstrIter()(className, mesh, combustionProperties, phaseName) + cstrIter()(className, thermo, turb, combustionProperties) ); } diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C index e2b2440b5..cc4c342c1 100644 --- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C +++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,12 +30,12 @@ License Foam::combustionModels::psiThermoCombustion::psiThermoCombustion ( const word& modelType, - const fvMesh& mesh, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb ) : - psiCombustionModel(modelType, mesh, combustionPropertiesName, phaseName), - thermoPtr_(psiReactionThermo::New(mesh, phaseName)) + psiCombustionModel(modelType, thermo, turb, combustionPropertiesName), + thermo_(thermo) {} @@ -50,14 +50,14 @@ Foam::combustionModels::psiThermoCombustion::~psiThermoCombustion() Foam::psiReactionThermo& Foam::combustionModels::psiThermoCombustion::thermo() { - return thermoPtr_(); + return thermo_; } const Foam::psiReactionThermo& Foam::combustionModels::psiThermoCombustion::thermo() const { - return thermoPtr_(); + return thermo_; } diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H index f922e1a44..7f7a4d39d 100644 --- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H +++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,8 +67,8 @@ protected: // Protected data - //- Pointer to chemistry model - autoPtr thermoPtr_; + //- Thermo + psiReactionThermo& thermo_; public: @@ -79,8 +79,8 @@ public: psiThermoCombustion ( const word& modelType, - const fvMesh& mesh, - const word& phaseName + psiReactionThermo& thermo, + const compressibleTurbulenceModel& turb ); diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C index 4d977c7fd..657be6fc2 100644 --- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C +++ b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,13 +30,13 @@ License Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - rhoCombustionModel(modelType, mesh, combustionProperties, phaseName), - chemistryPtr_(rhoChemistryModel::New(mesh, phaseName)) + rhoCombustionModel(modelType, thermo, turb, combustionProperties), + chemistryPtr_(rhoChemistryModel::New(thermo)) {} diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H index 93d473102..8d361c699 100644 --- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H +++ b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,9 +79,9 @@ public: rhoChemistryCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C index bcc0b18c3..07317cb0a 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,12 +41,12 @@ namespace combustionModels Foam::combustionModels::rhoCombustionModel::rhoCombustionModel ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - combustionModel(modelType, mesh, combustionProperties, phaseName) + combustionModel(modelType, thermo, turb, combustionProperties) {} diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H index 2e261a5b9..66c501c39 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,7 +69,8 @@ class rhoCombustionModel public: - typedef rhoReactionThermo ReactionThermo; + //- Thermo type + typedef rhoReactionThermo reactionThermo; //- Runtime type information @@ -84,11 +85,11 @@ public: dictionary, ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ), - (modelType, mesh, combustionProperties, phaseName) + (modelType, thermo, turb, combustionProperties) ); @@ -99,9 +100,9 @@ public: rhoCombustionModel ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); @@ -109,9 +110,9 @@ public: //- Selector static autoPtr New ( - const fvMesh& mesh, - const word& combustionProperties=combustionPropertiesName, - const word& phaseName=word::null + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties=combustionPropertiesName ); diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C index e179f0414..8f4032aa8 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,9 +30,9 @@ License Foam::autoPtr Foam::combustionModels::rhoCombustionModel::New ( - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) { const word combTypeName @@ -41,9 +41,9 @@ Foam::combustionModels::rhoCombustionModel::New ( IOobject ( - IOobject::groupName(combustionProperties, phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName(combustionProperties), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -72,7 +72,7 @@ Foam::combustionModels::rhoCombustionModel::New return autoPtr ( - cstrIter()(className, mesh, combustionProperties, phaseName) + cstrIter()(className, thermo, turb, combustionProperties) ); } diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C index a4a5be12c..8b2fe2372 100644 --- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C +++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,12 +30,12 @@ License Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion ( const word& modelType, - const fvMesh& mesh, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb ) : - rhoCombustionModel(modelType, mesh, combustionPropertiesName, phaseName), - thermoPtr_(rhoReactionThermo::New(mesh, phaseName)) + rhoCombustionModel(modelType, thermo, turb, combustionPropertiesName), + thermo_(thermo) {} @@ -50,14 +50,14 @@ Foam::combustionModels::rhoThermoCombustion::~rhoThermoCombustion() Foam::rhoReactionThermo& Foam::combustionModels::rhoThermoCombustion::thermo() { - return thermoPtr_(); + return thermo_; } const Foam::rhoReactionThermo& Foam::combustionModels::rhoThermoCombustion::thermo() const { - return thermoPtr_(); + return thermo_; } diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H index 43041d460..7dfa06fa4 100644 --- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H +++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,8 +67,8 @@ protected: // Protected data - //- Pointer to thermo model - autoPtr thermoPtr_; + //- Thermo + rhoReactionThermo& thermo_; public: @@ -79,8 +79,8 @@ public: rhoThermoCombustion ( const word& modelType, - const fvMesh& mesh, - const word& phaseName + rhoReactionThermo& thermo, + const compressibleTurbulenceModel& turb ); diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C index 668a3c072..14bf1b8eb 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,18 +37,18 @@ template singleStepCombustion::singleStepCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - CombThermoType(modelType, mesh, phaseName), + CombThermoType(modelType, thermo, turb), singleMixturePtr_(nullptr), wFuel_ ( IOobject ( - IOobject::groupName("wFuel", phaseName), + this->thermo().phasePropertyName("wFuel"), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -103,7 +103,7 @@ tmp singleStepCombustion::R ) const { const label specieI = - this->thermoPtr_->composition().species()[Y.member()]; + this->thermo().composition().species()[Y.member()]; volScalarField wSpecie ( @@ -131,7 +131,7 @@ singleStepCombustion::Qdot() const { const label fuelI = singleMixturePtr_->fuelIndex(); volScalarField& YFuel = - const_cast(this->thermoPtr_->composition().Y(fuelI)); + const_cast(this->thermo().composition().Y(fuelI)); return -singleMixturePtr_->qFuel()*(R(YFuel) & YFuel); } diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.H b/src/combustionModels/singleStepCombustion/singleStepCombustion.H index 3c5d8fb7e..1da682d4f 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.H +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,9 +84,9 @@ public: singleStepCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename CombThermoType::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); diff --git a/src/combustionModels/zoneCombustion/zoneCombustion.C b/src/combustionModels/zoneCombustion/zoneCombustion.C index 3284c2aca..73b8a2ef2 100644 --- a/src/combustionModels/zoneCombustion/zoneCombustion.C +++ b/src/combustionModels/zoneCombustion/zoneCombustion.C @@ -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 @@ -104,21 +104,13 @@ template Foam::combustionModels::zoneCombustion::zoneCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ) : - Type(modelType, mesh, combustionProperties, phaseName), - combustionModelPtr_ - ( - Type::New - ( - mesh, - "zoneCombustionProperties", - phaseName - ) - ), + Type(modelType, thermo, turb, combustionProperties), + combustionModelPtr_(Type::New(thermo, turb, "zoneCombustionProperties")), zoneNames_(this->coeffs().lookup("zones")) {} @@ -133,7 +125,7 @@ Foam::combustionModels::zoneCombustion::~zoneCombustion() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // template -typename Type::ReactionThermo& +typename Type::reactionThermo& Foam::combustionModels::zoneCombustion::thermo() { return combustionModelPtr_->thermo(); @@ -141,7 +133,7 @@ Foam::combustionModels::zoneCombustion::thermo() template -const typename Type::ReactionThermo& +const typename Type::reactionThermo& Foam::combustionModels::zoneCombustion::thermo() const { return combustionModelPtr_->thermo(); diff --git a/src/combustionModels/zoneCombustion/zoneCombustion.H b/src/combustionModels/zoneCombustion/zoneCombustion.H index 351b40cab..069b2f177 100644 --- a/src/combustionModels/zoneCombustion/zoneCombustion.H +++ b/src/combustionModels/zoneCombustion/zoneCombustion.H @@ -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 @@ -90,9 +90,9 @@ public: zoneCombustion ( const word& modelType, - const fvMesh& mesh, - const word& combustionProperties, - const word& phaseName + typename Type::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties ); @@ -103,10 +103,10 @@ public: // Member Functions //- Return access to the thermo package - virtual typename Type::ReactionThermo& thermo(); + virtual typename Type::reactionThermo& thermo(); //- Return const access to the thermo package - virtual const typename Type::ReactionThermo& thermo() const; + virtual const typename Type::reactionThermo& thermo() const; //- Correct combustion rate virtual void correct(); diff --git a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C index 257bddf92..32c6f3a5e 100644 --- a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C +++ b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,9 +47,14 @@ addToRunTimeSelectionTable(pyrolysisModel, noPyrolysis, dictionary); void noPyrolysis::constructThermoChemistry() { + solidThermo_.reset + ( + solidReactionThermo::New(regionMesh()).ptr() + ); + solidChemistry_.reset ( - basicSolidChemistryModel::New(regionMesh()).ptr() + basicSolidChemistryModel::New(solidThermo_()).ptr() ); solidThermo_.reset(&solidChemistry_->solidThermo()); @@ -95,8 +100,8 @@ noPyrolysis::noPyrolysis ) : pyrolysisModel(mesh, regionType), - solidChemistry_(nullptr), solidThermo_(nullptr), + solidChemistry_(nullptr), radiation_(nullptr) { if (active()) @@ -115,8 +120,8 @@ noPyrolysis::noPyrolysis ) : pyrolysisModel(mesh, regionType), - solidChemistry_(nullptr), solidThermo_(nullptr), + solidChemistry_(nullptr), radiation_(nullptr) { if (active()) diff --git a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H index 9107456be..62cc3fad6 100644 --- a/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H +++ b/src/regionModels/pyrolysisModels/noPyrolysis/noPyrolysis.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,12 +81,12 @@ protected: //- Reset solidChemistryModel and solidThermo pointers void constructThermoChemistry(); - //- Reference to the solid chemistry model - autoPtr solidChemistry_; - //- Reference to solid thermo autoPtr solidThermo_; + //- Reference to the solid chemistry model + autoPtr solidChemistry_; + //- Pointer to radiation model autoPtr radiation_; diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C index 782b72896..9a7cf73b1 100644 --- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C +++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C @@ -154,7 +154,7 @@ void reactingOneDim::updatePhiGas() forAll(gasTable, gasI) { tmp tHsiGas = - solidChemistry_->gasHs(solidThermo_.p(), solidThermo_.T(), gasI); + solidChemistry_->gasHs(solidThermo_->p(), solidThermo_->T(), gasI); const volScalarField& HsiGas = tHsiGas(); @@ -313,7 +313,7 @@ void reactingOneDim::solveEnergy() InfoInFunction << endl; } - tmp alpha(solidThermo_.alpha()); + tmp alpha(solidThermo_->alpha()); fvScalarMatrix hEqn ( @@ -384,9 +384,9 @@ reactingOneDim::reactingOneDim ) : pyrolysisModel(modelType, mesh, regionType), - solidChemistry_(basicSolidChemistryModel::New(regionMesh())), - solidThermo_(solidChemistry_->solidThermo()), - radiation_(radiation::radiationModel::New(solidThermo_.T())), + solidThermo_(solidReactionThermo::New(regionMesh())), + solidChemistry_(basicSolidChemistryModel::New(solidThermo_())), + radiation_(radiation::radiationModel::New(solidThermo_->T())), rho_ ( IOobject @@ -397,10 +397,10 @@ reactingOneDim::reactingOneDim IOobject::NO_READ, IOobject::AUTO_WRITE ), - solidThermo_.rho() + solidThermo_->rho() ), - Ys_(solidThermo_.composition().Y()), - h_(solidThermo_.he()), + Ys_(solidThermo_->composition().Y()), + h_(solidThermo_->he()), nNonOrthCorr_(-1), maxDiff_(10), minimumDelta_(1e-4), @@ -484,9 +484,9 @@ reactingOneDim::reactingOneDim ) : pyrolysisModel(modelType, mesh, dict, regionType), - solidChemistry_(basicSolidChemistryModel::New(regionMesh())), - solidThermo_(solidChemistry_->solidThermo()), - radiation_(radiation::radiationModel::New(solidThermo_.T())), + solidThermo_(solidReactionThermo::New(regionMesh())), + solidChemistry_(basicSolidChemistryModel::New(solidThermo_())), + radiation_(radiation::radiationModel::New(solidThermo_->T())), rho_ ( IOobject @@ -497,10 +497,10 @@ reactingOneDim::reactingOneDim IOobject::NO_READ, IOobject::AUTO_WRITE ), - solidThermo_.rho() + solidThermo_->rho() ), - Ys_(solidThermo_.composition().Y()), - h_(solidThermo_.he()), + Ys_(solidThermo_->composition().Y()), + h_(solidThermo_->he()), nNonOrthCorr_(-1), maxDiff_(10), minimumDelta_(1e-4), @@ -643,13 +643,13 @@ const volScalarField& reactingOneDim::rho() const const volScalarField& reactingOneDim::T() const { - return solidThermo_.T(); + return solidThermo_->T(); } const tmp reactingOneDim::Cp() const { - return solidThermo_.Cp(); + return solidThermo_->Cp(); } @@ -661,7 +661,7 @@ tmp reactingOneDim::kappaRad() const tmp reactingOneDim::kappa() const { - return solidThermo_.kappa(); + return solidThermo_->kappa(); } @@ -711,12 +711,12 @@ void reactingOneDim::evolveRegion() calculateMassTransfer(); - solidThermo_.correct(); + solidThermo_->correct(); Info<< "pyrolysis min/max(T) = " - << gMin(solidThermo_.T().primitiveField()) + << gMin(solidThermo_->T().primitiveField()) << ", " - << gMax(solidThermo_.T().primitiveField()) + << gMax(solidThermo_->T().primitiveField()) << endl; } diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.H b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.H index 60083838a..a17bf5985 100644 --- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.H +++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.H @@ -75,12 +75,12 @@ protected: // Protected data + //- Reference to solid thermo + autoPtr solidThermo_; + //- Reference to the solid chemistry model autoPtr solidChemistry_; - //- Reference to solid thermo - solidReactionThermo& solidThermo_; - //- Pointer to radiation model autoPtr radiation_; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C index 1c0d5ea05..9305c51ac 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C @@ -33,15 +33,18 @@ License template Foam::TDACChemistryModel::TDACChemistryModel ( - const fvMesh& mesh, - const word& phaseName + typename CompType::reactionThermo& thermo ) : - chemistryModel(mesh, phaseName), + chemistryModel(thermo), variableTimeStep_ ( - mesh.time().controlDict().lookupOrDefault("adjustTimeStep", false) - || fv::localEulerDdt::enabled(mesh) + this->mesh().time().controlDict().lookupOrDefault + ( + "adjustTimeStep", + false + ) + || fv::localEulerDdt::enabled(this->mesh()) ), timeSteps_(0), NsDAC_(this->nSpecie_), @@ -54,13 +57,13 @@ Foam::TDACChemistryModel::TDACChemistryModel ( IOobject ( - IOobject::groupName("TabulationResults", phaseName), + thermo.phasePropertyName("TabulationResults"), this->time().timeName(), this->mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), - mesh, + this->mesh(), scalar(0) ) { @@ -93,8 +96,8 @@ Foam::TDACChemistryModel::TDACChemistryModel IOobject header ( this->Y()[i].name(), - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ ); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H index 71af571b6..7ba031beb 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H @@ -150,12 +150,8 @@ public: // Constructors - //- Construct from mesh - TDACChemistryModel - ( - const fvMesh& mesh, - const word& phaseName - ); + //- Construct from thermo + TDACChemistryModel(typename CompType::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C index 1dd17e8d3..b47b71ecd 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C @@ -42,37 +42,33 @@ void Foam::basicChemistryModel::correct() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::basicChemistryModel::basicChemistryModel -( - const fvMesh& mesh, - const word& phaseName -) +Foam::basicChemistryModel::basicChemistryModel(basicThermo& thermo) : IOdictionary ( IOobject ( - IOobject::groupName("chemistryProperties", phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName("chemistryProperties"), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ), - mesh_(mesh), + mesh_(thermo.p().mesh()), chemistry_(lookup("chemistry")), deltaTChemIni_(readScalar(lookup("initialChemicalTimeStep"))), deltaTChem_ ( IOobject ( - IOobject::groupName("deltaTChem", phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName("deltaTChem"), + mesh().time().constant(), + mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + mesh(), dimensionedScalar("deltaTChem0", dimTime, deltaTChemIni_) ) {} diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H index c85cf3764..1d321912a 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,6 +40,7 @@ SourceFiles #include "Switch.H" #include "scalarField.H" #include "volFields.H" +#include "basicThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -101,15 +102,18 @@ public: // Constructors - //- Construct from mesh - basicChemistryModel(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + basicChemistryModel(basicThermo& thermo); // Selectors //- Generic New for each of the related chemistry model - template - static autoPtr New(const fvMesh& mesh, const word& phaseName); + template + static autoPtr New + ( + typename ChemistryModel::reactionThermo& thermo + ); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C index 3158c204d..ff484c9b6 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C @@ -31,17 +31,16 @@ License template Foam::autoPtr Foam::basicChemistryModel::New ( - const fvMesh& mesh, - const word& phaseName + typename ChemistryModel::reactionThermo& thermo ) { IOdictionary chemistryDict ( IOobject ( - IOobject::groupName("chemistryProperties", phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName("chemistryProperties"), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -76,9 +75,9 @@ Foam::autoPtr Foam::basicChemistryModel::New ( IOobject ( - IOobject::groupName(basicThermo::dictName, phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName(basicThermo::dictName), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false @@ -124,10 +123,10 @@ Foam::autoPtr Foam::basicChemistryModel::New + thermoTypeName + ">>"; } - typename ChemistryModel::fvMeshConstructorTable::iterator cstrIter = - ChemistryModel::fvMeshConstructorTablePtr_->find(chemistryTypeName); + typename ChemistryModel::thermoConstructorTable::iterator cstrIter = + ChemistryModel::thermoConstructorTablePtr_->find(chemistryTypeName); - if (cstrIter == ChemistryModel::fvMeshConstructorTablePtr_->end()) + if (cstrIter == ChemistryModel::thermoConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown " << ChemistryModel::typeName << " type " << nl @@ -138,7 +137,7 @@ Foam::autoPtr Foam::basicChemistryModel::New // Get the list of all the suitable chemistry packages available wordList validChemistryTypeNames ( - ChemistryModel::fvMeshConstructorTablePtr_->sortedToc() + ChemistryModel::thermoConstructorTablePtr_->sortedToc() ); // Build a table of the thermo packages constituent parts @@ -171,7 +170,7 @@ Foam::autoPtr Foam::basicChemistryModel::New FatalError<< exit(FatalError); } - return autoPtr(cstrIter()(mesh, phaseName)); + return autoPtr(cstrIter()(thermo)); } else { @@ -180,20 +179,20 @@ Foam::autoPtr Foam::basicChemistryModel::New Info<< "Selecting chemistry type " << chemistryTypeName << endl; - typename ChemistryModel::fvMeshConstructorTable::iterator cstrIter = - ChemistryModel::fvMeshConstructorTablePtr_->find(chemistryTypeName); + typename ChemistryModel::thermoConstructorTable::iterator cstrIter = + ChemistryModel::thermoConstructorTablePtr_->find(chemistryTypeName); - if (cstrIter == ChemistryModel::fvMeshConstructorTablePtr_->end()) + if (cstrIter == ChemistryModel::thermoConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown " << ChemistryModel::typeName << " type " << chemistryTypeName << nl << nl << "Valid ChemistryModel types are:" << nl - << ChemistryModel::fvMeshConstructorTablePtr_->sortedToc() << nl + << ChemistryModel::thermoConstructorTablePtr_->sortedToc() << nl << exit(FatalError); } - return autoPtr(cstrIter()(mesh, phaseName)); + return autoPtr(cstrIter()(thermo)); } } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C index fe401093c..c4bc21d23 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C @@ -33,11 +33,10 @@ License template Foam::chemistryModel::chemistryModel ( - const fvMesh& mesh, - const word& phaseName + typename CompType::reactionThermo& thermo ) : - CompType(mesh, phaseName), + CompType(thermo), ODESystem(), Y_(this->thermo().composition().Y()), reactions_ @@ -68,12 +67,12 @@ Foam::chemistryModel::chemistryModel IOobject ( "RR." + Y_[fieldi].name(), - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + thermo.p().mesh(), dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) ) ); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H index 8a69c4c95..4857ee63d 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H @@ -79,6 +79,7 @@ protected: typedef ThermoType thermoType; + // Protected data //- Reference to the field of specie mass fractions @@ -124,8 +125,8 @@ public: // Constructors - //- Construct from mesh - chemistryModel(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + chemistryModel(typename CompType::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C index 75ed215f9..31e0d083c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,20 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(psiChemistryModel, 0); - defineRunTimeSelectionTable(psiChemistryModel, fvMesh); + defineRunTimeSelectionTable(psiChemistryModel, thermo); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::psiChemistryModel::psiChemistryModel -( - const fvMesh& mesh, - const word& phaseName -) +Foam::psiChemistryModel::psiChemistryModel(psiReactionThermo& thermo) : - basicChemistryModel(mesh, phaseName), - thermo_(psiReactionThermo::New(mesh, phaseName)) + basicChemistryModel(thermo), + thermo_(thermo) {} @@ -52,11 +48,10 @@ Foam::psiChemistryModel::psiChemistryModel Foam::autoPtr Foam::psiChemistryModel::New ( - const fvMesh& mesh, - const word& phaseName + psiReactionThermo& thermo ) { - return basicChemistryModel::New(mesh, phaseName); + return basicChemistryModel::New(thermo); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H index 132999f78..fb994cca1 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,8 +71,8 @@ protected: // Protected data - //- Thermo package - autoPtr thermo_; + //- Thermo + psiReactionThermo& thermo_; public: @@ -81,29 +81,29 @@ public: TypeName("psi"); + //- Thermo type + typedef psiReactionThermo reactionThermo; + + //- Declare run-time constructor selection tables declareRunTimeSelectionTable ( autoPtr, psiChemistryModel, - fvMesh, - (const fvMesh& mesh, const word& phaseName), - (mesh, phaseName) + thermo, + (psiReactionThermo& thermo), + (thermo) ); // Constructors - //- Construct from mesh and phase name - psiChemistryModel(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + psiChemistryModel(psiReactionThermo& thermo); //- Selector - static autoPtr New - ( - const fvMesh& mesh, - const word& phaseName=word::null - ); + static autoPtr New(psiReactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H index b34e0b10b..9cff93b0a 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,13 +27,13 @@ License inline Foam::psiReactionThermo& Foam::psiChemistryModel::thermo() { - return thermo_(); + return thermo_; } inline const Foam::psiReactionThermo& Foam::psiChemistryModel::thermo() const { - return thermo_(); + return thermo_; } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C index 16a6fa463..b49bd6888 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,20 +31,16 @@ License namespace Foam { defineTypeNameAndDebug(rhoChemistryModel, 0); - defineRunTimeSelectionTable(rhoChemistryModel, fvMesh); + defineRunTimeSelectionTable(rhoChemistryModel, thermo); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::rhoChemistryModel::rhoChemistryModel -( - const fvMesh& mesh, - const word& phaseName -) +Foam::rhoChemistryModel::rhoChemistryModel(rhoReactionThermo& thermo) : - basicChemistryModel(mesh, phaseName), - thermo_(rhoReactionThermo::New(mesh, phaseName)) + basicChemistryModel(thermo), + thermo_(thermo) {} @@ -52,11 +48,10 @@ Foam::rhoChemistryModel::rhoChemistryModel Foam::autoPtr Foam::rhoChemistryModel::New ( - const fvMesh& mesh, - const word& phaseName + rhoReactionThermo& thermo ) { - return basicChemistryModel::New(mesh, phaseName); + return basicChemistryModel::New(thermo); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H index 3d160fa02..e23dfc15e 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,8 +71,8 @@ protected: // Protected data - //- Thermo package - autoPtr thermo_; + //- Thermo + rhoReactionThermo& thermo_; public: @@ -81,29 +81,29 @@ public: TypeName("rho"); + //- Thermo type + typedef rhoReactionThermo reactionThermo; + + //- Declare run-time constructor selection tables declareRunTimeSelectionTable ( autoPtr, rhoChemistryModel, - fvMesh, - (const fvMesh& mesh, const word& phaseName), - (mesh, phaseName) + thermo, + (rhoReactionThermo& thermo), + (thermo) ); // Constructors - //- Construct from mesh and phase name - rhoChemistryModel(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + rhoChemistryModel(rhoReactionThermo& thermo); //- Selector - static autoPtr New - ( - const fvMesh& mesh, - const word& phaseName=word::null - ); + static autoPtr New(rhoReactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H index 9664bd774..fd40522ac 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,13 +27,13 @@ License inline Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo() { - return thermo_(); + return thermo_; } inline const Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo() const { - return thermo_(); + return thermo_; } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C index 70db6c756..109a85edc 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C @@ -32,11 +32,10 @@ License template Foam::EulerImplicit::EulerImplicit ( - const fvMesh& mesh, - const word& phaseName + typename ChemistryModel::reactionThermo& thermo ) : - chemistrySolver(mesh, phaseName), + chemistrySolver(thermo), coeffsDict_(this->subDict("EulerImplicitCoeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), eqRateLimiter_(coeffsDict_.lookup("equilibriumRateLimiter")), diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H index 8196d8467..a0616ad10 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,8 +77,8 @@ public: // Constructors - //- Construct from mesh and phase name - EulerImplicit(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + EulerImplicit(typename ChemistryModel::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C index 3bbdaf27d..4fb90f61b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,10 @@ License template Foam::chemistrySolver::chemistrySolver ( - const fvMesh& mesh, - const word& phaseName + typename ChemistryModel::reactionThermo& thermo ) : - ChemistryModel(mesh, phaseName) + ChemistryModel(thermo) {} diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H index fa7ec343f..ba342a32e 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,8 +58,8 @@ public: // Constructors - //- Construct from components and phase name - chemistrySolver(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + chemistrySolver(typename ChemistryModel::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H index e98171d4b..31334fca9 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,7 @@ License ( \ Comp, \ SS##Comp##Thermo, \ - fvMesh \ + thermo \ ); \ \ defineTemplateTypeNameAndDebugWithName \ @@ -69,7 +69,7 @@ License ( \ Comp, \ TDAC##SS##Comp##Thermo, \ - fvMesh \ + thermo \ ); diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.C index 253468484..a266c4578 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,11 +31,10 @@ License template Foam::noChemistrySolver::noChemistrySolver ( - const fvMesh& mesh, - const word& phaseName + typename ChemistryModel::reactionThermo& thermo ) : - chemistrySolver(mesh, phaseName) + chemistrySolver(thermo) {} diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.H index d6f3a67e4..ab4004d29 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/noChemistrySolver/noChemistrySolver.H @@ -61,8 +61,8 @@ public: // Constructors - //- Construct from mesh and phase name - noChemistrySolver(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + noChemistrySolver(typename ChemistryModel::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C index f9acbe960..c1dcab591 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,13 +29,9 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::ode::ode -( - const fvMesh& mesh, - const word& phaseName -) +Foam::ode::ode(typename ChemistryModel::reactionThermo& thermo) : - chemistrySolver(mesh, phaseName), + chemistrySolver(thermo), coeffsDict_(this->subDict("odeCoeffs")), odeSolver_(ODESolver::New(*this, coeffsDict_)), cTp_(this->nEqns()) diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H index 0d1509f0c..b76abadca 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,8 +70,8 @@ public: // Constructors - //- Construct from mesh and phase name - ode(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + ode(typename ChemistryModel::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.C index 1e0d94690..a6501b158 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.C @@ -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) {} diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H index 5c3afee37..c7ac307b9 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModel.H @@ -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 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 New - ( - const fvMesh& mesh, - const word& phaseName=word::null - ); + static autoPtr New(solidReactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H index 48aa40841..81c7c28fa 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,14 +27,14 @@ License inline Foam::solidReactionThermo& Foam::basicSolidChemistryModel::solidThermo() { - return solidThermo_(); + return solidThermo_; } inline const Foam::solidReactionThermo& Foam::basicSolidChemistryModel::solidThermo() const { - return solidThermo_(); + return solidThermo_; } diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C index 12a5d39fa..913bef968 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,20 +27,16 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::basicSolidChemistryModel:: -New -( - const fvMesh& mesh, - const word& phaseName -) +Foam::autoPtr +Foam::basicSolidChemistryModel::New(solidReactionThermo& thermo) { IOdictionary chemistryDict ( IOobject ( - IOobject::groupName("chemistryProperties", phaseName), - mesh.time().constant(), - mesh, + thermo.phasePropertyName("chemistryProperties"), + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ, IOobject::NO_WRITE, false @@ -77,8 +73,8 @@ New IOobject ( basicThermo::dictName, - mesh.time().constant(), - mesh, + thermo.db().time().constant(), + thermo.db(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false @@ -116,10 +112,10 @@ New Info<< "chemistryTypeName " << chemistryTypeName << endl; - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(chemistryTypeName); + thermoConstructorTable::iterator cstrIter = + thermoConstructorTablePtr_->find(chemistryTypeName); - if (cstrIter == fvMeshConstructorTablePtr_->end()) + if (cstrIter == thermoConstructorTablePtr_->end()) { FatalErrorInFunction << "Unknown " << typeName << " type " << nl @@ -130,7 +126,7 @@ New // Get the list of all the suitable chemistry packages available wordList validChemistryTypeNames ( - fvMeshConstructorTablePtr_->sortedToc() + thermoConstructorTablePtr_->sortedToc() ); Info<< validChemistryTypeNames << endl; @@ -164,7 +160,8 @@ New FatalError<< exit(FatalError); } - return autoPtr(cstrIter()(mesh, phaseName)); + return + autoPtr(cstrIter()(thermo)); } diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C index 4f7771456..fd5ee59b7 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C @@ -33,11 +33,10 @@ template Foam::pyrolysisChemistryModel:: pyrolysisChemistryModel ( - const fvMesh& mesh, - const word& phaseName + typename CompType::reactionThermo& thermo ) : - solidChemistryModel(mesh, phaseName), + solidChemistryModel(thermo), pyrolisisGases_(this->reactions_[0].gasSpecies()), gasThermo_(pyrolisisGases_.size()), nGases_(pyrolisisGases_.size()), @@ -52,8 +51,8 @@ pyrolysisChemistryModel IOobject header ( this->Ys_[fieldi].name() + "0", - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ ); @@ -68,12 +67,12 @@ pyrolysisChemistryModel IOobject ( this->Ys_[fieldi].name() + "0", - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::MUST_READ, IOobject::AUTO_WRITE ), - mesh + this->mesh() ) ); } @@ -84,12 +83,12 @@ pyrolysisChemistryModel IOobject ( "Y0Default", - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::MUST_READ, IOobject::NO_WRITE ), - mesh + this->mesh() ); Ys0_.set @@ -100,8 +99,8 @@ pyrolysisChemistryModel IOobject ( this->Ys_[fieldi].name() + "0", - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), @@ -112,7 +111,7 @@ pyrolysisChemistryModel // Calculate inital values of Ysi0 = rho*delta*Yi Ys0_[fieldi].primitiveFieldRef() = this->solidThermo().rho() - *max(this->Ys_[fieldi], scalar(0.001))*mesh.V(); + *max(this->Ys_[fieldi], scalar(0.001))*this->mesh().V(); } } @@ -126,12 +125,12 @@ pyrolysisChemistryModel IOobject ( "RRg." + pyrolisisGases_[fieldi], - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + this->mesh(), dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) ) ); @@ -140,7 +139,7 @@ pyrolysisChemistryModel forAll(gasThermo_, gasI) { dictionary thermoDict = - mesh.lookupObject + this->mesh().template lookupObject ( basicThermo::dictName ).subDict(pyrolisisGases_[gasI]); diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H index 8e1581fd0..30e3b6d6c 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H @@ -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 @@ -105,8 +105,8 @@ public: // Constructors - //- Construct from mesh and phase name - pyrolysisChemistryModel(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + pyrolysisChemistryModel(typename CompType::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C index 47664c4fc..a490029ca 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,14 +29,12 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::solidChemistryModel:: -solidChemistryModel +Foam::solidChemistryModel::solidChemistryModel ( - const fvMesh& mesh, - const word& phaseName + typename CompType::reactionThermo& thermo ) : - CompType(mesh, phaseName), + CompType(thermo), ODESystem(), Ys_(this->solidThermo().composition().Y()), reactions_ @@ -56,7 +54,7 @@ solidChemistryModel nSolids_(Ys_.size()), nReaction_(reactions_.size()), RRs_(nSolids_), - reactingCells_(mesh.nCells(), true) + reactingCells_(this->mesh().nCells(), true) { // create the fields for the chemistry sources forAll(RRs_, fieldi) @@ -69,12 +67,12 @@ solidChemistryModel IOobject ( "RRs." + Ys_[fieldi].name(), - mesh.time().timeName(), - mesh, + this->mesh().time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), - mesh, + this->mesh(), dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) ) ); diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H index 0a04c4f4f..2e6715667 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H @@ -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 @@ -112,8 +112,8 @@ public: // Constructors - //- Construct from mesh and phase name - solidChemistryModel(const fvMesh& mesh, const word& phaseName); + //- Construct from thermo + solidChemistryModel(typename CompType::reactionThermo& thermo); //- Destructor diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H index 0a888421c..e78f6df97 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ namespace Foam ( \ Comp, \ SS##Schem##Comp##SThermo##GThermo, \ - fvMesh \ + thermo \ );