From 61cab84fa6a0b5ed428a4f19b030e63eeea7eca4 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 7 Dec 2017 11:54:48 +0000 Subject: [PATCH] combustionModel, chemistryModel: Simplified model selection The combustion and chemistry model selection has been simplified so that the user does not have to specify the form of the thermodynamics. Examples of new combustion and chemistry entries are as follows: In constant/combustionProperties: combustionModel PaSR; combustionModel FSD; In constant/chemistryProperties: chemistryType { solver ode; method TDAC; } All the angle bracket parts of the model names (e.g., ) have been removed as well as the chemistryThermo entry. The changes are mostly backward compatible. Only support for the angle bracket form of chemistry solver names has been removed. Warnings will print if some of the old entries are used, as the parts relating to thermodynamics are now ignored. --- .../solvers/combustion/chemFoam/chemFoam.C | 5 +- .../combustion/chemFoam/createFieldRefs.H | 7 +- .../combustion/chemFoam/createFields.H | 5 +- .../combustion/fireFoam/createFields.H | 8 +- .../solvers/combustion/fireFoam/fireFoam.C | 3 +- .../combustion/reactingFoam/createFields.H | 8 +- .../combustion/reactingFoam/reactingFoam.C | 3 +- .../rhoReactingBuoyantFoam/createFields.H | 8 +- .../rhoReactingBuoyantFoam.C | 3 +- .../rhoReactingFoam/createFields.H | 8 +- .../rhoReactingFoam/rhoReactingFoam.C | 3 +- .../coalChemistryFoam/coalChemistryFoam.C | 3 +- .../coalChemistryFoam/createFields.H | 8 +- .../reactingParcelFoam/createFields.H | 8 +- .../reactingParcelFoam/reactingParcelFoam.C | 3 +- .../simpleReactingParcelFoam/createFields.H | 8 +- .../simpleReactingParcelFoam.C | 3 +- .../lagrangian/sprayFoam/createFields.H | 8 +- .../sprayFoam/engineFoam/engineFoam.C | 3 +- .../sprayFoam/sprayDyMFoam/sprayDyMFoam.C | 3 +- .../solvers/lagrangian/sprayFoam/sprayFoam.C | 3 +- .../twoPhaseMixtureThermo.C | 6 + .../twoPhaseMixtureThermo.H | 3 + .../multiphaseMixtureThermo.C | 15 + .../multiphaseMixtureThermo.H | 3 + .../phaseModel/phaseModel/phaseModels.C | 4 +- .../ChemistryCombustion.C} | 25 +- .../ChemistryCombustion.H} | 48 ++- .../CombustionModel/CombustionModel.C} | 45 ++- .../CombustionModel/CombustionModel.H} | 57 ++- .../CombustionModel/CombustionModels.C} | 18 +- .../ThermoCombustion/ThermoCombustion.C} | 28 +- .../ThermoCombustion/ThermoCombustion.H} | 47 ++- src/combustionModels/EDC/EDC.C | 32 +- src/combustionModels/EDC/EDC.H | 6 +- src/combustionModels/EDC/EDCs.C | 8 +- src/combustionModels/FSD/FSD.C | 26 +- src/combustionModels/FSD/FSD.H | 6 +- src/combustionModels/FSD/FSDs.C | 48 +-- src/combustionModels/Make/files | 11 +- src/combustionModels/PaSR/PaSR.C | 36 +- src/combustionModels/PaSR/PaSR.H | 6 +- src/combustionModels/PaSR/PaSRs.C | 10 +- .../combustionModel/combustionModel.H | 16 + .../combustionModelTemplates.C | 171 +++++++++ .../combustionModel/makeCombustionTypes.H | 80 +++-- src/combustionModels/diffusion/diffusion.C | 22 +- src/combustionModels/diffusion/diffusion.H | 6 +- src/combustionModels/diffusion/diffusions.C | 46 +-- .../infinitelyFastChemistry.C | 22 +- .../infinitelyFastChemistry.H | 6 +- .../infinitelyFastChemistrys.C | 46 +-- src/combustionModels/laminar/laminar.C | 40 ++- src/combustionModels/laminar/laminar.H | 8 +- src/combustionModels/laminar/laminars.C | 10 +- .../noCombustion/noCombustion.C | 30 +- .../noCombustion/noCombustion.H | 10 +- .../noCombustion/noCombustions.C | 23 +- .../psiChemistryCombustion.H | 111 ------ .../psiCombustionModel/psiCombustionModel.C | 74 ---- .../psiCombustionModelNew.C | 78 ---- .../psiThermoCombustion/psiThermoCombustion.H | 110 ------ .../rhoChemistryCombustion.C | 65 ---- .../rhoCombustionModel/rhoCombustionModel.H | 154 -------- .../rhoCombustionModelNew.C | 80 ----- .../rhoThermoCombustion/rhoThermoCombustion.C | 64 ---- .../singleStepCombustion.C | 26 +- .../singleStepCombustion.H | 7 +- .../zoneCombustion/zoneCombustion.C | 68 ++-- .../zoneCombustion/zoneCombustion.H | 14 +- .../zoneCombustion/zoneCombustions.C | 10 +- .../basic/basicThermo/basicThermo.H | 3 + .../basic/heThermo/heThermo.H | 6 + .../chemistryModel/Make/files | 7 +- .../BasicChemistryModel.C} | 33 +- .../BasicChemistryModel.H} | 57 ++- .../BasicChemistryModelI.H} | 9 +- .../BasicChemistryModels.C | 339 ++++++++++++++++++ .../StandardChemistryModel.C} | 76 ++-- .../StandardChemistryModel.H} | 33 +- .../StandardChemistryModelI.H} | 41 +-- .../TDACChemistryModel/TDACChemistryModel.C | 67 ++-- .../TDACChemistryModel/TDACChemistryModel.H | 27 +- .../TDACChemistryModel/TDACChemistryModelI.H | 79 ++-- .../chemistryReductionMethodNew.C | 103 +++--- .../reduction/makeChemistryReductionMethods.C | 46 +-- .../reduction/makeChemistryReductionMethods.H | 8 +- .../chemistryTabulationMethodNew.C | 104 +++--- .../makeChemistryTabulationMethods.C | 46 +-- .../makeChemistryTabulationMethods.H | 4 +- .../basicChemistryModelTemplates.C | 230 ++++++------ .../chemistryModel/makeChemistryModel.H | 22 +- .../psiChemistryModel/psiChemistryModel.H | 135 ------- .../psiChemistryModel/psiChemistryModels.C | 189 ---------- .../rhoChemistryModel/rhoChemistryModel.C | 64 ---- .../rhoChemistryModel/rhoChemistryModels.C | 189 ---------- .../EulerImplicit/EulerImplicit.C | 1 + .../EulerImplicit/EulerImplicit.H | 4 + .../chemistrySolver/chemistrySolver.H | 1 - .../makeChemistrySolverTypes.H | 57 ++- .../chemistrySolver/makeChemistrySolvers.C | 46 +-- .../chemistryModel/chemistrySolver/ode/ode.C | 1 - .../specieReactionRates/specieReactionRates.C | 25 +- .../basicMultiComponentMixture.C | 1 + .../basicMultiComponentMixture.H | 5 +- .../thermophysicalPropertiesSelector.H | 9 + .../membrane/constant/combustionProperties | 2 +- 107 files changed, 1720 insertions(+), 2345 deletions(-) rename src/combustionModels/{psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C => CombustionModel/ChemistryCombustion/ChemistryCombustion.C} (73%) rename src/combustionModels/{rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H => CombustionModel/ChemistryCombustion/ChemistryCombustion.H} (72%) rename src/combustionModels/{rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C => CombustionModel/CombustionModel/CombustionModel.C} (66%) rename src/combustionModels/{psiCombustionModel/psiCombustionModel/psiCombustionModel.H => CombustionModel/CombustionModel/CombustionModel.H} (74%) rename src/{thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H => combustionModels/CombustionModel/CombustionModel/CombustionModels.C} (81%) rename src/combustionModels/{psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C => CombustionModel/ThermoCombustion/ThermoCombustion.C} (71%) rename src/combustionModels/{rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H => CombustionModel/ThermoCombustion/ThermoCombustion.H} (72%) create mode 100644 src/combustionModels/combustionModel/combustionModelTemplates.C delete mode 100644 src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H delete mode 100644 src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C delete mode 100644 src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C delete mode 100644 src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H delete mode 100644 src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C delete mode 100644 src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H delete mode 100644 src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C delete mode 100644 src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C rename src/thermophysicalModels/chemistryModel/chemistryModel/{psiChemistryModel/psiChemistryModel.C => BasicChemistryModel/BasicChemistryModel.C} (74%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{rhoChemistryModel/rhoChemistryModel.H => BasicChemistryModel/BasicChemistryModel.H} (71%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{psiChemistryModel/psiChemistryModelI.H => BasicChemistryModel/BasicChemistryModelI.H} (84%) create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModel.C => StandardChemistryModel/StandardChemistryModel.C} (88%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModel.H => StandardChemistryModel/StandardChemistryModel.H} (91%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModelI.H => StandardChemistryModel/StandardChemistryModelI.H} (63%) delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C diff --git a/applications/solvers/combustion/chemFoam/chemFoam.C b/applications/solvers/combustion/chemFoam/chemFoam.C index a68d7d079..8a5c33cbe 100644 --- a/applications/solvers/combustion/chemFoam/chemFoam.C +++ b/applications/solvers/combustion/chemFoam/chemFoam.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 @@ -33,7 +33,8 @@ Description #include "fvCFD.H" #include "psiReactionThermo.H" -#include "psiChemistryModel.H" +#include "BasicChemistryModel.H" +#include "reactingMixture.H" #include "chemistrySolver.H" #include "OFstream.H" #include "thermoPhysicsTypes.H" diff --git a/applications/solvers/combustion/chemFoam/createFieldRefs.H b/applications/solvers/combustion/chemFoam/createFieldRefs.H index db7fb51a1..fa0fbe2fe 100644 --- a/applications/solvers/combustion/chemFoam/createFieldRefs.H +++ b/applications/solvers/combustion/chemFoam/createFieldRefs.H @@ -1,5 +1,8 @@ -psiChemistryModel& chemistry = pChemistry(); -scalar dtChem = refCast(chemistry).deltaTChem()[0]; +BasicChemistryModel& chemistry = pChemistry(); +scalar dtChem = refCast> +( + chemistry +).deltaTChem()[0]; basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); volScalarField& p = thermo.p(); diff --git a/applications/solvers/combustion/chemFoam/createFields.H b/applications/solvers/combustion/chemFoam/createFields.H index 28529708c..a70760962 100644 --- a/applications/solvers/combustion/chemFoam/createFields.H +++ b/applications/solvers/combustion/chemFoam/createFields.H @@ -28,7 +28,10 @@ psiReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h"); - autoPtr pChemistry(psiChemistryModel::New(thermo)); + autoPtr> pChemistry + ( + BasicChemistryModel::New(thermo) + ); volScalarField rho ( diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 35048d915..4d54029be 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -65,9 +65,13 @@ autoPtr turbulence ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr> combustion ( - combustionModels::psiCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index f0c760dc1..ad51a77fe 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -38,7 +38,8 @@ Description #include "radiationModel.H" #include "SLGThermo.H" #include "solidChemistryModel.H" -#include "psiCombustionModel.H" +#include "psiReactionThermo.H" +#include "CombustionModel.H" #include "pimpleControl.H" #include "fvOptions.H" diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 7b10733c2..2659ca02c 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -62,9 +62,13 @@ autoPtr turbulence ); Info<< "Creating reaction model\n" << endl; -autoPtr reaction +autoPtr> reaction ( - combustionModels::psiCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); Info<< "Creating field dpdt\n" << endl; diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 9184fd6f6..213582356 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -31,7 +31,8 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" -#include "psiCombustionModel.H" +#include "psiReactionThermo.H" +#include "CombustionModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" #include "pressureControl.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H index 624f7e504..c7b04b5c8 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/createFields.H @@ -63,9 +63,13 @@ autoPtr turbulence ); Info<< "Creating reaction model\n" << endl; -autoPtr reaction +autoPtr> reaction ( - combustionModels::rhoCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); #include "readGravitationalAcceleration.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C index c1ba78de4..eb0200aed 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingBuoyantFoam/rhoReactingBuoyantFoam.C @@ -31,7 +31,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "rhoCombustionModel.H" +#include "rhoReactionThermo.H" +#include "CombustionModel.H" #include "turbulentFluidThermoModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H index 2e23afe90..610efd71d 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/createFields.H @@ -65,9 +65,13 @@ autoPtr turbulence ); Info<< "Creating reaction model\n" << endl; -autoPtr reaction +autoPtr> reaction ( - combustionModels::rhoCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); diff --git a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C index d06f51e99..d3f4234f4 100644 --- a/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/rhoReactingFoam/rhoReactingFoam.C @@ -31,7 +31,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "rhoCombustionModel.H" +#include "rhoReactionThermo.H" +#include "CombustionModel.H" #include "turbulentFluidThermoModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index 16d4c44e2..53047c1c8 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -34,7 +34,8 @@ Description #include "turbulentFluidThermoModel.H" #include "basicThermoCloud.H" #include "coalCloud.H" -#include "psiCombustionModel.H" +#include "psiReactionThermo.H" +#include "CombustionModel.H" #include "fvOptions.H" #include "radiationModel.H" #include "SLGThermo.H" diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 423ac3e17..9ab6773d2 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -108,9 +108,13 @@ autoPtr turbulence ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr> combustion ( - combustionModels::psiCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); Info<< "Creating field dpdt\n" << endl; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index 03d5f36e0..ee95ea3ea 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -64,9 +64,13 @@ autoPtr turbulence ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr> combustion ( - combustionModels::rhoCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); Info<< "Creating field dpdt\n" << endl; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index 95b0badb1..597bc8b26 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -34,7 +34,8 @@ Description #include "turbulentFluidThermoModel.H" #include "basicReactingMultiphaseCloud.H" #include "surfaceFilmModel.H" -#include "rhoCombustionModel.H" +#include "rhoReactionThermo.H" +#include "CombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "fvOptions.H" diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H index 3bbf4fa20..369dcec9c 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/createFields.H @@ -87,9 +87,13 @@ autoPtr turbulence ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr> combustion ( - combustionModels::rhoCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); Info<< "Creating multi-variate interpolation scheme\n" << endl; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C index 25a2e310f..d9b02c472 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/simpleReactingParcelFoam.C @@ -33,7 +33,8 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" #include "basicReactingMultiphaseCloud.H" -#include "rhoCombustionModel.H" +#include "rhoReactionThermo.H" +#include "CombustionModel.H" #include "radiationModel.H" #include "IOporosityModelList.H" #include "fvOptions.H" diff --git a/applications/solvers/lagrangian/sprayFoam/createFields.H b/applications/solvers/lagrangian/sprayFoam/createFields.H index 9920dd7ca..b6bbc8021 100644 --- a/applications/solvers/lagrangian/sprayFoam/createFields.H +++ b/applications/solvers/lagrangian/sprayFoam/createFields.H @@ -87,9 +87,13 @@ autoPtr turbulence ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr> combustion ( - combustionModels::psiCombustionModel::New(thermo, turbulence()) + combustionModels::CombustionModel::New + ( + thermo, + turbulence() + ) ); Info<< "Creating field dpdt\n" << endl; diff --git a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C index 71f0be0df..1b7076e3a 100644 --- a/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/engineFoam/engineFoam.C @@ -35,7 +35,8 @@ Description #include "engineMesh.H" #include "turbulentFluidThermoModel.H" #include "basicSprayCloud.H" -#include "psiCombustionModel.H" +#include "psiReactionThermo.H" +#include "CombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C index dcc751c18..1422c7401 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayDyMFoam/sprayDyMFoam.C @@ -34,7 +34,8 @@ Description #include "dynamicFvMesh.H" #include "turbulenceModel.H" #include "basicSprayCloud.H" -#include "psiCombustionModel.H" +#include "psiReactionThermo.H" +#include "CombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C index fa8d51b96..e258346d3 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C @@ -33,7 +33,8 @@ Description #include "fvCFD.H" #include "turbulentFluidThermoModel.H" #include "basicSprayCloud.H" -#include "psiCombustionModel.H" +#include "psiReactionThermo.H" +#include "CombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C index 05d3bedfd..69daa03ab 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C @@ -98,6 +98,12 @@ void Foam::twoPhaseMixtureThermo::correct() } +Foam::word Foam::twoPhaseMixtureThermo::thermoName() const +{ + return thermo1_->thermoName() + ',' + thermo2_->thermoName(); +} + + bool Foam::twoPhaseMixtureThermo::incompressible() const { return thermo1_->incompressible() && thermo2_->incompressible(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index 9047d6d85..907d09a0f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -113,6 +113,9 @@ public: //- Update mixture properties virtual void correct(); + //- Return the name of the thermo physics + virtual word thermoName() const; + //- Return true if the equation of state is incompressible // i.e. rho != f(p) virtual bool incompressible() const; diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C index c9f687089..1cfc445e2 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.C @@ -152,6 +152,21 @@ void Foam::multiphaseMixtureThermo::correctRho(const volScalarField& dp) } +Foam::word Foam::multiphaseMixtureThermo::thermoName() const +{ + PtrDictionary::const_iterator phasei = phases_.begin(); + + word name = phasei().thermo().thermoName(); + + for (++ phasei; phasei != phases_.end(); ++ phasei) + { + name += ',' + phasei().thermo().thermoName(); + } + + return name; +} + + bool Foam::multiphaseMixtureThermo::incompressible() const { bool ico = true; diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H index 15cc2ee06..83f575b03 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/multiphaseMixtureThermo/multiphaseMixtureThermo.H @@ -238,6 +238,9 @@ public: //- Update densities for given pressure change void correctRho(const volScalarField& dp); + //- Return the name of the thermo physics + virtual word thermoName() const; + //- Return true if the equation of state is incompressible // i.e. rho != f(p) virtual bool incompressible() const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C index b5a631339..26fa7d1e6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModels.C @@ -28,7 +28,7 @@ License #include "rhoThermo.H" #include "rhoReactionThermo.H" -#include "rhoCombustionModel.H" +#include "CombustionModel.H" #include "phaseModel.H" #include "ThermoPhaseModel.H" @@ -127,7 +127,7 @@ namespace Foam < ThermoPhaseModel >, - combustionModels::rhoCombustionModel + combustionModels::CombustionModel > > > diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C b/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C similarity index 73% rename from src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C rename to src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C index a4966c425..e7ba6884b 100644 --- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C +++ b/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.C @@ -23,46 +23,51 @@ License \*---------------------------------------------------------------------------*/ -#include "psiChemistryCombustion.H" +#include "ChemistryCombustion.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion +template +Foam::combustionModels::ChemistryCombustion::ChemistryCombustion ( const word& modelType, - psiReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - psiCombustionModel + CombustionModel ( modelType, thermo, turb, combustionProperties ), - chemistryPtr_(psiChemistryModel::New(thermo)) + chemistryPtr_(BasicChemistryModel::New(thermo)) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::combustionModels::psiChemistryCombustion::~psiChemistryCombustion() +template +Foam::combustionModels::ChemistryCombustion:: +~ChemistryCombustion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::psiReactionThermo& -Foam::combustionModels::psiChemistryCombustion::thermo() +template +ReactionThermo& +Foam::combustionModels::ChemistryCombustion::thermo() { return chemistryPtr_->thermo(); } -const Foam::psiReactionThermo& -Foam::combustionModels::psiChemistryCombustion::thermo() const +template +const ReactionThermo& +Foam::combustionModels::ChemistryCombustion::thermo() const { return chemistryPtr_->thermo(); } diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H b/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H similarity index 72% rename from src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H rename to src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H index 8d361c699..0a0925370 100644 --- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H +++ b/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H @@ -22,22 +22,22 @@ License along with OpenFOAM. If not, see . Class - Foam::rhoChemistryCombustion + Foam::ChemistryCombustion Description - Density-based chemistry model wrapper for combustion models + Chemistry model wrapper for combustion models SourceFiles - rhoChemistryCombustion.C + ChemistryCombustion.C \*---------------------------------------------------------------------------*/ -#ifndef rhoChemistryCombustion_H -#define rhoChemistryCombustion_H +#ifndef ChemistryCombustion_H +#define ChemistryCombustion_H #include "autoPtr.H" -#include "rhoCombustionModel.H" -#include "rhoChemistryModel.H" +#include "CombustionModel.H" +#include "BasicChemistryModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,28 +47,20 @@ namespace combustionModels { /*---------------------------------------------------------------------------*\ - class rhoChemistryCombustion Declaration + class ChemistryCombustion Declaration \*---------------------------------------------------------------------------*/ -class rhoChemistryCombustion +template +class ChemistryCombustion : - public rhoCombustionModel + public CombustionModel { - // Private Member Functions - - //- Construct as copy (not implemented) - rhoChemistryCombustion(const rhoChemistryCombustion&); - - //- Disallow default bitwise assignment - void operator=(const rhoChemistryCombustion&); - - protected: // Protected data //- Pointer to chemistry model - autoPtr chemistryPtr_; + autoPtr> chemistryPtr_; public: @@ -76,26 +68,26 @@ public: // Constructors //- Construct from components and thermo - rhoChemistryCombustion + ChemistryCombustion ( const word& modelType, - rhoReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); //- Destructor - virtual ~rhoChemistryCombustion(); + virtual ~ChemistryCombustion(); // Member Functions //- Return access to the thermo package - virtual rhoReactionThermo& thermo(); + virtual ReactionThermo& thermo(); //- Return const access to the thermo package - virtual const rhoReactionThermo& thermo() const; + virtual const ReactionThermo& thermo() const; }; @@ -106,6 +98,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "ChemistryCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C b/src/combustionModels/CombustionModel/CombustionModel/CombustionModel.C similarity index 66% rename from src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C rename to src/combustionModels/CombustionModel/CombustionModel/CombustionModel.C index 07317cb0a..8f8e906fd 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C +++ b/src/combustionModels/CombustionModel/CombustionModel/CombustionModel.C @@ -23,25 +23,15 @@ License \*---------------------------------------------------------------------------*/ -#include "rhoCombustionModel.H" - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ -namespace combustionModels -{ - defineTypeNameAndDebug(rhoCombustionModel, 0); - defineRunTimeSelectionTable(rhoCombustionModel, dictionary); -} -} +#include "CombustionModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::combustionModels::rhoCombustionModel::rhoCombustionModel +template +Foam::combustionModels::CombustionModel::CombustionModel ( const word& modelType, - rhoReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) @@ -50,15 +40,38 @@ Foam::combustionModels::rhoCombustionModel::rhoCombustionModel {} +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr> +Foam::combustionModels::CombustionModel::New +( + ReactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +{ + return + combustionModel::New> + ( + thermo, + turb, + combustionProperties + ); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::combustionModels::rhoCombustionModel::~rhoCombustionModel() +template +Foam::combustionModels::CombustionModel::~CombustionModel() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::combustionModels::rhoCombustionModel::read() +template +bool Foam::combustionModels::CombustionModel::read() { if (combustionModel::read()) { diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H b/src/combustionModels/CombustionModel/CombustionModel/CombustionModel.H similarity index 74% rename from src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H rename to src/combustionModels/CombustionModel/CombustionModel/CombustionModel.H index 621b3a02c..6676fc7cd 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H +++ b/src/combustionModels/CombustionModel/CombustionModel/CombustionModel.H @@ -22,25 +22,24 @@ License along with OpenFOAM. If not, see . Class - Foam::psiCombustionModel + Foam::CombustionModel Description - Combustion models for compressibility-based thermodynamics + Combustion models for templated thermodynamics SourceFiles - psiCombustionModelI.H - psiCombustionModel.C - psiCombustionModelNew.C + CombustionModelI.H + CombustionModel.C + CombustionModelNew.C \*---------------------------------------------------------------------------*/ -#ifndef psiCombustionModel_H -#define psiCombustionModel_H +#ifndef CombustionModel_H +#define CombustionModel_H #include "combustionModel.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" -#include "psiReactionThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,41 +49,33 @@ namespace combustionModels { /*---------------------------------------------------------------------------*\ - class psiCombustionModel Declaration + class CombustionModel Declaration \*---------------------------------------------------------------------------*/ -class psiCombustionModel +template +class CombustionModel : public combustionModel { - // Private Member Functions - - //- Construct as copy (not implemented) - psiCombustionModel(const psiCombustionModel&); - - //- Disallow default bitwise assignment - void operator=(const psiCombustionModel&); - - public: //- Thermo type - typedef psiReactionThermo reactionThermo; + typedef ReactionThermo reactionThermo; //- Runtime type information - TypeName("psiCombustionModel"); + TypeName("CombustionModel"); //- Declare run-time constructor selection tables declareRunTimeSelectionTable ( autoPtr, - psiCombustionModel, + CombustionModel, dictionary, ( const word& modelType, - psiReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ), @@ -95,35 +86,35 @@ public: // Constructors //- Construct from components - psiCombustionModel + CombustionModel ( const word& modelType, - psiReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); //- Selector - static autoPtr New + static autoPtr New ( - psiReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties=combustionPropertiesName ); //- Destructor - virtual ~psiCombustionModel(); + virtual ~CombustionModel(); // Member Functions //- Return access to the thermo package - virtual psiReactionThermo& thermo() = 0; + virtual ReactionThermo& thermo() = 0; //- Return const access to the thermo package - virtual const psiReactionThermo& thermo() const = 0; + virtual const ReactionThermo& thermo() const = 0; // IO @@ -140,6 +131,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "CombustionModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H b/src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C similarity index 81% rename from src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H rename to src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C index fd40522ac..b74299206 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H +++ b/src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C @@ -23,18 +23,18 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +#include "makeCombustionTypes.H" -inline Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo() -{ - return thermo_; -} +#include "ChemistryCombustion.H" +#include "ThermoCombustion.H" +#include "rhoReactionThermo.H" +#include "psiReactionThermo.H" -inline const Foam::rhoReactionThermo& Foam::rhoChemistryModel::thermo() const -{ - return thermo_; -} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeCombustion(psiReactionThermo); +makeCombustion(rhoReactionThermo); // ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C b/src/combustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C similarity index 71% rename from src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C rename to src/combustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C index cc4c342c1..b9989a373 100644 --- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C +++ b/src/combustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.C @@ -23,39 +23,49 @@ License \*---------------------------------------------------------------------------*/ -#include "psiThermoCombustion.H" +#include "ThermoCombustion.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::combustionModels::psiThermoCombustion::psiThermoCombustion +template +Foam::combustionModels::ThermoCombustion::ThermoCombustion ( const word& modelType, - psiReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb ) : - psiCombustionModel(modelType, thermo, turb, combustionPropertiesName), + CombustionModel + ( + modelType, + thermo, + turb, + combustionModel::combustionPropertiesName + ), thermo_(thermo) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::combustionModels::psiThermoCombustion::~psiThermoCombustion() +template +Foam::combustionModels::ThermoCombustion::~ThermoCombustion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::psiReactionThermo& -Foam::combustionModels::psiThermoCombustion::thermo() +template +ReactionThermo& +Foam::combustionModels::ThermoCombustion::thermo() { return thermo_; } -const Foam::psiReactionThermo& -Foam::combustionModels::psiThermoCombustion::thermo() const +template +const ReactionThermo& +Foam::combustionModels::ThermoCombustion::thermo() const { return thermo_; } diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H b/src/combustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H similarity index 72% rename from src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H rename to src/combustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H index 7dfa06fa4..4726d3ed5 100644 --- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H +++ b/src/combustionModels/CombustionModel/ThermoCombustion/ThermoCombustion.H @@ -22,22 +22,21 @@ License along with OpenFOAM. If not, see . Class - Foam::rhoThermoCombustion + Foam::ThermoCombustion Description - Density-based thermo model wrapper for combustion models + Thermo model wrapper for combustion models SourceFiles - rhoThermoCombustion.C + ThermoCombustion.C \*---------------------------------------------------------------------------*/ -#ifndef rhoThermoCombustion_H -#define rhoThermoCombustion_H +#ifndef ThermoCombustion_H +#define ThermoCombustion_H #include "autoPtr.H" -#include "rhoCombustionModel.H" -#include "rhoChemistryModel.H" +#include "CombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,28 +46,20 @@ namespace combustionModels { /*---------------------------------------------------------------------------*\ - class rhoThermoCombustion Declaration + class ThermoCombustion Declaration \*---------------------------------------------------------------------------*/ -class rhoThermoCombustion +template +class ThermoCombustion : - public rhoCombustionModel + public CombustionModel { - // Private Member Functions - - //- Construct as copy (not implemented) - rhoThermoCombustion(const rhoThermoCombustion&); - - //- Disallow default bitwise assignment - void operator=(const rhoThermoCombustion&); - - protected: // Protected data //- Thermo - rhoReactionThermo& thermo_; + ReactionThermo& thermo_; public: @@ -76,25 +67,25 @@ public: // Constructors //- Construct from components - rhoThermoCombustion + ThermoCombustion ( const word& modelType, - rhoReactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb ); //- Destructor - virtual ~rhoThermoCombustion(); + virtual ~ThermoCombustion(); // Member Functions //- Return access to the thermo package - virtual rhoReactionThermo& thermo(); + virtual ReactionThermo& thermo(); //- Return const access to the thermo package - virtual const rhoReactionThermo& thermo() const; + virtual const ReactionThermo& thermo() const; }; @@ -105,6 +96,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "ThermoCombustion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/combustionModels/EDC/EDC.C b/src/combustionModels/EDC/EDC.C index e629547cc..23ed387e5 100644 --- a/src/combustionModels/EDC/EDC.C +++ b/src/combustionModels/EDC/EDC.C @@ -27,16 +27,16 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::combustionModels::EDC::EDC +template +Foam::combustionModels::EDC::EDC ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - laminar(modelType, thermo, turb, combustionProperties), + laminar(modelType, thermo, turb, combustionProperties), version_ ( EDCversionNames @@ -72,15 +72,15 @@ Foam::combustionModels::EDC::EDC // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::combustionModels::EDC::~EDC() +template +Foam::combustionModels::EDC::~EDC() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -void Foam::combustionModels::EDC::correct() +template +void Foam::combustionModels::EDC::correct() { if (this->active()) { @@ -174,17 +174,17 @@ void Foam::combustionModels::EDC::correct() } -template +template Foam::tmp -Foam::combustionModels::EDC::R(volScalarField& Y) const +Foam::combustionModels::EDC::R(volScalarField& Y) const { - return kappa_*laminar::R(Y); + return kappa_*laminar::R(Y); } -template +template Foam::tmp -Foam::combustionModels::EDC::Qdot() const +Foam::combustionModels::EDC::Qdot() const { tmp tQdot ( @@ -213,10 +213,10 @@ Foam::combustionModels::EDC::Qdot() const } -template -bool Foam::combustionModels::EDC::read() +template +bool Foam::combustionModels::EDC::read() { - if (Type::read()) + if (laminar::read()) { version_ = ( diff --git a/src/combustionModels/EDC/EDC.H b/src/combustionModels/EDC/EDC.H index 478c8aea7..8d954ea31 100644 --- a/src/combustionModels/EDC/EDC.H +++ b/src/combustionModels/EDC/EDC.H @@ -128,10 +128,10 @@ const scalar EDCexp2[] = {3, 3, 2, 2}; Class EDC Declaration \*---------------------------------------------------------------------------*/ -template +template class EDC : - public laminar + public laminar { // Private data @@ -170,7 +170,7 @@ public: EDC ( const word& modelType, - typename Type::reactionThermo& type, + ReactionThermo& type, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/EDC/EDCs.C b/src/combustionModels/EDC/EDCs.C index 280d6c3db..2c378d4a0 100644 --- a/src/combustionModels/EDC/EDCs.C +++ b/src/combustionModels/EDC/EDCs.C @@ -25,8 +25,8 @@ License #include "makeCombustionTypes.H" -#include "psiChemistryCombustion.H" -#include "rhoChemistryCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "EDC.H" // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // @@ -55,7 +55,7 @@ Foam::combustionModels::EDCdefaultVersion // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeCombustionTypes(EDC, psiChemistryCombustion, psiCombustionModel); -makeCombustionTypes(EDC, rhoChemistryCombustion, rhoCombustionModel); +makeCombustionTypes(EDC, psiReactionThermo); +makeCombustionTypes(EDC, rhoReactionThermo); // ************************************************************************* // diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index b50281fb1..ef3abdf4c 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -36,16 +36,16 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -FSD::FSD +template +FSD::FSD ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - singleStepCombustion + singleStepCombustion ( modelType, thermo, @@ -87,15 +87,15 @@ FSD::FSD // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -FSD::~FSD() +template +FSD::~FSD() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -void FSD::calculateSourceNorm() +template +void FSD::calculateSourceNorm() { this->singleMixturePtr_->fresCorrect(); @@ -335,8 +335,8 @@ void FSD::calculateSourceNorm() } -template -void FSD::correct() +template +void FSD::correct() { this->wFuel_ == dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0); @@ -348,10 +348,10 @@ void FSD::correct() } -template -bool FSD::read() +template +bool FSD::read() { - if (singleStepCombustion::read()) + if (singleStepCombustion::read()) { this->coeffs().lookup("Cv") >> Cv_ ; this->coeffs().lookup("ftVarMin") >> ftVarMin_; diff --git a/src/combustionModels/FSD/FSD.H b/src/combustionModels/FSD/FSD.H index 3fb7d555a..f1f8ea4f6 100644 --- a/src/combustionModels/FSD/FSD.H +++ b/src/combustionModels/FSD/FSD.H @@ -77,10 +77,10 @@ namespace combustionModels Class FSD Declaration \*---------------------------------------------------------------------------*/ -template +template class FSD : - public singleStepCombustion + public singleStepCombustion { // Private data @@ -139,7 +139,7 @@ public: FSD ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/FSD/FSDs.C b/src/combustionModels/FSD/FSDs.C index 1fff6a86e..08c6d682b 100644 --- a/src/combustionModels/FSD/FSDs.C +++ b/src/combustionModels/FSD/FSDs.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 @@ -26,10 +26,8 @@ License #include "makeCombustionTypes.H" #include "thermoPhysicsTypes.H" -#include "psiCombustionModel.H" -#include "psiThermoCombustion.H" -#include "rhoCombustionModel.H" -#include "rhoThermoCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "FSD.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -38,66 +36,58 @@ License makeCombustionTypesThermo ( FSD, - psiThermoCombustion, - gasHThermoPhysics, - psiCombustionModel + psiReactionThermo, + gasHThermoPhysics ); makeCombustionTypesThermo ( FSD, - psiThermoCombustion, - constGasHThermoPhysics, - psiCombustionModel + psiReactionThermo, + constGasHThermoPhysics ); makeCombustionTypesThermo ( FSD, - rhoThermoCombustion, - gasHThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + gasHThermoPhysics ); makeCombustionTypesThermo ( FSD, - rhoThermoCombustion, - constGasHThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + constGasHThermoPhysics ); // Combustion models based on sensibleInternalEnergy makeCombustionTypesThermo ( FSD, - psiThermoCombustion, - gasEThermoPhysics, - psiCombustionModel + psiReactionThermo, + gasEThermoPhysics ); makeCombustionTypesThermo ( FSD, - psiThermoCombustion, - constGasEThermoPhysics, - psiCombustionModel + psiReactionThermo, + constGasEThermoPhysics ); makeCombustionTypesThermo ( FSD, - rhoThermoCombustion, - gasEThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + gasEThermoPhysics ); makeCombustionTypesThermo ( FSD, - rhoThermoCombustion, - constGasEThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + constGasEThermoPhysics ); diff --git a/src/combustionModels/Make/files b/src/combustionModels/Make/files index 783bb68fa..76efa6827 100644 --- a/src/combustionModels/Make/files +++ b/src/combustionModels/Make/files @@ -1,14 +1,5 @@ combustionModel/combustionModel.C - -psiCombustionModel/psiCombustionModel/psiCombustionModel.C -psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C -psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C -psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C - -rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C -rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C -rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C -rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C +CombustionModel/CombustionModel/CombustionModels.C diffusion/diffusions.C infinitelyFastChemistry/infinitelyFastChemistrys.C diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index 9bbf8f582..47734391d 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -27,16 +27,16 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::combustionModels::PaSR::PaSR +template +Foam::combustionModels::PaSR::PaSR ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - laminar(modelType, thermo, turb, combustionProperties), + laminar(modelType, thermo, turb, combustionProperties), Cmix_(readScalar(this->coeffs().lookup("Cmix"))), kappa_ ( @@ -56,19 +56,19 @@ Foam::combustionModels::PaSR::PaSR // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::combustionModels::PaSR::~PaSR() +template +Foam::combustionModels::PaSR::~PaSR() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -void Foam::combustionModels::PaSR::correct() +template +void Foam::combustionModels::PaSR::correct() { if (this->active()) { - laminar::correct(); + laminar::correct(); tmp tepsilon(this->turbulence().epsilon()); const scalarField& epsilon = tepsilon(); @@ -100,33 +100,33 @@ void Foam::combustionModels::PaSR::correct() } -template +template Foam::tmp -Foam::combustionModels::PaSR::R(volScalarField& Y) const +Foam::combustionModels::PaSR::R(volScalarField& Y) const { - return kappa_*laminar::R(Y); + return kappa_*laminar::R(Y); } -template +template Foam::tmp -Foam::combustionModels::PaSR::Qdot() const +Foam::combustionModels::PaSR::Qdot() const { return tmp ( new volScalarField ( this->thermo().phasePropertyName(typeName + ":Qdot"), - kappa_*laminar::Qdot() + kappa_*laminar::Qdot() ) ); } -template -bool Foam::combustionModels::PaSR::read() +template +bool Foam::combustionModels::PaSR::read() { - if (laminar::read()) + if (laminar::read()) { this->coeffs().lookup("Cmix") >> Cmix_; return true; diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H index 0ac549c1e..f1c4ff2c4 100644 --- a/src/combustionModels/PaSR/PaSR.H +++ b/src/combustionModels/PaSR/PaSR.H @@ -52,10 +52,10 @@ namespace combustionModels Class PaSR Declaration \*---------------------------------------------------------------------------*/ -template +template class PaSR : - public laminar + public laminar { // Private data @@ -87,7 +87,7 @@ public: PaSR ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/PaSR/PaSRs.C b/src/combustionModels/PaSR/PaSRs.C index 0e52c3f0a..5113f3d66 100644 --- a/src/combustionModels/PaSR/PaSRs.C +++ b/src/combustionModels/PaSR/PaSRs.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 @@ -25,14 +25,14 @@ License #include "makeCombustionTypes.H" -#include "psiChemistryCombustion.H" -#include "rhoChemistryCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "PaSR.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeCombustionTypes(PaSR, psiChemistryCombustion, psiCombustionModel); -makeCombustionTypes(PaSR, rhoChemistryCombustion, rhoCombustionModel); +makeCombustionTypes(PaSR, psiReactionThermo); +makeCombustionTypes(PaSR, rhoReactionThermo); // ************************************************************************* // diff --git a/src/combustionModels/combustionModel/combustionModel.H b/src/combustionModels/combustionModel/combustionModel.H index 8c3b085db..be3e8728d 100644 --- a/src/combustionModels/combustionModel/combustionModel.H +++ b/src/combustionModels/combustionModel/combustionModel.H @@ -101,6 +101,18 @@ public: ); + // Selectors + + //- Generic New for each of the related chemistry model + template + static autoPtr New + ( + typename CombustionModel::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties + ); + + //- Destructor virtual ~combustionModel(); @@ -147,6 +159,10 @@ public: #include "combustionModelI.H" +#ifdef NoRepository + #include "combustionModelTemplates.C" +#endif + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/combustionModels/combustionModel/combustionModelTemplates.C b/src/combustionModels/combustionModel/combustionModelTemplates.C new file mode 100644 index 000000000..8be92d0d8 --- /dev/null +++ b/src/combustionModels/combustionModel/combustionModelTemplates.C @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr Foam::combustionModel::New +( + typename CombustionModel::reactionThermo& thermo, + const compressibleTurbulenceModel& turb, + const word& combustionProperties +) +{ + word combModelName + ( + IOdictionary + ( + IOobject + ( + thermo.phasePropertyName(combustionProperties), + thermo.db().time().constant(), + thermo.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ).lookup("combustionModel") + ); + + Info<< "Selecting combustion model " << combModelName << endl; + + const wordList cmpts2(basicThermo::splitThermoName(combModelName, 2)); + const wordList cmpts3(basicThermo::splitThermoName(combModelName, 3)); + if (cmpts2.size() == 2 || cmpts3.size() == 3) + { + combModelName = cmpts2.size() ? cmpts2[0] : cmpts3[0]; + + WarningInFunction + << "Template parameters are no longer required when selecting a " + << combustionModel::typeName << ". This information is now " + << "obtained directly from the thermodynamics. Actually selecting " + << "combustion model " << combModelName << "." << endl; + } + + typedef typename CombustionModel::dictionaryConstructorTable cstrTableType; + cstrTableType* cstrTable = CombustionModel::dictionaryConstructorTablePtr_; + + const word compCombModelName = + combModelName + '<' + CombustionModel::reactionThermo::typeName + '>'; + + const word thermoCombModelName = + combModelName + '<' + CombustionModel::reactionThermo::typeName + ',' + + thermo.thermoName() + '>'; + + typename cstrTableType::iterator compCstrIter = + cstrTable->find(compCombModelName); + + typename cstrTableType::iterator thermoCstrIter = + cstrTable->find(thermoCombModelName); + + if (compCstrIter == cstrTable->end() && thermoCstrIter == cstrTable->end()) + { + FatalErrorInFunction + << "Unknown " << combustionModel::typeName << " type " + << combModelName << endl << endl; + + const wordList names(cstrTable->toc()); + + wordList thisCmpts; + thisCmpts.append(word::null); + thisCmpts.append(CombustionModel::reactionThermo::typeName); + thisCmpts.append(basicThermo::splitThermoName(thermo.thermoName(), 5)); + + wordList validNames; + forAll(names, i) + { + wordList cmpts(basicThermo::splitThermoName(names[i], 2)); + if (cmpts.size() != 2) + { + cmpts = basicThermo::splitThermoName(names[i], 7); + } + + bool isValid = true; + for (label i = 1; i < cmpts.size() && isValid; ++ i) + { + isValid = isValid && cmpts[i] == thisCmpts[i]; + } + + if (isValid) + { + validNames.append(cmpts[0]); + } + } + + FatalErrorInFunction + << "Valid " << combustionModel::typeName << " types for this " + << "thermodynamic model are:" << endl << validNames << endl; + + List validCmpts2, validCmpts7; + validCmpts2.append(wordList(2, word::null)); + validCmpts2[0][0] = combustionModel::typeName; + validCmpts2[0][1] = "reactionThermo"; + validCmpts7.append(wordList(7, word::null)); + validCmpts7[0][0] = combustionModel::typeName; + validCmpts7[0][1] = "reactionThermo"; + validCmpts7[0][2] = "transport"; + validCmpts7[0][3] = "thermo"; + validCmpts7[0][4] = "equationOfState"; + validCmpts7[0][5] = "specie"; + validCmpts7[0][6] = "energy"; + forAll(names, i) + { + const wordList cmpts2(basicThermo::splitThermoName(names[i], 2)); + const wordList cmpts7(basicThermo::splitThermoName(names[i], 7)); + if (cmpts2.size() == 2) + { + validCmpts2.append(cmpts2); + } + if (cmpts7.size() == 7) + { + validCmpts7.append(cmpts7); + } + } + + FatalErrorInFunction + << "All " << validCmpts2[0][0] << '/' << validCmpts2[0][1] + << " combinations are:" << endl << endl; + printTable(validCmpts2, FatalErrorInFunction); + + FatalErrorInFunction << endl; + + FatalErrorInFunction + << "All " << validCmpts7[0][0] << '/' << validCmpts7[0][1] + << "/thermoPhysics combinations are:" << endl << endl; + printTable(validCmpts7, FatalErrorInFunction); + + FatalErrorInFunction << exit(FatalError); + } + + return autoPtr + ( + thermoCstrIter != cstrTable->end() + ? thermoCstrIter()(combModelName, thermo, turb, combustionProperties) + : compCstrIter()(combModelName, thermo, turb, combustionProperties) + ); +} + + +// ************************************************************************* // diff --git a/src/combustionModels/combustionModel/makeCombustionTypes.H b/src/combustionModels/combustionModel/makeCombustionTypes.H index 4bf871d3b..085aa4458 100644 --- a/src/combustionModels/combustionModel/makeCombustionTypes.H +++ b/src/combustionModels/combustionModel/makeCombustionTypes.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 @@ -30,61 +30,63 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeCombustionTypesThermo(CombModel, CombType, Thermo, Table) \ +#define makeCombustion(Comp) \ \ - typedef Foam::combustionModels::CombModel \ - \ - CombModel##CombType##Thermo; \ + typedef typename Foam::combustionModels::CombustionModel \ + CombustionModel##Comp; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - CombModel##CombType##Thermo, \ - #CombModel"<"#CombType","#Thermo">", \ + CombustionModel##Comp, \ + "CombustionModel<"#Comp">", \ 0 \ ); \ \ - namespace Foam \ - { \ - namespace combustionModels \ - { \ - typedef CombModel CombModel##CombType##Thermo; \ - addToRunTimeSelectionTable \ - ( \ - Table, \ - CombModel##CombType##Thermo, \ - dictionary \ - ); \ - } \ - } + defineTemplateRunTimeSelectionTable \ + ( \ + CombustionModel##Comp, \ + dictionary \ + ); -#define makeCombustionTypes(CombModel, CombType, Table) \ +#define makeCombustionTypesThermo(CombModel, Comp, Thermo) \ \ - typedef Foam::combustionModels::CombModel \ - \ - CombModel##CombType; \ + typedef Foam::combustionModels::CombModel \ + CombModel##Comp##Thermo; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - CombModel##CombType, \ - #CombModel"<"#CombType">", \ + CombModel##Comp##Thermo, \ + ( \ + Foam::word(CombModel##Comp##Thermo::typeName_()) + "<"#Comp"," \ + + Foam::Thermo::typeName() + ">" \ + ).c_str(), \ 0 \ ); \ \ - namespace Foam \ - { \ - namespace combustionModels \ - { \ - typedef CombModel CombModel##CombType; \ + Foam::combustionModels::CombustionModel:: \ + add##dictionary##ConstructorToTable \ + add##CombModel##Comp##Thermo##dictionary##ConstructorTo##\ +CombustionModel##Comp##Table_; + + +#define makeCombustionTypes(CombModel, Comp) \ \ - addToRunTimeSelectionTable \ - ( \ - Table, \ - CombModel##CombType, \ - dictionary \ - ); \ - } \ - } + typedef Foam::combustionModels::CombModel \ + CombModel##Comp; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + CombModel##Comp, \ + (Foam::word(CombModel##Comp::typeName_()) + "<"#Comp">").c_str(), \ + 0 \ + ); \ + \ + Foam::combustionModels::CombustionModel:: \ + add##dictionary##ConstructorToTable \ + add##CombModel##Comp##dictionary##ConstructorTo##CombustionModel##Comp\ +##Table_; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C index 7ba33ebe3..75be53c86 100644 --- a/src/combustionModels/diffusion/diffusion.C +++ b/src/combustionModels/diffusion/diffusion.C @@ -33,16 +33,16 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -diffusion::diffusion +template +diffusion::diffusion ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - singleStepCombustion + singleStepCombustion ( modelType, thermo, @@ -56,15 +56,15 @@ diffusion::diffusion // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -diffusion::~diffusion() +template +diffusion::~diffusion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -void diffusion::correct() +template +void diffusion::correct() { this->wFuel_ == dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0); @@ -92,10 +92,10 @@ void diffusion::correct() } -template -bool diffusion::read() +template +bool diffusion::read() { - if (singleStepCombustion::read()) + if (singleStepCombustion::read()) { this->coeffs().lookup("C") >> C_ ; this->coeffs().readIfPresent("oxidant", oxidantName_); diff --git a/src/combustionModels/diffusion/diffusion.H b/src/combustionModels/diffusion/diffusion.H index 5590afec9..49e69f446 100644 --- a/src/combustionModels/diffusion/diffusion.H +++ b/src/combustionModels/diffusion/diffusion.H @@ -50,10 +50,10 @@ namespace combustionModels Class diffusion Declaration \*---------------------------------------------------------------------------*/ -template +template class diffusion : - public singleStepCombustion + public singleStepCombustion { // Private data @@ -85,7 +85,7 @@ public: diffusion ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C index 68ec7b73a..99cd7fafc 100644 --- a/src/combustionModels/diffusion/diffusions.C +++ b/src/combustionModels/diffusion/diffusions.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 @@ -26,8 +26,8 @@ License #include "makeCombustionTypes.H" #include "thermoPhysicsTypes.H" -#include "psiThermoCombustion.H" -#include "rhoThermoCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "diffusion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -36,33 +36,29 @@ License makeCombustionTypesThermo ( diffusion, - psiThermoCombustion, - gasHThermoPhysics, - psiCombustionModel + psiReactionThermo, + gasHThermoPhysics ); makeCombustionTypesThermo ( diffusion, - psiThermoCombustion, - constGasHThermoPhysics, - psiCombustionModel + psiReactionThermo, + constGasHThermoPhysics ); makeCombustionTypesThermo ( diffusion, - rhoThermoCombustion, - gasHThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + gasHThermoPhysics ); makeCombustionTypesThermo ( diffusion, - rhoThermoCombustion, - constGasHThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + constGasHThermoPhysics ); @@ -71,33 +67,29 @@ makeCombustionTypesThermo makeCombustionTypesThermo ( diffusion, - psiThermoCombustion, - gasEThermoPhysics, - psiCombustionModel + psiReactionThermo, + gasEThermoPhysics ); makeCombustionTypesThermo ( diffusion, - psiThermoCombustion, - constGasEThermoPhysics, - psiCombustionModel + psiReactionThermo, + constGasEThermoPhysics ); makeCombustionTypesThermo ( diffusion, - rhoThermoCombustion, - gasEThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + gasEThermoPhysics ); makeCombustionTypesThermo ( diffusion, - rhoThermoCombustion, - constGasEThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + constGasEThermoPhysics ); diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C index f2dc14acf..f1c737f25 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -32,16 +32,16 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -infinitelyFastChemistry::infinitelyFastChemistry +template +infinitelyFastChemistry::infinitelyFastChemistry ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - singleStepCombustion + singleStepCombustion ( modelType, thermo, @@ -54,15 +54,15 @@ infinitelyFastChemistry::infinitelyFastChemistry // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -infinitelyFastChemistry::~infinitelyFastChemistry() +template +infinitelyFastChemistry::~infinitelyFastChemistry() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -void infinitelyFastChemistry::correct() +template +void infinitelyFastChemistry::correct() { this->wFuel_ == dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0); @@ -90,10 +90,10 @@ void infinitelyFastChemistry::correct() } -template -bool infinitelyFastChemistry::read() +template +bool infinitelyFastChemistry::read() { - if (singleStepCombustion::read()) + if (singleStepCombustion::read()) { this->coeffs().lookup("C") >> C_ ; return true; diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H index 15c051540..b0bfd1f42 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H @@ -50,10 +50,10 @@ namespace combustionModels Class infinitelyFastChemistry Declaration \*---------------------------------------------------------------------------*/ -template +template class infinitelyFastChemistry : - public singleStepCombustion + public singleStepCombustion { // Private data @@ -82,7 +82,7 @@ public: infinitelyFastChemistry ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C index 95e5a79d4..3260b9bbe 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.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 @@ -26,8 +26,8 @@ License #include "makeCombustionTypes.H" #include "thermoPhysicsTypes.H" -#include "psiThermoCombustion.H" -#include "rhoThermoCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "infinitelyFastChemistry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -37,33 +37,29 @@ License makeCombustionTypesThermo ( infinitelyFastChemistry, - psiThermoCombustion, - gasHThermoPhysics, - psiCombustionModel + psiReactionThermo, + gasHThermoPhysics ); makeCombustionTypesThermo ( infinitelyFastChemistry, - psiThermoCombustion, - constGasHThermoPhysics, - psiCombustionModel + psiReactionThermo, + constGasHThermoPhysics ); makeCombustionTypesThermo ( infinitelyFastChemistry, - rhoThermoCombustion, - gasHThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + gasHThermoPhysics ); makeCombustionTypesThermo ( infinitelyFastChemistry, - rhoThermoCombustion, - constGasHThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + constGasHThermoPhysics ); // Combustion models based on sensibleInternalEnergy @@ -71,33 +67,29 @@ makeCombustionTypesThermo makeCombustionTypesThermo ( infinitelyFastChemistry, - psiThermoCombustion, - gasEThermoPhysics, - psiCombustionModel + psiReactionThermo, + gasEThermoPhysics ); makeCombustionTypesThermo ( infinitelyFastChemistry, - psiThermoCombustion, - constGasEThermoPhysics, - psiCombustionModel + psiReactionThermo, + constGasEThermoPhysics ); makeCombustionTypesThermo ( infinitelyFastChemistry, - rhoThermoCombustion, - gasEThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + gasEThermoPhysics ); makeCombustionTypesThermo ( infinitelyFastChemistry, - rhoThermoCombustion, - constGasEThermoPhysics, - rhoCombustionModel + rhoReactionThermo, + constGasEThermoPhysics ); diff --git a/src/combustionModels/laminar/laminar.C b/src/combustionModels/laminar/laminar.C index b4ec3df3d..01e9a4585 100644 --- a/src/combustionModels/laminar/laminar.C +++ b/src/combustionModels/laminar/laminar.C @@ -29,16 +29,22 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::combustionModels::laminar::laminar +template +Foam::combustionModels::laminar::laminar ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - Type(modelType, thermo, turb, combustionProperties), + ChemistryCombustion + ( + modelType, + thermo, + turb, + combustionProperties + ), integrateReactionRate_ ( this->coeffs().lookupOrDefault("integrateReactionRate", true) @@ -57,23 +63,23 @@ Foam::combustionModels::laminar::laminar // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::combustionModels::laminar::~laminar() +template +Foam::combustionModels::laminar::~laminar() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template +template Foam::tmp -Foam::combustionModels::laminar::tc() const +Foam::combustionModels::laminar::tc() const { return this->chemistryPtr_->tc(); } -template -void Foam::combustionModels::laminar::correct() +template +void Foam::combustionModels::laminar::correct() { if (this->active()) { @@ -114,9 +120,9 @@ void Foam::combustionModels::laminar::correct() } -template +template Foam::tmp -Foam::combustionModels::laminar::R(volScalarField& Y) const +Foam::combustionModels::laminar::R(volScalarField& Y) const { tmp tSu(new fvScalarMatrix(Y, dimMass/dimTime)); @@ -134,9 +140,9 @@ Foam::combustionModels::laminar::R(volScalarField& Y) const } -template +template Foam::tmp -Foam::combustionModels::laminar::Qdot() const +Foam::combustionModels::laminar::Qdot() const { tmp tQdot ( @@ -165,10 +171,10 @@ Foam::combustionModels::laminar::Qdot() const } -template -bool Foam::combustionModels::laminar::read() +template +bool Foam::combustionModels::laminar::read() { - if (Type::read()) + if (ChemistryCombustion::read()) { integrateReactionRate_ = this->coeffs().lookupOrDefault("integrateReactionRate", true); diff --git a/src/combustionModels/laminar/laminar.H b/src/combustionModels/laminar/laminar.H index ba8a99cea..cefd22d7e 100644 --- a/src/combustionModels/laminar/laminar.H +++ b/src/combustionModels/laminar/laminar.H @@ -35,6 +35,8 @@ SourceFiles #ifndef laminar_H #define laminar_H +#include "ChemistryCombustion.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -46,10 +48,10 @@ namespace combustionModels Class laminar Declaration \*---------------------------------------------------------------------------*/ -template +template class laminar : - public Type + public ChemistryCombustion { // Private data @@ -87,7 +89,7 @@ public: laminar ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/laminar/laminars.C b/src/combustionModels/laminar/laminars.C index 73d400c09..692f8ed26 100644 --- a/src/combustionModels/laminar/laminars.C +++ b/src/combustionModels/laminar/laminars.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 @@ -25,14 +25,14 @@ License #include "makeCombustionTypes.H" -#include "psiChemistryCombustion.H" -#include "rhoChemistryCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "laminar.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeCombustionTypes(laminar, psiChemistryCombustion, psiCombustionModel); -makeCombustionTypes(laminar, rhoChemistryCombustion, rhoCombustionModel); +makeCombustionTypes(laminar, psiReactionThermo); +makeCombustionTypes(laminar, rhoReactionThermo); // ************************************************************************* // diff --git a/src/combustionModels/noCombustion/noCombustion.C b/src/combustionModels/noCombustion/noCombustion.C index b74bc1cc9..417e4e9f3 100644 --- a/src/combustionModels/noCombustion/noCombustion.C +++ b/src/combustionModels/noCombustion/noCombustion.C @@ -28,36 +28,36 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::combustionModels::noCombustion::noCombustion +template +Foam::combustionModels::noCombustion::noCombustion ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - CombThermoType(modelType, thermo, turb) + ThermoCombustion(modelType, thermo, turb) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::combustionModels::noCombustion::~noCombustion() +template +Foam::combustionModels::noCombustion::~noCombustion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -void Foam::combustionModels::noCombustion::correct() +template +void Foam::combustionModels::noCombustion::correct() {} -template +template Foam::tmp -Foam::combustionModels::noCombustion::R +Foam::combustionModels::noCombustion::R ( volScalarField& Y ) const @@ -71,9 +71,9 @@ Foam::combustionModels::noCombustion::R } -template +template Foam::tmp -Foam::combustionModels::noCombustion::Qdot() const +Foam::combustionModels::noCombustion::Qdot() const { tmp tQdot ( @@ -97,10 +97,10 @@ Foam::combustionModels::noCombustion::Qdot() const } -template -bool Foam::combustionModels::noCombustion::read() +template +bool Foam::combustionModels::noCombustion::read() { - if (CombThermoType::read()) + if (ThermoCombustion::read()) { return true; } diff --git a/src/combustionModels/noCombustion/noCombustion.H b/src/combustionModels/noCombustion/noCombustion.H index 2bf36719a..b3ef87438 100644 --- a/src/combustionModels/noCombustion/noCombustion.H +++ b/src/combustionModels/noCombustion/noCombustion.H @@ -35,6 +35,8 @@ SourceFiles #ifndef noCombustion_H #define noCombustion_H +#include "ThermoCombustion.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -46,10 +48,10 @@ namespace combustionModels Class noCombustion Declaration \*---------------------------------------------------------------------------*/ -template +template class noCombustion : - public CombThermoType + public ThermoCombustion { //- Disallow copy construct @@ -62,7 +64,7 @@ class noCombustion public: //- Runtime type information - TypeName("noCombustion"); + TypeName("none"); // Constructors @@ -71,7 +73,7 @@ public: noCombustion ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/noCombustion/noCombustions.C b/src/combustionModels/noCombustion/noCombustions.C index 516e5af82..dab4e2b10 100644 --- a/src/combustionModels/noCombustion/noCombustions.C +++ b/src/combustionModels/noCombustion/noCombustions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,28 +25,15 @@ License #include "makeCombustionTypes.H" -#include "psiCombustionModel.H" -#include "rhoCombustionModel.H" -#include "psiThermoCombustion.H" -#include "rhoThermoCombustion.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "noCombustion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeCombustionTypes -( - noCombustion, - psiThermoCombustion, - psiCombustionModel -); - -makeCombustionTypes -( - noCombustion, - rhoThermoCombustion, - rhoCombustionModel -); +makeCombustionTypes(noCombustion, psiReactionThermo); +makeCombustionTypes(noCombustion, rhoReactionThermo); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H deleted file mode 100644 index c9059f10a..000000000 --- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H +++ /dev/null @@ -1,111 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::psiChemistryCombustion - -Description - Compressibility-based chemistry model wrapper for combustion models - -SourceFiles - psiChemistryCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef psiChemistryCombustion_H -#define psiChemistryCombustion_H - -#include "autoPtr.H" -#include "psiCombustionModel.H" -#include "psiChemistryModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - class psiChemistryCombustion Declaration -\*---------------------------------------------------------------------------*/ - -class psiChemistryCombustion -: - public psiCombustionModel -{ - // Private Member Functions - - //- Construct as copy (not implemented) - psiChemistryCombustion(const psiChemistryCombustion&); - - //- Disallow default bitwise assignment - void operator=(const psiChemistryCombustion&); - - -protected: - - // Protected data - - //- Pointer to chemistry model - autoPtr chemistryPtr_; - - -public: - - // Constructors - - //- Construct from components and thermo - psiChemistryCombustion - ( - const word& modelType, - psiReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - - //- Destructor - virtual ~psiChemistryCombustion(); - - - // Member Functions - - //- Return access to the thermo package - virtual psiReactionThermo& thermo(); - - //- Return const access to the thermo package - virtual const psiReactionThermo& thermo() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C deleted file mode 100644 index c51749bd6..000000000 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "psiCombustionModel.H" - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ -namespace combustionModels -{ - defineTypeNameAndDebug(psiCombustionModel, 0); - defineRunTimeSelectionTable(psiCombustionModel, dictionary); -} -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::combustionModels::psiCombustionModel::psiCombustionModel -( - const word& modelType, - psiReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - combustionModel(modelType, thermo, turb, combustionProperties) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::combustionModels::psiCombustionModel::~psiCombustionModel() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -bool Foam::combustionModels::psiCombustionModel::read() -{ - if (combustionModel::read()) - { - return true; - } - else - { - return false; - } -} - - -// ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C deleted file mode 100644 index 508b06af5..000000000 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +++ /dev/null @@ -1,78 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "psiCombustionModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr -Foam::combustionModels::psiCombustionModel::New -( - psiReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -{ - const word combModelName - ( - IOdictionary - ( - IOobject - ( - thermo.phasePropertyName(combustionProperties), - thermo.db().time().constant(), - thermo.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ).lookup("combustionModel") - ); - - Info<< "Selecting combustion model " << combModelName << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combModelName); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorInFunction - << "Unknown psiCombustionModel type " - << combModelName << endl << endl - << "Valid combustionModels are : " << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); - } - - const word className = combModelName(0, combModelName.find('<')); - - return autoPtr - ( - cstrIter()(className, thermo, turb, combustionProperties) - ); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H deleted file mode 100644 index 7f7a4d39d..000000000 --- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H +++ /dev/null @@ -1,110 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::psiThermoCombustion - -Description - Compressibility-based thermo model wrapper for combustion models - -SourceFiles - psiThermoCombustion.C - -\*---------------------------------------------------------------------------*/ - -#ifndef psiThermoCombustion_H -#define psiThermoCombustion_H - -#include "autoPtr.H" -#include "psiCombustionModel.H" -#include "psiReactionThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - class psiThermoCombustion Declaration -\*---------------------------------------------------------------------------*/ - -class psiThermoCombustion -: - public psiCombustionModel -{ - // Private Member Functions - - //- Construct as copy (not implemented) - psiThermoCombustion(const psiThermoCombustion&); - - //- Disallow default bitwise assignment - void operator=(const psiThermoCombustion&); - - -protected: - - // Protected data - - //- Thermo - psiReactionThermo& thermo_; - - -public: - - // Constructors - - //- Construct from components - psiThermoCombustion - ( - const word& modelType, - psiReactionThermo& thermo, - const compressibleTurbulenceModel& turb - ); - - - //- Destructor - virtual ~psiThermoCombustion(); - - - // Member Functions - - //- Return access to the thermo package - virtual psiReactionThermo& thermo(); - - //- Return const access to the thermo package - virtual const psiReactionThermo& thermo() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C deleted file mode 100644 index 657be6fc2..000000000 --- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "rhoChemistryCombustion.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion -( - const word& modelType, - rhoReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -: - rhoCombustionModel(modelType, thermo, turb, combustionProperties), - chemistryPtr_(rhoChemistryModel::New(thermo)) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::combustionModels::rhoChemistryCombustion::~rhoChemistryCombustion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -Foam::rhoReactionThermo& -Foam::combustionModels::rhoChemistryCombustion::thermo() -{ - return chemistryPtr_->thermo(); -} - - -const Foam::rhoReactionThermo& -Foam::combustionModels::rhoChemistryCombustion::thermo() const -{ - return chemistryPtr_->thermo(); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H deleted file mode 100644 index 66c501c39..000000000 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H +++ /dev/null @@ -1,154 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::rhoCombustionModel - -Description - Combustion models for rho-based thermodynamics - -SourceFiles - rhoCombustionModelI.H - rhoCombustionModel.C - rhoCombustionModelNew.C - -\*---------------------------------------------------------------------------*/ - -#ifndef rhoCombustionModel_H -#define rhoCombustionModel_H - -#include "combustionModel.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" -#include "rhoReactionThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace combustionModels -{ - -/*---------------------------------------------------------------------------*\ - class rhoCombustionModel Declaration -\*---------------------------------------------------------------------------*/ - -class rhoCombustionModel -: - public combustionModel -{ - - // Private Member Functions - - //- Construct as copy (not implemented) - rhoCombustionModel(const rhoCombustionModel&); - - //- Disallow default bitwise assignment - void operator=(const rhoCombustionModel&); - - -public: - - //- Thermo type - typedef rhoReactionThermo reactionThermo; - - - //- Runtime type information - TypeName("rhoCombustionModel"); - - - //- Declare run-time constructor selection tables - declareRunTimeSelectionTable - ( - autoPtr, - rhoCombustionModel, - dictionary, - ( - const word& modelType, - rhoReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ), - (modelType, thermo, turb, combustionProperties) - ); - - - // Constructors - - - //- Construct from components - rhoCombustionModel - ( - const word& modelType, - rhoReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties - ); - - - - //- Selector - static autoPtr New - ( - rhoReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties=combustionPropertiesName - ); - - - //- Destructor - virtual ~rhoCombustionModel(); - - - // Member Functions - - // Access functions - - //- Access combustion dict - inline const dictionary& coeff() const; - - - //- Return access to the thermo package - virtual rhoReactionThermo& thermo() = 0; - - //- Return const access to the thermo package - virtual const rhoReactionThermo& thermo() const = 0; - - - // IO - - //- Update properties from given dictionary - virtual bool read(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace combustionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C deleted file mode 100644 index 8f4032aa8..000000000 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +++ /dev/null @@ -1,80 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "rhoCombustionModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr -Foam::combustionModels::rhoCombustionModel::New -( - rhoReactionThermo& thermo, - const compressibleTurbulenceModel& turb, - const word& combustionProperties -) -{ - const word combTypeName - ( - IOdictionary - ( - IOobject - ( - thermo.phasePropertyName(combustionProperties), - thermo.db().time().constant(), - thermo.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ).lookup("combustionModel") - ); - - Info<< "Selecting combustion model " << combTypeName << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combTypeName); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorInFunction - << "Unknown rhoCombustionModel type " - << combTypeName << endl << endl - << "Valid combustionModels are : " << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); - } - - const label tempOpen = combTypeName.find('<'); - - const word className = combTypeName(0, tempOpen); - - return autoPtr - ( - cstrIter()(className, thermo, turb, combustionProperties) - ); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C deleted file mode 100644 index 8b2fe2372..000000000 --- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C +++ /dev/null @@ -1,64 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "rhoThermoCombustion.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion -( - const word& modelType, - rhoReactionThermo& thermo, - const compressibleTurbulenceModel& turb -) -: - rhoCombustionModel(modelType, thermo, turb, combustionPropertiesName), - thermo_(thermo) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::combustionModels::rhoThermoCombustion::~rhoThermoCombustion() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -Foam::rhoReactionThermo& -Foam::combustionModels::rhoThermoCombustion::thermo() -{ - return thermo_; -} - - -const Foam::rhoReactionThermo& -Foam::combustionModels::rhoThermoCombustion::thermo() const -{ - return thermo_; -} - - -// ************************************************************************* // diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C index 14bf1b8eb..f216a3102 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C @@ -33,16 +33,16 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -singleStepCombustion::singleStepCombustion +template +singleStepCombustion::singleStepCombustion ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - CombThermoType(modelType, thermo, turb), + ThermoCombustion(modelType, thermo, turb), singleMixturePtr_(nullptr), wFuel_ ( @@ -89,15 +89,15 @@ singleStepCombustion::singleStepCombustion // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -singleStepCombustion::~singleStepCombustion() +template +singleStepCombustion::~singleStepCombustion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -tmp singleStepCombustion::R +template +tmp singleStepCombustion::R ( volScalarField& Y ) const @@ -125,9 +125,9 @@ tmp singleStepCombustion::R } -template +template tmp -singleStepCombustion::Qdot() const +singleStepCombustion::Qdot() const { const label fuelI = singleMixturePtr_->fuelIndex(); volScalarField& YFuel = @@ -137,10 +137,10 @@ singleStepCombustion::Qdot() const } -template -bool singleStepCombustion::read() +template +bool singleStepCombustion::read() { - if (CombThermoType::read()) + if (ThermoCombustion::read()) { return true; } diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.H b/src/combustionModels/singleStepCombustion/singleStepCombustion.H index 1da682d4f..9653aa788 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.H +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.H @@ -36,6 +36,7 @@ SourceFiles #define singleStepCombustion_H #include "singleStepReactingMixture.H" +#include "ThermoCombustion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,10 +49,10 @@ namespace combustionModels Class singleStepCombustion Declaration \*---------------------------------------------------------------------------*/ -template +template class singleStepCombustion : - public CombThermoType + public ThermoCombustion { // Private Member Functions @@ -84,7 +85,7 @@ public: singleStepCombustion ( const word& modelType, - typename CombThermoType::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); diff --git a/src/combustionModels/zoneCombustion/zoneCombustion.C b/src/combustionModels/zoneCombustion/zoneCombustion.C index 73b8a2ef2..262c2589b 100644 --- a/src/combustionModels/zoneCombustion/zoneCombustion.C +++ b/src/combustionModels/zoneCombustion/zoneCombustion.C @@ -27,9 +27,9 @@ License // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // -template +template Foam::tmp -Foam::combustionModels::zoneCombustion::filter +Foam::combustionModels::zoneCombustion::filter ( const tmp& tR ) const @@ -72,9 +72,9 @@ Foam::combustionModels::zoneCombustion::filter } -template +template Foam::tmp -Foam::combustionModels::zoneCombustion::filter +Foam::combustionModels::zoneCombustion::filter ( const tmp& tS ) const @@ -100,73 +100,89 @@ Foam::combustionModels::zoneCombustion::filter // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::combustionModels::zoneCombustion::zoneCombustion +template +Foam::combustionModels::zoneCombustion::zoneCombustion ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ) : - Type(modelType, thermo, turb, combustionProperties), - combustionModelPtr_(Type::New(thermo, turb, "zoneCombustionProperties")), + CombustionModel + ( + modelType, + thermo, + turb, + combustionProperties + ), + combustionModelPtr_ + ( + CombustionModel::New + ( + thermo, + turb, + "zoneCombustionProperties" + ) + ), zoneNames_(this->coeffs().lookup("zones")) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::combustionModels::zoneCombustion::~zoneCombustion() +template +Foam::combustionModels::zoneCombustion::~zoneCombustion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -typename Type::reactionThermo& -Foam::combustionModels::zoneCombustion::thermo() +template +ReactionThermo& Foam::combustionModels::zoneCombustion::thermo() { return combustionModelPtr_->thermo(); } -template -const typename Type::reactionThermo& -Foam::combustionModels::zoneCombustion::thermo() const +template +const ReactionThermo& +Foam::combustionModels::zoneCombustion::thermo() const { return combustionModelPtr_->thermo(); } -template -void Foam::combustionModels::zoneCombustion::correct() +template +void Foam::combustionModels::zoneCombustion::correct() { combustionModelPtr_->correct(); } -template +template Foam::tmp -Foam::combustionModels::zoneCombustion::R(volScalarField& Y) const +Foam::combustionModels::zoneCombustion::R +( + volScalarField& Y +) const { return filter(combustionModelPtr_->R(Y)); } -template +template Foam::tmp -Foam::combustionModels::zoneCombustion::Qdot() const +Foam::combustionModels::zoneCombustion::Qdot() const { return filter(combustionModelPtr_->Qdot()); } -template -bool Foam::combustionModels::zoneCombustion::read() +template +bool Foam::combustionModels::zoneCombustion::read() { - if (Type::read()) + if (CombustionModel::read()) { combustionModelPtr_->read(); return true; diff --git a/src/combustionModels/zoneCombustion/zoneCombustion.H b/src/combustionModels/zoneCombustion/zoneCombustion.H index 069b2f177..9f230c47f 100644 --- a/src/combustionModels/zoneCombustion/zoneCombustion.H +++ b/src/combustionModels/zoneCombustion/zoneCombustion.H @@ -38,6 +38,8 @@ SourceFiles #ifndef zoneCombustion_H #define zoneCombustion_H +#include "CombustionModel.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -49,15 +51,15 @@ namespace combustionModels Class zoneCombustion Declaration \*---------------------------------------------------------------------------*/ -template +template class zoneCombustion : - public Type + public CombustionModel { // Private data //- The combustion model to be zone-filtered - autoPtr combustionModelPtr_; + autoPtr> combustionModelPtr_; //- List of zone names in which the reactions are active wordList zoneNames_; @@ -90,7 +92,7 @@ public: zoneCombustion ( const word& modelType, - typename Type::reactionThermo& thermo, + ReactionThermo& thermo, const compressibleTurbulenceModel& turb, const word& combustionProperties ); @@ -103,10 +105,10 @@ public: // Member Functions //- Return access to the thermo package - virtual typename Type::reactionThermo& thermo(); + virtual ReactionThermo& thermo(); //- Return const access to the thermo package - virtual const typename Type::reactionThermo& thermo() const; + virtual const ReactionThermo& thermo() const; //- Correct combustion rate virtual void correct(); diff --git a/src/combustionModels/zoneCombustion/zoneCombustions.C b/src/combustionModels/zoneCombustion/zoneCombustions.C index 9c0c9279f..29583ec6d 100644 --- a/src/combustionModels/zoneCombustion/zoneCombustions.C +++ b/src/combustionModels/zoneCombustion/zoneCombustions.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 @@ -25,13 +25,13 @@ License #include "makeCombustionTypes.H" -#include "psiCombustionModel.H" -#include "rhoCombustionModel.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "zoneCombustion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeCombustionTypes(zoneCombustion, psiCombustionModel, psiCombustionModel); -makeCombustionTypes(zoneCombustion, rhoCombustionModel, rhoCombustionModel); +makeCombustionTypes(zoneCombustion, psiReactionThermo); +makeCombustionTypes(zoneCombustion, rhoReactionThermo); // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 7ad4c9165..d13938137 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -251,6 +251,9 @@ public: //- Update properties virtual void correct() = 0; + //- Return the name of the thermo physics + virtual word thermoName() const = 0; + //- Return true if the equation of state is incompressible // i.e. rho != f(p) virtual bool incompressible() const = 0; diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index 3764114e5..55e5d2b07 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -120,6 +120,12 @@ public: return *this; } + //- Return the name of the thermo physics + virtual word thermoName() const + { + return MixtureType::thermoType::typeName(); + } + //- Return true if the equation of state is incompressible // i.e. rho != f(p) virtual bool incompressible() const diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index 19e704dcf..630137c0e 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -1,10 +1,5 @@ chemistryModel/basicChemistryModel/basicChemistryModel.C - -chemistryModel/psiChemistryModel/psiChemistryModel.C -chemistryModel/psiChemistryModel/psiChemistryModels.C - -chemistryModel/rhoChemistryModel/rhoChemistryModel.C -chemistryModel/rhoChemistryModel/rhoChemistryModels.C +chemistryModel/BasicChemistryModel/BasicChemistryModels.C chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.C similarity index 74% rename from src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.C index 31e0d083c..ae0cf3878 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.C @@ -23,21 +23,15 @@ License \*---------------------------------------------------------------------------*/ -#include "psiChemistryModel.H" -#include "fvMesh.H" - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ - defineTypeNameAndDebug(psiChemistryModel, 0); - defineRunTimeSelectionTable(psiChemistryModel, thermo); -} - +#include "BasicChemistryModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::psiChemistryModel::psiChemistryModel(psiReactionThermo& thermo) +template +Foam::BasicChemistryModel::BasicChemistryModel +( + ReactionThermo& thermo +) : basicChemistryModel(thermo), thermo_(thermo) @@ -46,18 +40,21 @@ Foam::psiChemistryModel::psiChemistryModel(psiReactionThermo& thermo) // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::psiChemistryModel::New -( - psiReactionThermo& thermo -) +template +Foam::autoPtr> +Foam::BasicChemistryModel::New(ReactionThermo& thermo) { - return basicChemistryModel::New(thermo); + return basicChemistryModel::New> + ( + thermo + ); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::psiChemistryModel::~psiChemistryModel() +template +Foam::BasicChemistryModel::~BasicChemistryModel() {} diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H similarity index 71% rename from src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H index e23dfc15e..fdda36205 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H @@ -22,25 +22,23 @@ License along with OpenFOAM. If not, see . Class - Foam::rhoChemistryModel + Foam::BasicChemistryModel Description - Chemistry model for density-based thermodynamics + Basic chemistry model templated on thermodynamics SourceFiles - rhoChemistryModelI.H - rhoChemistryModel.C - newChemistryModel.C + BasicChemistryModelI.H + BasicChemistryModel.C \*---------------------------------------------------------------------------*/ -#ifndef rhoChemistryModel_H -#define rhoChemistryModel_H +#ifndef BasicChemistryModel_H +#define BasicChemistryModel_H #include "basicChemistryModel.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" -#include "rhoReactionThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,47 +49,39 @@ namespace Foam class fvMesh; /*---------------------------------------------------------------------------*\ - class rhoChemistryModel Declaration + class BasicChemistryModel Declaration \*---------------------------------------------------------------------------*/ -class rhoChemistryModel +template +class BasicChemistryModel : public basicChemistryModel { - // Private Member Functions - - //- Construct as copy (not implemented) - rhoChemistryModel(const rhoChemistryModel&); - - //- Disallow default bitwise assignment - void operator=(const rhoChemistryModel&); - - protected: // Protected data //- Thermo - rhoReactionThermo& thermo_; + ReactionThermo& thermo_; public: //- Runtime type information - TypeName("rho"); + TypeName("BasicChemistryModel"); //- Thermo type - typedef rhoReactionThermo reactionThermo; + typedef ReactionThermo reactionThermo; //- Declare run-time constructor selection tables declareRunTimeSelectionTable ( autoPtr, - rhoChemistryModel, + BasicChemistryModel, thermo, - (rhoReactionThermo& thermo), + (ReactionThermo& thermo), (thermo) ); @@ -99,24 +89,27 @@ public: // Constructors //- Construct from thermo - rhoChemistryModel(rhoReactionThermo& thermo); + BasicChemistryModel(ReactionThermo& thermo); //- Selector - static autoPtr New(rhoReactionThermo& thermo); + static autoPtr> New + ( + ReactionThermo& thermo + ); //- Destructor - virtual ~rhoChemistryModel(); + virtual ~BasicChemistryModel(); // Member Functions //- Return access to the thermo package - inline rhoReactionThermo& thermo(); + inline ReactionThermo& thermo(); //- Return const access to the thermo package - inline const rhoReactionThermo& thermo() const; + inline const ReactionThermo& thermo() const; }; @@ -126,7 +119,11 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "rhoChemistryModelI.H" +#ifdef NoRepository + #include "BasicChemistryModel.C" +#endif + +#include "BasicChemistryModelI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModelI.H similarity index 84% rename from src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModelI.H index 9cff93b0a..4c21dc602 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModelI.H @@ -23,15 +23,20 @@ License \*---------------------------------------------------------------------------*/ +#include "BasicChemistryModel.H" + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::psiReactionThermo& Foam::psiChemistryModel::thermo() +template +inline ReactionThermo& Foam::BasicChemistryModel::thermo() { return thermo_; } -inline const Foam::psiReactionThermo& Foam::psiChemistryModel::thermo() const +template +inline const ReactionThermo& +Foam::BasicChemistryModel::thermo() const { return thermo_; } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C new file mode 100644 index 000000000..c71217a5c --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C @@ -0,0 +1,339 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +InClass + Foam::psiChemistryModel + +Description + Creates chemistry model instances templated on the type of thermodynamics + +\*---------------------------------------------------------------------------*/ + +#include "makeChemistryModel.H" + +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" + +#include "StandardChemistryModel.H" +#include "TDACChemistryModel.H" +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + // Make base types + makeChemistryModel(psiReactionThermo); + makeChemistryModel(rhoReactionThermo); + + // Chemistry moldels based on sensibleEnthalpy + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constGasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + gasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constIncompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + incompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + icoPoly8HThermoPhysics + ); + + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constGasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + gasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constIncompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + incompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + icoPoly8HThermoPhysics + ); + + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constGasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + gasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constIncompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + incompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + icoPoly8HThermoPhysics + ); + + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constGasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + gasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constIncompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + incompressibleGasHThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + icoPoly8HThermoPhysics + ); + + + // Chemistry moldels based on sensibleInternalEnergy + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constGasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + gasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + incompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + psiReactionThermo, + icoPoly8EThermoPhysics + ); + + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constGasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + gasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + incompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + StandardChemistryModel, + rhoReactionThermo, + icoPoly8EThermoPhysics + ); + + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constGasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + gasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + incompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + psiReactionThermo, + icoPoly8EThermoPhysics + ); + + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constGasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + gasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + incompressibleGasEThermoPhysics + ); + + makeChemistryModelType + ( + TDACChemistryModel, + rhoReactionThermo, + icoPoly8EThermoPhysics + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C similarity index 88% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C index c4bc21d23..7e21e8695 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.C @@ -23,20 +23,20 @@ License \*---------------------------------------------------------------------------*/ -#include "chemistryModel.H" +#include "StandardChemistryModel.H" #include "reactingMixture.H" #include "UniformField.H" #include "extrapolatedCalculatedFvPatchFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::chemistryModel::chemistryModel +template +Foam::StandardChemistryModel::StandardChemistryModel ( - typename CompType::reactionThermo& thermo + ReactionThermo& thermo ) : - CompType(thermo), + BasicChemistryModel(thermo), ODESystem(), Y_(this->thermo().composition().Y()), reactions_ @@ -51,7 +51,14 @@ Foam::chemistryModel::chemistryModel nSpecie_(Y_.size()), nReaction_(reactions_.size()), - Treact_(CompType::template lookupOrDefault("Treact", 0.0)), + Treact_ + ( + BasicChemistryModel::template lookupOrDefault + ( + "Treact", + 0.0 + ) + ), RR_(nSpecie_), c_(nSpecie_), dcdt_(nSpecie_) @@ -78,22 +85,23 @@ Foam::chemistryModel::chemistryModel ); } - Info<< "chemistryModel: Number of species = " << nSpecie_ + Info<< "StandardChemistryModel: Number of species = " << nSpecie_ << " and reactions = " << nReaction_ << endl; } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::chemistryModel::~chemistryModel() +template +Foam::StandardChemistryModel:: +~StandardChemistryModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -void Foam::chemistryModel::omega +template +void Foam::StandardChemistryModel::omega ( const scalarField& c, const scalar T, @@ -132,8 +140,8 @@ void Foam::chemistryModel::omega } -template -Foam::scalar Foam::chemistryModel::omegaI +template +Foam::scalar Foam::StandardChemistryModel::omegaI ( const label index, const scalarField& c, @@ -153,8 +161,8 @@ Foam::scalar Foam::chemistryModel::omegaI } -template -Foam::scalar Foam::chemistryModel::omega +template +Foam::scalar Foam::StandardChemistryModel::omega ( const Reaction& R, const scalarField& c, @@ -265,8 +273,8 @@ Foam::scalar Foam::chemistryModel::omega } -template -void Foam::chemistryModel::derivatives +template +void Foam::StandardChemistryModel::derivatives ( const scalar time, const scalarField& c, @@ -315,8 +323,8 @@ void Foam::chemistryModel::derivatives } -template -void Foam::chemistryModel::jacobian +template +void Foam::StandardChemistryModel::jacobian ( const scalar t, const scalarField& c, @@ -457,9 +465,9 @@ void Foam::chemistryModel::jacobian } -template +template Foam::tmp -Foam::chemistryModel::tc() const +Foam::StandardChemistryModel::tc() const { tmp ttc ( @@ -531,9 +539,9 @@ Foam::chemistryModel::tc() const } -template +template Foam::tmp -Foam::chemistryModel::Qdot() const +Foam::StandardChemistryModel::Qdot() const { tmp tQdot ( @@ -571,9 +579,9 @@ Foam::chemistryModel::Qdot() const } -template +template Foam::tmp> -Foam::chemistryModel::calculateRR +Foam::StandardChemistryModel::calculateRR ( const label ri, const label si @@ -640,8 +648,8 @@ Foam::chemistryModel::calculateRR } -template -void Foam::chemistryModel::calculate() +template +void Foam::StandardChemistryModel::calculate() { if (!this->chemistry_) { @@ -676,14 +684,14 @@ void Foam::chemistryModel::calculate() } -template +template template -Foam::scalar Foam::chemistryModel::solve +Foam::scalar Foam::StandardChemistryModel::solve ( const DeltaTType& deltaT ) { - CompType::correct(); + BasicChemistryModel::correct(); scalar deltaTMin = GREAT; @@ -747,8 +755,8 @@ Foam::scalar Foam::chemistryModel::solve } -template -Foam::scalar Foam::chemistryModel::solve +template +Foam::scalar Foam::StandardChemistryModel::solve ( const scalar deltaT ) @@ -762,8 +770,8 @@ Foam::scalar Foam::chemistryModel::solve } -template -Foam::scalar Foam::chemistryModel::solve +template +Foam::scalar Foam::StandardChemistryModel::solve ( const scalarField& deltaT ) diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.H similarity index 91% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.H index 4857ee63d..1a75627a0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModel.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::chemistryModel + Foam::StandardChemistryModel Description Extends base chemistry model by adding a thermo package, and ODE functions. @@ -30,14 +30,15 @@ Description terms. SourceFiles - chemistryModelI.H - chemistryModel.C + StandardChemistryModelI.H + StandardChemistryModel.C \*---------------------------------------------------------------------------*/ -#ifndef chemistryModel_H -#define chemistryModel_H +#ifndef StandardChemistryModel_H +#define StandardChemistryModel_H +#include "BasicChemistryModel.H" #include "Reaction.H" #include "ODESystem.H" #include "volFields.H" @@ -52,13 +53,13 @@ namespace Foam class fvMesh; /*---------------------------------------------------------------------------*\ - Class chemistryModel Declaration + Class StandardChemistryModel Declaration \*---------------------------------------------------------------------------*/ -template -class chemistryModel +template +class StandardChemistryModel : - public CompType, + public BasicChemistryModel, public ODESystem { // Private Member Functions @@ -69,10 +70,10 @@ class chemistryModel scalar solve(const DeltaTType& deltaT); //- Disallow copy constructor - chemistryModel(const chemistryModel&); + StandardChemistryModel(const StandardChemistryModel&); //- Disallow default bitwise assignment - void operator=(const chemistryModel&); + void operator=(const StandardChemistryModel&); protected: @@ -120,17 +121,17 @@ protected: public: //- Runtime type information - TypeName("chemistryModel"); + TypeName("standard"); // Constructors //- Construct from thermo - chemistryModel(typename CompType::reactionThermo& thermo); + StandardChemistryModel(ReactionThermo& thermo); //- Destructor - virtual ~chemistryModel(); + virtual ~StandardChemistryModel(); // Member Functions @@ -273,12 +274,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "chemistryModelI.H" +#include "StandardChemistryModelI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository - #include "chemistryModel.C" + #include "StandardChemistryModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModelI.H similarity index 63% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModelI.H index f797bf6d7..16249144b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/StandardChemistryModel/StandardChemistryModelI.H @@ -28,73 +28,74 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -inline Foam::label Foam::chemistryModel::nEqns() const +template +inline Foam::label +Foam::StandardChemistryModel::nEqns() const { // nEqns = number of species + temperature + pressure return nSpecie_ + 2; } -template +template inline Foam::PtrList>& -Foam::chemistryModel::RR() +Foam::StandardChemistryModel::RR() { return RR_; } -template +template inline const Foam::PtrList>& -Foam::chemistryModel::reactions() const +Foam::StandardChemistryModel::reactions() const { return reactions_; } -template +template inline const Foam::PtrList& -Foam::chemistryModel::specieThermo() const +Foam::StandardChemistryModel::specieThermo() const { return specieThermo_; } -template +template inline Foam::label -Foam::chemistryModel::nSpecie() const +Foam::StandardChemistryModel::nSpecie() const { return nSpecie_; } -template +template inline Foam::label -Foam::chemistryModel::nReaction() const +Foam::StandardChemistryModel::nReaction() const { return nReaction_; } -template +template inline Foam::scalar -Foam::chemistryModel::Treact() const +Foam::StandardChemistryModel::Treact() const { return Treact_; } -template +template inline Foam::scalar& -Foam::chemistryModel::Treact() +Foam::StandardChemistryModel::Treact() { return Treact_; } -template +template inline const Foam::DimensionedField& -Foam::chemistryModel::RR +Foam::StandardChemistryModel::RR ( const label i ) const @@ -102,9 +103,9 @@ Foam::chemistryModel::RR return RR_[i]; } -template +template Foam::DimensionedField& -Foam::chemistryModel::RR +Foam::StandardChemistryModel::RR ( const label i ) diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C index 9305c51ac..7eb600785 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.C @@ -30,13 +30,13 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::TDACChemistryModel::TDACChemistryModel +template +Foam::TDACChemistryModel::TDACChemistryModel ( - typename CompType::reactionThermo& thermo + ReactionThermo& thermo ) : - chemistryModel(thermo), + StandardChemistryModel(thermo), variableTimeStep_ ( this->mesh().time().controlDict().lookupOrDefault @@ -81,7 +81,7 @@ Foam::TDACChemistryModel::TDACChemistryModel specieComp_[i] = specComp[this->Y()[i].member()]; } - mechRed_ = chemistryReductionMethod::New + mechRed_ = chemistryReductionMethod::New ( *this, *this @@ -111,7 +111,7 @@ Foam::TDACChemistryModel::TDACChemistryModel } } - tabulation_ = chemistryTabulationMethod::New + tabulation_ = chemistryTabulationMethod::New ( *this, *this @@ -139,15 +139,15 @@ Foam::TDACChemistryModel::TDACChemistryModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::TDACChemistryModel::~TDACChemistryModel() +template +Foam::TDACChemistryModel::~TDACChemistryModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -void Foam::TDACChemistryModel::omega +template +void Foam::TDACChemistryModel::omega ( const scalarField& c, // Contains all species even when mechRed is active const scalar T, @@ -200,8 +200,8 @@ void Foam::TDACChemistryModel::omega } -template -Foam::scalar Foam::TDACChemistryModel::omega +template +Foam::scalar Foam::TDACChemistryModel::omega ( const Reaction& R, const scalarField& c, // Contains all species even when mechRed is active @@ -309,8 +309,8 @@ Foam::scalar Foam::TDACChemistryModel::omega } -template -void Foam::TDACChemistryModel::derivatives +template +void Foam::TDACChemistryModel::derivatives ( const scalar time, const scalarField& c, @@ -393,8 +393,8 @@ void Foam::TDACChemistryModel::derivatives } -template -void Foam::TDACChemistryModel::jacobian +template +void Foam::TDACChemistryModel::jacobian ( const scalar t, const scalarField& c, @@ -577,8 +577,8 @@ void Foam::TDACChemistryModel::jacobian } -template -void Foam::TDACChemistryModel::jacobian +template +void Foam::TDACChemistryModel::jacobian ( const scalar t, const scalarField& c, @@ -596,9 +596,9 @@ void Foam::TDACChemistryModel::jacobian } -template +template template -Foam::scalar Foam::TDACChemistryModel::solve +Foam::scalar Foam::TDACChemistryModel::solve ( const DeltaTType& deltaT ) @@ -627,7 +627,7 @@ Foam::scalar Foam::TDACChemistryModel::solve scalar nActiveSpecies = 0; scalar nAvg = 0; - CompType::correct(); + BasicChemistryModel::correct(); scalar deltaTMin = GREAT; @@ -880,8 +880,8 @@ Foam::scalar Foam::TDACChemistryModel::solve } -template -Foam::scalar Foam::TDACChemistryModel::solve +template +Foam::scalar Foam::TDACChemistryModel::solve ( const scalar deltaT ) @@ -895,8 +895,8 @@ Foam::scalar Foam::TDACChemistryModel::solve } -template -Foam::scalar Foam::TDACChemistryModel::solve +template +Foam::scalar Foam::TDACChemistryModel::solve ( const scalarField& deltaT ) @@ -905,8 +905,9 @@ Foam::scalar Foam::TDACChemistryModel::solve } -template -void Foam::TDACChemistryModel::setTabulationResultsAdd +template +void Foam::TDACChemistryModel:: +setTabulationResultsAdd ( const label celli ) @@ -915,18 +916,16 @@ void Foam::TDACChemistryModel::setTabulationResultsAdd } -template -void Foam::TDACChemistryModel::setTabulationResultsGrow -( - const label celli -) +template +void Foam::TDACChemistryModel:: +setTabulationResultsGrow(const label celli) { tabulationResults_[celli] = 1.0; } -template -void Foam::TDACChemistryModel:: +template +void Foam::TDACChemistryModel:: setTabulationResultsRetrieve ( const label celli diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H index 7ba031beb..87cc80eb6 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/TDACChemistryModel.H @@ -25,7 +25,7 @@ Class Foam::TDACChemistryModel Description - Extends chemistryModel by adding the TDAC method. + Extends StandardChemistryModel by adding the TDAC method. References: \verbatim @@ -64,7 +64,7 @@ SourceFiles #ifndef TDACChemistryModel_H #define TDACChemistryModel_H -#include "chemistryModel.H" +#include "StandardChemistryModel.H" #include "chemistryReductionMethod.H" #include "chemistryTabulationMethod.H" #include "OFstream.H" @@ -78,10 +78,10 @@ namespace Foam Class TDACChemistryModel Declaration \*---------------------------------------------------------------------------*/ -template +template class TDACChemistryModel : - public chemistryModel + public StandardChemistryModel { // Private member data @@ -97,10 +97,12 @@ class TDACChemistryModel List> specieComp_; Field