From fe89082f73c6c65320528632c1398ce938c4ebd3 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 30 Apr 2020 09:42:18 +0100 Subject: [PATCH] thermophysicalModels: Centralised instantiation macros All models that require templating on the thermodynamic model, including the thermodynamic models themselves, are now instantiated using a centralised set of variadic macros. Seven macros exist to instantiate models for different classes of thermodynamics model. These are: forGases: All model combinations valid for gases forCommonGases: The most commonly used gas models forAbsoluteGases: A limited selection of gas models with absolute forms of energy, for use with Xi-combustion models forLiquids: All model combinations valid for liquids forCommonLiquids: The most commonly used liquid models forPolynomials: Model combinations with properties fitted to polynomials forSolids: All model combinations valid for solids All the *ThermoPhysics typedefs have been removed, as this system was fundamentally not extensible. The enormous lists of thermodynamic instantiations that existed for reaction thermos, chemistry models, tabulation methods, etc..., were extremely difficult to read and reason about what combinations are valid under what circumstances. This change centralises those decisions, makes them concise and readable, and makes them consistent across the entire codebase. Soot model selection has now been brought up to date in line with chemistry, combustion, and others. The angle-bracketed part of the name is no longer necessary; this information is determined directly from the existing thermo model. So, now to select a mixture-fraction soot model, the entry is simply: sootModel mixtureFraction; Rather than: sootModel mixtureFraction; The only place in which *ThermoPhysics typedefs are still required in the selection name is in the thermalBaffle1D boundary condition. Here there is no thermo model from which to determine a name. This eventually needs resolving either by adding a selection mechanism similar to that of the thermo packages themselves, or by removing this boundary condition in favour of the (non-1D) thermal baffle boundary condition and region model. --- .../solvers/combustion/chemFoam/chemFoam.C | 3 +- .../combustion/chemFoam/thermoTypeFunctions.H | 71 +- .../chemkinReader/chemkinLexer.L | 18 +- .../chemkinReader/chemkinReader.C | 26 +- .../chemkinReader/chemkinReader.H | 35 +- .../chemkinToFoam/chemkinToFoam.C | 12 +- .../thermalBaffle1DFvPatchScalarFields.C | 74 ++- .../CombustionModel/CombustionModels.C | 14 +- src/combustionModels/EDC/EDCs.C | 13 +- src/combustionModels/FSD/FSDs.C | 70 +- src/combustionModels/PaSR/PaSRs.C | 13 +- .../combustionModel/makeCombustionModel.H} | 88 ++- .../makeThermoCombustionModel.H | 71 ++ src/combustionModels/diffusion/diffusions.C | 72 +-- .../infinitelyFastChemistrys.C | 82 +-- src/combustionModels/laminar/laminars.C | 14 +- .../noCombustion/noCombustions.C | 14 +- .../mixtureFraction/mixtureFraction.C | 50 +- .../mixtureFraction/mixtureFraction.H | 8 +- .../mixtureFraction/mixtureFractions.C | 64 +- .../zoneCombustion/zoneCombustions.C | 14 +- ...{makeSootTypes.H => makeThermoSootModel.H} | 24 +- .../sootModels/sootModel/sootModelNew.C | 130 +++- .../basic/fluidThermo/makeThermo.H | 133 ---- .../basic/psiThermo/psiThermos.C | 191 +----- .../basic/rhoThermo/rhoThermos.C | 476 +------------- .../chemistryModel/Make/files | 8 +- .../BasicChemistryModels.C | 476 +------------- .../TDACChemistryModel/reduction/DAC/DAC.H | 4 +- .../TDACChemistryModel/reduction/EFA/EFA.H | 4 +- .../TDACChemistryModel/reduction/PFA/PFA.H | 4 +- .../chemistryReductionMethods.C | 70 ++ .../reduction/makeChemistryReductionMethod.H} | 73 +-- .../reduction/makeChemistryReductionMethods.C | 126 ---- .../reduction/makeChemistryReductionMethods.H | 126 ---- .../noChemistryReduction.H | 4 +- .../chemistryTabulationMethods.C} | 43 +- .../makeChemistryTabulationMethod.H} | 99 ++- .../makeChemistryTabulationMethods.C | 126 ---- .../basicChemistryModelTemplates.C | 8 +- .../chemistryModel/makeChemistryModel.H | 32 +- .../chemistrySolver/chemistrySolvers.C | 98 +++ .../chemistrySolver/makeChemistrySolvers.C | 124 ---- .../chemistrySolver/makeChemistrySolver.H | 85 +++ ...xLimitedLangmuirHinshelwoodReactionRateI.H | 4 +- ...efluxLimitedLangmuirHinshelwoodReactions.C | 17 +- .../makeLangmuirHinshelwoodReactions.C | 20 +- .../reactions/makeMichaelisMentenReactions.C | 20 +- .../chemistryModel/reactions/makeReaction.H | 143 +++-- .../chemistryModel/reactions/makeReactions.C | 249 +++++-- .../makesurfaceArrheniusReactions.C | 31 +- .../reactionThermo/makeReactionThermo.H | 56 +- .../psiReactionThermo/psiReactionThermos.C | 262 +------- .../psiuReactionThermo/psiuReactionThermos.C | 223 +------ .../rhoReactionThermo/rhoReactionThermos.C | 605 ++---------------- ...{solidThermoPhysicsTypes.H => forSolids.H} | 86 +-- .../heSolidThermo/heSolidThermos.C | 63 +- .../heSolidThermo/makeHeSolidThermo.H | 152 ++--- .../equationOfState/Boussinesq/Boussinesq.H | 3 +- .../equationOfState/Boussinesq/BoussinesqI.H | 16 +- .../specie/include/forAbsoluteGases.H | 70 ++ .../specie/include/forCommonGases.H | 72 +++ .../specie/include/forCommonLiquids.H | 70 ++ .../specie/include/forGases.H | 76 +++ .../specie/include/forLiquids.H | 72 +++ .../specie/include/forPolynomials.H | 65 ++ .../specie/include/forThermo.H | 50 ++ .../specie/include/makeThermo.H | 91 +++ .../specie/include/reactionTypes.H | 92 --- .../specie/include/thermoPhysicsTypes.H | 285 --------- .../specie/include/typedefThermo.H | 54 ++ .../specie/transport/WLF/WLFTransport.H | 16 +- .../specie/transport/WLF/WLFTransportI.H | 22 +- .../constant/radiationProperties | 2 +- .../constant/thermophysicalProperties | 8 +- .../constant/thermophysicalProperties | 8 +- .../constant/thermophysicalProperties | 8 +- .../constant/thermophysicalProperties | 12 +- .../constant/thermophysicalProperties | 6 +- .../constant/thermophysicalProperties | 6 +- .../constant/thermophysicalProperties | 8 +- .../thermophysicalProperties.particles | 9 +- .../thermophysicalProperties.particles | 9 +- 83 files changed, 2016 insertions(+), 4335 deletions(-) rename src/{thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.H => combustionModels/combustionModel/makeCombustionModel.H} (56%) create mode 100644 src/combustionModels/combustionModel/makeThermoCombustionModel.H rename src/radiationModels/sootModels/sootModel/{makeSootTypes.H => makeThermoSootModel.H} (71%) delete mode 100644 src/thermophysicalModels/basic/fluidThermo/makeThermo.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethods.C rename src/{combustionModels/combustionModel/makeCombustionTypes.H => thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethod.H} (61%) delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.H rename src/{ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.H => thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethods.C} (57%) rename src/thermophysicalModels/chemistryModel/{chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H => chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethod.H} (51%) delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolvers.C delete mode 100644 src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistrySolver/makeChemistrySolver.H rename src/thermophysicalModels/solidSpecie/include/{solidThermoPhysicsTypes.H => forSolids.H} (54%) create mode 100644 src/thermophysicalModels/specie/include/forAbsoluteGases.H create mode 100644 src/thermophysicalModels/specie/include/forCommonGases.H create mode 100644 src/thermophysicalModels/specie/include/forCommonLiquids.H create mode 100644 src/thermophysicalModels/specie/include/forGases.H create mode 100644 src/thermophysicalModels/specie/include/forLiquids.H create mode 100644 src/thermophysicalModels/specie/include/forPolynomials.H create mode 100644 src/thermophysicalModels/specie/include/forThermo.H create mode 100644 src/thermophysicalModels/specie/include/makeThermo.H delete mode 100644 src/thermophysicalModels/specie/include/reactionTypes.H delete mode 100644 src/thermophysicalModels/specie/include/thermoPhysicsTypes.H create mode 100644 src/thermophysicalModels/specie/include/typedefThermo.H diff --git a/applications/solvers/combustion/chemFoam/chemFoam.C b/applications/solvers/combustion/chemFoam/chemFoam.C index 15680864dc..e2b811c89e 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,6 @@ Description #include "multiComponentMixture.H" #include "chemistrySolver.H" #include "OFstream.H" -#include "thermoPhysicsTypes.H" #include "basicSpecieMixture.H" #include "cellModeller.H" #include "thermoTypeFunctions.H" diff --git a/applications/solvers/combustion/chemFoam/thermoTypeFunctions.H b/applications/solvers/combustion/chemFoam/thermoTypeFunctions.H index 64a545a2e2..41c14ec370 100644 --- a/applications/solvers/combustion/chemFoam/thermoTypeFunctions.H +++ b/applications/solvers/combustion/chemFoam/thermoTypeFunctions.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,25 +23,21 @@ License \*---------------------------------------------------------------------------*/ -template scalarList W(const rhoReactionThermo& thermo) { - const PtrList& specieData = - dynamicCast>(thermo) - .speciesData(); + const basicSpecieMixture& composition = thermo.composition(); - scalarList W(specieData.size()); + scalarList W(composition.Y().size()); - forAll(specieData, i) + forAll(W, i) { - W[i] = specieData[i].W(); + W[i] = composition.Wi(i); } return W; } -template scalar h0 ( const rhoReactionThermo& thermo, @@ -50,68 +46,17 @@ scalar h0 const scalar T ) { - const PtrList& specieData = - dynamic_cast&>(thermo) - .speciesData(); + const basicSpecieMixture& composition = thermo.composition(); scalar h0 = 0; + forAll(Y, i) { - h0 += Y[i]*specieData[i].Hs(p, T); + h0 += Y[i]*composition.Hs(i, p, T); } return h0; } -scalarList W(const rhoReactionThermo& thermo) -{ - if (isA>(thermo)) - { - return W(thermo); - } - else if (isA>(thermo)) - { - return W(thermo); - } - else - { - FatalErrorInFunction - << "Thermodynamics type " << thermo.type() - << " not supported by chemFoam" - << exit(FatalError); - - return scalarList::null(); - } -} - - -scalar h0 -( - const rhoReactionThermo& thermo, - const scalarList& Y, - const scalar p, - const scalar T -) -{ - if (isA>(thermo)) - { - return h0(thermo, Y, p, T); - } - else if (isA>(thermo)) - { - return h0(thermo, Y, p, T); - } - else - { - FatalErrorInFunction - << "Thermodynamics type " << thermo.type() - << " not supported by chemFoam" - << exit(FatalError); - - return 0; - } -} - - // ************************************************************************* // diff --git a/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinLexer.L b/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinLexer.L index b2c3fed7a8..59979992a5 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinLexer.L +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinLexer.L @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -315,8 +315,8 @@ List currentSpecieComposition(5); scalar currentLowT = 0; scalar currentHighT = 0; scalar currentCommonT = 0; -gasHThermoPhysics::coeffArray highCpCoeffs(scalarList(7)); -gasHThermoPhysics::coeffArray lowCpCoeffs(scalarList(7)); +chemkinReader::thermoPhysics::coeffArray highCpCoeffs(scalarList(7)); +chemkinReader::thermoPhysics::coeffArray lowCpCoeffs(scalarList(7)); specieCoeffs currentSpecieCoeff; @@ -633,7 +633,7 @@ bool finishReaction = false; {thermoLineLabel4} { - HashPtrTable::iterator specieThermoIter + HashPtrTable::iterator specieThermoIter ( speciesThermo_.find(currentSpecieName) ); @@ -646,7 +646,7 @@ bool finishReaction = false; speciesThermo_.insert ( currentSpecieName, - new gasHThermoPhysics + new chemkinReader::thermoPhysics ( janafThermo> ( @@ -671,15 +671,15 @@ bool finishReaction = false; } {end} { - Reaction::TlowDefault = max + Reaction::TlowDefault = max ( - Reaction::TlowDefault, + Reaction::TlowDefault, currentLowT ); - Reaction::ThighDefault = min + Reaction::ThighDefault = min ( - Reaction::ThighDefault, + Reaction::ThighDefault, currentHighT ); diff --git a/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.C b/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.C index cc5e513bfb..b5db929661 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.C +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -172,9 +172,9 @@ void Foam::chemkinReader::addReactionType { reactions_.append ( - new IrreversibleReaction + new IrreversibleReaction ( - ReactionProxy + ReactionProxy ( speciesTable_, lhs.shrink(), @@ -191,9 +191,9 @@ void Foam::chemkinReader::addReactionType { reactions_.append ( - new ReversibleReaction + new ReversibleReaction ( - ReactionProxy + ReactionProxy ( speciesTable_, lhs.shrink(), @@ -480,11 +480,11 @@ void Foam::chemkinReader::addReaction ( new NonEquilibriumReversibleReaction < - gasHThermoPhysics, + thermoPhysics, ArrheniusReactionRate > ( - ReactionProxy + ReactionProxy ( speciesTable_, lhs.shrink(), @@ -535,11 +535,11 @@ void Foam::chemkinReader::addReaction ( new NonEquilibriumReversibleReaction < - gasHThermoPhysics, + thermoPhysics, thirdBodyArrheniusReactionRate > ( - ReactionProxy + ReactionProxy ( speciesTable_, lhs.shrink(), @@ -640,11 +640,11 @@ void Foam::chemkinReader::addReaction ( new NonEquilibriumReversibleReaction < - gasHThermoPhysics, + thermoPhysics, LandauTellerReactionRate > ( - ReactionProxy + ReactionProxy ( speciesTable_, lhs.shrink(), @@ -776,8 +776,8 @@ void Foam::chemkinReader::read const fileName& transportFileName ) { - Reaction::TlowDefault = 0; - Reaction::ThighDefault = great; + Reaction::TlowDefault = 0; + Reaction::ThighDefault = great; transportDict_.read(IFstream(transportFileName)()); diff --git a/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.H b/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.H index 8f55e26041..6f830cfb5a 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.H +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinReader/chemkinReader.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,13 @@ SourceFiles #include "speciesTable.H" #include "specieElement.H" #include "atomicWeights.H" -#include "reactionTypes.H" + +#include "specie.H" +#include "perfectGas.H" +#include "janafThermo.H" +#include "sensibleEnthalpy.H" +#include "sutherlandTransport.H" +#include "thermo.H" #include @@ -55,6 +61,8 @@ SourceFiles namespace Foam { + + typedef HashTable> speciesCompositionTable; /*---------------------------------------------------------------------------*\ @@ -77,6 +85,21 @@ public: gas }; + // Public typedefs + + typedef + sutherlandTransport + < + species::thermo + < + janafThermo + < + perfectGas + >, + sensibleEnthalpy + > + > thermoPhysics; + private: @@ -173,13 +196,13 @@ private: HashTable speciePhase_; //- Table of the thermodynamic data given in the CHEMKIN file - HashPtrTable speciesThermo_; + HashPtrTable speciesThermo_; //- Table of species composition speciesCompositionTable speciesComposition_; //- List of the reactions - ReactionList reactions_; + ReactionList reactions_; //- Transport properties dictionary dictionary transportDict_; @@ -351,13 +374,13 @@ public: } //- Table of the thermodynamic data given in the CHEMKIN file - const HashPtrTable& speciesThermo() const + const HashPtrTable& speciesThermo() const { return speciesThermo_; } //- List of the reactions - const ReactionList& reactions() const + const ReactionList& reactions() const { return reactions_; } diff --git a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C index 316fb6bb5c..95e1427fbd 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C +++ b/applications/utilities/thermophysical/chemkinToFoam/chemkinToFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,7 +65,8 @@ int main(int argc, char *argv[]) speciesTable species; chemkinReader cr(species, args[1], args[3], args[2], newFormat); - const HashPtrTable& speciesThermo = cr.speciesThermo(); + const HashPtrTable& speciesThermo = + cr.speciesThermo(); dictionary thermoDict; thermoDict.add("species", cr.species()); @@ -82,7 +83,12 @@ int main(int argc, char *argv[]) // pending complete integration into the thermodynamics structure // Add elements - forAllConstIter(HashPtrTable, speciesThermo, iter) + forAllConstIter + ( + HashPtrTable, + speciesThermo, + iter + ) { const word specieName(iter.key()); diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C b/src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C index 4307746405..7e57f0fc7c 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C @@ -23,43 +23,77 @@ License \*---------------------------------------------------------------------------*/ -#include "thermalBaffle1DFvPatchScalarFields.H" +#include "thermalBaffle1DFvPatchScalarField.H" + +#include "forSolids.H" + #include "addToRunTimeSelectionTable.H" +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +namespace Foam +{ + +typedef + constIsoSolidTransport + < + species::thermo + < + hConstThermo + < + rhoConst + >, + sensibleEnthalpy + > + > hConstSolidThermoPhysics; + +typedef + compressible::thermalBaffle1DFvPatchScalarField + thermalBaffle1DHConstSolidThermoPhysicsFvPatchScalarField; defineTemplateTypeNameAndDebugWithName ( - Foam::compressible::constSolid_thermalBaffle1DFvPatchScalarField, + thermalBaffle1DHConstSolidThermoPhysicsFvPatchScalarField, "compressible::thermalBaffle1D", 0 ); +addToPatchFieldRunTimeSelection +( + fvPatchScalarField, + thermalBaffle1DHConstSolidThermoPhysicsFvPatchScalarField +); + +typedef + exponentialSolidTransport + < + species::thermo + < + hPowerThermo + < + rhoConst + >, + sensibleEnthalpy + > + > hPowerSolidThermoPhysics; + +typedef + compressible::thermalBaffle1DFvPatchScalarField + thermalBaffle1DHPowerSolidThermoPhysicsFvPatchScalarField; + defineTemplateTypeNameAndDebugWithName ( - Foam::compressible::expoSolid_thermalBaffle1DFvPatchScalarField, + thermalBaffle1DHPowerSolidThermoPhysicsFvPatchScalarField, "compressible::thermalBaffle1D", 0 ); -namespace Foam -{ -namespace compressible -{ - addToPatchFieldRunTimeSelection - ( - fvPatchScalarField, - constSolid_thermalBaffle1DFvPatchScalarField - ); +addToPatchFieldRunTimeSelection +( + fvPatchScalarField, + thermalBaffle1DHPowerSolidThermoPhysicsFvPatchScalarField +); - addToPatchFieldRunTimeSelection - ( - fvPatchScalarField, - expoSolid_thermalBaffle1DFvPatchScalarField - ); } -} - // ************************************************************************* // diff --git a/src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C b/src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C index 6348a5a8e9..07d3796c43 100644 --- a/src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C +++ b/src/combustionModels/CombustionModel/CombustionModel/CombustionModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,21 +23,19 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" - #include "CombustionModel.H" -#include "rhoReactionThermo.H" #include "psiReactionThermo.H" +#include "rhoReactionThermo.H" + +#include "makeCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -makeCombustion(psiReactionThermo); -makeCombustion(rhoReactionThermo); - + defineCombustionModel(psiReactionThermo); + defineCombustionModel(rhoReactionThermo); } // ************************************************************************* // diff --git a/src/combustionModels/EDC/EDCs.C b/src/combustionModels/EDC/EDCs.C index 2003ad079d..a327be7130 100644 --- a/src/combustionModels/EDC/EDCs.C +++ b/src/combustionModels/EDC/EDCs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,11 +23,12 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" +#include "EDC.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "EDC.H" + +#include "makeCombustionModel.H" // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // @@ -57,10 +58,8 @@ Foam::combustionModels::EDCdefaultVersion namespace Foam { - -makeCombustionTypes(EDC, psiReactionThermo); -makeCombustionTypes(EDC, rhoReactionThermo); - + makeCombustionModel(EDC, psiReactionThermo); + makeCombustionModel(EDC, rhoReactionThermo); } // ************************************************************************* // diff --git a/src/combustionModels/FSD/FSDs.C b/src/combustionModels/FSD/FSDs.C index 28d073992d..b40e04ab70 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,76 +23,20 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" +#include "FSD.H" -#include "thermoPhysicsTypes.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "FSD.H" + +#include "forCommonGases.H" +#include "makeThermoCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Combustion models based on sensibleEnthalpy -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - constGasHThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - constGasHThermoPhysics -); - -// Combustion models based on sensibleInternalEnergy -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - psiReactionThermo, - constGasEThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - FSD, - rhoReactionThermo, - constGasEThermoPhysics -); - + forCommonGases(makeThermoCombustionModel, FSD, psiReactionThermo); + forCommonGases(makeThermoCombustionModel, FSD, rhoReactionThermo); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/PaSR/PaSRs.C b/src/combustionModels/PaSR/PaSRs.C index 965881a243..c9076da89f 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,20 +23,19 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" +#include "PaSR.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "PaSR.H" + +#include "makeCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -makeCombustionTypes(PaSR, psiReactionThermo); -makeCombustionTypes(PaSR, rhoReactionThermo); - + makeCombustionModel(PaSR, psiReactionThermo); + makeCombustionModel(PaSR, rhoReactionThermo); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.H b/src/combustionModels/combustionModel/makeCombustionModel.H similarity index 56% rename from src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.H rename to src/combustionModels/combustionModel/makeCombustionModel.H index 2bf28e3c8f..aaeeb3355c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.H +++ b/src/combustionModels/combustionModel/makeCombustionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,68 +23,64 @@ License \*---------------------------------------------------------------------------*/ -#ifndef makeChemistryTabulationMethods_H -#define makeChemistryTabulationMethods_H +#ifndef makeCombustionModel_H +#define makeCombustionModel_H -#include "chemistryTabulationMethod.H" -#include "noChemistryTabulation.H" -#include "ISAT.H" +#include "CombustionModel.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeChemistryTabulationMethod(SS, Comp, Thermo) \ +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define defineCombustionModel(ReactionThermo) \ \ - typedef chemistryTabulationMethods::SS \ - chemistryTabulationMethod##SS##Comp##Thermo; \ + typedef CombustionModel CombustionModel##ReactionThermo; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - chemistryTabulationMethod##SS##Comp##Thermo, \ - (#SS"<" + word(Comp::typeName_()) \ - + "," + Thermo::typeName() + ">").c_str(), \ - 0 \ - ); \ - \ - chemistryTabulationMethod:: \ - adddictionaryConstructorToTable \ - \ - add##chemistryTabulationMethods##SS##Comp##Thermo##ConstructorToTable_; - - -#define makeChemistryTabulationMethods(CompChemModel, Thermo) \ - \ - typedef chemistryTabulationMethod \ - chemistryTabulationMethod##CompChemModel##Thermo; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - chemistryTabulationMethod##CompChemModel##Thermo, \ - (word(chemistryTabulationMethod##CompChemModel##Thermo::typeName_()) + \ - '<' + word(CompChemModel::typeName_()) + "," + Thermo::typeName() + '>'\ + CombustionModel##ReactionThermo, \ + ( \ + word(CombustionModel##ReactionThermo::typeName_()) + "<" \ + + ReactionThermo::typeName + ">" \ ).c_str(), \ 0 \ ); \ \ defineTemplateRunTimeSelectionTable \ ( \ - chemistryTabulationMethod##CompChemModel##Thermo, \ + CombustionModel##ReactionThermo, \ dictionary \ - ); \ - \ - makeChemistryTabulationMethod \ - ( \ - none, \ - CompChemModel, \ - Thermo \ - ); \ - \ - makeChemistryTabulationMethod \ - ( \ - ISAT, \ - CompChemModel, \ - Thermo \ ); +#define makeCombustionModel(Model, ReactionThermo) \ + \ + typedef combustionModels::Model Model##ReactionThermo; \ + typedef CombustionModel Model##ReactionThermo##Base; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + Model##ReactionThermo, \ + ( \ + word(Model##ReactionThermo::typeName_()) + "<" \ + + ReactionThermo::typeName + ">" \ + ).c_str(), \ + 0 \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + Model##ReactionThermo##Base, \ + Model##ReactionThermo, \ + dictionary \ + ) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/combustionModel/makeThermoCombustionModel.H b/src/combustionModels/combustionModel/makeThermoCombustionModel.H new file mode 100644 index 0000000000..b7ca9c2d7f --- /dev/null +++ b/src/combustionModels/combustionModel/makeThermoCombustionModel.H @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeThermoCombustionModel_H +#define makeThermoCombustionModel_H + +#include "CombustionModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeThermoCombustionModel(Model, ReactionThermo, ThermoPhys) \ + \ + typedef combustionModels::Model \ + Model##ReactionThermo##ThermoPhys; \ + typedef CombustionModel \ + Model##ReactionThermo##ThermoPhys##Base; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + Model##ReactionThermo##ThermoPhys, \ + ( \ + word(Model##ReactionThermo##ThermoPhys::typeName_()) + "<" \ + + ReactionThermo::typeName + "," + ThermoPhys::typeName() + ">" \ + ).c_str(), \ + 0 \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + Model##ReactionThermo##ThermoPhys##Base, \ + Model##ReactionThermo##ThermoPhys, \ + dictionary \ + ) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C index 0fb18d8620..b7da34d132 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,78 +23,20 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" +#include "diffusion.H" -#include "thermoPhysicsTypes.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "diffusion.H" + +#include "forCommonGases.H" +#include "makeThermoCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Combustion models based on sensibleEnthalpy -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - constGasHThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - constGasHThermoPhysics -); - - -// Combustion models based on sensibleInternalEnergy - -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - psiReactionThermo, - constGasEThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - diffusion, - rhoReactionThermo, - constGasEThermoPhysics -); - + forCommonGases(makeThermoCombustionModel, diffusion, psiReactionThermo); + forCommonGases(makeThermoCombustionModel, diffusion, rhoReactionThermo); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C index e86a886e5e..be65acd28c 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,78 +23,30 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" +#include "infinitelyFastChemistry.H" -#include "thermoPhysicsTypes.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "infinitelyFastChemistry.H" + +#include "forCommonGases.H" +#include "makeThermoCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// Combustion models based on sensibleEnthalpy - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - constGasHThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - gasHThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - constGasHThermoPhysics -); - -// Combustion models based on sensibleInternalEnergy - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - psiReactionThermo, - constGasEThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - gasEThermoPhysics -); - -makeCombustionTypesThermo -( - infinitelyFastChemistry, - rhoReactionThermo, - constGasEThermoPhysics -); - + forCommonGases + ( + makeThermoCombustionModel, + infinitelyFastChemistry, + psiReactionThermo + ); + forCommonGases + ( + makeThermoCombustionModel, + infinitelyFastChemistry, + rhoReactionThermo + ); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/laminar/laminars.C b/src/combustionModels/laminar/laminars.C index 2c5b2cee53..3c9d561fbf 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,20 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" - +#include "laminar.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "laminar.H" + +#include "makeCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -makeCombustionTypes(laminar, psiReactionThermo); -makeCombustionTypes(laminar, rhoReactionThermo); - + makeCombustionModel(laminar, psiReactionThermo); + makeCombustionModel(laminar, rhoReactionThermo); } // ************************************************************************* // diff --git a/src/combustionModels/noCombustion/noCombustions.C b/src/combustionModels/noCombustion/noCombustions.C index b1c496fd1b..24dcc0356f 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,20 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" - +#include "noCombustion.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "noCombustion.H" + +#include "makeCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -makeCombustionTypes(noCombustion, psiReactionThermo); -makeCombustionTypes(noCombustion, rhoReactionThermo); - + makeCombustionModel(noCombustion, psiReactionThermo); + makeCombustionModel(noCombustion, rhoReactionThermo); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.C b/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.C index bf1b03fa3d..e24b123897 100644 --- a/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.C +++ b/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,13 +24,14 @@ License \*---------------------------------------------------------------------------*/ #include "mixtureFraction.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" #include "singleStepCombustion.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::radiationModels::sootModels::mixtureFraction:: -mixtureFraction +template +Foam::radiationModels::sootModels::mixtureFraction::mixtureFraction ( const dictionary& dict, const fvMesh& mesh, @@ -60,20 +61,25 @@ mixtureFraction ), mapFieldMax_(1) { - const combustionModels::singleStepCombustion& - combustion - ( - mesh.lookupObject - < - combustionModels::singleStepCombustion - > - ( - combustionModel::combustionPropertiesName - ) - ); + const word& combustionName = combustionModel::combustionPropertiesName; - const multiComponentMixture& mixture(combustion.mixture()); - const Reaction& reaction = combustion.reaction(); + typedef + combustionModels::singleStepCombustion + psiCombustionType; + + typedef + combustionModels::singleStepCombustion + rhoCombustionType; + + const multiComponentMixture& mixture = + mesh.foundObject(combustionName) + ? mesh.lookupObject(combustionName).mixture() + : mesh.lookupObject(combustionName).mixture(); + + const Reaction& reaction = + mesh.foundObject(combustionName) + ? mesh.lookupObject(combustionName).reaction() + : mesh.lookupObject(combustionName).reaction(); scalar totalMol = 0; forAll(reaction.rhs(), i) @@ -124,18 +130,16 @@ mixtureFraction // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::radiationModels::sootModels::mixtureFraction:: +template +Foam::radiationModels::sootModels::mixtureFraction:: ~mixtureFraction() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -void -Foam::radiationModels::sootModels::mixtureFraction:: -correct() +template +void Foam::radiationModels::sootModels::mixtureFraction::correct() { const volScalarField& mapField = mesh_.lookupObject(mappingFieldName_); diff --git a/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.H b/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.H index a4a5c00502..6569304f31 100644 --- a/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.H +++ b/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFraction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,9 +41,9 @@ Description For example in the radiationProperties dictionary set: - sootModel mixtureFraction; + sootModel mixtureFraction; - mixtureFractionSootCoeffs + mixtureFractionCoeffs { nuSoot 0.015; Wsoot 12; @@ -73,7 +73,7 @@ namespace sootModels Class mixtureFraction Declaration \*---------------------------------------------------------------------------*/ -template +template class mixtureFraction : public sootModel diff --git a/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFractions.C b/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFractions.C index bdfe2f152c..e61d794a5f 100644 --- a/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFractions.C +++ b/src/combustionModels/radiationModels/sootModels/mixtureFraction/mixtureFractions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,69 +24,17 @@ License \*---------------------------------------------------------------------------*/ #include "mixtureFraction.H" -#include "thermoPhysicsTypes.H" -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" + +#include "forCommonGases.H" +#include "makeThermoSootModel.H" + #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeMixtureSootTypesThermo(SootModelType, ReactionThermo, Thermo) \ - \ - typedef radiationModels::sootModels::SootModelType \ - SootModelType##ReactionThermo##Thermo; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - SootModelType##ReactionThermo##Thermo, \ - ( \ - word(SootModelType##ReactionThermo##Thermo::typeName_()) + \ - "<"#ReactionThermo","#Thermo">" \ - ).c_str(), \ - 0 \ - ); \ - \ - namespace radiationModels \ - { \ - addToRunTimeSelectionTable \ - ( \ - sootModel, \ - SootModelType##ReactionThermo##Thermo, \ - dictionary \ - ); \ - } - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - namespace Foam { - makeMixtureSootTypesThermo - ( - mixtureFraction, - psiReactionThermo, - gasHThermoPhysics - ); - - makeMixtureSootTypesThermo - ( - mixtureFraction, - psiReactionThermo, - gasEThermoPhysics - ); - - makeMixtureSootTypesThermo - ( - mixtureFraction, - rhoReactionThermo, - gasHThermoPhysics - ); - - makeMixtureSootTypesThermo - ( - mixtureFraction, - rhoReactionThermo, - gasEThermoPhysics - ); + forCommonGases(makeThermoSootModel, mixtureFraction); } // ************************************************************************* // diff --git a/src/combustionModels/zoneCombustion/zoneCombustions.C b/src/combustionModels/zoneCombustion/zoneCombustions.C index d4bb9b4726..a33df68cfe 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 | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,20 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "makeCombustionTypes.H" - +#include "zoneCombustion.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "zoneCombustion.H" + +#include "makeCombustionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -makeCombustionTypes(zoneCombustion, psiReactionThermo); -makeCombustionTypes(zoneCombustion, rhoReactionThermo); - + makeCombustionModel(zoneCombustion, psiReactionThermo); + makeCombustionModel(zoneCombustion, rhoReactionThermo); } // ************************************************************************* // diff --git a/src/radiationModels/sootModels/sootModel/makeSootTypes.H b/src/radiationModels/sootModels/sootModel/makeThermoSootModel.H similarity index 71% rename from src/radiationModels/sootModels/sootModel/makeSootTypes.H rename to src/radiationModels/sootModels/sootModel/makeThermoSootModel.H index 400065ca58..980cc76cf4 100644 --- a/src/radiationModels/sootModels/sootModel/makeSootTypes.H +++ b/src/radiationModels/sootModels/sootModel/makeThermoSootModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,35 +23,31 @@ License \*---------------------------------------------------------------------------*/ -#ifndef makeSootTypes_H -#define makeSootTypes_H +#ifndef makeThermoSootModel_H +#define makeThermoSootModel_H +#include "sootModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeSootTypesThermo(SootModelType, Thermo) \ +#define makeThermoSootModel(Model, ThermoPhys) \ \ - typedef radiationModels::sootModels::SootModelType \ - SootModelType##Thermo; \ + typedef radiationModels::sootModels::Model Model##ThermoPhys; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - SootModelType##Thermo, \ + Model##ThermoPhys, \ ( \ - word(SootModelType##Thermo::typeName_()) + "<"#Thermo">" \ + word(Model##ThermoPhys::typeName_()) + "<" \ + + ThermoPhys::typeName() + ">" \ ).c_str(), \ 0 \ ); \ \ namespace radiationModels \ { \ - addToRunTimeSelectionTable \ - ( \ - sootModel, \ - SootModelType##Thermo, \ - dictionary \ - ); \ + addToRunTimeSelectionTable(sootModel, Model##ThermoPhys, dictionary); \ } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/radiationModels/sootModels/sootModel/sootModelNew.C b/src/radiationModels/sootModels/sootModel/sootModelNew.C index 0a43aed787..e5bce5a41d 100644 --- a/src/radiationModels/sootModels/sootModel/sootModelNew.C +++ b/src/radiationModels/sootModels/sootModel/sootModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,8 @@ License #include "error.H" #include "sootModel.H" +#include "noSoot.H" +#include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -35,32 +37,122 @@ Foam::radiationModels::sootModel::New const fvMesh& mesh ) { - word modelType("none"); - - if (dict.found("sootModel")) + // Get the soot model type name + word modelType(sootModels::noSoot::typeName); + if (dict.found(sootModel::typeName)) { - dict.lookup("sootModel") >> modelType; + dict.lookup(sootModel::typeName) >> modelType; + Info<< "Selecting soot model " << modelType << endl; + } + const wordList cmpts(basicThermo::splitThermoName(modelType, 3)); + if (cmpts.size() == 3) + { + modelType = cmpts[0]; - Info<< "Selecting sootModel " << modelType << endl; + WarningInFunction + << "Template parameters are no longer required when selecting a " + << sootModel::typeName << ". This information is now " + << "obtained directly from the thermodynamics. Actually selecting " + << "combustion model " << modelType << "." << endl; } - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); + // Get the thermo model type names + word thermoType(word::null); + if (mesh.foundObject(basicThermo::dictName)) + { + const basicThermo& thermo = + mesh.lookupObject(basicThermo::dictName); - if (cstrIter == dictionaryConstructorTablePtr_->end()) + thermoType = thermo.thermoName(); + } + + // Construct a thermo-soot model type name + const word thermoModelType = modelType + '<' + thermoType + '>'; + + // Lookup both possible model names + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + dictionaryConstructorTable::iterator thermoCstrIter = + dictionaryConstructorTablePtr_->find(thermoModelType); + + // Construct and return + if (thermoCstrIter != dictionaryConstructorTablePtr_->end()) + { + return autoPtr(thermoCstrIter()(dict, mesh, modelType)); + } + else if (cstrIter != dictionaryConstructorTablePtr_->end()) + { + return autoPtr(cstrIter()(dict, mesh, modelType)); + } + else { FatalErrorInFunction - << "Unknown sootModel type " - << modelType << nl << nl - << "Valid sootModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + << "Unknown " << sootModel::typeName << " type " + << modelType << nl << nl; + + const wordList names(dictionaryConstructorTablePtr_->sortedToc()); + + wordList thisCmpts; + thisCmpts.append(word::null); + thisCmpts.append(basicThermo::splitThermoName(thermoType, 5)); + + wordList validNames; + forAll(names, i) + { + wordList cmpts(basicThermo::splitThermoName(names[i], 1)); + if (cmpts.size() != 1) + { + cmpts = basicThermo::splitThermoName(names[i], 6); + } + + 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 " << sootModel::typeName << " types for this " + << "thermodynamic model are:" << endl << validNames << endl; + + List validCmpts; + validCmpts.append(wordList(6, word::null)); + validCmpts[0][0] = sootModel::typeName; + validCmpts[0][1] = "transport"; + validCmpts[0][2] = "thermo"; + validCmpts[0][3] = "equationOfState"; + validCmpts[0][4] = "specie"; + validCmpts[0][5] = "energy"; + forAll(names, i) + { + const wordList cmpts1(basicThermo::splitThermoName(names[i], 1)); + const wordList cmpts6(basicThermo::splitThermoName(names[i], 6)); + if (cmpts1.size() == 1) + { + validCmpts.append(wordList(6, "")); + validCmpts.last()[0] = cmpts1[0]; + } + if (cmpts6.size() == 6) + { + validCmpts.append(cmpts6); + } + } + + FatalErrorInFunction + << "All " << sootModel::typeName + << "/thermoPhysics combinations are:" << endl << endl; + printTable(validCmpts, FatalErrorInFunction); + + FatalErrorInFunction << exit(FatalError); + + return autoPtr(nullptr); } - - const label tempOpen = modelType.find('<'); - - const word className = modelType(0, tempOpen); - - return autoPtr(cstrIter()(dict, mesh, className)); } diff --git a/src/thermophysicalModels/basic/fluidThermo/makeThermo.H b/src/thermophysicalModels/basic/fluidThermo/makeThermo.H deleted file mode 100644 index 6fc0672c90..0000000000 --- a/src/thermophysicalModels/basic/fluidThermo/makeThermo.H +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 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::fluidThermo - -Description - Macros for creating basic fluid thermo packages - -\*---------------------------------------------------------------------------*/ - -#ifndef makeThermo_H -#define makeThermo_H - -#include "fluidThermo.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie) \ - \ - typedef \ - Transport \ - < \ - species::thermo \ - < \ - Thermo \ - < \ - EqnOfState \ - < \ - Specie \ - > \ - >, \ - Type \ - > \ - > \ - Transport##Type##Thermo##EqnOfState##Specie - - -#define defineThermoPhysicsThermo(BaseThermo,CThermo,Mixture,ThermoPhys) \ - \ - typedef \ - CThermo \ - < \ - BaseThermo, \ - Mixture \ - > \ - CThermo##Mixture##ThermoPhys; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - CThermo##Mixture##ThermoPhys, \ - (#CThermo"<" + Mixture::typeName() + ">").c_str(), \ - 0 \ - ) - - -#define addThermoPhysicsThermo(BaseThermo,CThermoMixtureThermoPhys) \ - \ - addToRunTimeSelectionTable \ - ( \ - BaseThermo, \ - CThermoMixtureThermoPhys, \ - fvMesh \ - ); \ - - -#define makeThermoPhysicsThermo(BaseThermo,CThermo,Mixture,ThermoPhys) \ - \ - defineThermoPhysicsThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \ - \ - addThermoPhysicsThermo(BaseThermo, CThermo##Mixture##ThermoPhys) - - -#define makeThermoPhysicsThermos(BaseThermo,CThermo,Mixture,ThermoPhys) \ - \ - defineThermoPhysicsThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \ - \ - addThermoPhysicsThermo(basicThermo, CThermo##Mixture##ThermoPhys); \ - addThermoPhysicsThermo(fluidThermo, CThermo##Mixture##ThermoPhys); \ - addThermoPhysicsThermo(BaseThermo, CThermo##Mixture##ThermoPhys) - - -#define makeThermo(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \ - \ - typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie); \ - \ - makeThermoPhysicsThermo \ - ( \ - BaseThermo, \ - CThermo, \ - Mixture, \ - Transport##Type##Thermo##EqnOfState##Specie \ - ) - - -#define makeThermos(BaseThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \ - \ - typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie); \ - \ - makeThermoPhysicsThermos \ - ( \ - BaseThermo, \ - CThermo, \ - Mixture, \ - Transport##Type##Thermo##EqnOfState##Specie \ - ) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermos.C b/src/thermophysicalModels/basic/psiThermo/psiThermos.C index aa080217fd..17c5ed617d 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,198 +24,17 @@ License \*---------------------------------------------------------------------------*/ #include "psiThermo.H" -#include "makeThermo.H" - -#include "specie.H" -#include "perfectGas.H" -#include "PengRobinsonGas.H" -#include "hConstThermo.H" -#include "eConstThermo.H" -#include "janafThermo.H" -#include "sensibleEnthalpy.H" -#include "sensibleInternalEnergy.H" -#include "thermo.H" - -#include "constTransport.H" -#include "sutherlandTransport.H" - -#include "hPolynomialThermo.H" -#include "polynomialTransport.H" - #include "hePsiThermo.H" #include "pureMixture.H" -#include "thermoPhysicsTypes.H" +#include "forGases.H" +#include "makeThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -/* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */ - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - PengRobinsonGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - polynomialTransport, - sensibleEnthalpy, - hPolynomialThermo, - PengRobinsonGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - polynomialTransport, - sensibleEnthalpy, - janafThermo, - PengRobinsonGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - PengRobinsonGas, - specie -); - - -/* * * * * * * * * * * * * * Internal-energy-based * * * * * * * * * * * * * */ - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - perfectGas, - specie -); - -makeThermos -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - PengRobinsonGas, - specie -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + forGases(makeThermos, psiThermo, hePsiThermo, pureMixture); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C index d1662c5247..fe0f25d4bf 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C @@ -24,479 +24,21 @@ License \*---------------------------------------------------------------------------*/ #include "rhoThermo.H" -#include "makeThermo.H" - -#include "specie.H" -#include "perfectGas.H" -#include "incompressiblePerfectGas.H" -#include "Boussinesq.H" -#include "rhoConst.H" -#include "rPolynomial.H" -#include "PengRobinsonGas.H" -#include "adiabaticPerfectFluid.H" - -#include "hConstThermo.H" -#include "eConstThermo.H" -#include "janafThermo.H" -#include "sensibleEnthalpy.H" -#include "sensibleInternalEnergy.H" -#include "thermo.H" - -#include "constTransport.H" -#include "sutherlandTransport.H" -#include "WLFTransport.H" - -#include "icoPolynomial.H" -#include "hPolynomialThermo.H" -#include "polynomialTransport.H" - #include "heRhoThermo.H" #include "pureMixture.H" +#include "forGases.H" +#include "forLiquids.H" +#include "forPolynomials.H" +#include "makeThermo.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - rhoConst, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - rPolynomial, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - adiabaticPerfectFluid, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - polynomialTransport, - sensibleEnthalpy, - hPolynomialThermo, - icoPolynomial, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - incompressiblePerfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - PengRobinsonGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - polynomialTransport, - sensibleEnthalpy, - hPolynomialThermo, - PengRobinsonGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - polynomialTransport, - sensibleEnthalpy, - janafThermo, - PengRobinsonGas, - specie -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - hConstThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - perfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - rhoConst, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - rhoConst, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - rPolynomial, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - rPolynomial, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - adiabaticPerfectFluid, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - adiabaticPerfectFluid, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - polynomialTransport, - sensibleInternalEnergy, - hPolynomialThermo, - icoPolynomial, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - incompressiblePerfectGas, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - hConstThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - Boussinesq, - specie -); - -makeThermos -( - rhoThermo, - heRhoThermo, - pureMixture, - WLFTransport, - sensibleInternalEnergy, - eConstThermo, - rhoConst, - specie -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + forGases(makeThermos, rhoThermo, heRhoThermo, pureMixture); + forLiquids(makeThermos, rhoThermo, heRhoThermo, pureMixture); + forPolynomials(makeThermos, rhoThermo, heRhoThermo, pureMixture); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index 9538d4f935..0564d71baf 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -1,12 +1,12 @@ chemistryModel/basicChemistryModel/basicChemistryModel.C chemistryModel/BasicChemistryModel/BasicChemistryModels.C -chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C -chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C - -chemistrySolver/chemistrySolver/makeChemistrySolvers.C +chemistrySolver/chemistrySolver/chemistrySolvers.C +chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethods.C +chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethods.C reactions/makeReactions.C + reactions/makeLangmuirHinshelwoodReactions.C reactions/makeMichaelisMentenReactions.C reactions/fluxLimitedLangmuirHinshelwood/makefluxLimitedLangmuirHinshelwoodReactions.C diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C index 3985473544..adc45b5885 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,488 +21,24 @@ License 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 + Creates chemistry model instances \*---------------------------------------------------------------------------*/ -#include "makeChemistryModel.H" +#include "BasicChemistryModel.H" #include "psiReactionThermo.H" #include "rhoReactionThermo.H" -#include "StandardChemistryModel.H" -#include "TDACChemistryModel.H" -#include "thermoPhysicsTypes.H" +#include "makeChemistryModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - // Make base types - makeChemistryModel(psiReactionThermo); - makeChemistryModel(rhoReactionThermo); - - // Chemistry models 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, - psiReactionThermo, - constFluidHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - psiReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - psiReactionThermo, - constHThermoPhysics - ); - - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constGasHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - gasHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constIncompressibleGasHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - incompressibleGasHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - icoPoly8HThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constFluidHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constHThermoPhysics - ); - - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constGasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - gasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constIncompressibleGasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - incompressibleGasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - icoPoly8HThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constFluidHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constHThermoPhysics - ); - - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constGasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - gasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constIncompressibleGasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - incompressibleGasHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - icoPoly8HThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constFluidHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constHThermoPhysics - ); - - - // Chemistry models 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, - psiReactionThermo, - constFluidEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - psiReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - psiReactionThermo, - constEThermoPhysics - ); - - - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constGasEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - gasEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constIncompressibleGasEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - incompressibleGasEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - icoPoly8EThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constFluidEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - - makeChemistryModelType - ( - StandardChemistryModel, - rhoReactionThermo, - constEThermoPhysics - ); - - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constGasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - gasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constIncompressibleGasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - incompressibleGasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - icoPoly8EThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constFluidEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - psiReactionThermo, - constEThermoPhysics - ); - - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constGasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - gasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constIncompressibleGasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - incompressibleGasEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - icoPoly8EThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constFluidEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - - makeChemistryModelType - ( - TDACChemistryModel, - rhoReactionThermo, - constEThermoPhysics - ); + defineChemistryModel(BasicChemistryModel, psiReactionThermo); + defineChemistryModel(BasicChemistryModel, rhoReactionThermo); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.H index 2474bb02bb..259552207f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/DAC/DAC.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,6 +89,8 @@ SourceFiles #ifndef DAC_H #define DAC_H +#include "chemistryReductionMethod.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/EFA/EFA.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/EFA/EFA.H index 0702a11f14..bfebe1293c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/EFA/EFA.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/EFA/EFA.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,8 @@ SourceFiles #ifndef EFA_H #define EFA_H +#include "chemistryReductionMethod.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/PFA/PFA.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/PFA/PFA.H index 1daec070e3..fac0d54553 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/PFA/PFA.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/PFA/PFA.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,8 @@ SourceFiles #ifndef PFA_H #define PFA_H +#include "chemistryReductionMethod.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethods.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethods.C new file mode 100644 index 0000000000..58632ea592 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/chemistryReductionMethod/chemistryReductionMethods.C @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "noChemistryReduction.H" +#include "DAC.H" +#include "DRG.H" +#include "DRGEP.H" +#include "EFA.H" +#include "PFA.H" + +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" + +#include "forCommonGases.H" +#include "forCommonLiquids.H" +#include "makeChemistryReductionMethod.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + forCommonGases(defineChemistryReductionMethod, psiReactionThermo); + forCommonGases(defineChemistryReductionMethod, rhoReactionThermo); + + forCommonGases(makeChemistryReductionMethod, none, psiReactionThermo); + forCommonGases(makeChemistryReductionMethod, none, rhoReactionThermo); + forCommonGases(makeChemistryReductionMethod, DAC, psiReactionThermo); + forCommonGases(makeChemistryReductionMethod, DAC, rhoReactionThermo); + forCommonGases(makeChemistryReductionMethod, DRG, psiReactionThermo); + forCommonGases(makeChemistryReductionMethod, DRG, rhoReactionThermo); + forCommonGases(makeChemistryReductionMethod, DRGEP, psiReactionThermo); + forCommonGases(makeChemistryReductionMethod, DRGEP, rhoReactionThermo); + forCommonGases(makeChemistryReductionMethod, EFA, psiReactionThermo); + forCommonGases(makeChemistryReductionMethod, EFA, rhoReactionThermo); + forCommonGases(makeChemistryReductionMethod, PFA, psiReactionThermo); + forCommonGases(makeChemistryReductionMethod, PFA, rhoReactionThermo); + + forCommonLiquids(defineChemistryReductionMethod, rhoReactionThermo); + + forCommonLiquids(makeChemistryReductionMethod, none, rhoReactionThermo); + forCommonLiquids(makeChemistryReductionMethod, DAC, rhoReactionThermo); + forCommonLiquids(makeChemistryReductionMethod, DRG, rhoReactionThermo); + forCommonLiquids(makeChemistryReductionMethod, DRGEP, rhoReactionThermo); + forCommonLiquids(makeChemistryReductionMethod, EFA, rhoReactionThermo); + forCommonLiquids(makeChemistryReductionMethod, PFA, rhoReactionThermo); +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/combustionModel/makeCombustionTypes.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethod.H similarity index 61% rename from src/combustionModels/combustionModel/makeCombustionTypes.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethod.H index 3e989f2d54..b4defe57c1 100644 --- a/src/combustionModels/combustionModel/makeCombustionTypes.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethod.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,8 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#ifndef makeCombustionTypes_H -#define makeCombustionTypes_H +#ifndef makeChemistryReductionMethod_H +#define makeChemistryReductionMethod_H #include "addToRunTimeSelectionTable.H" @@ -35,66 +35,57 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeCombustion(Comp) \ +#define defineChemistryReductionMethod(ReactionThermo, ThermoPhysics) \ \ - typedef CombustionModel CombustionModel##Comp; \ + typedef chemistryReductionMethod \ + chemistryReductionMethod##ReactionThermo##ThermoPhysics; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - CombustionModel##Comp, \ + chemistryReductionMethod##ReactionThermo##ThermoPhysics, \ ( \ - word(CombustionModel##Comp::typeName_()) + "<" + Comp::typeName \ - + ">" \ + word \ + ( \ + chemistryReductionMethod##ReactionThermo##ThermoPhysics:: \ + typeName_() \ + ) \ + + "<" + word(ReactionThermo::typeName_()) \ + + "," + ThermoPhysics::typeName() + ">" \ ).c_str(), \ 0 \ ); \ \ defineTemplateRunTimeSelectionTable \ ( \ - CombustionModel##Comp, \ + chemistryReductionMethod##ReactionThermo##ThermoPhysics, \ dictionary \ - ); + ); \ - -#define makeCombustionTypesThermo(CombModel, Comp, Thermo) \ +#define makeChemistryReductionMethod(Method, ReactionThermo, ThermoPhysics) \ \ - typedef combustionModels::CombModel \ - CombModel##Comp##Thermo; \ + typedef chemistryReductionMethods::Method \ + chemistryReductionMethod##Method##ReactionThermo##ThermoPhysics; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - CombModel##Comp##Thermo, \ + chemistryReductionMethod##Method##ReactionThermo##ThermoPhysics, \ ( \ - word(CombModel##Comp##Thermo::typeName_()) + "<" + Comp::typeName \ - + "," + Thermo::typeName() + ">" \ + word \ + ( \ + chemistryReductionMethod##Method##ReactionThermo##\ +ThermoPhysics::typeName_() \ + ) \ + + "<" + word(ReactionThermo::typeName_()) \ + + "," + ThermoPhysics::typeName() + ">" \ ).c_str(), \ 0 \ ); \ \ - CombustionModel:: \ - add##dictionary##ConstructorToTable \ - add##CombModel##Comp##Thermo##dictionary##ConstructorTo##\ -CombustionModel##Comp##Table_; - - -#define makeCombustionTypes(CombModel, Comp) \ - \ - typedef combustionModels::CombModel CombModel##Comp; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - CombModel##Comp, \ - ( \ - word(CombModel##Comp::typeName_()) + "<" + Comp::typeName + ">" \ - ).c_str(), \ - 0 \ - ); \ - \ - CombustionModel:: \ - add##dictionary##ConstructorToTable \ - add##CombModel##Comp##dictionary##ConstructorTo##CombustionModel##Comp\ -##Table_; - + chemistryReductionMethod:: \ + adddictionaryConstructorToTable \ + \ + add##chemistryReductionMethod##Method##ReactionThermo##ThermoPhysics##\ +dictionaryConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C deleted file mode 100644 index 252ebc94bc..0000000000 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 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 "makeChemistryReductionMethods.H" - -#include "thermoPhysicsTypes.H" - -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // Chemistry solvers based on sensibleEnthalpy - makeChemistryReductionMethods(psiReactionThermo, constGasHThermoPhysics); - makeChemistryReductionMethods(psiReactionThermo, gasHThermoPhysics); - makeChemistryReductionMethods - ( - psiReactionThermo, - constIncompressibleGasHThermoPhysics - ); - makeChemistryReductionMethods - ( - psiReactionThermo, - incompressibleGasHThermoPhysics - ); - makeChemistryReductionMethods(psiReactionThermo, icoPoly8HThermoPhysics); - makeChemistryReductionMethods(psiReactionThermo, constFluidHThermoPhysics); - makeChemistryReductionMethods - ( - psiReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - makeChemistryReductionMethods(psiReactionThermo, constHThermoPhysics); - - makeChemistryReductionMethods(rhoReactionThermo, constGasHThermoPhysics); - makeChemistryReductionMethods(rhoReactionThermo, gasHThermoPhysics); - makeChemistryReductionMethods - ( - rhoReactionThermo, - constIncompressibleGasHThermoPhysics - ); - makeChemistryReductionMethods - ( - rhoReactionThermo, - incompressibleGasHThermoPhysics - ); - makeChemistryReductionMethods(rhoReactionThermo, icoPoly8HThermoPhysics); - makeChemistryReductionMethods(rhoReactionThermo, constFluidHThermoPhysics); - makeChemistryReductionMethods - ( - rhoReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - makeChemistryReductionMethods(rhoReactionThermo, constHThermoPhysics); - - - // Chemistry solvers based on sensibleInternalEnergy - makeChemistryReductionMethods(psiReactionThermo, constGasEThermoPhysics); - makeChemistryReductionMethods(psiReactionThermo, gasEThermoPhysics); - makeChemistryReductionMethods - ( - psiReactionThermo, - constIncompressibleGasEThermoPhysics - ); - makeChemistryReductionMethods - ( - psiReactionThermo, - incompressibleGasEThermoPhysics - ); - makeChemistryReductionMethods(psiReactionThermo, icoPoly8EThermoPhysics); - makeChemistryReductionMethods(psiReactionThermo, constFluidEThermoPhysics); - makeChemistryReductionMethods - ( - psiReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - makeChemistryReductionMethods(psiReactionThermo, constEThermoPhysics); - - makeChemistryReductionMethods(rhoReactionThermo, constGasEThermoPhysics); - makeChemistryReductionMethods(rhoReactionThermo, gasEThermoPhysics); - makeChemistryReductionMethods - ( - rhoReactionThermo, - constIncompressibleGasEThermoPhysics - ); - makeChemistryReductionMethods - ( - rhoReactionThermo, - incompressibleGasEThermoPhysics - ); - makeChemistryReductionMethods(rhoReactionThermo, icoPoly8EThermoPhysics); - makeChemistryReductionMethods(rhoReactionThermo, constFluidEThermoPhysics); - makeChemistryReductionMethods - ( - rhoReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - makeChemistryReductionMethods(rhoReactionThermo, constEThermoPhysics); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.H deleted file mode 100644 index ed5a94c2cf..0000000000 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/makeChemistryReductionMethods.H +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeChemistryReductionMethods_H -#define makeChemistryReductionMethods_H - -#include "chemistryReductionMethod.H" - -#include "noChemistryReduction.H" -#include "DAC.H" -#include "DRG.H" -#include "DRGEP.H" -#include "EFA.H" -#include "PFA.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeChemistryReductionMethod(SS, Comp, Thermo) \ - \ - typedef chemistryReductionMethods::SS \ - chemistryReductionMethod##SS##Comp##Thermo; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - chemistryReductionMethod##SS##Comp##Thermo, \ - (#SS"<" + word(Comp::typeName_()) \ - + "," + Thermo::typeName() + ">").c_str(), \ - 0 \ - ); \ - \ - chemistryReductionMethod:: \ - adddictionaryConstructorToTable \ - \ - add##chemistryReductionMethods##SS##Comp##Thermo##ConstructorToTable_; - - -#define makeChemistryReductionMethods(CompChemModel, Thermo) \ - \ - typedef chemistryReductionMethod \ - chemistryReductionMethod##CompChemModel##Thermo; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - chemistryReductionMethod##CompChemModel##Thermo, \ - (word(chemistryReductionMethod##CompChemModel##Thermo::typeName_()) + \ - '<' + word(CompChemModel::typeName_()) + "," + Thermo::typeName() + '>'\ - ).c_str(), \ - 0 \ - ); \ - \ - defineTemplateRunTimeSelectionTable \ - ( \ - chemistryReductionMethod##CompChemModel##Thermo, \ - dictionary \ - ); \ - \ - makeChemistryReductionMethod \ - ( \ - none, \ - CompChemModel, \ - Thermo \ - ); \ - \ - makeChemistryReductionMethod \ - ( \ - DAC, \ - CompChemModel, \ - Thermo \ - ); \ - \ - makeChemistryReductionMethod \ - ( \ - DRG, \ - CompChemModel, \ - Thermo \ - ); \ - \ - makeChemistryReductionMethod \ - ( \ - DRGEP, \ - CompChemModel, \ - Thermo \ - ); \ - \ - makeChemistryReductionMethod \ - ( \ - EFA, \ - CompChemModel, \ - Thermo \ - ); \ - \ - makeChemistryReductionMethod \ - ( \ - PFA, \ - CompChemModel, \ - Thermo \ - ); \ - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/noChemistryReduction/noChemistryReduction.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/noChemistryReduction/noChemistryReduction.H index dc7a372462..f1358872c0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/noChemistryReduction/noChemistryReduction.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/reduction/noChemistryReduction/noChemistryReduction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,8 @@ SourceFiles #ifndef noChemistryReduction_H #define noChemistryReduction_H +#include "chemistryReductionMethod.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethods.C similarity index 57% rename from src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethods.C index 18bf857955..47f682784e 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/chemistryTabulationMethod/chemistryTabulationMethods.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,39 +23,32 @@ License \*---------------------------------------------------------------------------*/ -#ifndef thermalBaffle1DFvPatchScalarFields_H -#define thermalBaffle1DFvPatchScalarFields_H +#include "noChemistryTabulation.H" +#include "ISAT.H" -#include "thermalBaffle1DFvPatchScalarField.H" -#include "solidThermoPhysicsTypes.H" +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" + +#include "forCommonGases.H" +#include "forCommonLiquids.H" +#include "makeChemistryTabulationMethod.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -namespace compressible -{ + forCommonGases(defineChemistryTabulationMethod, psiReactionThermo); + forCommonGases(defineChemistryTabulationMethod, rhoReactionThermo); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + forCommonGases(makeChemistryTabulationMethod, none, psiReactionThermo); + forCommonGases(makeChemistryTabulationMethod, none, rhoReactionThermo); + forCommonGases(makeChemistryTabulationMethod, ISAT, psiReactionThermo); + forCommonGases(makeChemistryTabulationMethod, ISAT, rhoReactionThermo); - typedef thermalBaffle1DFvPatchScalarField - < - hConstSolidThermoPhysics - >constSolid_thermalBaffle1DFvPatchScalarField; - - typedef thermalBaffle1DFvPatchScalarField - < - hPowerSolidThermoPhysics - >expoSolid_thermalBaffle1DFvPatchScalarField; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + forCommonLiquids(defineChemistryTabulationMethod, rhoReactionThermo); + forCommonLiquids(makeChemistryTabulationMethod, none, rhoReactionThermo); + forCommonLiquids(makeChemistryTabulationMethod, ISAT, rhoReactionThermo); } -} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethod.H similarity index 51% rename from src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethod.H index ab9b468403..2f910f32d6 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolverTypes.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethod.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,76 +23,73 @@ License \*---------------------------------------------------------------------------*/ -#ifndef makeChemistrySolverTypes_H -#define makeChemistrySolverTypes_H +#ifndef makeChemistryTabulationMethod_H +#define makeChemistryTabulationMethod_H -#include "chemistrySolver.H" - -#include "StandardChemistryModel.H" -#include "TDACChemistryModel.H" - -#include "noChemistrySolver.H" -#include "EulerImplicit.H" -#include "ode.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeChemistrySolverType(SS, Comp, Thermo) \ +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define defineChemistryTabulationMethod(ReactionThermo, ThermoPhysics) \ \ - typedef SS> SS##Comp##Thermo; \ + typedef chemistryTabulationMethod \ + chemistryTabulationMethod##ReactionThermo##ThermoPhysics; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - SS##Comp##Thermo, \ - (#SS"<" + word(StandardChemistryModel::typeName_()) + "<"\ - + word(Comp::typeName_()) + "," + Thermo::typeName() + ">>").c_str(), \ + chemistryTabulationMethod##ReactionThermo##ThermoPhysics, \ + ( \ + word \ + ( \ + chemistryTabulationMethod##ReactionThermo##ThermoPhysics:: \ + typeName_() \ + ) \ + + "<" + word(ReactionThermo::typeName_()) \ + + "," + ThermoPhysics::typeName() + ">" \ + ).c_str(), \ 0 \ ); \ \ - BasicChemistryModel:: \ - add##thermo##ConstructorToTable \ - add##SS##Comp##Thermo##thermo##ConstructorTo##BasicChemistryModel##Comp\ -##Table_; \ + defineTemplateRunTimeSelectionTable \ + ( \ + chemistryTabulationMethod##ReactionThermo##ThermoPhysics, \ + dictionary \ + ); \ + +#define makeChemistryTabulationMethod(Method, ReactionThermo, ThermoPhysics) \ \ - typedef SS> TDAC##SS##Comp##Thermo; \ + typedef chemistryTabulationMethods::Method \ + chemistryTabulationMethod##Method##ReactionThermo##ThermoPhysics; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - TDAC##SS##Comp##Thermo, \ - (#SS"<" + word(TDACChemistryModel::typeName_()) + "<" \ - + word(Comp::typeName_()) + "," + Thermo::typeName() + ">>").c_str(), \ + chemistryTabulationMethod##Method##ReactionThermo##ThermoPhysics, \ + ( \ + word \ + ( \ + chemistryTabulationMethod##Method##ReactionThermo##\ +ThermoPhysics::typeName_() \ + ) \ + + "<" + word(ReactionThermo::typeName_()) \ + + "," + ThermoPhysics::typeName() + ">" \ + ).c_str(), \ 0 \ ); \ \ - BasicChemistryModel:: \ - add##thermo##ConstructorToTable \ - add##TDAC##SS##Comp##Thermo##thermo##ConstructorTo##BasicChemistryModel\ -##Comp##Table_; + chemistryTabulationMethod:: \ + adddictionaryConstructorToTable \ + \ + add##chemistryTabulationMethod##Method##ReactionThermo##ThermoPhysics##\ +dictionaryConstructorToTable_; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeChemistrySolverTypes(Comp, Thermo) \ - \ - makeChemistrySolverType \ - ( \ - noChemistrySolver, \ - Comp, \ - Thermo \ - ); \ - \ - makeChemistrySolverType \ - ( \ - EulerImplicit, \ - Comp, \ - Thermo \ - ); \ - \ - makeChemistrySolverType \ - ( \ - ode, \ - Comp, \ - Thermo \ - ); \ - +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C b/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C deleted file mode 100644 index 6c4e2e541b..0000000000 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/TDACChemistryModel/tabulation/makeChemistryTabulationMethods.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 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 "makeChemistryTabulationMethods.H" - -#include "thermoPhysicsTypes.H" - -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // Chemistry solvers based on sensibleEnthalpy - makeChemistryTabulationMethods(psiReactionThermo, constGasHThermoPhysics); - makeChemistryTabulationMethods(psiReactionThermo, gasHThermoPhysics); - makeChemistryTabulationMethods - ( - psiReactionThermo, - constIncompressibleGasHThermoPhysics - ); - makeChemistryTabulationMethods - ( - psiReactionThermo, - incompressibleGasHThermoPhysics - ); - makeChemistryTabulationMethods(psiReactionThermo, icoPoly8HThermoPhysics); - makeChemistryTabulationMethods(psiReactionThermo, constFluidHThermoPhysics); - makeChemistryTabulationMethods - ( - psiReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - makeChemistryTabulationMethods(psiReactionThermo, constHThermoPhysics); - - makeChemistryTabulationMethods(rhoReactionThermo, constGasHThermoPhysics); - makeChemistryTabulationMethods(rhoReactionThermo, gasHThermoPhysics); - makeChemistryTabulationMethods - ( - rhoReactionThermo, - constIncompressibleGasHThermoPhysics - ); - makeChemistryTabulationMethods - ( - rhoReactionThermo, - incompressibleGasHThermoPhysics - ); - makeChemistryTabulationMethods(rhoReactionThermo, icoPoly8HThermoPhysics); - makeChemistryTabulationMethods(rhoReactionThermo, constFluidHThermoPhysics); - makeChemistryTabulationMethods - ( - rhoReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - makeChemistryTabulationMethods(rhoReactionThermo, constHThermoPhysics); - - // Chemistry solvers based on sensibleInternalEnergy - - makeChemistryTabulationMethods(psiReactionThermo, constGasEThermoPhysics); - makeChemistryTabulationMethods(psiReactionThermo, gasEThermoPhysics); - makeChemistryTabulationMethods - ( - psiReactionThermo, - constIncompressibleGasEThermoPhysics - ); - makeChemistryTabulationMethods - ( - psiReactionThermo, - incompressibleGasEThermoPhysics - ); - makeChemistryTabulationMethods(psiReactionThermo, icoPoly8EThermoPhysics); - makeChemistryTabulationMethods(psiReactionThermo, constFluidEThermoPhysics); - makeChemistryTabulationMethods - ( - psiReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - makeChemistryTabulationMethods(psiReactionThermo, constEThermoPhysics); - - makeChemistryTabulationMethods(rhoReactionThermo, constGasEThermoPhysics); - makeChemistryTabulationMethods(rhoReactionThermo, gasEThermoPhysics); - makeChemistryTabulationMethods - ( - rhoReactionThermo, - constIncompressibleGasEThermoPhysics - ); - makeChemistryTabulationMethods - ( - rhoReactionThermo, - incompressibleGasEThermoPhysics - ); - makeChemistryTabulationMethods(rhoReactionThermo, icoPoly8EThermoPhysics); - makeChemistryTabulationMethods(rhoReactionThermo, constFluidEThermoPhysics); - makeChemistryTabulationMethods - ( - rhoReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - makeChemistryTabulationMethods(rhoReactionThermo, constEThermoPhysics); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C index 48b5767d79..5d1da588ef 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,9 +54,9 @@ Foam::autoPtr Foam::basicChemistryModel::New << "longer supported. Please create a chemistryType dictionary" << "instead." << endl << endl << "For example, the entry:" << endl << " chemistrySolver ode," - << "sensibleInternalEnergy>>" << endl << endl << "becomes:" << endl - << " chemistryType" << endl << " {" << endl + << "rhoChemistryModel,sutherland," + << "sensibleInternalEnergy>>>>" << endl << endl << "becomes:" + << endl << " chemistryType" << endl << " {" << endl << " solver ode;" << endl << " method standard;" << endl << " }" << exit(FatalError); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/makeChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/makeChemistryModel.H index 595033fcc7..246530d529 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/makeChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/makeChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,10 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Macros for instantiating chemistry models based on compressibility and - transport types - \*---------------------------------------------------------------------------*/ #ifndef makeChemistryModel_H @@ -39,36 +35,26 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeChemistryModel(Comp) \ +#define defineChemistryModel(Model, ReactionThermo) \ \ - typedef BasicChemistryModel BasicChemistryModel##Comp; \ + typedef Model Model##ReactionThermo; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - BasicChemistryModel##Comp, \ - "BasicChemistryModel<"#Comp">", \ + Model##ReactionThermo, \ + ( \ + word(Model##ReactionThermo::typeName_()) + "<" \ + + ReactionThermo::typeName + ">" \ + ).c_str(), \ 0 \ ); \ \ defineTemplateRunTimeSelectionTable \ ( \ - BasicChemistryModel##Comp, \ + Model##ReactionThermo, \ thermo \ ); - -#define makeChemistryModelType(SS, Comp, Thermo) \ - \ - typedef SS SS##Comp##Thermo; \ - \ - defineTemplateTypeNameAndDebugWithName \ - ( \ - SS##Comp##Thermo, \ - (#SS"<"#Comp"," + Thermo::typeName() + ">").c_str(), \ - 0 \ - ); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolvers.C new file mode 100644 index 0000000000..6b7698278b --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolvers.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 "noChemistrySolver.H" +#include "EulerImplicit.H" +#include "ode.H" + +#include "StandardChemistryModel.H" +#include "TDACChemistryModel.H" + +#include "psiReactionThermo.H" +#include "rhoReactionThermo.H" + +#include "forCommonGases.H" +#include "forCommonLiquids.H" +#include "makeChemistrySolver.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define defineChemistrySolvers(ReactionThermo, ThermoPhysics) \ + defineChemistrySolver \ + ( \ + StandardChemistryModel, \ + ReactionThermo, \ + ThermoPhysics \ + ); \ + defineChemistrySolver \ + ( \ + TDACChemistryModel, \ + ReactionThermo, \ + ThermoPhysics \ + ) + +#define makeChemistrySolvers(Solver, ReactionThermo, ThermoPhysics) \ + makeChemistrySolver \ + ( \ + Solver, \ + StandardChemistryModel, \ + ReactionThermo, \ + ThermoPhysics \ + ); \ + makeChemistrySolver \ + ( \ + Solver, \ + TDACChemistryModel, \ + ReactionThermo, \ + ThermoPhysics \ + ) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + forCommonGases(defineChemistrySolvers, psiReactionThermo); + forCommonGases(defineChemistrySolvers, rhoReactionThermo); + + forCommonGases(makeChemistrySolvers, noChemistrySolver, psiReactionThermo); + forCommonGases(makeChemistrySolvers, noChemistrySolver, rhoReactionThermo); + forCommonGases(makeChemistrySolvers, EulerImplicit, psiReactionThermo); + forCommonGases(makeChemistrySolvers, EulerImplicit, rhoReactionThermo); + forCommonGases(makeChemistrySolvers, ode, psiReactionThermo); + forCommonGases(makeChemistrySolvers, ode, rhoReactionThermo); + + forCommonLiquids(defineChemistrySolvers, rhoReactionThermo); + + forCommonLiquids + ( + makeChemistrySolvers, + noChemistrySolver, + rhoReactionThermo + ); + forCommonLiquids(makeChemistrySolvers, EulerImplicit, rhoReactionThermo); + forCommonLiquids(makeChemistrySolvers, ode, rhoReactionThermo); +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C deleted file mode 100644 index c999b0945e..0000000000 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 "makeChemistrySolverTypes.H" - -#include "thermoPhysicsTypes.H" -#include "psiReactionThermo.H" -#include "rhoReactionThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // Chemistry solvers based on sensibleEnthalpy - makeChemistrySolverTypes(psiReactionThermo, constGasHThermoPhysics); - makeChemistrySolverTypes(psiReactionThermo, gasHThermoPhysics); - makeChemistrySolverTypes - ( - psiReactionThermo, - constIncompressibleGasHThermoPhysics - ); - makeChemistrySolverTypes - ( - psiReactionThermo, - incompressibleGasHThermoPhysics - ); - makeChemistrySolverTypes(psiReactionThermo, icoPoly8HThermoPhysics); - makeChemistrySolverTypes(psiReactionThermo, constFluidHThermoPhysics); - makeChemistrySolverTypes - ( - psiReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - makeChemistrySolverTypes(psiReactionThermo, constHThermoPhysics); - - makeChemistrySolverTypes(rhoReactionThermo, constGasHThermoPhysics); - makeChemistrySolverTypes(rhoReactionThermo, gasHThermoPhysics); - makeChemistrySolverTypes - ( - rhoReactionThermo, - constIncompressibleGasHThermoPhysics - ); - makeChemistrySolverTypes - ( - rhoReactionThermo, - incompressibleGasHThermoPhysics - ); - makeChemistrySolverTypes(rhoReactionThermo, icoPoly8HThermoPhysics); - makeChemistrySolverTypes(rhoReactionThermo, constFluidHThermoPhysics); - makeChemistrySolverTypes - ( - rhoReactionThermo, - constAdiabaticFluidHThermoPhysics - ); - makeChemistrySolverTypes(rhoReactionThermo, constHThermoPhysics); - - // Chemistry solvers based on sensibleInternalEnergy - makeChemistrySolverTypes(psiReactionThermo, constGasEThermoPhysics); - makeChemistrySolverTypes(psiReactionThermo, gasEThermoPhysics); - makeChemistrySolverTypes - ( - psiReactionThermo, - constIncompressibleGasEThermoPhysics - ); - makeChemistrySolverTypes - ( - psiReactionThermo, - incompressibleGasEThermoPhysics - ); - makeChemistrySolverTypes(psiReactionThermo, icoPoly8EThermoPhysics); - makeChemistrySolverTypes(psiReactionThermo, constFluidEThermoPhysics); - makeChemistrySolverTypes - ( - psiReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - makeChemistrySolverTypes(psiReactionThermo, constEThermoPhysics); - - makeChemistrySolverTypes(rhoReactionThermo, constGasEThermoPhysics); - makeChemistrySolverTypes(rhoReactionThermo, gasEThermoPhysics); - makeChemistrySolverTypes - ( - rhoReactionThermo, - constIncompressibleGasEThermoPhysics - ); - makeChemistrySolverTypes - ( - rhoReactionThermo, - incompressibleGasEThermoPhysics - ); - makeChemistrySolverTypes(rhoReactionThermo, icoPoly8EThermoPhysics); - makeChemistrySolverTypes(rhoReactionThermo, constFluidEThermoPhysics); - makeChemistrySolverTypes - ( - rhoReactionThermo, - constAdiabaticFluidEThermoPhysics - ); - makeChemistrySolverTypes(rhoReactionThermo, constEThermoPhysics); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/makeChemistrySolver.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/makeChemistrySolver.H new file mode 100644 index 0000000000..22e88406dc --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/makeChemistrySolver.H @@ -0,0 +1,85 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeChemistrySolver_H +#define makeChemistrySolver_H + +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define defineChemistrySolver(Model, ReactionThermo, ThermoPhysics) \ + \ + typedef Model \ + Model##ReactionThermo##ThermoPhysics; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + Model##ReactionThermo##ThermoPhysics, \ + ( \ + word(Model##ReactionThermo##ThermoPhysics::typeName_()) + "<" \ + + ReactionThermo::typeName + "," + ThermoPhysics::typeName() + ">" \ + ).c_str(), \ + 0 \ + ); + + +#define makeChemistrySolver(Solver, Model, ReactionThermo, ThermoPhysics) \ + \ + typedef Solver> \ + Solver##Model##ReactionThermo##ThermoPhysics; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + Solver##Model##ReactionThermo##ThermoPhysics, \ + ( \ + word(Solver##Model##ReactionThermo##ThermoPhysics::typeName_()) \ + + "<" + word(Model::typeName_()) \ + + "<" + word(ReactionThermo::typeName_()) + "," \ + + ThermoPhysics::typeName() + ">>" \ + ).c_str(), \ + 0 \ + ); \ + \ + BasicChemistryModel:: \ + addthermoConstructorToTable \ + \ + add##Solver##Model##ReactionThermo##ThermoPhysics##\ +thermoConstructorToTable_; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/fluxLimitedLangmuirHinshelwoodReactionRateI.H b/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/fluxLimitedLangmuirHinshelwoodReactionRateI.H index a229628b75..9ffe7c2add 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/fluxLimitedLangmuirHinshelwoodReactionRateI.H +++ b/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/fluxLimitedLangmuirHinshelwoodReactionRateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,8 +25,10 @@ License #include "volFields.H" #include "mathematicalConstants.H" +#include "thermodynamicConstants.H" using namespace Foam::constant::mathematical; +using namespace Foam::constant::thermodynamic; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/makefluxLimitedLangmuirHinshelwoodReactions.C b/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/makefluxLimitedLangmuirHinshelwoodReactions.C index db82c5795b..084808998b 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/makefluxLimitedLangmuirHinshelwoodReactions.C +++ b/src/thermophysicalModels/chemistryModel/reactions/fluxLimitedLangmuirHinshelwood/makefluxLimitedLangmuirHinshelwoodReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,23 +24,18 @@ License \*---------------------------------------------------------------------------*/ #include "makeReaction.H" -#include "reactionTypes.H" + #include "fluxLimitedLangmuirHinshelwoodReactionRate.H" +#include "forCommonGases.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeGeneralReaction + forCommonGases ( - gasHThermoPhysics, - IrreversibleReaction, - fluxLimitedLangmuirHinshelwoodReactionRate - ) - - makeGeneralReaction - ( - gasEThermoPhysics, + makeGeneralReaction, IrreversibleReaction, fluxLimitedLangmuirHinshelwoodReactionRate ) diff --git a/src/thermophysicalModels/chemistryModel/reactions/makeLangmuirHinshelwoodReactions.C b/src/thermophysicalModels/chemistryModel/reactions/makeLangmuirHinshelwoodReactions.C index 701727581f..f2f3d18c70 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/makeLangmuirHinshelwoodReactions.C +++ b/src/thermophysicalModels/chemistryModel/reactions/makeLangmuirHinshelwoodReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,24 +24,18 @@ License \*---------------------------------------------------------------------------*/ #include "makeReaction.H" -#include "reactionTypes.H" + #include "LangmuirHinshelwoodReactionRate.H" +#include "forCommonGases.H" +#include "forPolynomials.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -template<> -const char* const Foam::Tuple2::typeName -( - "Tuple2" -); - namespace Foam { - makeIRReactions(gasHThermoPhysics, LangmuirHinshelwoodReactionRate) - makeIRReactions(icoPoly8HThermoPhysics, LangmuirHinshelwoodReactionRate) - - makeIRReactions(gasEThermoPhysics, LangmuirHinshelwoodReactionRate) - makeIRReactions(icoPoly8EThermoPhysics, LangmuirHinshelwoodReactionRate) + forCommonGases(makeIRReactions, LangmuirHinshelwoodReactionRate); + forPolynomials(makeIRReactions, LangmuirHinshelwoodReactionRate); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/reactions/makeMichaelisMentenReactions.C b/src/thermophysicalModels/chemistryModel/reactions/makeMichaelisMentenReactions.C index c023bd7195..e081485b96 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/makeMichaelisMentenReactions.C +++ b/src/thermophysicalModels/chemistryModel/reactions/makeMichaelisMentenReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,26 +24,16 @@ License \*---------------------------------------------------------------------------*/ #include "makeReaction.H" -#include "reactionTypes.H" + #include "MichaelisMentenReactionRate.H" +#include "forCommonLiquids.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeReaction - ( - constFluidHThermoPhysics, - IrreversibleReaction, - MichaelisMentenReactionRate - ) - - makeReaction - ( - constFluidEThermoPhysics, - IrreversibleReaction, - MichaelisMentenReactionRate - ) + forCommonLiquids(makeIReactions, MichaelisMentenReactionRate); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/reactions/makeReaction.H b/src/thermophysicalModels/chemistryModel/reactions/makeReaction.H index ba522e1fab..7de8b48274 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/makeReaction.H +++ b/src/thermophysicalModels/chemistryModel/reactions/makeReaction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,16 +38,6 @@ Description #include "ReversibleReaction.H" #include "NonEquilibriumReversibleReaction.H" -#include "thermo.H" - -#include "sutherlandTransport.H" -#include "janafThermo.H" -#include "perfectGas.H" - -#include "polynomialTransport.H" -#include "hPolynomialThermo.H" -#include "icoPolynomial.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,109 +47,126 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactionName(Thermo, ReactionType, ReactionRate) \ - typedef Reaction Reaction##Thermo; \ +#define defineReaction(nullArg, ThermoPhysics) \ \ - typedef ReactionType \ - ReactionType##Thermo##ReactionRate; \ + typedef Reaction Reaction##ThermoPhysics; \ + \ + defineTemplateTypeNameAndDebug(Reaction##ThermoPhysics, 0); \ + \ + defineTemplateRunTimeSelectionTable(Reaction##ThermoPhysics, dictionary) \ + defineTemplateRunTimeSelectionTable \ + ( \ + Reaction##ThermoPhysics, \ + objectRegistry \ + ) + + +#define makeReaction(ReactionType, ReactionRate, ThermoPhysics) \ + \ + typedef ReactionType \ + ReactionType##ThermoPhysics##ReactionRate; \ + typedef Reaction \ + ReactionType##ThermoPhysics##ReactionRate##Base; \ \ template<> \ - const word ReactionType##Thermo##ReactionRate::typeName \ + const word ReactionType##ThermoPhysics##ReactionRate::typeName \ ( \ ReactionType::typeName_() \ + ReactionRate::type().capitalise() \ - ); - - -#define makeReaction(Thermo, ReactionType, ReactionRate) \ - makeReactionName(Thermo, ReactionType, ReactionRate) \ + ); \ \ addToRunTimeSelectionTable \ ( \ - Reaction##Thermo, \ - ReactionType##Thermo##ReactionRate, \ + ReactionType##ThermoPhysics##ReactionRate##Base, \ + ReactionType##ThermoPhysics##ReactionRate, \ dictionary \ - ); + ) -#define makeGeneralReaction(Thermo, ReactionType, ReactionRate) \ - makeReactionName(Thermo, ReactionType, ReactionRate) \ +#define makeGeneralReaction(ReactionType, ReactionRate, ThermoPhysics) \ + \ + typedef ReactionType \ + ReactionType##ThermoPhysics##ReactionRate; \ + typedef Reaction \ + ReactionType##ThermoPhysics##ReactionRate##Base; \ + \ + template<> \ + const word ReactionType##ThermoPhysics##ReactionRate::typeName \ + ( \ + ReactionType::typeName_() \ + + ReactionRate::type().capitalise() \ + ); \ \ addToRunTimeSelectionTable \ ( \ - Reaction##Thermo, \ - ReactionType##Thermo##ReactionRate, \ + ReactionType##ThermoPhysics##ReactionRate##Base, \ + ReactionType##ThermoPhysics##ReactionRate, \ objectRegistry \ ); #define makePressureDependentReaction\ ( \ - Thermo, \ - Reaction, \ + ReactionType, \ PressureDependentReactionRate, \ ReactionRate, \ - FallOffFunction \ + FallOffFunction, \ + ThermoPhysics \ ) \ + \ typedef PressureDependentReactionRate \ PressureDependentReactionRate##ReactionRate##FallOffFunction; \ \ makeReaction \ ( \ - Thermo, \ - Reaction, \ - PressureDependentReactionRate##ReactionRate##FallOffFunction \ + ReactionType, \ + PressureDependentReactionRate##ReactionRate##FallOffFunction, \ + ThermoPhysics \ ) -#define makeIRReactions(Thermo, ReactionRate) \ - makeReaction(Thermo, IrreversibleReaction, ReactionRate) \ - makeReaction(Thermo, ReversibleReaction, ReactionRate) +#define makeIReactions(ReactionRate, ThermoPhysics) \ + \ + makeReaction(IrreversibleReaction, ReactionRate, ThermoPhysics) -#define makeIRNReactions(Thermo, ReactionRate) \ - makeIRReactions(Thermo, ReactionRate) \ - makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate) +#define makeIRReactions(ReactionRate, ThermoPhysics) \ + \ + makeIReactions(ReactionRate, ThermoPhysics); \ + makeReaction(ReversibleReaction, ReactionRate, ThermoPhysics) -#define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \ +#define makeIRNReactions(ReactionRate, ThermoPhysics) \ + \ + makeIRReactions(ReactionRate, ThermoPhysics); \ + makeReaction(NonEquilibriumReversibleReaction, ReactionRate, ThermoPhysics) + + +#define makeIRRPressureDependentReactions\ +( \ + PressureDependentReactionRate, \ + ReactionRate, \ + FallOffFunction, \ + ThermoPhysics \ +) \ + \ makePressureDependentReaction \ ( \ - Thermo, \ IrreversibleReaction, \ - FallOffReactionRate, \ + PressureDependentReactionRate, \ ReactionRate, \ - FallOffFunction \ - ) \ - \ + FallOffFunction, \ + ThermoPhysics \ + ); \ makePressureDependentReaction \ ( \ - Thermo, \ ReversibleReaction, \ - FallOffReactionRate, \ + PressureDependentReactionRate, \ ReactionRate, \ - FallOffFunction \ - ) \ - \ - makePressureDependentReaction \ - ( \ - Thermo, \ - IrreversibleReaction, \ - ChemicallyActivatedReactionRate, \ - ReactionRate, \ - FallOffFunction \ - ) \ - \ - makePressureDependentReaction \ - ( \ - Thermo, \ - ReversibleReaction, \ - ChemicallyActivatedReactionRate, \ - ReactionRate, \ - FallOffFunction \ + FallOffFunction, \ + ThermoPhysics \ ) - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/reactions/makeReactions.C b/src/thermophysicalModels/chemistryModel/reactions/makeReactions.C index 25d8b34a5b..3cc2dc25b3 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/makeReactions.C +++ b/src/thermophysicalModels/chemistryModel/reactions/makeReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,7 +23,6 @@ License \*---------------------------------------------------------------------------*/ -#include "reactionTypes.H" #include "makeReaction.H" #include "ArrheniusReactionRate.H" @@ -31,92 +30,204 @@ License #include "LandauTellerReactionRate.H" #include "thirdBodyArrheniusReactionRate.H" -#include "ChemicallyActivatedReactionRate.H" #include "JanevReactionRate.H" #include "powerSeriesReactionRate.H" +#include "ChemicallyActivatedReactionRate.H" #include "FallOffReactionRate.H" + #include "LindemannFallOffFunction.H" #include "SRIFallOffFunction.H" #include "TroeFallOffFunction.H" +#include "LangmuirHinshelwoodReactionRate.H" + +#include "MichaelisMentenReactionRate.H" + +#include "forCommonGases.H" +#include "forCommonLiquids.H" +#include "forPolynomials.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactions(Thermo, Reaction) \ - \ - defineTemplateTypeNameAndDebug(Reaction, 0); \ - defineTemplateRunTimeSelectionTable(Reaction, dictionary); \ - defineTemplateRunTimeSelectionTable(Reaction, objectRegistry); \ - \ - makeIRNReactions(Thermo, ArrheniusReactionRate) \ - makeIRNReactions(Thermo, infiniteReactionRate) \ - makeIRNReactions(Thermo, LandauTellerReactionRate) \ - makeIRNReactions(Thermo, thirdBodyArrheniusReactionRate) \ - \ - makeIRReactions(Thermo, JanevReactionRate) \ - makeIRReactions(Thermo, powerSeriesReactionRate) \ - \ - makePressureDependentReactions \ - ( \ - Thermo, \ - ArrheniusReactionRate, \ - LindemannFallOffFunction \ - ) \ - \ - makePressureDependentReactions \ - ( \ - Thermo, \ - ArrheniusReactionRate, \ - TroeFallOffFunction \ - ) \ - \ - makePressureDependentReactions \ - ( \ - Thermo, \ - ArrheniusReactionRate, \ - SRIFallOffFunction \ - ) - +template<> +const char* const Foam::Tuple2::typeName +( + "Tuple2" +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - // sensible enthalpy based reactions - makeReactions(constGasHThermoPhysics, constGasHReaction) - makeReactions(gasHThermoPhysics, gasHReaction) - makeReactions - ( - constIncompressibleGasHThermoPhysics, - constIncompressibleGasHReaction - ) - makeReactions(incompressibleGasHThermoPhysics, incompressibleGasHReaction) - makeReactions(icoPoly8HThermoPhysics, icoPoly8HReaction) - makeReactions(constFluidHThermoPhysics, constFluidHReaction) - makeReactions - ( - constAdiabaticFluidHThermoPhysics, - constAdiabaticFluidHReaction - ) - makeReactions(constHThermoPhysics, constHReaction) + forCommonGases(defineReaction, nullArg); + forCommonLiquids(defineReaction, nullArg); + forPolynomials(defineReaction, nullArg); - makeReactions(constGasEThermoPhysics, constGasEReaction) - makeReactions(gasEThermoPhysics, gasEReaction) - makeReactions + + // Irreversible/reversible/non-equilibrium-reversible reactions + + forCommonGases(makeIRNReactions, ArrheniusReactionRate); + forCommonLiquids(makeIRNReactions, ArrheniusReactionRate); + forPolynomials(makeIRNReactions, ArrheniusReactionRate); + + forCommonGases(makeIRNReactions, infiniteReactionRate); + forCommonLiquids(makeIRNReactions, infiniteReactionRate); + forPolynomials(makeIRNReactions, infiniteReactionRate); + + forCommonGases(makeIRNReactions, LandauTellerReactionRate); + forCommonLiquids(makeIRNReactions, LandauTellerReactionRate); + forPolynomials(makeIRNReactions, LandauTellerReactionRate); + + forCommonGases(makeIRNReactions, thirdBodyArrheniusReactionRate); + forCommonLiquids(makeIRNReactions, thirdBodyArrheniusReactionRate); + forPolynomials(makeIRNReactions, thirdBodyArrheniusReactionRate); + + + // Irreversible/reversible reactions + + forCommonGases(makeIRReactions, JanevReactionRate); + forCommonLiquids(makeIRReactions, JanevReactionRate); + forPolynomials(makeIRReactions, JanevReactionRate); + + forCommonGases(makeIRReactions, powerSeriesReactionRate); + forCommonLiquids(makeIRReactions, powerSeriesReactionRate); + forPolynomials(makeIRReactions, powerSeriesReactionRate); + + + // Pressure dependent reactions + + forCommonGases ( - constIncompressibleGasEThermoPhysics, - constIncompressibleGasEReaction - ) - makeReactions(incompressibleGasEThermoPhysics, incompressibleGasEReaction) - makeReactions(icoPoly8EThermoPhysics, icoPoly8EReaction) - makeReactions(constFluidEThermoPhysics, constFluidEReaction) - makeReactions + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + LindemannFallOffFunction + ); + forCommonLiquids ( - constAdiabaticFluidEThermoPhysics, - constAdiabaticFluidEReaction - ) - makeReactions(constEThermoPhysics, constEReaction) + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + LindemannFallOffFunction + ); + forPolynomials + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + LindemannFallOffFunction + ); + + forCommonGases + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + TroeFallOffFunction + ); + forCommonLiquids + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + TroeFallOffFunction + ); + forPolynomials + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + TroeFallOffFunction + ); + + forCommonGases + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + SRIFallOffFunction + ); + forCommonLiquids + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + SRIFallOffFunction + ); + forPolynomials + ( + makeIRRPressureDependentReactions, + FallOffReactionRate, + ArrheniusReactionRate, + SRIFallOffFunction + ); + + forCommonGases + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + LindemannFallOffFunction + ); + forCommonLiquids + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + LindemannFallOffFunction + ); + forPolynomials + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + LindemannFallOffFunction + ); + + forCommonGases + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + TroeFallOffFunction + ); + forCommonLiquids + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + TroeFallOffFunction + ); + forPolynomials + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + TroeFallOffFunction + ); + + forCommonGases + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + SRIFallOffFunction + ); + forCommonLiquids + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + SRIFallOffFunction + ); + forPolynomials + ( + makeIRRPressureDependentReactions, + ChemicallyActivatedReactionRate, + ArrheniusReactionRate, + SRIFallOffFunction + ); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C index dd153179b1..a52ff7c684 100644 --- a/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C +++ b/src/thermophysicalModels/chemistryModel/reactions/surfaceArrheniusReactionRate/makesurfaceArrheniusReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,40 +24,21 @@ License \*---------------------------------------------------------------------------*/ #include "makeReaction.H" -#include "reactionTypes.H" + #include "surfaceArrheniusReactionRate.H" +#include "forCommonGases.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeGeneralReaction + forCommonGases ( - gasHThermoPhysics, + makeGeneralReaction, IrreversibleReaction, surfaceArrheniusReactionRate ) - - makeGeneralReaction - ( - gasHThermoPhysics, - ReversibleReaction, - surfaceArrheniusReactionRate - ) - - makeGeneralReaction - ( - gasEThermoPhysics, - IrreversibleReaction, - surfaceArrheniusReactionRate - ) - - makeGeneralReaction - ( - gasEThermoPhysics, - ReversibleReaction, - surfaceArrheniusReactionRate - ) } // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/makeReactionThermo.H index 078f742716..ff9ac6050f 100644 --- a/src/thermophysicalModels/reactionThermo/makeReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/makeReactionThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,13 +26,13 @@ License #ifndef makeReactionThermo_H #define makeReactionThermo_H -#include "addToRunTimeSelectionTable.H" #include "makeThermo.H" #include "SpecieMixture.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define defineThermoPhysicsReactionThermo(BaseReactionThermo,CThermo,Mixture,ThermoPhys) \ +#define defineReactionThermo(BaseReactionThermo, CThermo, Mixture, ThermoPhys) \ \ typedef CThermo \ < \ @@ -49,14 +49,18 @@ License defineTemplateTypeNameAndDebugWithName \ ( \ CThermo##Mixture##ThermoPhys, \ - (#CThermo"<" + Mixture::typeName() + ">").c_str(), \ + ( \ + word(CThermo##Mixture##ThermoPhys::typeName_()) + "<" \ + + Mixture::typeName() + ">" \ + ).c_str(), \ 0 \ ) -#define makeThermoPhysicsReactionThermos(BaseThermo,BaseReactionThermo,CThermo,Mixture,ThermoPhys) \ +#define makeReactionThermos( \ + BaseThermo, BaseReactionThermo, CThermo, Mixture, ThermoPhys) \ \ - defineThermoPhysicsReactionThermo \ + defineReactionThermo \ ( \ BaseReactionThermo, \ CThermo, \ @@ -64,15 +68,15 @@ License ThermoPhys \ ); \ \ - addThermoPhysicsThermo(basicThermo, CThermo##Mixture##ThermoPhys); \ - addThermoPhysicsThermo(fluidThermo, CThermo##Mixture##ThermoPhys); \ - addThermoPhysicsThermo(BaseThermo, CThermo##Mixture##ThermoPhys); \ - addThermoPhysicsThermo(BaseReactionThermo, CThermo##Mixture##ThermoPhys) + addThermo(basicThermo, CThermo##Mixture##ThermoPhys); \ + addThermo(fluidThermo, CThermo##Mixture##ThermoPhys); \ + addThermo(BaseThermo, CThermo##Mixture##ThermoPhys); \ + addThermo(BaseReactionThermo, CThermo##Mixture##ThermoPhys) -#define makeThermoPhysicsReactionThermo(BaseReactionThermo,CThermo,Mixture,ThermoPhys) \ +#define makeReactionThermo(BaseReactionThermo, CThermo, Mixture, ThermoPhys) \ \ - defineThermoPhysicsReactionThermo \ + defineReactionThermo \ ( \ BaseReactionThermo, \ CThermo, \ @@ -80,35 +84,9 @@ License ThermoPhys \ ); \ \ - addThermoPhysicsThermo(BaseReactionThermo, CThermo##Mixture##ThermoPhys) + addThermo(BaseReactionThermo, CThermo##Mixture##ThermoPhys) -#define makeReactionThermos(BaseThermo,BaseReactionThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \ - \ - typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie); \ - \ - makeThermoPhysicsReactionThermos \ - ( \ - BaseThermo, \ - BaseReactionThermo, \ - CThermo, \ - Mixture, \ - Transport##Type##Thermo##EqnOfState##Specie \ - ) - - -#define makeReactionThermo(BaseReactionThermo,CThermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie) \ - \ - typedefThermoPhysics(Transport,Type,Thermo,EqnOfState,Specie); \ - \ - makeThermoPhysicsReactionThermo \ - ( \ - BaseReactionThermo, \ - CThermo, \ - Mixture, \ - Transport##Type##Thermo##EqnOfState##Specie \ - ) - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C index 15bf24577b..dec26e2786 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,243 +23,43 @@ License \*---------------------------------------------------------------------------*/ -#include "makeReactionThermo.H" - -#include "psiReactionThermo.H" -#include "hePsiThermo.H" - -#include "specie.H" -#include "perfectGas.H" -#include "hConstThermo.H" -#include "janafThermo.H" -#include "sensibleEnthalpy.H" -#include "thermo.H" -#include "constTransport.H" -#include "sutherlandTransport.H" - -#include "homogeneousMixture.H" -#include "inhomogeneousMixture.H" -#include "veryInhomogeneousMixture.H" #include "multiComponentMixture.H" #include "singleComponentMixture.H" -#include "thermoPhysicsTypes.H" +#include "psiThermo.H" +#include "psiReactionThermo.H" +#include "hePsiThermo.H" + +#include "forGases.H" +#include "makeReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makePsiReactionThermos(Mixture, ThermoPhysics) \ + makeReactionThermos \ + ( \ + psiThermo, \ + psiReactionThermo, \ + hePsiThermo, \ + Mixture, \ + ThermoPhysics \ + ) + +#define makePsiReactionThermo(Mixture, ThermoPhysics) \ + makeReactionThermo \ + ( \ + psiReactionThermo, \ + hePsiThermo, \ + Mixture, \ + ThermoPhysics \ + ) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// constTransport, hConstThermo - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - homogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - inhomogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - veryInhomogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - - -// sutherlandTransport, hConstThermo - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - homogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - inhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - veryInhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - - -// sutherlandTransport, janafThermo - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - homogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - inhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - veryInhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Multi-component thermo for sensible enthalpy - -makeThermoPhysicsReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - multiComponentMixture, - constGasHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - multiComponentMixture, - gasHThermoPhysics -); - - -// Multi-component thermo for internal energy - -makeThermoPhysicsReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - multiComponentMixture, - constGasEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - psiThermo, - psiReactionThermo, - hePsiThermo, - multiComponentMixture, - gasEThermoPhysics -); - - -// Single-component thermo for sensible enthalpy - -makeThermoPhysicsReactionThermo -( - psiReactionThermo, - hePsiThermo, - singleComponentMixture, - constGasHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - psiReactionThermo, - hePsiThermo, - singleComponentMixture, - gasHThermoPhysics -); - - -// Single-component thermo for internal energy - -makeThermoPhysicsReactionThermo -( - psiReactionThermo, - hePsiThermo, - singleComponentMixture, - constGasEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - psiReactionThermo, - hePsiThermo, - singleComponentMixture, - gasEThermoPhysics -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + forGases(makePsiReactionThermos, multiComponentMixture); + forGases(makePsiReactionThermo, singleComponentMixture); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermos.C b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermos.C index 28e5f28e5b..16a9c0fb5e 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,211 +23,38 @@ License \*---------------------------------------------------------------------------*/ -#include "psiuReactionThermo.H" -#include "heheuPsiThermo.H" - -#include "makeReactionThermo.H" -#include "addToRunTimeSelectionTable.H" - -#include "specie.H" -#include "perfectGas.H" -#include "hConstThermo.H" -#include "janafThermo.H" -#include "thermo.H" -#include "constTransport.H" -#include "sutherlandTransport.H" - -#include "absoluteEnthalpy.H" -#include "absoluteInternalEnergy.H" - +#include "egrMixture.H" #include "homogeneousMixture.H" #include "inhomogeneousMixture.H" #include "veryInhomogeneousMixture.H" -#include "multiComponentMixture.H" -#include "egrMixture.H" +#include "psiThermo.H" +#include "psiuReactionThermo.H" +#include "heheuPsiThermo.H" + +#include "forAbsoluteGases.H" +#include "makeReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makePsiuReactionThermos(Mixture, ThermoPhysics) \ + makeReactionThermos \ + ( \ + psiThermo, \ + psiuReactionThermo, \ + heheuPsiThermo, \ + Mixture, \ + ThermoPhysics \ + ) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - -// * * * * * * * * * * * * * * * * h-hu-Thermos * * * * * * * * * * * * * * * // - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - homogeneousMixture, - constTransport, - absoluteEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - inhomogeneousMixture, - constTransport, - absoluteEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - veryInhomogeneousMixture, - constTransport, - absoluteEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - egrMixture, - constTransport, - absoluteEnthalpy, - hConstThermo, - perfectGas, - specie -); - - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - homogeneousMixture, - constTransport, - absoluteEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - homogeneousMixture, - sutherlandTransport, - absoluteEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - inhomogeneousMixture, - sutherlandTransport, - absoluteEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - veryInhomogeneousMixture, - sutherlandTransport, - absoluteEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - egrMixture, - sutherlandTransport, - absoluteEnthalpy, - janafThermo, - perfectGas, - specie -); - - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - homogeneousMixture, - sutherlandTransport, - absoluteInternalEnergy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - inhomogeneousMixture, - sutherlandTransport, - absoluteInternalEnergy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - veryInhomogeneousMixture, - sutherlandTransport, - absoluteInternalEnergy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - psiThermo, - psiuReactionThermo, - heheuPsiThermo, - egrMixture, - sutherlandTransport, - absoluteInternalEnergy, - janafThermo, - perfectGas, - specie -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + forAbsoluteGases(makePsiuReactionThermos, egrMixture); + forAbsoluteGases(makePsiuReactionThermos, homogeneousMixture); + forAbsoluteGases(makePsiuReactionThermos, inhomogeneousMixture); + forAbsoluteGases(makePsiuReactionThermos, veryInhomogeneousMixture); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C index 77751a3224..59b064edb7 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C @@ -23,583 +23,52 @@ License \*---------------------------------------------------------------------------*/ -#include "makeReactionThermo.H" - -#include "rhoReactionThermo.H" -#include "heRhoThermo.H" - -#include "specie.H" -#include "perfectGas.H" -#include "incompressiblePerfectGas.H" -#include "hConstThermo.H" -#include "janafThermo.H" -#include "sensibleEnthalpy.H" -#include "thermo.H" -#include "rhoConst.H" -#include "rPolynomial.H" -#include "adiabaticPerfectFluid.H" -#include "Boussinesq.H" - -#include "constTransport.H" -#include "sutherlandTransport.H" -#include "WLFTransport.H" - -#include "homogeneousMixture.H" -#include "inhomogeneousMixture.H" -#include "veryInhomogeneousMixture.H" #include "multiComponentMixture.H" #include "singleComponentMixture.H" -#include "thermoPhysicsTypes.H" +#include "rhoThermo.H" +#include "rhoReactionThermo.H" +#include "heRhoThermo.H" + +#include "forCommonGases.H" +#include "forGases.H" +#include "forLiquids.H" +#include "forPolynomials.H" +#include "makeReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeRhoReactionThermos(Mixture, ThermoPhysics) \ + makeReactionThermos \ + ( \ + rhoThermo, \ + rhoReactionThermo, \ + heRhoThermo, \ + Mixture, \ + ThermoPhysics \ + ) + +#define makeRhoReactionThermo(Mixture, ThermoPhysics) \ + makeReactionThermo \ + ( \ + rhoReactionThermo, \ + heRhoThermo, \ + Mixture, \ + ThermoPhysics \ + ) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + forGases(makeRhoReactionThermos, multiComponentMixture); + forGases(makeRhoReactionThermo, singleComponentMixture); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + forLiquids(makeRhoReactionThermos, multiComponentMixture); + forLiquids(makeRhoReactionThermo, singleComponentMixture); -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - homogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - inhomogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - veryInhomogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - homogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - inhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - veryInhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - homogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - inhomogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - veryInhomogeneousMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - homogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - incompressiblePerfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - inhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - incompressiblePerfectGas, - specie -); - -makeReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - veryInhomogeneousMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - incompressiblePerfectGas, - specie -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Multi-component thermo for internal energy - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constGasEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - gasEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constIncompressibleGasEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - incompressibleGasEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - icoPoly8EThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constFluidEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constAdiabaticFluidEThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constEThermoPhysics -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constTransport, - sensibleInternalEnergy, - janafThermo, - rhoConst, - specie -); - - -// Single-component thermo for internal energy - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constGasEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - gasEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constIncompressibleGasEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - incompressibleGasEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - icoPoly8EThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constFluidEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constAdiabaticFluidEThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constEThermoPhysics -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - Boussinesq, - specie -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - Boussinesq, - specie -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - WLFTransport, - sensibleInternalEnergy, - eConstThermo, - rhoConst, - specie -); - - - -// Multi-component thermo for sensible enthalpy - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constGasHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - gasHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constIncompressibleGasHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - incompressibleGasHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - icoPoly8HThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constFluidHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constAdiabaticFluidHThermoPhysics -); - -makeThermoPhysicsReactionThermos -( - rhoThermo, - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constHThermoPhysics -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - multiComponentMixture, - constTransport, - sensibleEnthalpy, - janafThermo, - rhoConst, - specie -); - - -// Single-component thermo for sensible enthalpy - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constGasHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - gasHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constIncompressibleGasHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - incompressibleGasHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - icoPoly8HThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constFluidHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constAdiabaticFluidHThermoPhysics -); - -makeThermoPhysicsReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constHThermoPhysics -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - Boussinesq, - specie -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - Boussinesq, - specie -); - -makeReactionThermo -( - rhoReactionThermo, - heRhoThermo, - singleComponentMixture, - WLFTransport, - sensibleEnthalpy, - eConstThermo, - rhoConst, - specie -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam + forPolynomials(makeRhoReactionThermos, multiComponentMixture); + forPolynomials(makeRhoReactionThermo, singleComponentMixture); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H b/src/thermophysicalModels/solidSpecie/include/forSolids.H similarity index 54% rename from src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H rename to src/thermophysicalModels/solidSpecie/include/forSolids.H index b1b6f5c4ea..c496e51492 100644 --- a/src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H +++ b/src/thermophysicalModels/solidSpecie/include/forSolids.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,90 +21,48 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Typedefs - Foam::solidThermoPhysicsTypes - -Description - Type definitions for solid-thermo-physics models - \*---------------------------------------------------------------------------*/ -#ifndef solidThermoPhysicsTypes_H -#define solidThermoPhysicsTypes_H +#ifndef forSolids_H +#define forSolids_H #include "specie.H" + #include "rhoConst.H" + #include "hConstThermo.H" #include "hPolynomialThermo.H" #include "hPowerThermo.H" + +#include "sensibleEnthalpy.H" + #include "constIsoSolidTransport.H" #include "constAnIsoSolidTransport.H" #include "exponentialSolidTransport.H" #include "polynomialSolidTransport.H" -#include "sensibleEnthalpy.H" #include "thermo.H" +#include "forThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - typedef - constIsoSolidTransport - < - species::thermo - < - hConstThermo - < - rhoConst - >, - sensibleEnthalpy - > - > hConstSolidThermoPhysics; +#define forSolidEquations(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, rhoConst, specie, Macro, Args) - typedef - exponentialSolidTransport - < - species::thermo - < - hPowerThermo - < - rhoConst - >, - sensibleEnthalpy - > - > hPowerSolidThermoPhysics; +#define forSolidEnergiesAndThermos(Mu, Macro, Args...) \ + forSolidEquations(Mu, sensibleEnthalpy, hConstThermo, Macro, Args); \ + forSolidEquations(Mu, sensibleEnthalpy, hPolynomialThermo, Macro, Args); \ + forSolidEquations(Mu, sensibleEnthalpy, hPowerThermo, Macro, Args) - typedef - polynomialSolidTransport - < - species::thermo - < - hPolynomialThermo - < - rhoConst, - 8 - >, - sensibleEnthalpy - >, - 8 - > hTransportThermoPoly8SolidThermoPhysics; - - typedef - constIsoSolidTransport - < - species::thermo - < - hPowerThermo - < - rhoConst - >, - sensibleEnthalpy - > - > hExpKappaConstSolidThermoPhysics; -} +#define forSolidTransports(Macro, Args...) \ + forSolidEnergiesAndThermos(constIsoSolidTransport, Macro, Args); \ + forSolidEnergiesAndThermos(constAnIsoSolidTransport, Macro, Args); \ + forSolidEnergiesAndThermos(exponentialSolidTransport, Macro, Args); \ + forSolidEnergiesAndThermos(polynomialSolidTransport, Macro, Args) +#define forSolids(Macro, Args...) \ + forSolidTransports(Macro, Args) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C b/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C index 1fa7a2e5f1..4b1555193d 100644 --- a/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C +++ b/src/thermophysicalModels/solidThermo/heSolidThermo/heSolidThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,25 +23,12 @@ License \*---------------------------------------------------------------------------*/ -#include "makeHeSolidThermo.H" #include "solidPressureThermo.H" #include "heSolidThermo.H" - -#include "specie.H" -#include "rhoConst.H" -#include "hConstThermo.H" -#include "hPowerThermo.H" -#include "hPolynomialThermo.H" -#include "constIsoSolidTransport.H" -#include "constAnIsoSolidTransport.H" -#include "exponentialSolidTransport.H" -#include "polynomialSolidTransport.H" #include "pureMixture.H" -#include "sensibleEnthalpy.H" -#include "sensibleInternalEnergy.H" -#include "thermo.H" -#include "solidThermoPhysicsTypes.H" +#include "forSolids.H" +#include "makeHeSolidThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,49 +37,7 @@ namespace Foam /* * * * * * * * * * * * * * * * * Enthalpy-based * * * * * * * * * * * * * */ -makeSolidThermo -( - solidPressureThermo, - heSolidThermo, - pureMixture, - constIsoSolidTransport, - sensibleEnthalpy, - hConstThermo, - rhoConst, - specie -); - -makeSolidThermo -( - solidPressureThermo, - heSolidThermo, - pureMixture, - constAnIsoSolidTransport, - sensibleEnthalpy, - hConstThermo, - rhoConst, - specie -); - -makeSolidThermo -( - solidPressureThermo, - heSolidThermo, - pureMixture, - exponentialSolidTransport, - sensibleEnthalpy, - hPowerThermo, - rhoConst, - specie -); - -makeSolidThermoPhysicsType -( - solidPressureThermo, - heSolidThermo, - pureMixture, - hTransportThermoPoly8SolidThermoPhysics -); +forSolids(makeSolidThermos, solidPressureThermo, heSolidThermo, pureMixture); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H b/src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H index 6a6abb926a..b98cb22434 100644 --- a/src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/heSolidThermo/makeHeSolidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,129 +32,65 @@ Description #ifndef makeHeSolidThermo_H #define makeHeSolidThermo_H +#include "basicThermo.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeSolidThermo(BaseThermo,Cthermo,Mixture,Transport,Type,Thermo,EqnOfState,Specie)\ + +#define defineSolidThermo(BaseThermo, CThermo, Mixture, ThermoPhys) \ \ - \ -typedef \ - Transport \ - < \ - species::thermo \ + typedef \ + heThermo \ < \ - Thermo \ - < \ - EqnOfState \ - < \ - Specie \ - > \ - >, \ - Type \ - > \ - > Transport##Type##Thermo##EqnOfState##Specie; \ + BaseThermo, \ + Mixture \ + > heThermo##Mixture##ThermoPhys; \ \ -typedef \ - heThermo \ - < \ - BaseThermo, \ - Mixture \ - > heThermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \ + typedef \ + CThermo \ + < \ + BaseThermo, \ + Mixture \ + > CThermo##Mixture##ThermoPhys; \ \ -typedef \ - Cthermo \ - < \ - BaseThermo, \ - Mixture \ - > Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie; \ - \ - \ -defineTemplateTypeNameAndDebugWithName \ -( \ - Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ + defineTemplateTypeNameAndDebugWithName \ ( \ - #Cthermo"<"#Mixture"<" \ - + Transport##Type##Thermo##EqnOfState##Specie::typeName() \ - + ">>" \ - ).c_str(), \ - 0 \ -); \ - \ - \ -addToRunTimeSelectionTable \ -( \ - basicThermo, \ - Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ - fvMesh \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - BaseThermo, \ - Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ - fvMesh \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - BaseThermo, \ - Cthermo##Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ - dictionary \ -); + CThermo##Mixture##ThermoPhys, \ + ( \ + #CThermo"<"#Mixture"<" \ + + ThermoPhys::typeName() \ + + ">>" \ + ).c_str(), \ + 0 \ + ) - -#define makeSolidThermoPhysicsType(BaseThermo,Cthermo,Mixture,SolidPhysicsType)\ +#define addSolidThermo(BaseThermo, CThermoMixtureThermoPhys, Table) \ \ - \ - \ -typedef \ - heThermo \ - < \ - BaseThermo, \ - Mixture \ - > heThermo##Mixture##SolidPhysicsType; \ - \ -typedef \ - Cthermo \ - < \ - BaseThermo, \ - Mixture \ - > Cthermo##Mixture##SolidPhysicsType; \ - \ - \ -defineTemplateTypeNameAndDebugWithName \ -( \ - Cthermo##Mixture##SolidPhysicsType, \ + addToRunTimeSelectionTable \ ( \ - #Cthermo"<"#Mixture"<" \ - + SolidPhysicsType::typeName() \ - + ">>" \ - ).c_str(), \ - 0 \ -); \ + BaseThermo, \ + CThermoMixtureThermoPhys, \ + Table \ + ) + + +#define makeSolidThermo(BaseThermo, CThermo, Mixture, ThermoPhys) \ \ + defineSolidThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \ \ -addToRunTimeSelectionTable \ -( \ - basicThermo, \ - Cthermo##Mixture##SolidPhysicsType, \ - fvMesh \ -); \ + addSolidThermo(BaseThermo, CThermo##Mixture##ThermoPhys, fvMesh + + +#define makeSolidThermos(BaseThermo, CThermo, Mixture, ThermoPhys) \ \ -addToRunTimeSelectionTable \ -( \ - BaseThermo, \ - Cthermo##Mixture##SolidPhysicsType, \ - fvMesh \ -); \ + defineSolidThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \ \ -addToRunTimeSelectionTable \ -( \ - BaseThermo, \ - Cthermo##Mixture##SolidPhysicsType, \ - dictionary \ -); + addSolidThermo(basicThermo, CThermo##Mixture##ThermoPhys, fvMesh); \ + addSolidThermo(BaseThermo, CThermo##Mixture##ThermoPhys, fvMesh); \ + addSolidThermo(BaseThermo, CThermo##Mixture##ThermoPhys, dictionary) + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H index 076ad5ea03..4b82946dbb 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/Boussinesq.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -193,7 +193,6 @@ public: // Member Operators - inline void operator=(const Boussinesq&); inline void operator+=(const Boussinesq&); inline void operator*=(const scalar); diff --git a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H index eeefe7fbb9..c23cbf37f1 100644 --- a/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H +++ b/src/thermophysicalModels/specie/equationOfState/Boussinesq/BoussinesqI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -167,20 +167,6 @@ inline Foam::scalar Foam::Boussinesq::CpMCv // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // -template -inline void Foam::Boussinesq::operator= -( - const Boussinesq& b -) -{ - Specie::operator=(b); - - rho0_ = b.rho0_; - T0_ = b.T0_; - beta_ = b.beta_; -} - - template inline void Foam::Boussinesq::operator+= ( diff --git a/src/thermophysicalModels/specie/include/forAbsoluteGases.H b/src/thermophysicalModels/specie/include/forAbsoluteGases.H new file mode 100644 index 0000000000..758c445d5e --- /dev/null +++ b/src/thermophysicalModels/specie/include/forAbsoluteGases.H @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forAbsoluteGases_H +#define forAbsoluteGases_H + +#include "specie.H" + +#include "perfectGas.H" + +#include "eConstThermo.H" +#include "hConstThermo.H" +#include "janafThermo.H" + +#include "absoluteEnthalpy.H" +#include "absoluteInternalEnergy.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "thermo.H" + +#include "forThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forAbsoluteGasEqns(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, perfectGas, specie, Macro, Args) + +#define forAbsoluteGasEnergiesAndThermos(Mu, Macro, Args...) \ + forAbsoluteGasEqns(Mu, absoluteEnthalpy, hConstThermo, Macro, Args); \ + forAbsoluteGasEqns(Mu, absoluteEnthalpy, janafThermo, Macro, Args); \ + forAbsoluteGasEqns(Mu, absoluteInternalEnergy, eConstThermo, Macro, Args); \ + forAbsoluteGasEqns(Mu, absoluteInternalEnergy, hConstThermo, Macro, Args); \ + forAbsoluteGasEqns(Mu, absoluteInternalEnergy, janafThermo, Macro, Args) + +#define forAbsoluteGasTransports(Macro, Args...) \ + forAbsoluteGasEnergiesAndThermos(constTransport, Macro, Args); \ + forAbsoluteGasEnergiesAndThermos(sutherlandTransport, Macro, Args) + +#define forAbsoluteGases(Macro, Args...) \ + forAbsoluteGasTransports(Macro, Args) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/forCommonGases.H b/src/thermophysicalModels/specie/include/forCommonGases.H new file mode 100644 index 0000000000..e23038e8a0 --- /dev/null +++ b/src/thermophysicalModels/specie/include/forCommonGases.H @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forCommonGases_H +#define forCommonGases_H + +#include "specie.H" + +#include "incompressiblePerfectGas.H" +#include "perfectGas.H" + +#include "eConstThermo.H" +#include "hConstThermo.H" +#include "janafThermo.H" + +#include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "thermo.H" + +#include "forThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forCommonGasEqns(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, incompressiblePerfectGas, specie, Macro, Args); \ + forThermo(Mu, He, Cp, perfectGas, specie, Macro, Args) + +#define forCommonGasEnergiesAndThermos(Mu, Macro, Args...) \ + forCommonGasEqns(Mu, sensibleEnthalpy, hConstThermo, Macro, Args); \ + forCommonGasEqns(Mu, sensibleEnthalpy, janafThermo, Macro, Args); \ + forCommonGasEqns(Mu, sensibleInternalEnergy, eConstThermo, Macro, Args); \ + forCommonGasEqns(Mu, sensibleInternalEnergy, hConstThermo, Macro, Args); \ + forCommonGasEqns(Mu, sensibleInternalEnergy, janafThermo, Macro, Args) + +#define forCommonGasTransports(Macro, Args...) \ + forCommonGasEnergiesAndThermos(constTransport, Macro, Args); \ + forCommonGasEnergiesAndThermos(sutherlandTransport, Macro, Args) + +#define forCommonGases(Macro, Args...) \ + forCommonGasTransports(Macro, Args) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/forCommonLiquids.H b/src/thermophysicalModels/specie/include/forCommonLiquids.H new file mode 100644 index 0000000000..368a984283 --- /dev/null +++ b/src/thermophysicalModels/specie/include/forCommonLiquids.H @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forCommonLiquids_H +#define forCommonLiquids_H + +#include "specie.H" + +#include "adiabaticPerfectFluid.H" +#include "perfectFluid.H" +#include "rhoConst.H" +#include "rPolynomial.H" + +#include "eConstThermo.H" +#include "hConstThermo.H" + +#include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" + +#include "constTransport.H" +#include "WLFTransport.H" + +#include "thermo.H" + +#include "forThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forCommonLiquidEqns(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, rhoConst, specie, Macro, Args); \ + forThermo(Mu, He, Cp, rPolynomial, specie, Macro, Args) + +#define forCommonLiquidEnergiesAndThermos(Mu, Macro, Args...) \ + forCommonLiquidEqns(Mu, sensibleEnthalpy, hConstThermo, Macro, Args); \ + forCommonLiquidEqns(Mu, sensibleInternalEnergy, eConstThermo, Macro, Args);\ + forCommonLiquidEqns(Mu, sensibleInternalEnergy, hConstThermo, Macro, Args) + +#define forCommonLiquidTransports(Macro, Args...) \ + forCommonLiquidEnergiesAndThermos(constTransport, Macro, Args); + +#define forCommonLiquids(Macro, Args...) \ + forCommonLiquidTransports(Macro, Args) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/forGases.H b/src/thermophysicalModels/specie/include/forGases.H new file mode 100644 index 0000000000..83ee50eb7e --- /dev/null +++ b/src/thermophysicalModels/specie/include/forGases.H @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forGases_H +#define forGases_H + +#include "specie.H" + +#include "Boussinesq.H" +#include "incompressiblePerfectGas.H" +#include "perfectGas.H" +#include "PengRobinsonGas.H" + +#include "eConstThermo.H" +#include "hConstThermo.H" +#include "janafThermo.H" + +#include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "thermo.H" + +#include "forThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forGasEquations(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, Boussinesq, specie, Macro, Args); \ + forThermo(Mu, He, Cp, incompressiblePerfectGas, specie, Macro, Args); \ + forThermo(Mu, He, Cp, PengRobinsonGas, specie, Macro, Args); \ + forThermo(Mu, He, Cp, perfectGas, specie, Macro, Args) + +#define forGasEnergiesAndThermos(Mu, Macro, Args...) \ + forGasEquations(Mu, sensibleEnthalpy, hConstThermo, Macro, Args); \ + forGasEquations(Mu, sensibleEnthalpy, janafThermo, Macro, Args); \ + forGasEquations(Mu, sensibleInternalEnergy, eConstThermo, Macro, Args); \ + forGasEquations(Mu, sensibleInternalEnergy, hConstThermo, Macro, Args); \ + forGasEquations(Mu, sensibleInternalEnergy, janafThermo, Macro, Args) + +#define forGasTransports(Macro, Args...) \ + forGasEnergiesAndThermos(constTransport, Macro, Args); \ + forGasEnergiesAndThermos(sutherlandTransport, Macro, Args) + +#define forGases(Macro, Args...) \ + forGasTransports(Macro, Args) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/forLiquids.H b/src/thermophysicalModels/specie/include/forLiquids.H new file mode 100644 index 0000000000..6898f97d0c --- /dev/null +++ b/src/thermophysicalModels/specie/include/forLiquids.H @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forLiquids_H +#define forLiquids_H + +#include "specie.H" + +#include "adiabaticPerfectFluid.H" +#include "perfectFluid.H" +#include "rhoConst.H" +#include "rPolynomial.H" + +#include "eConstThermo.H" +#include "hConstThermo.H" + +#include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" + +#include "constTransport.H" +#include "WLFTransport.H" + +#include "thermo.H" + +#include "forThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forLiquidEquations(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, adiabaticPerfectFluid, specie, Macro, Args); \ + forThermo(Mu, He, Cp, rhoConst, specie, Macro, Args); \ + forThermo(Mu, He, Cp, rPolynomial, specie, Macro, Args) + +#define forLiquidEnergiesAndThermos(Mu, Macro, Args...) \ + forLiquidEquations(Mu, sensibleEnthalpy, hConstThermo, Macro, Args); \ + forLiquidEquations(Mu, sensibleInternalEnergy, eConstThermo, Macro, Args); \ + forLiquidEquations(Mu, sensibleInternalEnergy, hConstThermo, Macro, Args) + +#define forLiquidTransports(Macro, Args...) \ + forLiquidEnergiesAndThermos(constTransport, Macro, Args); \ + forLiquidEnergiesAndThermos(WLFTransport, Macro, Args) + +#define forLiquids(Macro, Args...) \ + forLiquidTransports(Macro, Args) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/forPolynomials.H b/src/thermophysicalModels/specie/include/forPolynomials.H new file mode 100644 index 0000000000..a492920f2b --- /dev/null +++ b/src/thermophysicalModels/specie/include/forPolynomials.H @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forPolynomials_H +#define forPolynomials_H + +#include "specie.H" + +#include "icoPolynomial.H" + +#include "eConstThermo.H" +#include "hConstThermo.H" + +#include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" + +#include "logPolynomialTransport.H" +#include "polynomialTransport.H" + +#include "thermo.H" + +#include "forThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forPolynomialEqns(Mu, He, Cp, Macro, Args...) \ + forThermo(Mu, He, Cp, icoPolynomial, specie, Macro, Args); + +#define forPolynomialEnergiesAndThermos(Mu, Macro, Args...) \ + forPolynomialEqns(Mu, sensibleEnthalpy, hConstThermo, Macro, Args); \ + forPolynomialEqns(Mu, sensibleInternalEnergy, eConstThermo, Macro, Args); \ + forPolynomialEqns(Mu, sensibleInternalEnergy, hConstThermo, Macro, Args) + +#define forPolynomialTransports(Macro, Args...) \ + forPolynomialEnergiesAndThermos(logPolynomialTransport, Macro, Args); \ + forPolynomialEnergiesAndThermos(polynomialTransport, Macro, Args) + +#define forPolynomials(Macro, Args...) \ + forPolynomialTransports(Macro, Args) + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/forThermo.H b/src/thermophysicalModels/specie/include/forThermo.H new file mode 100644 index 0000000000..19de00916f --- /dev/null +++ b/src/thermophysicalModels/specie/include/forThermo.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2019-2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef forThermo_H +#define forThermo_H + +#include "typedefThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define forThermo(Transport, Energy, Thermo, Equation, Specie, Macro, Args...) \ + \ + typedefThermo \ + ( \ + Transport, \ + Energy, \ + Thermo, \ + Equation, \ + Specie \ + ); \ + \ + Macro(Args, Transport##Energy##Thermo##Equation##Specie) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/makeThermo.H b/src/thermophysicalModels/specie/include/makeThermo.H new file mode 100644 index 0000000000..eccc5958cc --- /dev/null +++ b/src/thermophysicalModels/specie/include/makeThermo.H @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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::fluidThermo + +Description + Macros for creating basic fluid thermo packages + +\*---------------------------------------------------------------------------*/ + +#ifndef makeThermo_H +#define makeThermo_H + +#include "fluidThermo.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define defineThermo(BaseThermo, CThermo, Mixture, ThermoPhys) \ + \ + typedef \ + CThermo \ + < \ + BaseThermo, \ + Mixture \ + > \ + CThermo##Mixture##ThermoPhys; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + CThermo##Mixture##ThermoPhys, \ + ( \ + word(CThermo##Mixture##ThermoPhys::typeName_()) + "<" \ + + Mixture::typeName() + ">" \ + ).c_str(), \ + 0 \ + ) + + +#define addThermo(BaseThermo, CThermoMixtureThermoPhys) \ + \ + addToRunTimeSelectionTable \ + ( \ + BaseThermo, \ + CThermoMixtureThermoPhys, \ + fvMesh \ + ) + + +#define makeThermo(BaseThermo, CThermo, Mixture, ThermoPhys) \ + \ + defineThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \ + \ + addThermo(BaseThermo, CThermo##Mixture##ThermoPhys) + + +#define makeThermos(BaseThermo, CThermo, Mixture, ThermoPhys) \ + \ + defineThermo(BaseThermo, CThermo, Mixture, ThermoPhys); \ + \ + addThermo(basicThermo, CThermo##Mixture##ThermoPhys); \ + addThermo(fluidThermo, CThermo##Mixture##ThermoPhys); \ + addThermo(BaseThermo, CThermo##Mixture##ThermoPhys) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H deleted file mode 100644 index 17b75aeb45..0000000000 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ /dev/null @@ -1,92 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 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 . - -Typedefs - Foam::reactionTypes - -Description - Type definitions for reactions - -\*---------------------------------------------------------------------------*/ - -#ifndef reactionTypes_H -#define reactionTypes_H - -#include "thermoPhysicsTypes.H" -#include "Reaction.H" - -#include "icoPolynomial.H" -#include "hPolynomialThermo.H" -#include "polynomialTransport.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // sensible enthalpy based reactions - typedef Reaction constGasHReaction; - - typedef Reaction gasHReaction; - - typedef Reaction - constIncompressibleGasHReaction; - - typedef Reaction - incompressibleGasHReaction; - - typedef Reaction icoPoly8HReaction; - - typedef Reaction constFluidHReaction; - - typedef Reaction - constAdiabaticFluidHReaction; - - typedef Reaction constHReaction; - - - // internal ennergy based reactions - typedef Reaction constGasEReaction; - - typedef Reaction gasEReaction; - - typedef Reaction - constIncompressibleGasEReaction; - - typedef Reaction - incompressibleGasEReaction; - - typedef Reaction icoPoly8EReaction; - - typedef Reaction constFluidEReaction; - - typedef Reaction - constAdiabaticFluidEReaction; - - typedef Reaction constEReaction; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H deleted file mode 100644 index 8ec0e6a78b..0000000000 --- a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H +++ /dev/null @@ -1,285 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 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 . - -Typedefs - Foam::thermoPhysicsTypes - -Description - Type definitions for thermo-physics models - -\*---------------------------------------------------------------------------*/ - -#ifndef thermoPhysicsTypes_H -#define thermoPhysicsTypes_H - -#include "specie.H" -#include "perfectGas.H" -#include "incompressiblePerfectGas.H" -#include "rPolynomial.H" -#include "adiabaticPerfectFluid.H" -#include "rhoConst.H" -#include "hConstThermo.H" -#include "eConstThermo.H" -#include "janafThermo.H" - -#include "sensibleEnthalpy.H" -#include "sensibleInternalEnergy.H" -#include "thermo.H" -#include "sutherlandTransport.H" -#include "constTransport.H" - -#include "icoPolynomial.H" -#include "hPolynomialThermo.H" -#include "polynomialTransport.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // thermo physics types based on sensibleEnthalpy - typedef - constTransport - < - species::thermo - < - hConstThermo - < - perfectGas - >, - sensibleEnthalpy - > - > constGasHThermoPhysics; - - typedef - sutherlandTransport - < - species::thermo - < - janafThermo - < - perfectGas - >, - sensibleEnthalpy - > - > gasHThermoPhysics; - - typedef - constTransport - < - species::thermo - < - hConstThermo - < - incompressiblePerfectGas - >, - sensibleEnthalpy - > - > constIncompressibleGasHThermoPhysics; - - typedef - sutherlandTransport - < - species::thermo - < - janafThermo - < - incompressiblePerfectGas - >, - sensibleEnthalpy - > - > incompressibleGasHThermoPhysics; - - typedef - polynomialTransport - < - species::thermo - < - hPolynomialThermo - < - icoPolynomial, - 8 - >, - sensibleEnthalpy - >, - 8 - > icoPoly8HThermoPhysics; - - typedef - constTransport - < - species::thermo - < - hConstThermo - < - rPolynomial - >, - sensibleEnthalpy - > - > - constFluidHThermoPhysics; - - typedef - constTransport - < - species::thermo - < - hConstThermo - < - adiabaticPerfectFluid - >, - sensibleEnthalpy - > - > - constAdiabaticFluidHThermoPhysics; - - typedef - constTransport - < - species::thermo - < - hConstThermo - < - rhoConst - >, - sensibleEnthalpy - > - > - constHThermoPhysics; - - - // thermo physics types based on sensibleInternalEnergy - typedef - constTransport - < - species::thermo - < - eConstThermo - < - perfectGas - >, - sensibleInternalEnergy - > - > constGasEThermoPhysics; - - typedef - sutherlandTransport - < - species::thermo - < - janafThermo - < - perfectGas - >, - sensibleInternalEnergy - > - > gasEThermoPhysics; - - typedef - constTransport - < - species::thermo - < - eConstThermo - < - incompressiblePerfectGas - >, - sensibleInternalEnergy - > - > constIncompressibleGasEThermoPhysics; - - typedef - sutherlandTransport - < - species::thermo - < - janafThermo - < - incompressiblePerfectGas - >, - sensibleInternalEnergy - > - > incompressibleGasEThermoPhysics; - - typedef - polynomialTransport - < - species::thermo - < - hPolynomialThermo - < - icoPolynomial, - 8 - >, - sensibleInternalEnergy - >, - 8 - > icoPoly8EThermoPhysics; - - typedef - constTransport - < - species::thermo - < - eConstThermo - < - rPolynomial - >, - sensibleInternalEnergy - > - > - constFluidEThermoPhysics; - - typedef - constTransport - < - species::thermo - < - eConstThermo - < - adiabaticPerfectFluid - >, - sensibleInternalEnergy - > - > - constAdiabaticFluidEThermoPhysics; - - typedef - constTransport - < - species::thermo - < - eConstThermo - < - rhoConst - >, - sensibleInternalEnergy - > - > - constEThermoPhysics; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/typedefThermo.H b/src/thermophysicalModels/specie/include/typedefThermo.H new file mode 100644 index 0000000000..208c970695 --- /dev/null +++ b/src/thermophysicalModels/specie/include/typedefThermo.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef typedefThermo_H +#define typedefThermo_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define typedefThermo(Transport, Energy, Thermo, Equation, Specie) \ + \ + typedef \ + Transport \ + < \ + species::thermo \ + < \ + Thermo \ + < \ + Equation \ + < \ + Specie \ + > \ + >, \ + Energy \ + > \ + > \ + Transport##Energy##Thermo##Equation##Specie + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H b/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H index 713175e367..f5ab1e09b7 100644 --- a/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H +++ b/src/thermophysicalModels/specie/transport/WLF/WLFTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,6 +110,20 @@ class WLFTransport scalar rPr_; + // Private Constructors + + //- Construct from components + inline WLFTransport + ( + const Thermo& t, + const scalar mu0, + const scalar Tr, + const scalar C1, + const scalar C2, + const scalar Pr + ); + + // Private Member Functions //- Read coefficient from dictionary diff --git a/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H b/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H index bde73351fe..8fa746fc41 100644 --- a/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H +++ b/src/thermophysicalModels/specie/transport/WLF/WLFTransportI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,26 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template +inline Foam::WLFTransport::WLFTransport +( + const Thermo& t, + const scalar mu0, + const scalar Tr, + const scalar C1, + const scalar C2, + const scalar Pr +) +: + Thermo(t), + mu0_(mu0), + Tr_(Tr), + C1_(C1), + C2_(C2), + rPr_(scalar(1)/Pr) +{} + + template inline Foam::WLFTransport::WLFTransport ( diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/constant/radiationProperties b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/constant/radiationProperties index 7aa097f7c7..4a01196d41 100644 --- a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/constant/radiationProperties +++ b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/constant/radiationProperties @@ -185,7 +185,7 @@ greyMeanCombustionCoeffs scatterModel none; -sootModel mixtureFraction; +sootModel mixtureFraction; mixtureFractionCoeffs { diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/constant/thermophysicalProperties index c039ae40ce..b5f5ba8221 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type hePsiThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -34,13 +34,13 @@ mixture } thermodynamics { - Cp 1007; + Cp 1005; Hf 0; } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/constant/thermophysicalProperties index 14e4c3e995..a855aeac72 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type hePsiThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -34,13 +34,13 @@ mixture } thermodynamics { - Cp 1007; + Cp 1005; Hf 0; } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/constant/thermophysicalProperties index 14e4c3e995..a855aeac72 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type hePsiThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -34,13 +34,13 @@ mixture } thermodynamics { - Cp 1007; + Cp 1005; Hf 0; } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/constant/thermophysicalProperties index 56ab01fa85..a855aeac72 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type hePsiThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -30,17 +30,17 @@ mixture { specie { - molWeight 28.9; + molWeight 28.9; } thermodynamics { - Cp 1007; - Hf 0; + Cp 1005; + Hf 0; } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties index ae5a9ca350..770ab109f3 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type heRhoThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -39,8 +39,8 @@ mixture } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/thermophysicalProperties b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/thermophysicalProperties index 5f416d1cfc..b5f5ba8221 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type hePsiThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -39,8 +39,8 @@ mixture } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/constant/thermophysicalProperties b/tutorials/compressible/rhoSimpleFoam/squareBend/constant/thermophysicalProperties index c039ae40ce..b5f5ba8221 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBend/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/constant/thermophysicalProperties @@ -19,7 +19,7 @@ thermoType { type hePsiThermo; mixture pureMixture; - transport sutherland; + transport const; thermo hConst; equationOfState perfectGas; specie specie; @@ -34,13 +34,13 @@ mixture } thermodynamics { - Cp 1007; + Cp 1005; Hf 0; } transport { - As 1.4792e-06; - Ts 116; + mu 1.82e-05; + Pr 0.71; } } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesis/constant/thermophysicalProperties.particles b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesis/constant/thermophysicalProperties.particles index 05e52e4690..d50f1712fc 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesis/constant/thermophysicalProperties.particles +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesis/constant/thermophysicalProperties.particles @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture multiComponentMixture; transport const; - thermo janaf; + thermo hConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; @@ -42,11 +42,8 @@ TiO2 } thermodynamics { - Tlow 280; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 6.84891510e+00 4.24634610e-03 -3.00889840e-06 1.06025190e-09 -1.43795970e-13 -1.15992460e+05 -3.45141060e+01 ); - lowCpCoeffs ( -1.61175170e-01 3.79666600e-02 -6.51547500e-05 5.25521360e-08 -1.62000510e-11 -1.14788970e+05 -1.88740350e+00 ); // Check heat capacities + Hf -1.18307e+07; + Cp 684.246; } transport { diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesisSurface/constant/thermophysicalProperties.particles b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesisSurface/constant/thermophysicalProperties.particles index 1c625e0c80..1673e35ccc 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesisSurface/constant/thermophysicalProperties.particles +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/titaniaSynthesisSurface/constant/thermophysicalProperties.particles @@ -20,7 +20,7 @@ thermoType type heRhoThermo; mixture multiComponentMixture; transport const; - thermo janaf; + thermo hConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; @@ -42,11 +42,8 @@ TiO2 } thermodynamics { - Tlow 280; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 6.84891510e+00 4.24634610e-03 -3.00889840e-06 1.06025190e-09 -1.43795970e-13 -1.15992460e+05 -3.45141060e+01 ); - lowCpCoeffs ( -1.61175170e-01 3.79666600e-02 -6.51547500e-05 5.25521360e-08 -1.62000510e-11 -1.14788970e+05 -1.88740350e+00 ); // Check heat capacities + Hf -1.18307e+07; + Cp 684.246; } transport {