From 3c0e9e62f3e1db2d3ed3c00673396aec831237c0 Mon Sep 17 00:00:00 2001 From: graham Date: Tue, 28 Apr 2009 13:17:37 +0100 Subject: [PATCH 01/74] Added free stream velocity components to tangential velocities. --- .../dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index cd18d9064d..9d791a1ed3 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -367,6 +367,8 @@ void Foam::FreeStream::inflow() rndGen.GaussNormal()*t1 + rndGen.GaussNormal()*t2 ) + + (t1 & faceVelocity)*t1 + + (t2 & faceVelocity)*t2 + mostProbableSpeed*uNormal*n; scalar Ei = cloud.equipartitionInternalEnergy From 5554300fb99f4b96339c18a371900625f1d29129 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 18:02:15 +0100 Subject: [PATCH 02/74] restructuring - psi and rho thermo packages --- .../basic/basicThermo/basicThermo.C | 226 ++++++++++-- .../basic/basicThermo/basicThermo.H | 216 ++++------- .../basic/basicThermo/makeBasicThermo.H | 9 +- .../basic/basicThermo/newBasicThermo.C | 20 +- .../mixtures/basicMixture/basicMixture.C | 2 - .../mixtures/basicMixture/basicMixture.H | 7 +- .../mixtures/basicMixture/basicMixtures.C | 2 +- .../psiThermo/basicPsiThermo/basicPsiThermo.C | 51 +++ .../psiThermo/basicPsiThermo/basicPsiThermo.H | 99 +++++ .../ePsiThermo/ePsiThermo.C} | 178 ++++----- .../ePsiThermo/ePsiThermo.H} | 30 +- .../ePsiThermo/ePsiThermos.C} | 13 +- .../hPsiThermo/hPsiThermo.C} | 179 ++++----- .../basic/psiThermo/hPsiThermo/hPsiThermo.H | 178 +++++++++ .../hPsiThermo/hPsiThermos.C} | 15 +- .../basic/rhoThermo/.directory | 5 + .../rhoThermo/basicRhoThermo/basicRhoThermo.C | 72 ++++ .../rhoThermo/basicRhoThermo/basicRhoThermo.H | 103 ++++++ .../basicRhoThermo/basicRhoThermos.C} | 2 +- .../basic/rhoThermo/hRhoThermo/hRhoThermo.C | 346 ++++++++++++++++++ .../hRhoThermo/hRhoThermo.H} | 30 +- .../basic/rhoThermo/hRhoThermo/hRhoThermos.C | 83 +++++ .../chemistryModel/chemistryModel.H | 22 +- .../combustion/Make/files | 33 -- .../reactionThermo/Make/files | 21 ++ .../Make/options | 0 .../chemistryReader/chemistryReader.C | 0 .../chemistryReader/chemistryReader.H | 0 .../chemkinReader/chemkinLexer.L | 0 .../chemkinReader/chemkinReader.C | 0 .../chemkinReader/chemkinReader.H | 0 .../foamChemistryReader/foamChemistryReader.C | 0 .../foamChemistryReader/foamChemistryReader.H | 0 .../hCombustionThermo/hCombustionThermo.C | 20 +- .../hCombustionThermo/hCombustionThermo.H | 42 +-- .../hCombustionThermo/hCombustionThermos.C | 29 +- .../hCombustionThermo/makeCombustionThermo.H | 35 +- .../hCombustionThermo/newhCombustionThermo.C | 24 +- .../hhuCombustionThermo/hhuCombustionThermo.C | 0 .../hhuCombustionThermo/hhuCombustionThermo.H | 0 .../hhuCombustionThermos.C | 0 .../newhhuCombustionThermo.C | 0 .../hMixtureThermo/hMixtureThermo.C | 0 .../hMixtureThermo/hMixtureThermo.H | 11 +- .../hhuMixtureThermo/hhuMixtureThermo.C | 0 .../hhuMixtureThermo/hhuMixtureThermo.H | 10 +- .../fixedUnburntEnthalpyFvPatchScalarField.C | 0 .../fixedUnburntEnthalpyFvPatchScalarField.H | 2 +- ...radientUnburntEnthalpyFvPatchScalarField.C | 0 ...radientUnburntEnthalpyFvPatchScalarField.H | 2 +- .../mixedUnburntEnthalpyFvPatchScalarField.C | 0 .../mixedUnburntEnthalpyFvPatchScalarField.H | 2 +- .../basicMultiComponentMixture.C} | 28 +- .../basicMultiComponentMixture.H} | 82 ++--- .../basicMultiComponentMixtureI.H | 103 ++++++ .../mixtures/dieselMixture/dieselMixture.C | 25 +- .../mixtures/dieselMixture/dieselMixture.H | 13 +- .../mixtures/egrMixture/egrMixture.C | 30 +- .../mixtures/egrMixture/egrMixture.H | 13 +- .../homogeneousMixture/homogeneousMixture.C | 27 +- .../homogeneousMixture/homogeneousMixture.H | 13 +- .../inhomogeneousMixture.C | 25 +- .../inhomogeneousMixture.H | 13 +- .../multiComponentMixture.C | 58 +-- .../multiComponentMixture.H | 13 +- .../reactingMixture/reactingMixture.C | 13 +- .../reactingMixture/reactingMixture.H | 9 +- .../veryInhomogeneousMixture.C | 27 +- .../veryInhomogeneousMixture.H | 13 +- 69 files changed, 1850 insertions(+), 774 deletions(-) create mode 100644 src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C create mode 100644 src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H rename src/thermophysicalModels/basic/{eThermo/eThermo.C => psiThermo/ePsiThermo/ePsiThermo.C} (72%) rename src/thermophysicalModels/basic/{eThermo/eThermo.H => psiThermo/ePsiThermo/ePsiThermo.H} (89%) rename src/thermophysicalModels/basic/{hThermo/hThermos.C => psiThermo/ePsiThermo/ePsiThermos.C} (93%) rename src/thermophysicalModels/basic/{hThermo/hThermo.C => psiThermo/hPsiThermo/hPsiThermo.C} (73%) create mode 100644 src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H rename src/thermophysicalModels/basic/{eThermo/eThermos.C => psiThermo/hPsiThermo/hPsiThermos.C} (90%) create mode 100644 src/thermophysicalModels/basic/rhoThermo/.directory create mode 100644 src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C create mode 100644 src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H rename src/thermophysicalModels/basic/{basicThermo/basicThermos.C => rhoThermo/basicRhoThermo/basicRhoThermos.C} (96%) create mode 100644 src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C rename src/thermophysicalModels/basic/{hThermo/hThermo.H => rhoThermo/hRhoThermo/hRhoThermo.H} (89%) create mode 100644 src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C delete mode 100644 src/thermophysicalModels/combustion/Make/files create mode 100644 src/thermophysicalModels/reactionThermo/Make/files rename src/thermophysicalModels/{combustion => reactionThermo}/Make/options (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/chemistryReader/chemistryReader.C (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/chemistryReader/chemistryReader.H (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/chemkinReader/chemkinLexer.L (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/chemkinReader/chemkinReader.C (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/chemkinReader/chemkinReader.H (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/foamChemistryReader/foamChemistryReader.C (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/chemistryReaders/foamChemistryReader/foamChemistryReader.H (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hCombustionThermo/hCombustionThermo.C (81%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hCombustionThermo/hCombustionThermo.H (80%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hCombustionThermo/hCombustionThermos.C (89%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hCombustionThermo/makeCombustionThermo.H (59%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hCombustionThermo/newhCombustionThermo.C (81%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hhuCombustionThermo/hhuCombustionThermo.C (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hhuCombustionThermo/hhuCombustionThermo.H (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hhuCombustionThermo/hhuCombustionThermos.C (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/hhuCombustionThermo/newhhuCombustionThermo.C (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H (92%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C (100%) rename src/thermophysicalModels/{ => reactionThermo}/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H (93%) rename src/thermophysicalModels/{combustion => reactionThermo}/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H (98%) rename src/thermophysicalModels/{combustion => reactionThermo}/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H (98%) rename src/thermophysicalModels/{combustion => reactionThermo}/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C (100%) rename src/thermophysicalModels/{combustion => reactionThermo}/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H (98%) rename src/thermophysicalModels/{combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C => reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C} (88%) rename src/thermophysicalModels/{combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H => reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H} (66%) create mode 100644 src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/dieselMixture/dieselMixture.C (83%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/dieselMixture/dieselMixture.H (95%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/egrMixture/egrMixture.C (84%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/egrMixture/egrMixture.H (96%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/homogeneousMixture/homogeneousMixture.C (80%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/homogeneousMixture/homogeneousMixture.H (94%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/inhomogeneousMixture/inhomogeneousMixture.C (83%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/inhomogeneousMixture/inhomogeneousMixture.H (95%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/multiComponentMixture/multiComponentMixture.C (73%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/multiComponentMixture/multiComponentMixture.H (95%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/reactingMixture/reactingMixture.C (87%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/reactingMixture/reactingMixture.H (95%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C (82%) rename src/thermophysicalModels/{combustion/mixtureThermos => reactionThermo}/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H (95%) diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 14d2e23592..2339d34f89 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -35,20 +35,17 @@ License #include "gradientInternalEnergyFvPatchScalarField.H" #include "mixedInternalEnergyFvPatchScalarField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ namespace Foam { - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -defineTypeNameAndDebug(basicThermo, 0); -defineRunTimeSelectionTable(basicThermo, fvMesh); - + defineTypeNameAndDebug(basicThermo, 0); + defineRunTimeSelectionTable(basicThermo, fvMesh); +} // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -wordList basicThermo::hBoundaryTypes() +Foam::wordList Foam::basicThermo::hBoundaryTypes() { const volScalarField::GeometricBoundaryField& tbf = T_.boundaryField(); @@ -77,7 +74,8 @@ wordList basicThermo::hBoundaryTypes() return hbt; } -void basicThermo::hBoundaryCorrection(volScalarField& h) + +void Foam::basicThermo::hBoundaryCorrection(volScalarField& h) { volScalarField::GeometricBoundaryField& hbf = h.boundaryField(); @@ -96,7 +94,8 @@ void basicThermo::hBoundaryCorrection(volScalarField& h) } } -wordList basicThermo::eBoundaryTypes() + +Foam::wordList Foam::basicThermo::eBoundaryTypes() { const volScalarField::GeometricBoundaryField& tbf = T_.boundaryField(); @@ -125,7 +124,8 @@ wordList basicThermo::eBoundaryTypes() return ebt; } -void basicThermo::eBoundaryCorrection(volScalarField& e) + +void Foam::basicThermo::eBoundaryCorrection(volScalarField& e) { volScalarField::GeometricBoundaryField& ebf = e.boundaryField(); @@ -146,7 +146,7 @@ void basicThermo::eBoundaryCorrection(volScalarField& e) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -basicThermo::basicThermo(const fvMesh& mesh) +Foam::basicThermo::basicThermo(const fvMesh& mesh) : IOdictionary ( @@ -173,19 +173,6 @@ basicThermo::basicThermo(const fvMesh& mesh) mesh ), - T_ - ( - IOobject - ( - "T", - mesh.time().timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ), - psi_ ( IOobject @@ -200,6 +187,19 @@ basicThermo::basicThermo(const fvMesh& mesh) dimensionSet(0, -2, 2, 0, 0) ), + T_ + ( + IOobject + ( + "T", + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ), + mu_ ( IOobject @@ -232,20 +232,184 @@ basicThermo::basicThermo(const fvMesh& mesh) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -basicThermo::~basicThermo() +Foam::basicThermo::~basicThermo() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool basicThermo::read() +Foam::volScalarField& Foam::basicThermo::p() +{ + return p_; +} + + +const Foam::volScalarField& Foam::basicThermo::p() const +{ + return p_; +} + + +const Foam::volScalarField& Foam::basicThermo::psi() const +{ + return psi_; +} + + +Foam::volScalarField& Foam::basicThermo::h() +{ + notImplemented("basicThermo::h()"); + return const_cast(volScalarField::null()); +} + + +const Foam::volScalarField& Foam::basicThermo::h() const +{ + notImplemented("basicThermo::h() const"); + return volScalarField::null(); +} + + +Foam::tmp Foam::basicThermo::h +( + const scalarField& T, + const labelList& cells +) const +{ + notImplemented + ( + "basicThermo::h" + "(const scalarField& T, const labelList& cells) const" + ); + return tmp(NULL); +} + + +Foam::tmp Foam::basicThermo::h +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::h" + "(const scalarField& T, const label patchi) const" + ); + return tmp(NULL); +} + + +Foam::volScalarField& Foam::basicThermo::e() +{ + notImplemented("basicThermo::e()"); + return const_cast(volScalarField::null()); +} + + +const Foam::volScalarField& Foam::basicThermo::e() const +{ + notImplemented("basicThermo::e()"); + return volScalarField::null(); +} + + +Foam::tmp Foam::basicThermo::e +( + const scalarField& T, + const labelList& cells +) const +{ + notImplemented + ( + "basicThermo::e" + "(const scalarField& T, const labelList& cells) const" + ); + return tmp(NULL); +} + + +Foam::tmp Foam::basicThermo::e +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::e" + "(const scalarField& T, const label patchi) const" + ); + return tmp(NULL); +} + + +const Foam::volScalarField& Foam::basicThermo::T() const +{ + return T_; +} + + +Foam::tmp Foam::basicThermo::Cp +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::Cp" + "(const scalarField& T, const label patchi) const" + ); + return tmp(NULL); +} + + +Foam::tmp Foam::basicThermo::Cp() const +{ + notImplemented("basicThermo::Cp() const"); + return volScalarField::null(); +} + + +Foam::tmp Foam::basicThermo::Cv +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::Cv" + "(const scalarField& T, const label patchi) const" + ); + return tmp(NULL); +} + + +Foam::tmp Foam::basicThermo::Cv() const +{ + notImplemented("basicThermo::Cv() const"); + return volScalarField::null(); +} + + +const Foam::volScalarField& Foam::basicThermo::mu() const +{ + return mu_; +} + + +const Foam::volScalarField& Foam::basicThermo::alpha() const +{ + return alpha_; +} + + +bool Foam::basicThermo::read() { return regIOobject::read(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 4b316fc1c9..0c4a042312 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -49,7 +49,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class basicThermo Declaration + Class basicThermo Declaration \*---------------------------------------------------------------------------*/ class basicThermo @@ -61,21 +61,45 @@ protected: // Protected data - volScalarField p_; - volScalarField T_; - volScalarField psi_; + // Fields - volScalarField mu_; - volScalarField alpha_; + //- Pressure [Pa] + volScalarField p_; + + //- Compressibility [s^2/m^2] + volScalarField psi_; + + //- Temperature [K] + volScalarField T_; + + //- Laminar dynamic viscosity [kg/m/s] + volScalarField mu_; + + //- Laminar thermal diffusuvity [kg/m/s] + volScalarField alpha_; // Protected member functions - wordList hBoundaryTypes(); - void hBoundaryCorrection(volScalarField& h); + // Enthalpy + + //- Return the enthalpy field boundary types by interrogating the + // temperature field boundary types + wordList hBoundaryTypes(); + + //- Correct the enthalpy field boundaries + void hBoundaryCorrection(volScalarField& h); + + + // Internal energy + + //- Return the internal energy field boundary types by + // interrogating the temperature field boundary types + wordList eBoundaryTypes(); + + //- Correct the internal energy field boundaries + void eBoundaryCorrection(volScalarField& e); - wordList eBoundaryTypes(); - void eBoundaryCorrection(volScalarField& e); //- Construct as copy (not implemented) basicThermo(const basicThermo&); @@ -87,16 +111,15 @@ public: TypeName("basicThermo"); - // Declare run-time constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - basicThermo, - fvMesh, - (const fvMesh& mesh), - (mesh) - ); + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + basicThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); // Constructors @@ -105,9 +128,8 @@ public: basicThermo(const fvMesh&); - // Selectors - - static autoPtr New(const fvMesh&); + //- Selector + static autoPtr New(const fvMesh&); //- Destructor @@ -120,193 +142,101 @@ public: virtual void correct() = 0; - // Access to thermodynamic state variables. + // Access to thermodynamic state variables //- Pressure [Pa] // Non-const access allowed for transport equations - virtual volScalarField& p() - { - return p_; - } + virtual volScalarField& p(); //- Pressure [Pa] - virtual const volScalarField& p() const - { - return p_; - } + virtual const volScalarField& p() const; + + //- Density [kg/m^3] + virtual tmp rho() const = 0; + + //- Compressibility [s^2/m^2] + virtual const volScalarField& psi() const; //- Enthalpy [J/kg] // Non-const access allowed for transport equations - virtual volScalarField& h() - { - notImplemented("basicThermo::h()"); - return const_cast(volScalarField::null()); - } + virtual volScalarField& h(); //- Enthalpy [J/kg] - virtual const volScalarField& h() const - { - notImplemented("basicThermo::h() const"); - return volScalarField::null(); - } + virtual const volScalarField& h() const; //- Enthalpy for cell-set [J/kg] virtual tmp h ( const scalarField& T, const labelList& cells - ) const - { - notImplemented - ( - "basicThermo::h" - "(const scalarField& T, const labelList& cells) const" - ); - return tmp(NULL); - } + ) const; //- Enthalpy for patch [J/kg] virtual tmp h ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::h" - "(const scalarField& T, const label patchi) const" - ); - return tmp(NULL); - } + ) const; //- Internal energy [J/kg] // Non-const access allowed for transport equations - virtual volScalarField& e() - { - notImplemented("basicThermo::e()"); - return const_cast(volScalarField::null()); - } + virtual volScalarField& e(); //- Internal energy [J/kg] - virtual const volScalarField& e() const - { - notImplemented("basicThermo::e()"); - return volScalarField::null(); - } + virtual const volScalarField& e() const; //- Internal energy for cell-set [J/kg] virtual tmp e ( const scalarField& T, const labelList& cells - ) const - { - notImplemented - ( - "basicThermo::e" - "(const scalarField& T, const labelList& cells) const" - ); - return tmp(NULL); - } + ) const; //-Internal energy for patch [J/kg] virtual tmp e ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::e" - "(const scalarField& T, const label patchi) const" - ); - return tmp(NULL); - } + ) const; + // Fields derived from thermodynamic state variables //- Temperature [K] - virtual const volScalarField& T() const - { - return T_; - } - - //- Density [kg/m^3] - virtual tmp rho() const - { - return p_*psi(); - } - - //- Compressibility [s^2/m^2] - virtual const volScalarField& psi() const - { - return psi_; - } + virtual const volScalarField& T() const; //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::Cp" - "(const scalarField& T, const label patchi) const" - ); - return tmp(NULL); - } + ) const; //- Heat capacity at constant pressure [J/kg/K] - virtual tmp Cp() const - { - notImplemented("basicThermo::Cp() const"); - return volScalarField::null(); - } + virtual tmp Cp() const; //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp Cv ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::Cv" - "(const scalarField& T, const label patchi) const" - ); - return tmp(NULL); - } + ) const; //- Heat capacity at constant volume [J/kg/K] - virtual tmp Cv() const - { - notImplemented("basicThermo::Cv() const"); - return volScalarField::null(); - } + virtual tmp Cv() const; // Access to transport state variables - //- Dynamic viscosity of mixture [kg/ms] - virtual const volScalarField& mu() const - { - return mu_; - } + //- Dynamic viscosity of mixture [kg/m/s] + virtual const volScalarField& mu() const; - //- Thermal diffusivity for enthalpy of mixture [kg/ms] - virtual const volScalarField& alpha() const - { - return alpha_; - } + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual const volScalarField& alpha() const; //- Read thermophysicalProperties dictionary - virtual bool read() = 0; + virtual bool read(); }; diff --git a/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H b/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H index 59165247a4..847ea8aa16 100644 --- a/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H @@ -26,6 +26,7 @@ InClass Foam::basicThermo Description + Macros for creating 'basic' thermo packages \*---------------------------------------------------------------------------*/ @@ -33,6 +34,7 @@ Description #define makeBasicThermo_H #include "basicThermo.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,9 +44,12 @@ typedef Cthermo > > > > \ Cthermo##Mixture##Transport##Thermo##EqnOfState; \ \ defineTemplateTypeNameAndDebugWithName \ - (Cthermo##Mixture##Transport##Thermo##EqnOfState, \ +( \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ #Cthermo \ - "<"#Mixture"<"#Transport">>>>", 0); \ + "<"#Mixture"<"#Transport">>>>", \ + 0 \ +); \ \ addToRunTimeSelectionTable \ ( \ diff --git a/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C b/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C index 3ff6bc9dd1..84b9724790 100644 --- a/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for internal energy based thermodynamics package. + Selection function for 'basic' thermodynamics package. \*---------------------------------------------------------------------------*/ @@ -32,12 +32,7 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr basicThermo::New(const fvMesh& mesh) +Foam::autoPtr Foam::basicThermo::New(const fvMesh& mesh) { word basicThermoTypeName; @@ -68,10 +63,9 @@ autoPtr basicThermo::New(const fvMesh& mesh) if (cstrIter == fvMeshConstructorTablePtr_->end()) { FatalErrorIn("basicThermo::New(const fvMesh&)") - << "Unknown basicThermo type " << basicThermoTypeName - << endl << endl - << "Valid basicThermo types are :" << endl - << fvMeshConstructorTablePtr_->toc() + << "Unknown basicThermo type " << basicThermoTypeName << nl << nl + << "Valid basicThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } @@ -79,8 +73,4 @@ autoPtr basicThermo::New(const fvMesh& mesh) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C index bbe76c43ef..0167d9c4cb 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "error.H" diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H index d44f5483f9..a976184530 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H @@ -47,7 +47,7 @@ class fvMesh; class dictionary; /*---------------------------------------------------------------------------*\ - Class basicMixture Declaration + Class basicMixture Declaration \*---------------------------------------------------------------------------*/ class basicMixture @@ -65,9 +65,8 @@ public: basicMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~basicMixture(); + //- Destructor + virtual ~basicMixture(); }; diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C index c3bad32fc1..022263ecc3 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for internal energy based thermodynamics package. + Mixture instantiation \*---------------------------------------------------------------------------*/ diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C new file mode 100644 index 0000000000..0675043caf --- /dev/null +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicPsiThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(basicPsiThermo, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::basicPsiThermo::basicPsiThermo(const fvMesh& mesh) +: + basicThermo(mesh) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::basicPsiThermo::~basicPsiThermo() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H new file mode 100644 index 0000000000..f7a141e66e --- /dev/null +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::basicPsiThermo + +Description + Basic thermodynamic properties based in compressibility + +SourceFiles + basicRhoThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicPsiThermo_H +#define basicPsiThermo_H + +#include "basicThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicPsiThermo Declaration +\*---------------------------------------------------------------------------*/ + +class basicPsiThermo +: + public basicThermo +{ + +protected: + + // Protected member functions + + //- Construct as copy (not implemented) + basicPsiThermo(const basicPsiThermo&); + + +public: + + //- Runtime type information + TypeName("basicPsiThermo"); + + + // Constructors + + //- Construct from mesh + basicPsiThermo(const fvMesh&); + + + //- Destructor + virtual ~basicPsiThermo(); + + + // Member functions + + // Fields derived from thermodynamic state variables + + //- Density [kg/m^3] + virtual tmp rho() const + { + return p_*psi(); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/eThermo/eThermo.C b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.C similarity index 72% rename from src/thermophysicalModels/basic/eThermo/eThermo.C rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.C index 3c7562b978..789f35bed9 100644 --- a/src/thermophysicalModels/basic/eThermo/eThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.C @@ -24,72 +24,22 @@ License \*---------------------------------------------------------------------------*/ -#include "eThermo.H" +#include "ePsiThermo.H" #include "fvMesh.H" #include "fixedValueFvPatchFields.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::eThermo::eThermo(const fvMesh& mesh) -: - basicThermo(mesh), - MixtureType(*this, mesh), - - e_ - ( - IOobject - ( - "e", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(0, 2, -2, 0, 0), - eBoundaryTypes() - ) -{ - scalarField& eCells = e_.internalField(); - const scalarField& TCells = T_.internalField(); - - forAll(eCells, celli) - { - eCells[celli] = this->cellMixture(celli).E(TCells[celli]); - } - - forAll(e_.boundaryField(), patchi) - { - e_.boundaryField()[patchi] == e(T_.boundaryField()[patchi], patchi); - } - - eBoundaryCorrection(e_); - - calculate(); - psi_.oldTime(); // Switch on saving old time -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::eThermo::~eThermo() -{} - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::eThermo::calculate() +void Foam::ePsiThermo::calculate() { const scalarField& eCells = e_.internalField(); - const scalarField& pCells = p_.internalField(); + const scalarField& pCells = this->p_.internalField(); - scalarField& TCells = T_.internalField(); - scalarField& psiCells = psi_.internalField(); - scalarField& muCells = mu_.internalField(); - scalarField& alphaCells = alpha_.internalField(); + scalarField& TCells = this->T_.internalField(); + scalarField& psiCells = this->psi_.internalField(); + scalarField& muCells = this->mu_.internalField(); + scalarField& alphaCells = this->alpha_.internalField(); forAll(TCells, celli) { @@ -103,16 +53,16 @@ void Foam::eThermo::calculate() alphaCells[celli] = mixture_.alpha(TCells[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - fvPatchScalarField& pp = p_.boundaryField()[patchi]; - fvPatchScalarField& pT = T_.boundaryField()[patchi]; - fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; + fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; fvPatchScalarField& pe = e_.boundaryField()[patchi]; - fvPatchScalarField& pmu = mu_.boundaryField()[patchi]; - fvPatchScalarField& palpha = alpha_.boundaryField()[patchi]; + fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; if (pT.fixesValue()) { @@ -146,30 +96,83 @@ void Foam::eThermo::calculate() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ePsiThermo::ePsiThermo(const fvMesh& mesh) +: + basicPsiThermo(mesh), + MixtureType(*this, mesh), + + e_ + ( + IOobject + ( + "e", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->eBoundaryTypes() + ) +{ + scalarField& eCells = e_.internalField(); + const scalarField& TCells = this->T_.internalField(); + + forAll(eCells, celli) + { + eCells[celli] = this->cellMixture(celli).E(TCells[celli]); + } + + forAll(e_.boundaryField(), patchi) + { + e_.boundaryField()[patchi] == + e(this->T_.boundaryField()[patchi], patchi); + } + + this->eBoundaryCorrection(e_); + + calculate(); + + // Switch on saving old time + this->psi_.oldTime(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ePsiThermo::~ePsiThermo() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::eThermo::correct() +void Foam::ePsiThermo::correct() { if (debug) { - Info<< "entering eThermo::correct()" << endl; + Info<< "entering ePsiThermo::correct()" << endl; } // force the saving of the old-time values - psi_.oldTime(); + this->psi_.oldTime(); calculate(); if (debug) { - Info<< "exiting eThermo::correct()" << endl; + Info<< "exiting ePsiThermo::correct()" << endl; } } template -Foam::tmp Foam::eThermo::e +Foam::tmp Foam::ePsiThermo::e ( const scalarField& T, const labelList& cells @@ -188,7 +191,7 @@ Foam::tmp Foam::eThermo::e template -Foam::tmp Foam::eThermo::e +Foam::tmp Foam::ePsiThermo::e ( const scalarField& T, const label patchi @@ -205,8 +208,9 @@ Foam::tmp Foam::eThermo::e return te; } + template -Foam::tmp Foam::eThermo::Cp +Foam::tmp Foam::ePsiThermo::Cp ( const scalarField& T, const label patchi @@ -223,10 +227,11 @@ Foam::tmp Foam::eThermo::Cp return tCp; } + template -Foam::tmp Foam::eThermo::Cp() const +Foam::tmp Foam::ePsiThermo::Cp() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp tCp ( @@ -242,20 +247,20 @@ Foam::tmp Foam::eThermo::Cp() const ), mesh, dimensionSet(0, 2, -2, -1, 0), - T_.boundaryField().types() + this->T_.boundaryField().types() ) ); volScalarField& cp = tCp(); - forAll(T_, celli) + forAll(this->T_, celli) { - cp[celli] = this->cellMixture(celli).Cp(T_[celli]); + cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - const fvPatchScalarField& pT = T_.boundaryField()[patchi]; + const fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; fvPatchScalarField& pCp = cp.boundaryField()[patchi]; forAll(pT, facei) @@ -269,7 +274,7 @@ Foam::tmp Foam::eThermo::Cp() const template -Foam::tmp Foam::eThermo::Cv +Foam::tmp Foam::ePsiThermo::Cv ( const scalarField& T, const label patchi @@ -288,9 +293,9 @@ Foam::tmp Foam::eThermo::Cv template -Foam::tmp Foam::eThermo::Cv() const +Foam::tmp Foam::ePsiThermo::Cv() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp tCv ( @@ -311,14 +316,15 @@ Foam::tmp Foam::eThermo::Cv() const volScalarField& cv = tCv(); - forAll(T_, celli) + forAll(this->T_, celli) { - cv[celli] = this->cellMixture(celli).Cv(T_[celli]); + cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - cv.boundaryField()[patchi] = Cv(T_.boundaryField()[patchi], patchi); + cv.boundaryField()[patchi] = + Cv(this->T_.boundaryField()[patchi], patchi); } return tCv; @@ -326,9 +332,9 @@ Foam::tmp Foam::eThermo::Cv() const template -bool Foam::eThermo::read() +bool Foam::ePsiThermo::read() { - if (basicThermo::read()) + if (basicPsiThermo::read()) { MixtureType::read(*this); return true; diff --git a/src/thermophysicalModels/basic/eThermo/eThermo.H b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.H similarity index 89% rename from src/thermophysicalModels/basic/eThermo/eThermo.H rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.H index b573ca4aa4..6952edc423 100644 --- a/src/thermophysicalModels/basic/eThermo/eThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.H @@ -23,20 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::eThermo + Foam::ePsiThermo Description - Internal energy for a mixture + Internal energy for a mixture based on compressibility SourceFiles - eThermo.C + ePsiThermo.C \*---------------------------------------------------------------------------*/ -#ifndef eThermo_H -#define eThermo_H +#ifndef ePsiThermo_H +#define ePsiThermo_H -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "basicMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,42 +45,44 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class eThermo Declaration + Class ePsiThermo Declaration \*---------------------------------------------------------------------------*/ template -class eThermo +class ePsiThermo : - public basicThermo, + public basicPsiThermo, public MixtureType { // Private data + //- Internal energy field volScalarField e_; // Private member functions + //- Calculate the thermo variables void calculate(); //- Construct as copy (not implemented) - eThermo(const eThermo&); + ePsiThermo(const ePsiThermo&); public: //- Runtime type information - TypeName("eThermo"); + TypeName("ePsiThermo"); // Constructors //- Construct from mese - eThermo(const fvMesh&); + ePsiThermo(const fvMesh&); //- Destructor - virtual ~eThermo(); + virtual ~ePsiThermo(); // Member functions @@ -166,7 +168,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #ifdef NoRepository -# include "eThermo.C" +# include "ePsiThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/hThermo/hThermos.C b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C similarity index 93% rename from src/thermophysicalModels/basic/hThermo/hThermos.C rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C index 0ed152ec5f..eded615214 100644 --- a/src/thermophysicalModels/basic/hThermo/hThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C @@ -27,9 +27,6 @@ Description \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "basicThermo.H" #include "makeBasicThermo.H" #include "perfectGas.H" @@ -41,11 +38,9 @@ Description #include "constTransport.H" #include "sutherlandTransport.H" -#include "hThermo.H" +#include "ePsiThermo.H" #include "pureMixture.H" -#include "addToRunTimeSelectionTable.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -56,7 +51,7 @@ namespace Foam makeBasicThermo ( - hThermo, + ePsiThermo, pureMixture, constTransport, hConstThermo, @@ -65,7 +60,7 @@ makeBasicThermo makeBasicThermo ( - hThermo, + ePsiThermo, pureMixture, sutherlandTransport, hConstThermo, @@ -74,7 +69,7 @@ makeBasicThermo makeBasicThermo ( - hThermo, + ePsiThermo, pureMixture, sutherlandTransport, janafThermo, diff --git a/src/thermophysicalModels/basic/hThermo/hThermo.C b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C similarity index 73% rename from src/thermophysicalModels/basic/hThermo/hThermo.C rename to src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C index 74e80601b9..ab85557cf4 100644 --- a/src/thermophysicalModels/basic/hThermo/hThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C @@ -24,72 +24,20 @@ License \*---------------------------------------------------------------------------*/ -#include "hThermo.H" -#include "fvMesh.H" -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::hThermo::hThermo(const fvMesh& mesh) -: - basicThermo(mesh), - MixtureType(*this, mesh), - - h_ - ( - IOobject - ( - "h", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(0, 2, -2, 0, 0), - hBoundaryTypes() - ) -{ - scalarField& hCells = h_.internalField(); - const scalarField& TCells = T_.internalField(); - - forAll(hCells, celli) - { - hCells[celli] = this->cellMixture(celli).H(TCells[celli]); - } - - forAll(h_.boundaryField(), patchi) - { - h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); - } - - hBoundaryCorrection(h_); - - calculate(); - psi_.oldTime(); // Switch on saving old time -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::hThermo::~hThermo() -{} - +#include "hPsiThermo.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::hThermo::calculate() +void Foam::hPsiThermo::calculate() { const scalarField& hCells = h_.internalField(); - const scalarField& pCells = p_.internalField(); + const scalarField& pCells = this->p_.internalField(); - scalarField& TCells = T_.internalField(); - scalarField& psiCells = psi_.internalField(); - scalarField& muCells = mu_.internalField(); - scalarField& alphaCells = alpha_.internalField(); + scalarField& TCells = this->T_.internalField(); + scalarField& psiCells = this->psi_.internalField(); + scalarField& muCells = this->mu_.internalField(); + scalarField& alphaCells = this->alpha_.internalField(); forAll(TCells, celli) { @@ -105,14 +53,14 @@ void Foam::hThermo::calculate() forAll(T_.boundaryField(), patchi) { - fvPatchScalarField& pp = p_.boundaryField()[patchi]; - fvPatchScalarField& pT = T_.boundaryField()[patchi]; - fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; + fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; fvPatchScalarField& ph = h_.boundaryField()[patchi]; - fvPatchScalarField& pmu = mu_.boundaryField()[patchi]; - fvPatchScalarField& palpha = alpha_.boundaryField()[patchi]; + fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; if (pT.fixesValue()) { @@ -146,30 +94,83 @@ void Foam::hThermo::calculate() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::hPsiThermo::hPsiThermo(const fvMesh& mesh) +: + basicPsiThermo(mesh), + MixtureType(*this, mesh), + + h_ + ( + IOobject + ( + "h", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->hBoundaryTypes() + ) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = this->T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == + h(this->T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); + + // Switch on saving old time + this->psi_.oldTime(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::hPsiThermo::~hPsiThermo() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::hThermo::correct() +void Foam::hPsiThermo::correct() { if (debug) { - Info<< "entering hThermo::correct()" << endl; + Info<< "entering hPsiThermo::correct()" << endl; } // force the saving of the old-time values - psi_.oldTime(); + this->psi_.oldTime(); calculate(); if (debug) { - Info<< "exiting hThermo::correct()" << endl; + Info<< "exiting hPsiThermo::correct()" << endl; } } template -Foam::tmp Foam::hThermo::h +Foam::tmp Foam::hPsiThermo::h ( const scalarField& T, const labelList& cells @@ -188,7 +189,7 @@ Foam::tmp Foam::hThermo::h template -Foam::tmp Foam::hThermo::h +Foam::tmp Foam::hPsiThermo::h ( const scalarField& T, const label patchi @@ -205,8 +206,9 @@ Foam::tmp Foam::hThermo::h return th; } + template -Foam::tmp Foam::hThermo::Cp +Foam::tmp Foam::hPsiThermo::Cp ( const scalarField& T, const label patchi @@ -223,10 +225,11 @@ Foam::tmp Foam::hThermo::Cp return tCp; } + template -Foam::tmp Foam::hThermo::Cp() const +Foam::tmp Foam::hPsiThermo::Cp() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp tCp ( @@ -242,20 +245,20 @@ Foam::tmp Foam::hThermo::Cp() const ), mesh, dimensionSet(0, 2, -2, -1, 0), - T_.boundaryField().types() + this->T_.boundaryField().types() ) ); volScalarField& cp = tCp(); - forAll(T_, celli) + forAll(this->T_, celli) { - cp[celli] = this->cellMixture(celli).Cp(T_[celli]); + cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - const fvPatchScalarField& pT = T_.boundaryField()[patchi]; + const fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; fvPatchScalarField& pCp = cp.boundaryField()[patchi]; forAll(pT, facei) @@ -269,7 +272,7 @@ Foam::tmp Foam::hThermo::Cp() const template -Foam::tmp Foam::hThermo::Cv +Foam::tmp Foam::hPsiThermo::Cv ( const scalarField& T, const label patchi @@ -288,9 +291,9 @@ Foam::tmp Foam::hThermo::Cv template -Foam::tmp Foam::hThermo::Cv() const +Foam::tmp Foam::hPsiThermo::Cv() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp tCv ( @@ -311,23 +314,25 @@ Foam::tmp Foam::hThermo::Cv() const volScalarField& cv = tCv(); - forAll(T_, celli) + forAll(this->T_, celli) { - cv[celli] = this->cellMixture(celli).Cv(T_[celli]); + cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - cv.boundaryField()[patchi] = Cv(T_.boundaryField()[patchi], patchi); + cv.boundaryField()[patchi] = + Cv(this->T_.boundaryField()[patchi], patchi); } return tCv; } + template -bool Foam::hThermo::read() +bool Foam::hPsiThermo::read() { - if (basicThermo::read()) + if (basicPsiThermo::read()) { MixtureType::read(*this); return true; diff --git a/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H new file mode 100644 index 0000000000..c1d9b513a3 --- /dev/null +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::hPsiThermo + +Description + Enthalpy for a mixture based on compressibility + +SourceFiles + hPsiThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hPsiThermo_H +#define hPsiThermo_H + +#include "basicPsiThermo.H" +#include "basicMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hPsiThermo Declaration +\*---------------------------------------------------------------------------*/ + +template +class hPsiThermo +: + public basicPsiThermo, + public MixtureType +{ + // Private data + + //- Enthalpy field + volScalarField h_; + + + // Private member functions + + //- Calculate the thermo variables + void calculate(); + + //- Construct as copy (not implemented) + hPsiThermo(const hPsiThermo&); + + +public: + + //- Runtime type information + TypeName("hPsiThermo"); + + + // Constructors + + //- Construct from mesh + hPsiThermo(const fvMesh&); + + + //- Destructor + virtual ~hPsiThermo(); + + + // Member functions + + //- Return the compostion of the combustion mixture + virtual basicMixture& composition() + { + return *this; + } + + //- Return the compostion of the combustion mixture + virtual const basicMixture& composition() const + { + return *this; + } + + //- Update properties + virtual void correct(); + + + // Access to thermodynamic state variables + + //- Enthalpy [J/kg] + // Non-const access allowed for transport equations + virtual volScalarField& h() + { + return h_; + } + + //- Enthalpy [J/kg] + virtual const volScalarField& h() const + { + return h_; + } + + + // Fields derived from thermodynamic state variables + + //- Enthalpy for cell-set [J/kg] + virtual tmp h + ( + const scalarField& T, + const labelList& cells + ) const; + + //- Enthalpy for patch [J/kg] + virtual tmp h + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure for patch [J/kg/K] + virtual tmp Cp + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure [J/kg/K] + virtual tmp Cp() const; + + //- Heat capacity at constant volume for patch [J/kg/K] + virtual tmp Cv + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant volume [J/kg/K] + virtual tmp Cv() const; + + + //- Read thermophysicalProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +#ifdef NoRepository +# include "hPsiThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/eThermo/eThermos.C b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C similarity index 90% rename from src/thermophysicalModels/basic/eThermo/eThermos.C rename to src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C index b34bd9ce01..78dba26e9b 100644 --- a/src/thermophysicalModels/basic/eThermo/eThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C @@ -23,13 +23,10 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for internal energy based thermodynamics package. + Selection function for enthalpy based thermodynamics package. \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "basicThermo.H" #include "makeBasicThermo.H" #include "perfectGas.H" @@ -41,11 +38,9 @@ Description #include "constTransport.H" #include "sutherlandTransport.H" -#include "eThermo.H" +#include "hPsiThermo.H" #include "pureMixture.H" -#include "addToRunTimeSelectionTable.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -56,7 +51,7 @@ namespace Foam makeBasicThermo ( - eThermo, + hPsiThermo, pureMixture, constTransport, hConstThermo, @@ -65,7 +60,7 @@ makeBasicThermo makeBasicThermo ( - eThermo, + hPsiThermo, pureMixture, sutherlandTransport, hConstThermo, @@ -74,7 +69,7 @@ makeBasicThermo makeBasicThermo ( - eThermo, + hPsiThermo, pureMixture, sutherlandTransport, janafThermo, diff --git a/src/thermophysicalModels/basic/rhoThermo/.directory b/src/thermophysicalModels/basic/rhoThermo/.directory new file mode 100644 index 0000000000..72608b79a0 --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/.directory @@ -0,0 +1,5 @@ +[Dolphin] +AdditionalInfo=3 +SortOrder=0 +Timestamp=2009,6,10,15,58,20 +ViewMode=1 diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C new file mode 100644 index 0000000000..4b1cdd5062 --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicRhoThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(basicRhoThermo, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::basicRhoThermo::basicRhoThermo(const fvMesh& mesh) +: + basicThermo(mesh), + rho_ + ( + IOobject + ( + "rhoThermo", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimDensity + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::basicRhoThermo::~basicRhoThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::basicRhoThermo::rho() const +{ + return rho_; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H new file mode 100644 index 0000000000..68645c4ffd --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::basicRhoThermo + +Description + Basic thermodynamic properties based in density + +SourceFiles + basicRhoThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicRhoThermo_H +#define basicRhoThermo_H + +#include "basicThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicRhoThermo Declaration +\*---------------------------------------------------------------------------*/ + +class basicRhoThermo +: + public basicThermo +{ + +protected: + + // Protected data + + //- Density field [kg/m^3] + // Named 'rhoThermo' to avoid (potential) conflict with solver density + volScalarField rho_; + + + // Protected member functions + + //- Construct as copy (not implemented) + basicRhoThermo(const basicRhoThermo&); + + +public: + + //- Runtime type information + TypeName("basicRhoThermo"); + + + // Constructors + + //- Construct from mesh + basicRhoThermo(const fvMesh&); + + + //- Destructor + virtual ~basicRhoThermo(); + + + // Member functions + + // Fields derived from thermodynamic state variables + + //- Density [kg/m^3] + virtual tmp rho() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermos.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermos.C similarity index 96% rename from src/thermophysicalModels/basic/basicThermo/basicThermos.C rename to src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermos.C index 7a837bcc9b..2407a9490d 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermos.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for internal energy based thermodynamics package. + Selection function for enthalpy based thermodynamics package. \*---------------------------------------------------------------------------*/ diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C new file mode 100644 index 0000000000..ce3486fa15 --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C @@ -0,0 +1,346 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hRhoThermo.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::hRhoThermo::calculate() +{ + const scalarField& hCells = this->h_.internalField(); + const scalarField& pCells = this->p_.internalField(); + + scalarField& TCells = this->T_.internalField(); + scalarField& psiCells = this->psi_.internalField(); + scalarField& rhoCells = this->rho_.internalField(); + scalarField& muCells = this->mu_.internalField(); + scalarField& alphaCells = this->alpha_.internalField(); + + forAll(TCells, celli) + { + const typename MixtureType::thermoType& mixture_ = + this->cellMixture(celli); + + TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); + psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); + rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); + + muCells[celli] = mixture_.mu(TCells[celli]); + alphaCells[celli] = mixture_.alpha(TCells[celli]); + } + + forAll(this->T_.boundaryField(), patchi) + { + fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; + fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; + fvPatchScalarField& prho = this->rho_.boundaryField()[patchi]; + + fvPatchScalarField& ph = this->h_.boundaryField()[patchi]; + + fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; + + if (pT.fixesValue()) + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + ph[facei] = mixture_.H(pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu[facei] = mixture_.mu(pT[facei]); + palpha[facei] = mixture_.alpha(pT[facei]); + } + } + else + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + pT[facei] = mixture_.TH(ph[facei], pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu[facei] = mixture_.mu(pT[facei]); + palpha[facei] = mixture_.alpha(pT[facei]); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::hRhoThermo::hRhoThermo(const fvMesh& mesh) +: + basicRhoThermo(mesh), + MixtureType(*this, mesh), + + h_ + ( + IOobject + ( + "h", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->hBoundaryTypes() + ) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = this->T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == + h(this->T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::hRhoThermo::~hRhoThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::hRhoThermo::correct() +{ + if (debug) + { + Info<< "entering hRhoThermo::correct()" << endl; + } + + calculate(); + + if (debug) + { + Info<< "exiting hRhoThermo::correct()" << endl; + } +} + + +template +Foam::tmp Foam::hRhoThermo::h +( + const scalarField& T, + const labelList& cells +) const +{ + tmp th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, celli) + { + h[celli] = this->cellMixture(cells[celli]).H(T[celli]); + } + + return th; +} + + +template +Foam::tmp Foam::hRhoThermo::h +( + const scalarField& T, + const label patchi +) const +{ + tmp th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, facei) + { + h[facei] = this->patchFaceMixture(patchi, facei).H(T[facei]); + } + + return th; +} + + +template +Foam::tmp Foam::hRhoThermo::Cp +( + const scalarField& T, + const label patchi +) const +{ + tmp tCp(new scalarField(T.size())); + scalarField& cp = tCp(); + + forAll(T, facei) + { + cp[facei] = this->patchFaceMixture(patchi, facei).Cp(T[facei]); + } + + return tCp; +} + + +template +Foam::tmp Foam::hRhoThermo::Cp() const +{ + const fvMesh& mesh = this->T_.mesh(); + + tmp tCp + ( + new volScalarField + ( + IOobject + ( + "Cp", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, -1, 0), + this->T_.boundaryField().types() + ) + ); + + volScalarField& cp = tCp(); + + forAll(this->T_, celli) + { + cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]); + } + + forAll(this->T_.boundaryField(), patchi) + { + const fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& pCp = cp.boundaryField()[patchi]; + + forAll(pT, facei) + { + pCp[facei] = this->patchFaceMixture(patchi, facei).Cp(pT[facei]); + } + } + + return tCp; +} + + +template +Foam::tmp Foam::hRhoThermo::Cv +( + const scalarField& T, + const label patchi +) const +{ + tmp tCv(new scalarField(T.size())); + scalarField& cv = tCv(); + + forAll(T, facei) + { + cv[facei] = this->patchFaceMixture(patchi, facei).Cv(T[facei]); + } + + return tCv; +} + + +template +Foam::tmp Foam::hRhoThermo::Cv() const +{ + const fvMesh& mesh = this->T_.mesh(); + + tmp tCv + ( + new volScalarField + ( + IOobject + ( + "Cv", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, -1, 0) + ) + ); + + volScalarField& cv = tCv(); + + forAll(this->T_, celli) + { + cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]); + } + + forAll(this->T_.boundaryField(), patchi) + { + cv.boundaryField()[patchi] = + Cv(this->T_.boundaryField()[patchi], patchi); + } + + return tCv; +} + + +template +bool Foam::hRhoThermo::read() +{ + if (basicRhoThermo::read()) + { + MixtureType::read(*this); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/hThermo/hThermo.H b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H similarity index 89% rename from src/thermophysicalModels/basic/hThermo/hThermo.H rename to src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H index ead0088a7c..a83a241c26 100644 --- a/src/thermophysicalModels/basic/hThermo/hThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H @@ -23,20 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::hThermo + Foam::hPsiThermo Description - Enthalpy for a mixture + Enthalpy for a mixture based on density SourceFiles - hThermo.C + hRhoThermo.C \*---------------------------------------------------------------------------*/ -#ifndef hThermo_H -#define hThermo_H +#ifndef hRhoThermo_H +#define hRhoThermo_H -#include "basicThermo.H" +#include "basicRhoThermo.H" #include "basicMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,42 +45,44 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hThermo Declaration + Class hRhoThermo Declaration \*---------------------------------------------------------------------------*/ template -class hThermo +class hRhoThermo : - public basicThermo, + public basicRhoThermo, public MixtureType { // Private data + //- Enthalpy field volScalarField h_; // Private member functions + //- Calculate the thermo variables void calculate(); //- Construct as copy (not implemented) - hThermo(const hThermo&); + hRhoThermo(const hRhoThermo&); public: //- Runtime type information - TypeName("hThermo"); + TypeName("hRhoThermo"); // Constructors //- Construct from mesh - hThermo(const fvMesh&); + hRhoThermo(const fvMesh&); //- Destructor - virtual ~hThermo(); + virtual ~hRhoThermo(); // Member functions @@ -166,7 +168,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #ifdef NoRepository -# include "hThermo.C" +# include "hRhoThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C new file mode 100644 index 0000000000..0c44cc3af9 --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Selection function for enthalpy thermodynamics package. + +\*---------------------------------------------------------------------------*/ + +#include "makeBasicThermo.H" + +#include "perfectGas.H" + +#include "hConstThermo.H" +#include "janafThermo.H" +#include "specieThermo.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "hRhoThermo.H" +#include "pureMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + + +makeBasicThermo +( + hRhoThermo, + pureMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeBasicThermo +( + hRhoThermo, + pureMixture, + sutherlandTransport, + hConstThermo, + perfectGas +); + +makeBasicThermo +( + hRhoThermo, + pureMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H index a194b31ac9..7527cd480c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H @@ -67,32 +67,37 @@ private: // Private data + //- Reference to the thermo package const hCombustionThermo& thermo_; + //- Reference to the field of specie mass fractions PtrList& Y_; + + //- Reference to the density field const volScalarField& rho_; + //- Chemistry properties dictionary IOdictionary chemistryProperties_; - //- Do the chemistry or not. + //- Flag to activate the chemistry (or not) Switch chemistry_; - //- The reactions + //- List of reactions const PtrList& reactions_; - //- thermodynamic data of the species + //- Thermodynamic data of the species const PtrList& specieThermo_; - //- The number of species + //- Number of species label Ns_; - //- The number of reactions + //- Number of reactions label Nr_; - //- chemistry solver + //- Chemistry solver autoPtr solver_; - //- the chemical source term + //- Chemical source term PtrList RR_; //- Latest estimation of integration step @@ -104,6 +109,7 @@ private: //- Disallow default bitwise assignment void operator=(const chemistryModel&); + protected: // Protected Member Functions @@ -147,7 +153,7 @@ public: return thermo_; } - //- Access the fractions of the species + //- Access the mass fractions of the species const PtrList& Y() const { return Y_; diff --git a/src/thermophysicalModels/combustion/Make/files b/src/thermophysicalModels/combustion/Make/files deleted file mode 100644 index 70e985783d..0000000000 --- a/src/thermophysicalModels/combustion/Make/files +++ /dev/null @@ -1,33 +0,0 @@ -hCombustionThermo = hCombustionThermo -hhuCombustionThermo = hhuCombustionThermo -hThermo = hThermo - -chemistryReader = chemistryReaders/chemistryReader -foamChemistryReader = chemistryReaders/foamChemistryReader -chemkinReader = chemistryReaders/chemkinReader - -mixtures = mixtureThermos/mixtures -combustionMixture = $(mixtures)/combustionMixture -reactingMixture = $(mixtures)/reactingMixture - -$(chemistryReader)/chemistryReader.C -$(foamChemistryReader)/foamChemistryReader.C -$(chemkinReader)/chemkinReader.C -$(chemkinReader)/chemkinLexer.L - -$(combustionMixture)/combustionMixture.C -$(reactingMixture)/reactingMixture.C - -$(hCombustionThermo)/hCombustionThermo.C -$(hCombustionThermo)/newhCombustionThermo.C -$(hCombustionThermo)/hCombustionThermos.C - -$(hhuCombustionThermo)/hhuCombustionThermo.C -$(hhuCombustionThermo)/newhhuCombustionThermo.C -$(hhuCombustionThermo)/hhuCombustionThermos.C - -derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C -derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C -derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C - -LIB = $(FOAM_LIBBIN)/libcombustionThermophysicalModels diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files new file mode 100644 index 0000000000..177a2efd1e --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -0,0 +1,21 @@ +chemistryReaders/chemistryReader/chemistryReader.C +chemistryReaders/foamChemistryReader/foamChemistryReader.C +chemistryReaders/chemkinReader/chemkinReader.C +chemistryReaders/chemkinReader/chemkinLexer.L + +/* mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C */ +mixtures/reactingMixture/reactingMixture.C + +combustion/hCombustionThermo/hCombustionThermo.C +combustion/hCombustionThermo/newhCombustionThermo.C +combustion/hCombustionThermo/hCombustionThermos.C + +combustion/hhuCombustionThermo/hhuCombustionThermo.C +combustion/hhuCombustionThermo/newhhuCombustionThermo.C +combustion/hhuCombustionThermo/hhuCombustionThermos.C + +derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C +derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C +derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C + +LIB = $(FOAM_LIBBIN)/libreactionThermophysicalModels diff --git a/src/thermophysicalModels/combustion/Make/options b/src/thermophysicalModels/reactionThermo/Make/options similarity index 100% rename from src/thermophysicalModels/combustion/Make/options rename to src/thermophysicalModels/reactionThermo/Make/options diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.C rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H diff --git a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C rename to src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C diff --git a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H similarity index 100% rename from src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.C similarity index 81% rename from src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.C index 8f455f4eb4..5ea7402217 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.C @@ -31,17 +31,15 @@ License namespace Foam { - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -defineTypeNameAndDebug(hCombustionThermo, 0); -defineRunTimeSelectionTable(hCombustionThermo, fvMesh); + defineTypeNameAndDebug(hCombustionThermo, 0); + defineRunTimeSelectionTable(hCombustionThermo, fvMesh); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -hCombustionThermo::hCombustionThermo(const fvMesh& mesh) +Foam::hCombustionThermo::hCombustionThermo(const fvMesh& mesh) : - basicThermo(mesh), + basicPsiThermo(mesh), h_ ( @@ -55,19 +53,15 @@ hCombustionThermo::hCombustionThermo(const fvMesh& mesh) ), mesh, dimensionSet(0, 2, -2, 0, 0), - hBoundaryTypes() + this->hBoundaryTypes() ) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -hCombustionThermo::~hCombustionThermo() +Foam::hCombustionThermo::~hCombustionThermo() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.H similarity index 80% rename from src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.H index fe1e12adc0..fc4f20dfae 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.H @@ -30,15 +30,14 @@ Description SourceFiles hCombustionThermo.C - newhCombustionThermo.C \*---------------------------------------------------------------------------*/ #ifndef hCombustionThermo_H #define hCombustionThermo_H -#include "basicThermo.H" -#include "combustionMixture.H" +#include "basicPsiThermo.H" +#include "basicMultiComponentMixture.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" @@ -48,18 +47,19 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hCombustionThermo Declaration + Class hCombustionThermo Declaration \*---------------------------------------------------------------------------*/ class hCombustionThermo : - public basicThermo + public basicPsiThermo { protected: // Protected data + //- Enthalpy field volScalarField h_; @@ -69,16 +69,15 @@ public: TypeName("hCombustionThermo"); - // Declare run-time constructor selection tables - - declareRunTimeSelectionTable - ( - autoPtr, - hCombustionThermo, - fvMesh, - (const fvMesh& mesh), - (mesh) - ); + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + hCombustionThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); // Constructors @@ -87,9 +86,8 @@ public: hCombustionThermo(const fvMesh&); - // Selectors - - static autoPtr New(const fvMesh&); + //- Selector + static autoPtr New(const fvMesh&); //- Destructor @@ -98,11 +96,11 @@ public: // Member functions - //- Return the composition of the combustion mixture - virtual combustionMixture& composition() = 0; + //- Return the composition of the multi-component mixture + virtual basicMultiComponentMixture& composition() = 0; - //- Return the composition of the combustion mixture - virtual const combustionMixture& composition() const = 0; + //- Return the composition of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const = 0; // Access to thermodynamic state variables diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C similarity index 89% rename from src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C index fbfa73c856..81d28944b2 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C +++ b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C @@ -46,6 +46,7 @@ License #include "multiComponentMixture.H" #include "reactingMixture.H" +#include "transportTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -123,7 +124,7 @@ makeCombustionThermo janafThermo, perfectGas ); - + makeCombustionThermo ( hCombustionThermo, @@ -135,25 +136,25 @@ makeCombustionThermo ); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Reaction thermo +// Multi-component thermo -defineTemplateTypeNameAndDebug(hMixtureThermo, 0); - -typedef hMixtureThermo hMixtureThermoReactingMixture; - -addToRunTimeSelectionTable +makeCombustionMixtureThermo ( hCombustionThermo, - hMixtureThermoReactingMixture, - fvMesh + hMixtureThermo, + multiComponentMixture, + gasTransport ); -addToRunTimeSelectionTable + +// Multi-component reaction thermo + +makeCombustionMixtureThermo ( - basicThermo, - hMixtureThermoReactingMixture, - fvMesh + hCombustionThermo, + hMixtureThermo, + reactingMixture, + gasTransport ); diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/makeCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/makeCombustionThermo.H similarity index 59% rename from src/thermophysicalModels/combustion/hCombustionThermo/makeCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/makeCombustionThermo.H index f961d0ca0c..4faa218141 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/makeCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/makeCombustionThermo.H @@ -34,16 +34,19 @@ Description // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeCombustionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ +#define makeCombustionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ \ typedef MixtureThermo \ > > > > \ MixtureThermo##Mixture##Transport##Thermo##EqnOfState; \ \ defineTemplateTypeNameAndDebugWithName \ - (MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ +( \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ #MixtureThermo \ - "<"#Mixture"<"#Transport">>>>", 0); \ + "<"#Mixture"<"#Transport">>>>", \ + 0 \ +); \ \ addToRunTimeSelectionTable \ ( \ @@ -60,6 +63,32 @@ addToRunTimeSelectionTable \ ) +#define makeCombustionMixtureThermo(CThermo,MixtureThermo,Mixture,Transport) \ + \ +typedef MixtureThermo > MixtureThermo##Mixture##Transport; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##Transport, \ + #MixtureThermo"<"#Mixture"<"#Transport">>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + MixtureThermo##Mixture##Transport, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##Transport, \ + fvMesh \ +); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/newhCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/newhCombustionThermo.C similarity index 81% rename from src/thermophysicalModels/combustion/hCombustionThermo/newhCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/newhCombustionThermo.C index 2345a2b6d7..cb223d0c42 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/newhCombustionThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/newhCombustionThermo.C @@ -29,12 +29,10 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr hCombustionThermo::New(const fvMesh& mesh) +Foam::autoPtr Foam::hCombustionThermo::New +( + const fvMesh& mesh +) { word hCombustionThermoTypeName; @@ -57,8 +55,8 @@ autoPtr hCombustionThermo::New(const fvMesh& mesh) thermoDict.lookup("thermoType") >> hCombustionThermoTypeName; } - Info<< "Selecting thermodynamics package " - << hCombustionThermoTypeName << endl; + Info<< "Selecting thermodynamics package " << hCombustionThermoTypeName + << endl; fvMeshConstructorTable::iterator cstrIter = fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName); @@ -67,9 +65,9 @@ autoPtr hCombustionThermo::New(const fvMesh& mesh) { FatalErrorIn("hCombustionThermo::New(const fvMesh&)") << "Unknown hCombustionThermo type " - << hCombustionThermoTypeName << endl << endl - << "Valid hCombustionThermo types are :" << endl - << fvMeshConstructorTablePtr_->toc() + << hCombustionThermoTypeName << nl << nl + << "Valid hCombustionThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } @@ -77,8 +75,4 @@ autoPtr hCombustionThermo::New(const fvMesh& mesh) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.C diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.H similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.H diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermos.C similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermos.C diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/newhhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/newhhuCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/newhhuCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/newhhuCombustionThermo.C diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H similarity index 92% rename from src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H index 62d7943400..217109a310 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hMixtureThermo Declaration + Class hMixtureThermo Declaration \*---------------------------------------------------------------------------*/ template @@ -79,14 +79,14 @@ public: // Member functions - //- Return the compostion of the combustion mixture - virtual combustionMixture& composition() + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() { return *this; } - //- Return the compostion of the combustion mixture - virtual const combustionMixture& composition() const + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const { return *this; } @@ -100,6 +100,7 @@ public: //- Chemical enthalpy [J/kg] virtual tmp hc() const; + // Fields derived from thermodynamic state variables //- Enthalpy for cell-set [J/kg] diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H similarity index 93% rename from src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H index 99cf720488..3d331417cc 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hhuMixtureThermo Declaration + Class hhuMixtureThermo Declaration \*---------------------------------------------------------------------------*/ template @@ -79,14 +79,14 @@ public: // Member functions - //- Return the compostion of the combustion mixture - virtual combustionMixture& composition() + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() { return *this; } - //- Return the compostion of the combustion mixture - virtual const combustionMixture& composition() const + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const { return *this; } diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H index 6da82e29eb..d55a9585a1 100644 --- a/src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class fixedUnburntEnthalpyFvPatchScalarField Declaration + Class fixedUnburntEnthalpyFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class fixedUnburntEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H index 081ff77d91..f237bb98ba 100644 --- a/src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class gradientUnburntEnthalpyFvPatchScalarField Declaration + Class gradientUnburntEnthalpyFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class gradientUnburntEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H index f97d9ebf2c..28d6c939a4 100644 --- a/src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class mixedUnburntEnthalpyFvPatchScalarField Declaration + Class mixedUnburntEnthalpyFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class mixedUnburntEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C similarity index 88% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C index 0744a4e2ea..1016a33a97 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C @@ -24,17 +24,29 @@ License \*---------------------------------------------------------------------------*/ -#include "combustionMixture.H" -#include "fvMesh.H" +#include "basicMultiComponentMixture.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -namespace Foam +void Foam::basicMultiComponentMixture::correctMassFractions() { + volScalarField Yt = Y_[0]; + + for(label n=1; n Y_; + // Protected member functions + + //- Correct the mass fractions to sum to 1 + void correctMassFractions(); + + public: // Constructors //- Construct from dictionary and mesh - combustionMixture + basicMultiComponentMixture ( const dictionary&, const wordList& specieNames, @@ -76,69 +82,41 @@ public: ); - // Destructor - - virtual ~combustionMixture() - {} + //- Destructor + virtual ~basicMultiComponentMixture() + {} // Member functions //- Return the mass-fraction fields - PtrList& Y() - { - return Y_; - } + inline PtrList& Y(); //- Return the const mass-fraction fields - const PtrList& Y() const - { - return Y_; - } + inline const PtrList& Y() const; //- Return the mass-fraction field for a specie given by index - volScalarField& Y(const label i) - { - return Y_[i]; - } + inline volScalarField& Y(const label i); //- Return the const mass-fraction field for a specie given by index - const volScalarField& Y(const label i) const - { - return Y_[i]; - } + inline const volScalarField& Y(const label i) const; //- Return the mass-fraction field for a specie given by name - volScalarField& Y(const word& specieName) - { - return Y_[species_[specieName]]; - } + inline volScalarField& Y(const word& specieName); //- Return the const mass-fraction field for a specie given by name - const volScalarField& Y(const word& specieName) const - { - return Y_[species_[specieName]]; - } + inline const volScalarField& Y(const word& specieName) const; - //- does the mixture include this specie - bool contains(const word& specieName) const - { - return species_.contains(specieName); - } + //- Does the mixture include this specie? + inline bool contains(const word& specieName) const; - scalar fres(const scalar ft, const scalar stoicRatio) const - { - return max(ft - (1.0 - ft)/stoicRatio, 0.0); - } + inline scalar fres(const scalar ft, const scalar stoicRatio) const; - tmp fres + inline tmp fres ( const volScalarField& ft, const dimensionedScalar& stoicRatio - ) const - { - return max(ft - (scalar(1) - ft)/stoicRatio.value(), scalar(0)); - } + ) const; }; @@ -148,6 +126,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "basicMultiComponentMixtureI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H new file mode 100644 index 0000000000..593cb6c47b --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline Foam::PtrList& +Foam::basicMultiComponentMixture::Y() +{ + return Y_; +} + + +inline const Foam::PtrList& +Foam::basicMultiComponentMixture::Y() const +{ + return Y_; +} + + +inline Foam::volScalarField& Foam::basicMultiComponentMixture::Y(const label i) +{ + return Y_[i]; +} + + +inline const Foam::volScalarField& Foam::basicMultiComponentMixture::Y +( + const label i +) const +{ + return Y_[i]; +} + + +inline Foam::volScalarField& Foam::basicMultiComponentMixture::Y +( + const word& specieName +) +{ + return Y_[species_[specieName]]; +} + + +inline const Foam::volScalarField& Foam::basicMultiComponentMixture::Y +( + const word& specieName +) const +{ + return Y_[species_[specieName]]; +} + + +inline bool Foam::basicMultiComponentMixture::contains +( + const word& specieName +) const +{ + return species_.contains(specieName); +} + + +inline Foam::scalar Foam::basicMultiComponentMixture::fres +( + const scalar ft, + const scalar stoicRatio +) const +{ + return max(ft - (1.0 - ft)/stoicRatio, 0.0); +} + + +inline Foam::tmp Foam::basicMultiComponentMixture::fres +( + const volScalarField& ft, + const dimensionedScalar& stoicRatio +) const +{ + return max(ft - (scalar(1) - ft)/stoicRatio.value(), scalar(0)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C similarity index 83% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C index 09a12153a9..ff06946831 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C @@ -27,28 +27,27 @@ License #include "dieselMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -const char* dieselMixture::specieNames_[2] = - {"ft", "fu"}; +const char* Foam::dieselMixture::specieNames_[2] = {"ft", "fu"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -dieselMixture::dieselMixture +Foam::dieselMixture::dieselMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -66,7 +65,7 @@ dieselMixture::dieselMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const ThermoType& dieselMixture::mixture +const ThermoType& Foam::dieselMixture::mixture ( const scalar ft, const scalar fu @@ -91,7 +90,7 @@ const ThermoType& dieselMixture::mixture template -void dieselMixture::read(const dictionary& thermoDict) +void Foam::dieselMixture::read(const dictionary& thermoDict) { fuel_ = ThermoType(thermoDict.lookup("fuel")); oxidant_ = ThermoType(thermoDict.lookup("oxidant")); @@ -99,8 +98,4 @@ void dieselMixture::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H index 02e0605238..cc2a2e8fc2 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef dieselMixture_H #define dieselMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class dieselMixture Declaration + Class dieselMixture Declaration \*---------------------------------------------------------------------------*/ template class dieselMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -84,10 +84,9 @@ public: dieselMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~dieselMixture() - {} + //- Destructor + virtual ~dieselMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C similarity index 84% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C index b61ad10f4b..5e9e70e69f 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -27,27 +27,27 @@ License #include "egrMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -const char* egrMixture::specieNames_[3] = {"ft", "b", "egr"}; +const char* Foam::egrMixture::specieNames_[3] = {"ft", "b", "egr"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -egrMixture::egrMixture +Foam::egrMixture::egrMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -66,7 +66,7 @@ egrMixture::egrMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const ThermoType& egrMixture::mixture +const ThermoType& Foam::egrMixture::mixture ( const scalar ft, const scalar b, @@ -79,13 +79,13 @@ const ThermoType& egrMixture::mixture } else { - + scalar fu = b*ft + (1.0 - b)*fres(ft, stoicRatio().value()); scalar ox = 1 - ft - (ft - fu)*stoicRatio().value(); - + fu *= (1.0 - egr); ox *= (1.0 - egr); - + scalar pr = 1 - fu - ox; mixture_ = fu/fuel_.W()*fuel_; @@ -98,7 +98,7 @@ const ThermoType& egrMixture::mixture template -void egrMixture::read(const dictionary& thermoDict) +void Foam::egrMixture::read(const dictionary& thermoDict) { stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio"); @@ -108,8 +108,4 @@ void egrMixture::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H similarity index 96% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H index fc1b3fba39..e530291550 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef egrMixture_H #define egrMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class egrMixture Declaration + Class egrMixture Declaration \*---------------------------------------------------------------------------*/ template class egrMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -90,10 +90,9 @@ public: egrMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~egrMixture() - {} + //- Destructor + virtual ~egrMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C similarity index 80% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C index e71614f3e7..09fbc701d8 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C @@ -27,27 +27,27 @@ License #include "homogeneousMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -const char* homogeneousMixture::specieNames_[1] = {"b"}; +const char* Foam::homogeneousMixture::specieNames_[1] = {"b"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -homogeneousMixture::homogeneousMixture +Foam::homogeneousMixture::homogeneousMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), reactants_(thermoDict.lookup("reactants")), products_(thermoDict.lookup("products")), @@ -59,7 +59,10 @@ homogeneousMixture::homogeneousMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const ThermoType& homogeneousMixture::mixture(const scalar b) const +const ThermoType& Foam::homogeneousMixture::mixture +( + const scalar b +) const { if (b > 0.999) { @@ -80,15 +83,11 @@ const ThermoType& homogeneousMixture::mixture(const scalar b) const template -void homogeneousMixture::read(const dictionary& thermoDict) +void Foam::homogeneousMixture::read(const dictionary& thermoDict) { reactants_ = ThermoType(thermoDict.lookup("reactants")); products_ = ThermoType(thermoDict.lookup("products")); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H similarity index 94% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H index 50e1952f49..91c495fcc5 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef homogeneousMixture_H #define homogeneousMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class homogeneousMixture Declaration + Class homogeneousMixture Declaration \*---------------------------------------------------------------------------*/ template class homogeneousMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -81,10 +81,9 @@ public: homogeneousMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~homogeneousMixture() - {} + //- Destructor + virtual ~homogeneousMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C similarity index 83% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C index 0f916f5353..f491a70446 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -27,27 +27,28 @@ License #include "inhomogeneousMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -const char* inhomogeneousMixture::specieNames_[2] = {"ft", "b"}; +const char* Foam::inhomogeneousMixture::specieNames_[2] = + {"ft", "b"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -inhomogeneousMixture::inhomogeneousMixture +Foam::inhomogeneousMixture::inhomogeneousMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -65,7 +66,7 @@ inhomogeneousMixture::inhomogeneousMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const ThermoType& inhomogeneousMixture::mixture +const ThermoType& Foam::inhomogeneousMixture::mixture ( const scalar ft, const scalar b @@ -91,7 +92,7 @@ const ThermoType& inhomogeneousMixture::mixture template -void inhomogeneousMixture::read(const dictionary& thermoDict) +void Foam::inhomogeneousMixture::read(const dictionary& thermoDict) { stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio"); @@ -101,8 +102,4 @@ void inhomogeneousMixture::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index cb95973f54..22fbb83f3c 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef inhomogeneousMixture_H #define inhomogeneousMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class inhomogeneousMixture Declaration + Class inhomogeneousMixture Declaration \*---------------------------------------------------------------------------*/ template class inhomogeneousMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -87,10 +87,9 @@ public: inhomogeneousMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~inhomogeneousMixture() - {} + //- Destructor + virtual ~inhomogeneousMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C similarity index 73% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index 5e27d6caeb..521959a2e9 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -25,17 +25,11 @@ License \*---------------------------------------------------------------------------*/ #include "multiComponentMixture.H" -#include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -const ThermoType& multiComponentMixture::constructSpeciesData +const ThermoType& Foam::multiComponentMixture::constructSpeciesData ( const dictionary& thermoDict ) @@ -53,27 +47,10 @@ const ThermoType& multiComponentMixture::constructSpeciesData } -template -void multiComponentMixture::correctMassFractions() -{ - volScalarField Yt = Y_[0]; - - for(label n=1; n -multiComponentMixture::multiComponentMixture +Foam::multiComponentMixture::multiComponentMixture ( const dictionary& thermoDict, const wordList& specieNames, @@ -81,7 +58,7 @@ multiComponentMixture::multiComponentMixture const fvMesh& mesh ) : - combustionMixture(thermoDict, specieNames, mesh), + basicMultiComponentMixture(thermoDict, specieNames, mesh), speciesData_(species_.size()), mixture_("mixture", *specieThermoData[specieNames[0]]) { @@ -93,30 +70,26 @@ multiComponentMixture::multiComponentMixture new ThermoType(*specieThermoData[species_[i]]) ); } - - correctMassFractions(); } template -multiComponentMixture::multiComponentMixture +Foam::multiComponentMixture::multiComponentMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, thermoDict.lookup("species"), mesh), + basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh), speciesData_(species_.size()), mixture_("mixture", constructSpeciesData(thermoDict)) -{ - correctMassFractions(); -} +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const ThermoType& multiComponentMixture::cellMixture +const ThermoType& Foam::multiComponentMixture::cellMixture ( const label celli ) const @@ -127,13 +100,13 @@ const ThermoType& multiComponentMixture::cellMixture { mixture_ += Y_[n][celli]/speciesData_[n].W()*speciesData_[n]; } - + return mixture_; } template -const ThermoType& multiComponentMixture::patchFaceMixture +const ThermoType& Foam::multiComponentMixture::patchFaceMixture ( const label patchi, const label facei @@ -149,13 +122,16 @@ const ThermoType& multiComponentMixture::patchFaceMixture Y_[n].boundaryField()[patchi][facei] /speciesData_[n].W()*speciesData_[n]; } - + return mixture_; } template -void multiComponentMixture::read(const dictionary& thermoDict) +void Foam::multiComponentMixture::read +( + const dictionary& thermoDict +) { forAll(species_, i) { @@ -164,8 +140,4 @@ void multiComponentMixture::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H index e029831498..cb02f56683 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef multiComponentMixture_H #define multiComponentMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" #include "HashPtrTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,13 +45,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class multiComponentMixture Declaration + Class multiComponentMixture Declaration \*---------------------------------------------------------------------------*/ template class multiComponentMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -96,10 +96,9 @@ public: multiComponentMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~multiComponentMixture() - {} + //- Destructor + virtual ~multiComponentMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C similarity index 87% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C index 9c020b3ade..1e381f4ec0 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C @@ -27,14 +27,9 @@ License #include "reactingMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -reactingMixture::reactingMixture +Foam::reactingMixture::reactingMixture ( const dictionary& thermoDict, const fvMesh& mesh @@ -59,12 +54,8 @@ reactingMixture::reactingMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void reactingMixture::read(const dictionary& thermoDict) +void Foam::reactingMixture::read(const dictionary& thermoDict) {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H index a280ed834a..632230cd01 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H @@ -45,7 +45,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class reactingMixture Declaration + Class reactingMixture Declaration \*---------------------------------------------------------------------------*/ class reactingMixture @@ -80,10 +80,9 @@ public: reactingMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~reactingMixture() - {} + //- Destructor + virtual ~reactingMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C similarity index 82% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C index 06a4e0f9ba..82476163ea 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -27,28 +27,28 @@ License #include "veryInhomogeneousMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -const char* veryInhomogeneousMixture::specieNames_[3] = +const char* Foam::veryInhomogeneousMixture::specieNames_[3] = {"ft", "fu", "b"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -veryInhomogeneousMixture::veryInhomogeneousMixture +Foam::veryInhomogeneousMixture::veryInhomogeneousMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -67,7 +67,7 @@ veryInhomogeneousMixture::veryInhomogeneousMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const ThermoType& veryInhomogeneousMixture::mixture +const ThermoType& Foam::veryInhomogeneousMixture::mixture ( const scalar ft, const scalar fu @@ -92,7 +92,10 @@ const ThermoType& veryInhomogeneousMixture::mixture template -void veryInhomogeneousMixture::read(const dictionary& thermoDict) +void Foam::veryInhomogeneousMixture::read +( + const dictionary& thermoDict +) { fuel_ = ThermoType(thermoDict.lookup("fuel")); oxidant_ = ThermoType(thermoDict.lookup("oxidant")); @@ -100,8 +103,4 @@ void veryInhomogeneousMixture::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index fe0e1a7b69..c257334690 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef veryInhomogeneousMixture_H #define veryInhomogeneousMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class veryInhomogeneousMixture Declaration + Class veryInhomogeneousMixture Declaration \*---------------------------------------------------------------------------*/ template class veryInhomogeneousMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -90,10 +90,9 @@ public: veryInhomogeneousMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~veryInhomogeneousMixture() - {} + //- Destructor + virtual ~veryInhomogeneousMixture() + {} // Member functions From 530a86e5407de5e58d3683ad3ceca7c32dce7ab4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 18:02:40 +0100 Subject: [PATCH 03/74] adding polynomial class --- src/OpenFOAM/Make/files | 4 + .../functions/Polynomial/Polynomial.C | 162 ++++++++++++++++ .../functions/Polynomial/Polynomial.H | 180 ++++++++++++++++++ .../functions/Polynomial/PolynomialIO.C | 52 +++++ .../Polynomial/makePolynomialsOrder7.C | 51 +++++ 5 files changed, 449 insertions(+) create mode 100644 src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C create mode 100644 src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H create mode 100644 src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C create mode 100644 src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index c99ee23fa5..3de2322137 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -60,6 +60,10 @@ $(sha1)/SHA1Digest.C primitives/random/Random.C +functions = primitives/functions +$(functions)/Polynomial/makePolynomialsOrder7.C + + containers/HashTables/HashTable/HashTableName.C containers/HashTables/StaticHashTable/StaticHashTableName.C containers/Lists/SortableList/ParSortableListName.C diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C new file mode 100644 index 0000000000..f3621eabc0 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Polynomial.H" +#include "error.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::Polynomial::Polynomial() +: + VectorSpace, scalar, PolySize>(), + name_("unknownPolynomialName") +{} + + +template +Foam::Polynomial::Polynomial(const word& name, Istream& is) +: + VectorSpace, scalar, PolySize>(), + name_(is) +{ + if (name_ != name) + { + FatalErrorIn + ( + "Foam::Polynomial::Polynomial(const word&, Istream&)" + ) << "Expected polynomial name " << name << " but read " << name_ + << nl << exit(FatalError); + } + + VectorSpace, scalar, PolySize>:: + operator=(polyType(is)); + + if (this->size() == 0) + { + FatalErrorIn + ( + "Foam::Polynomial::Polynomial(const word&, Istream&)" + ) << "Polynomial coefficients for entry " << name_ + << " are invalid (empty)" << nl << exit(FatalError); + } +} + + +template +Foam::Polynomial::Polynomial(const Polynomial& poly) +: + VectorSpace, scalar, PolySize>(poly), + name_(poly.name_) +{} + + +template +Foam::Polynomial::Polynomial +( + const word& name, + const Polynomial& poly +) +: + VectorSpace, scalar, PolySize>(poly), + name_(name) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::Polynomial::~Polynomial() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +const Foam::word& Foam::Polynomial::name() const +{ + return name_; +} + + +template +Foam::scalar Foam::Polynomial::evaluate(const scalar x) const +{ + scalar y = 0.0; + forAll(*this, i) + { + y += this->v_[i]*pow(x, i); + } + + return y; +} + + +template +Foam::scalar Foam::Polynomial::integrateLimits +( + const scalar x1, + const scalar x2 +) const +{ + scalar intx = 0.0; + + forAll(*this, i) + { + intx += this->v_[i]/(i + 1)*(pow(x2, i + 1) - pow(x1, i + 1)); + } + + return intx; +} + + +template +typename Foam::Polynomial::intPolyType +Foam::Polynomial::integrate(const scalar intConstant) +{ + intPolyType newCoeffs; + + newCoeffs[0] = intConstant; + forAll(*this, i) + { + newCoeffs[i + 1] = this->v_[i]/(i + 1); + } + + return newCoeffs; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +void Foam::Polynomial::operator=(const Polynomial& poly) +{ + name_ = poly.name_; + VectorSpace, scalar, PolySize>::operator=(poly); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H new file mode 100644 index 0000000000..0ade28b2c8 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::Polynomial + +Description + Polynomial templated on size (order): + + poly = sum(coeff_[i]*x^i) + + where 0 <= i <= n + + - integer powers, starting at zero + - evaluate(x) to evaluate the poly for a given value + - integrate(x1, x2) between two scalar values + - integrate() to return a new, intergated coeff polynomial + - increases the size (order) + +SourceFiles + Polynomial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Polynomial_H +#define Polynomial_H + +#include "word.H" +#include "scalar.H" +#include "Ostream.H" +#include "VectorSpace.H" +#include "Vector.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template +class Polynomial; + +// Forward declaration of friend functions +template +Ostream& operator<< +( + Ostream&, + const Polynomial& +); + + +/*---------------------------------------------------------------------------*\ + Class Polynomial Declaration +\*---------------------------------------------------------------------------*/ + +template +class Polynomial +: + public VectorSpace, scalar, PolySize> +{ +private: + + // Private data + + //- Polynomial name + word name_; + + +public: + + typedef VectorSpace, scalar, PolySize> polyType; + + typedef Polynomial intPolyType; + + //- Run-time type information + TypeName("Polynomial") + + + // Constructors + + //- Construct null + Polynomial(); + + //- Construct from name and Istream + Polynomial(const word& name, Istream& is); + + //- Copy constructor + Polynomial(const Polynomial& poly); + + //- Copy constructor with name + Polynomial(const word& name, const Polynomial& poly); + + + //- Destructor + ~Polynomial(); + + + // Member Functions + + // Access + + //- Return const access to the polynomial name + const word& name() const; + + + // Evaluation + + //- Return polynomial value + scalar evaluate(const scalar x) const; + + //- Return integrated polynomial coefficients + // argument becomes zeroth element (constant of integration) + intPolyType integrate(const scalar intConstant = 0.0); + + //- Integrate between two values + scalar integrateLimits(const scalar x1, const scalar x2) const; + + + // Member operators + + void operator=(const Polynomial& poly); + + + //- Ostream Operator + friend Ostream& operator<< + ( + Ostream&, + const Polynomial& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makePolynomial(PolySize) \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + Polynomial, \ + "Polynomial<"#PolySize">", \ + 0 \ +) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "Polynomial.C" +# include "PolynomialIO.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C new file mode 100644 index 0000000000..e7c1fd452a --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const Polynomial& poly +) +{ + os << poly.name_ << token::SPACE + << static_cast + , scalar, PolySize> >(poly); + + // Check state of Ostream + os.check + ( + "Ostream& operator<<(Ostream&, const Polynomial&)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C b/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C new file mode 100644 index 0000000000..0d502964a8 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +namespace Foam +{ + makePolynomial(2); + makePolynomial(3); + makePolynomial(4); + makePolynomial(5); + makePolynomial(6); + makePolynomial(7); + makePolynomial(8); + + // explicitly define max order + 1 to define the integrated form + defineTemplateTypeNameAndDebugWithName + ( + Polynomial<9>, + "Polynomial<9>", + 0 + ); +} + + +// ************************************************************************* // From f6a70947998883ae79074170003e3cd526d7bcb6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 18:04:23 +0100 Subject: [PATCH 04/74] missed file during commit of 5554300fb99f4b96339c18a371900625f1d29129 --- src/thermophysicalModels/basic/Make/files | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 4cea8bf57d..b93d6f7867 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -1,13 +1,15 @@ -basicMixture = mixtures/basicMixture -basicThermo = basicThermo +mixtures/basicMixture/basicMixture.C +mixtures/basicMixture/basicMixtures.C -$(basicMixture)/basicMixture.C -$(basicMixture)/basicMixtures.C -$(basicThermo)/basicThermo.C -$(basicThermo)/newBasicThermo.C +basicThermo/basicThermo.C +basicThermo/newBasicThermo.C -hThermo/hThermos.C -eThermo/eThermos.C +psiThermo/basicPsiThermo/basicPsiThermo.C +psiThermo/hPsiThermo/hPsiThermos.C +psiThermo/ePsiThermo/ePsiThermos.C + +rhoThermo/basicRhoThermo/basicRhoThermo.C +rhoThermo/hRhoThermo/hRhoThermos.C derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C From e4c0cb3d2efd28ad4698bc35313d52a1fc5f5761 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 18:05:06 +0100 Subject: [PATCH 05/74] adding polynomial thermo package --- src/thermophysicalModels/specie/Make/files | 5 +- .../icoPolynomial/icoPolynomial.C | 65 +++++ .../icoPolynomial/icoPolynomial.H | 214 ++++++++++++++++ .../icoPolynomial/icoPolynomialI.H | 209 ++++++++++++++++ .../icoPolynomial/makeIcoPolynomials.C | 44 ++++ .../thermo/polynomial/polynomialThermo.C | 62 +++++ .../thermo/polynomial/polynomialThermo.H | 211 ++++++++++++++++ .../thermo/polynomial/polynomialThermoI.H | 235 ++++++++++++++++++ .../polynomial/polynomialTransport.C | 65 +++++ .../polynomial/polynomialTransport.H | 206 +++++++++++++++ .../polynomial/polynomialTransportI.H | 213 ++++++++++++++++ 11 files changed, 1527 insertions(+), 2 deletions(-) create mode 100644 src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C create mode 100644 src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H create mode 100644 src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H create mode 100644 src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C create mode 100644 src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C create mode 100644 src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H create mode 100644 src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H create mode 100644 src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C create mode 100644 src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H create mode 100644 src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H diff --git a/src/thermophysicalModels/specie/Make/files b/src/thermophysicalModels/specie/Make/files index 2f0e008422..ad4f7e0639 100644 --- a/src/thermophysicalModels/specie/Make/files +++ b/src/thermophysicalModels/specie/Make/files @@ -1,13 +1,14 @@ atomicWeights = atomicWeights specie = specie speciesTable = speciesTable -perfectGas = equationOfState/perfectGas +equationOfState = equationOfState reactions = reaction/reactions $(atomicWeights)/atomicWeights.C $(specie)/specie.C $(speciesTable)/speciesTable.C -$(perfectGas)/perfectGas.C +$(equationOfState)/perfectGas/perfectGas.C +$(equationOfState)/icoPolynomial/makeIcoPolynomials.C $(reactions)/makeChemkinReactions.C $(reactions)/makeLangmuirHinshelwoodReactions.C diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C new file mode 100644 index 0000000000..9fd15c2986 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "icoPolynomial.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +icoPolynomial::icoPolynomial(Istream& is) +: + specie(is), + rhoPolynomial_("rhoPolynomial", is) +{} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template +Ostream& operator<<(Ostream& os, const icoPolynomial& ip) +{ + os << static_cast(ip); + + os.check + ( + "Ostream& operator<<(Ostream& os, const icoPolynomial& ip)" + ); + + return os; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H new file mode 100644 index 0000000000..b23de491d1 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::icoPolynomial + +Description + Incompressible, polynomial form of equation of state, using a polynomial + function for density. + +SourceFiles + icoPolynomialI.H + icoPolynomial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef icoPolynomial_H +#define icoPolynomial_H + +#include "specie.H" +#include "autoPtr.H" +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template +class icoPolynomial; + +template +icoPolynomial operator+ +( + const icoPolynomial&, + const icoPolynomial& +); + +template +icoPolynomial operator- +( + const icoPolynomial&, + const icoPolynomial& +); + +template +icoPolynomial operator* +( + const scalar, + const icoPolynomial& +); + +template +icoPolynomial operator== +( + const icoPolynomial&, + const icoPolynomial& +); + +template +Ostream& operator<< +( + Ostream&, + const icoPolynomial& +); + + +/*---------------------------------------------------------------------------*\ + Class icoPolynomial Declaration +\*---------------------------------------------------------------------------*/ + +template +class icoPolynomial +: + public specie +{ + // Private data + + //- Density + Polynomial rhoPolynomial_; + + +public: + + TypeName("icoPolynomial") + + // Constructors + + //- Construct from components + inline icoPolynomial + ( + const specie& sp, + const Polynomial& rhoPoly + ); + + //- Construct from Istream + icoPolynomial(Istream&); + + //- Construct as named copy + inline icoPolynomial(const word& name, const icoPolynomial&); + + //- Construct and return a clone + inline autoPtr clone() const; + + // Selector from Istream + inline static autoPtr New(Istream& is); + + + // Member functions + + //- Return density [kg/m^3] + inline scalar rho(scalar p, scalar T) const; + + //- Return compressibility rho/p [s^2/m^2] + inline scalar psi(scalar p, scalar T) const; + + //- Return compression factor [] + inline scalar Z(scalar p, scalar T) const; + + + // Member operators + + inline void operator+=(const icoPolynomial&); + inline void operator-=(const icoPolynomial&); + + inline void operator*=(const scalar); + + + // Friend operators + + friend icoPolynomial operator+ + ( + const icoPolynomial&, + const icoPolynomial& + ); + + friend icoPolynomial operator- + ( + const icoPolynomial&, + const icoPolynomial& + ); + + friend icoPolynomial operator* + ( + const scalar s, + const icoPolynomial& + ); + + friend icoPolynomial operator== + ( + const icoPolynomial&, + const icoPolynomial& + ); + + + // Ostream Operator + + friend Ostream& operator<< (Ostream&, const icoPolynomial&); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeIcoPolynomial(PolySize) \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + icoPolynomial, \ + "icoPolynomial<"#PolySize">", \ + 0 \ +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "icoPolynomialI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "icoPolynomial.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H new file mode 100644 index 0000000000..d174c57192 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "icoPolynomial.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +inline Foam::icoPolynomial::icoPolynomial +( + const specie& sp, + const Polynomial& rhoPoly +) +: + specie(sp), + rhoPolynomial_(rhoPoly) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::icoPolynomial::icoPolynomial +( + const word& name, + const icoPolynomial& ip +) +: + specie(name, ip), + rhoPolynomial_(ip.rhoPolynomial_) +{} + + +template +inline Foam::autoPtr > +Foam::icoPolynomial::clone() const +{ + return autoPtr > + ( + new icoPolynomial(*this) + ); +} + + +template +inline Foam::autoPtr > +Foam::icoPolynomial::New(Istream& is) +{ + return autoPtr >(new icoPolynomial(is)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Foam::scalar Foam::icoPolynomial::rho(scalar, scalar T) const +{ + return rhoPolynomial_.evaluate(T); +} + + +template +inline Foam::scalar Foam::icoPolynomial::psi(scalar, scalar) const +{ + return 0.0; +} + + +template +inline Foam::scalar Foam::icoPolynomial::Z(scalar, scalar) const +{ + return 0.0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +inline void Foam::icoPolynomial::operator+= +( + const icoPolynomial& ip +) +{ + scalar molr1 = this->nMoles(); + + specie::operator+=(ip); + + molr1 /= this->nMoles(); + scalar molr2 = ip.nMoles()/this->nMoles(); + + rhoPolynomial_ = molr1*rhoPolynomial_ + molr2*ip.rhoPolynomial_; +} + + +template +inline void Foam::icoPolynomial::operator-= +( + const icoPolynomial& ip +) +{ + scalar molr1 = this->nMoles(); + specie::operator-=(ip); + + molr1 /= this->nMoles(); + scalar molr2 = ip.nMoles()/this->nMoles(); + + rhoPolynomial_ = molr1*rhoPolynomial_ - molr2*ip.rhoPolynomial_; +} + + +template +inline void Foam::icoPolynomial::operator*=(const scalar s) +{ + specie::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template +Foam::icoPolynomial Foam::operator+ +( + const icoPolynomial& ip1, + const icoPolynomial& ip2 +) +{ + scalar mol1 = ip1.nMoles(); + scalar mol2 = ip2.nMoles(); + scalar nMoles = mol1 + mol2; + + return icoPolynomial + ( + static_cast(ip1) + + static_cast(ip2), + (mol1/nMoles)*ip1.rhoPolynomial_ + (mol2/nMoles)*ip2.rhoPolynomial_ + ); +} + + +template +Foam::icoPolynomial Foam::operator- +( + const icoPolynomial& ip1, + const icoPolynomial& ip2 +) +{ + scalar mol1 = ip1.nMoles(); + scalar mol2 = ip2.nMoles(); + scalar nMoles = mol1 + mol2; + + return icoPolynomial + ( + static_cast(ip1) + - static_cast(ip2), + (mol1/nMoles)*ip1.rhoPolynomial_ - (mol2/nMoles)*ip2.rhoPolynomial_ + ); +} + + +template +Foam::icoPolynomial Foam::operator* +( + const scalar s, + const icoPolynomial& ip +) +{ + return icoPolynomial + ( + s*static_cast(ip), + ip.rhoPolynomial_ + ); +} + + +template +Foam::icoPolynomial Foam::operator== +( + const icoPolynomial& ip1, + const icoPolynomial& ip2 +) +{ + return ip2 - ip1; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C new file mode 100644 index 0000000000..e4136284c0 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "icoPolynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeIcoPolynomial(1) + makeIcoPolynomial(2) + makeIcoPolynomial(3) + makeIcoPolynomial(4) + makeIcoPolynomial(5) + makeIcoPolynomial(6) + makeIcoPolynomial(7) + makeIcoPolynomial(8) +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C new file mode 100644 index 0000000000..d8a2e19861 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C @@ -0,0 +1,62 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "polynomialThermo.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::polynomialThermo::polynomialThermo(Istream& is) +: + EquationOfState(is), + Hf_(readScalar(is)), + cpPolynomial_("cpPolynomial", is), + dhPolynomial_("dhPolynomial", cpPolynomial_.integrate()) +{} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const polynomialThermo& pt +) +{ + os << static_cast(pt) << tab << pt.Hf_; + + os.check + ( + "operator<<(Ostream& os, const polynomialThermo& pt)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H new file mode 100644 index 0000000000..903cf1d2db --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H @@ -0,0 +1,211 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::polynomialThermo + +Description + Thermodynamics package templated on the equation of state, using polynomial + functions for cp and h + +SourceFiles + polynomialThermoI.H + polynomialThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef polynomialThermo_H +#define polynomialThermo_H + +#include "scalar.H" +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template +class polynomialThermo; + +template +inline polynomialThermo operator+ +( + const polynomialThermo&, + const polynomialThermo& +); + +template +inline polynomialThermo operator- +( + const polynomialThermo&, + const polynomialThermo& +); + +template +inline polynomialThermo operator* +( + const scalar, + const polynomialThermo& +); + +template +inline polynomialThermo operator== +( + const polynomialThermo&, + const polynomialThermo& +); + +template +Ostream& operator<< +( + Ostream&, + const polynomialThermo& +); + + +/*---------------------------------------------------------------------------*\ + Class polynomialThermo Declaration +\*---------------------------------------------------------------------------*/ + +template +class polynomialThermo +: + public EquationOfState +{ + // Private data + + //- Heat of formation + scalar Hf_; + + //- Specific heat at constant pressure + Polynomial cpPolynomial_; + + //- Enthalpy - derived from cp + typename Polynomial::intPolyType dhPolynomial_; + + + // Private member functions + + //- Construct from components + inline polynomialThermo + ( + const EquationOfState& pt, + const scalar Hf, + const Polynomial& cpPoly, + const typename Polynomial::intPolyType& hPoly + ); + + +public: + + // Constructors + + //- Construct from dictionary + polynomialThermo(Istream& is); + + //- Construct as a named copy + inline polynomialThermo(const word&, const polynomialThermo&); + + + // Member Functions + + //- Heat capacity at constant pressure [J/(kmol K)] + inline scalar cp(const scalar T) const; + + //- Enthalpy [J/kmol] + inline scalar h(const scalar T) const; + + //- Sensible enthalpy [J/kmol] + inline scalar hs(const scalar T) const; + + //- Chemical enthalpy [J/kmol] + inline scalar hc() const; + + //- Entropy [J/(kmol K)] + inline scalar s(const scalar T) const; + + + // Member operators + + inline void operator+=(const polynomialThermo&); + inline void operator-=(const polynomialThermo&); + + + // Friend operators + + friend polynomialThermo operator+ + ( + const polynomialThermo&, + const polynomialThermo& + ); + + friend polynomialThermo operator- + ( + const polynomialThermo&, + const polynomialThermo& + ); + + friend polynomialThermo operator* + ( + const scalar, + const polynomialThermo& + ); + + friend polynomialThermo operator== + ( + const polynomialThermo&, + const polynomialThermo& + ); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const polynomialThermo& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "polynomialThermoI.H" + +#ifdef NoRepository +# include "polynomialThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H new file mode 100644 index 0000000000..a34f9fda80 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H @@ -0,0 +1,235 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "polynomialThermo.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +inline Foam::polynomialThermo::polynomialThermo +( + const EquationOfState& pt, + const scalar Hf, + const Polynomial& cpPoly, + const typename Polynomial::intPolyType& dhPoly +) +: + EquationOfState(pt), + Hf_(Hf), + cpPolynomial_(cpPoly), + dhPolynomial_(dhPoly) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::polynomialThermo::polynomialThermo +( + const word& name, + const polynomialThermo& pt +) +: + EquationOfState(name, pt), + Hf_(pt.Hf_), + cpPolynomial_(pt.cpPolynomial_), + dhPolynomial_(pt.dhPolynomial_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Foam::scalar Foam::polynomialThermo::cp +( + const scalar T +) const +{ + return cpPolynomial_.evaluate(T)*this->W(); +} + + +template +inline Foam::scalar Foam::polynomialThermo::h +( + const scalar T +) const +{ + return (dhPolynomial_.evaluate(T) + Hf_)*this->W(); +} + + +template +inline Foam::scalar Foam::polynomialThermo::hs +( + const scalar T +) const +{ + return dhPolynomial_.evaluate(T)*this->W(); +} + + +template +inline Foam::scalar Foam::polynomialThermo::hc() +const +{ + return Hf_*this->W(); +} + + +template +inline Foam::scalar Foam::polynomialThermo::s +( + const scalar T +) const +{ + notImplemented("scalar polynomialThermo::s"); + + return 0.0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +inline void Foam::polynomialThermo::operator+= +( + const polynomialThermo& pt +) +{ + scalar molr1 = this->nMoles(); + + EquationOfState::operator+=(pt); + + molr1 /= this->nMoles(); + scalar molr2 = pt.nMoles()/this->nMoles(); + + Hf_ = molr1*Hf_ + molr2*pt.Hf_; + cpPolynomial_ = molr1*cpPolynomial_ + molr2*pt.cpPolynomial_; + dhPolynomial_ = molr1*dhPolynomial_ + molr2*pt.dhPolynomial_; +} + + +template +inline void Foam::polynomialThermo::operator-= +( + const polynomialThermo& pt +) +{ + scalar molr1 = this->nMoles(); + + EquationOfState::operator-=(pt); + + molr1 /= this->nMoles(); + scalar molr2 = pt.nMoles()/this->nMoles(); + + Hf_ = molr1*Hf_ - molr2*pt.Hf_; + cpPolynomial_ = molr1*cpPolynomial_ - molr2*pt.cpPolynomial_; + dhPolynomial_ = molr1*dhPolynomial_ - molr2*pt.dhPolynomial_; +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template +inline Foam::polynomialThermo Foam::operator+ +( + const polynomialThermo& pt1, + const polynomialThermo& pt2 +) +{ + EquationOfState eofs + ( + static_cast(pt1) + + static_cast(pt2) + ); + + scalar molr1 = pt1.nMoles()/eofs.nMoles(); + scalar molr2 = pt2.nMoles()/eofs.nMoles(); + return polynomialThermo + ( + eofs, + molr1*pt1.Hf_ + molr2*pt2.Hf_, + molr1*pt1.cpPolynomial_ + molr2*pt2.cpPolynomial_, + molr1*pt1.dhPolynomial_ + molr2*pt2.dhPolynomial_ + ); +} + + +template +inline Foam::polynomialThermo Foam::operator- +( + const polynomialThermo& pt1, + const polynomialThermo& pt2 +) +{ + EquationOfState eofs + ( + static_cast(pt1) + - static_cast(pt2) + ); + + scalar molr1 = pt1.nMoles()/eofs.nMoles(); + scalar molr2 = pt2.nMoles()/eofs.nMoles(); + return polynomialThermo + ( + eofs, + molr1*pt1.Hf_ - molr2*pt2.Hf_, + molr1*pt1.cpPolynomial_ - molr2*pt2.cpPolynomial_, + molr1*pt1.dhPolynomial_ - molr2*pt2.dhPolynomial_ + ); +} + + +template +inline Foam::polynomialThermo Foam::operator* +( + const scalar s, + const polynomialThermo& pt +) +{ + return polynomialThermo + ( + s*static_cast(pt), + pt.Hf_, + pt.cpPolynomial_, + pt.dhPolynomial_ + ); +} + + +template +inline Foam::polynomialThermo Foam::operator== +( + const polynomialThermo& pt1, + const polynomialThermo& pt2 +) +{ + return pt2 - pt1; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C new file mode 100644 index 0000000000..2744d4a979 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "polynomialTransport.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::polynomialTransport::polynomialTransport(Istream& is) +: + Thermo(is), + muPolynomial_("muPolynomial", is), + kappaPolynomial_("kappaPolynomial", is) +{} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const polynomialTransport& pt +) +{ + os << static_cast(pt); + + os.check + ( + "Ostream& operator<<" + "(" + "Ostream&, " + "const polynomialTransport&" + ")" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H new file mode 100644 index 0000000000..3ab3879e64 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H @@ -0,0 +1,206 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::polynomialTransport + +Description + Transport package using polynomial functions for mu and kappa + +SourceFiles + polynomialTransportI.H + polynomialTransport.C + +\*---------------------------------------------------------------------------*/ + +#ifndef polynomialTransport_H +#define polynomialTransport_H + +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template class polynomialTransport; + +template +inline polynomialTransport operator+ +( + const polynomialTransport&, + const polynomialTransport& +); + +template +inline polynomialTransport operator- +( + const polynomialTransport&, + const polynomialTransport& +); + +template +inline polynomialTransport operator* +( + const scalar, + const polynomialTransport& +); + +template +inline polynomialTransport operator== +( + const polynomialTransport&, + const polynomialTransport& +); + +template +Ostream& operator<< +( + Ostream&, + const polynomialTransport& +); + + +/*---------------------------------------------------------------------------*\ + Class polynomialTransport Declaration +\*---------------------------------------------------------------------------*/ + +template +class polynomialTransport +: + public Thermo +{ + // Private data + + //- Dynamic viscosity + Polynomial muPolynomial_; + + //- Thermal conductivity + Polynomial kappaPolynomial_; + + + // Private member functions + + //- Construct from components + inline polynomialTransport + ( + const Thermo& t, + const Polynomial& muPoly, + const Polynomial& kappaPoly + ); + + +public: + + // Constructors + + //- Construct as named copy + inline polynomialTransport(const word&, const polynomialTransport&); + + //- Construct from Istream + polynomialTransport(Istream& is); + + //- Construct and return a clone + inline autoPtr clone() const; + + // Selector from Istream + inline static autoPtr New(Istream& is); + + + // Member functions + + //- Dynamic viscosity [kg/ms] + inline scalar mu(const scalar T) const; + + //- Thermal conductivity [W/mK] + inline scalar kappa(const scalar T) const; + + //- Thermal diffusivity for enthalpy [kg/ms] + inline scalar alpha(const scalar T) const; + + // Species diffusivity + //inline scalar D(const scalar T) const; + + + // Member operators + + inline polynomialTransport& operator=(const polynomialTransport&); + + + // Friend operators + + friend polynomialTransport operator+ + ( + const polynomialTransport&, + const polynomialTransport& + ); + + friend polynomialTransport operator- + ( + const polynomialTransport&, + const polynomialTransport& + ); + + friend polynomialTransport operator* + ( + const scalar, + const polynomialTransport& + ); + + friend polynomialTransport operator== + ( + const polynomialTransport&, + const polynomialTransport& + ); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const polynomialTransport& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "polynomialTransportI.H" + +#ifdef NoRepository +# include "polynomialTransport.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H new file mode 100644 index 0000000000..9e6e00e6e3 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H @@ -0,0 +1,213 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "specie.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::polynomialTransport::polynomialTransport +( + const Thermo& t, + const Polynomial& muPoly, + const Polynomial& kappaPoly +) +: + Thermo(t), + muPolynomial_(muPoly), + kappaPolynomial_(kappaPoly) +{} + + +template +inline Foam::polynomialTransport::polynomialTransport +( + const word& name, + const polynomialTransport& pt +) +: + Thermo(name, pt), + muPolynomial_(pt.muPolynomial_), + kappaPolynomial_(pt.kappaPolynomial_) +{} + + +template +inline Foam::autoPtr > +Foam::polynomialTransport::clone() const +{ + return autoPtr > + ( + new polynomialTransport(*this) + ); +} + + +template +inline Foam::autoPtr > +Foam::polynomialTransport::New(Istream& is) +{ + return autoPtr > + ( + new polynomialTransport(is) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Foam::scalar Foam::polynomialTransport::mu +( + const scalar T +) const +{ + return muPolynomial_.evaluate(T); +} + + +template +inline Foam::scalar Foam::polynomialTransport::kappa +( + const scalar T +) const +{ + return kappaPolynomial_.evaluate(T); +} + + +template +inline Foam::scalar Foam::polynomialTransport::alpha +( + const scalar T +) const +{ + scalar deltaT = T - specie::Tstd; + scalar CpBar = + (deltaT*(this->H(T) - this->H(specie::Tstd)) + this->Cp(T)) + /(sqr(deltaT) + 1); + + return kappa(T)/CpBar; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +inline Foam::polynomialTransport& +Foam::polynomialTransport::operator= +( + const polynomialTransport& pt +) +{ + Thermo::operator=(pt); + + muPolynomial_ = pt.muPolynomial_; + kappaPolynomial_ = pt.kappaPolynomial_; + + return *this; +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template +inline Foam::polynomialTransport Foam::operator+ +( + const polynomialTransport& pt1, + const polynomialTransport& pt2 +) +{ + Thermo t + ( + static_cast(pt1) + static_cast(pt2) + ); + + + scalar molr1 = pt1.nMoles()/t.nMoles(); + scalar molr2 = pt2.nMoles()/t.nMoles(); + + return polynomialTransport + ( + t, + molr1*pt1.muPolynomial_ + molr2*pt2.muPolynomial_, + molr1*pt1.kappaPolynomial_ + molr2*pt2.kappaPolynomial_ + ); +} + + +template +inline Foam::polynomialTransport Foam::operator- +( + const polynomialTransport& pt1, + const polynomialTransport& pt2 +) +{ + Thermo t + ( + static_cast(pt1) - static_cast(pt2) + ); + + scalar molr1 = pt1.nMoles()/t.nMoles(); + scalar molr2 = pt2.nMoles()/t.nMoles(); + + return polynomialTransport + ( + t, + molr1*pt1.muPolynomial_ - molr2*pt2.muPolynomial_, + molr1*pt1.kappaPolynomial_ - molr2*pt2.kappaPolynomial_ + ); +} + + +template +inline Foam::polynomialTransport Foam::operator* +( + const scalar s, + const polynomialTransport& pt +) +{ + return polynomialTransport + ( + s*static_cast(pt), + pt.muPolynomial_, + pt.kappaPolynomial_ + ); +} + + +template +inline Foam::polynomialTransport Foam::operator== +( + const polynomialTransport& pt1, + const polynomialTransport& pt2 +) +{ + return pt2 - pt1; +} + + +// ************************************************************************* // From 3884724b964ed4357ea0245f452516374513f3c9 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 18:05:30 +0100 Subject: [PATCH 06/74] adding convenience include files --- .../specie/include/reactionTypes.H | 59 ++++++++++++++ .../specie/include/transportTypes.H | 77 +++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 src/thermophysicalModels/specie/include/reactionTypes.H create mode 100644 src/thermophysicalModels/specie/include/transportTypes.H diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H new file mode 100644 index 0000000000..9e153436b3 --- /dev/null +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Typedefs + Foam::reactionTypes + +Description + Type definitions for reactions + +\*---------------------------------------------------------------------------*/ + +#ifndef reactionTypes_H +#define reactionTypes_H + +#include "transportTypes.H" +#include "Reaction.H" + +#include "icoPolynomial.H" +#include "polynomialThermo.H" +#include "polynomialTransport.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef Reaction gasReaction; + + typedef Reaction constGasReaction; + + typedef Reaction icoPoly8Reaction; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/thermophysicalModels/specie/include/transportTypes.H b/src/thermophysicalModels/specie/include/transportTypes.H new file mode 100644 index 0000000000..0786bb9b05 --- /dev/null +++ b/src/thermophysicalModels/specie/include/transportTypes.H @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Typedefs + Foam::transportTypes + +Description + Type definitions for reacting transport models + +\*---------------------------------------------------------------------------*/ + +#ifndef transportTypes_H +#define transportTypes_H + +#include "perfectGas.H" +#include "hConstThermo.H" +#include "janafThermo.H" +#include "specieThermo.H" +#include "sutherlandTransport.H" +#include "constTransport.H" + +#include "icoPolynomial.H" +#include "polynomialThermo.H" +#include "polynomialTransport.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef sutherlandTransport > > + gasTransport; + + typedef constTransport > > + constGasTransport; + + typedef polynomialTransport + < + specieThermo + < + polynomialThermo + < + icoPolynomial<8>, + 8 + > + >, + 8 + > + icoPoly8Transport; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + From 44452c0b1b8f7564c16283339333163e73664bd4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 19:30:54 +0100 Subject: [PATCH 07/74] templated chemistry readers + developing rho based thermo --- .../chemistryModel/Make/files | 13 +- .../chemistryModel/Make/options | 15 +- .../ODEChemistryModel.C} | 314 ++++++++------- .../ODEChemistryModel/ODEChemistryModel.H | 223 +++++++++++ .../ODEChemistryModel/ODEChemistryModelI.H | 111 ++++++ .../chemistryModel/chemistryModel.H | 287 -------------- .../chemistryModel/chemistryModel.C | 73 ++++ .../chemistryModel/chemistryModel.H | 182 +++++++++ .../{ => chemistryModel}/chemistryModelI.H | 60 +-- .../chemistryModel/chemistryModels.C | 45 +++ .../chemistryModel/makeChemistryModel.H | 72 ++++ .../chemistryModel/newChemistryModel.C | 77 ++++ .../EulerImplicit/EulerImplicit.C | 84 ++-- .../EulerImplicit/EulerImplicit.H | 24 +- .../chemistrySolver/chemistrySolver.C | 19 +- .../chemistrySolver/chemistrySolver.H | 68 ++-- .../chemistrySolver/makeChemistrySolvers.C | 49 +++ .../chemistrySolver/newChemistrySolver.C | 24 +- .../chemistryModel/chemistrySolver/ode/ode.C | 52 +-- .../chemistryModel/chemistrySolver/ode/ode.H | 28 +- .../chemistrySolver/sequential/sequential.C | 48 +-- .../chemistrySolver/sequential/sequential.H | 24 +- .../reactionThermo/Make/files | 13 +- .../chemistryReader/chemistryReader.C | 23 +- .../chemistryReader/chemistryReader.H | 70 ++-- .../chemistryReader/makeChemistryReaders.C | 50 +++ .../chemkinReader/chemkinLexer.L | 30 +- .../chemkinReader/chemkinReader.C | 37 +- .../chemkinReader/chemkinReader.H | 26 +- .../foamChemistryReader/foamChemistryReader.C | 25 +- .../foamChemistryReader/foamChemistryReader.H | 26 +- .../hCombustionThermo/hCombustionThermos.C | 37 +- .../hPsiMixtureThermo.C} | 96 ++--- .../hPsiMixtureThermo.H} | 24 +- .../hhuMixtureThermo/hhuMixtureThermo.H | 2 +- .../reactingMixture/reactingMixture.C | 24 +- .../reactingMixture/reactingMixture.H | 26 +- .../hReactionThermo/hReactionThermo.C | 67 ++++ .../hReactionThermo/hReactionThermo.H | 141 +++++++ .../hReactionThermo/hReactionThermos.C | 71 ++++ .../hReactionThermo/makeReactionThermo.H | 96 +++++ .../hReactionThermo/newhReactionThermo.C | 78 ++++ .../hRhoMixtureThermo/hRhoMixtureThermo.C | 367 ++++++++++++++++++ .../hRhoMixtureThermo/hRhoMixtureThermo.H | 150 +++++++ .../specie/include/reactionTypes.H | 8 +- ...{transportTypes.H => thermoPhysicsTypes.H} | 14 +- .../reaction/reactions/makeChemkinReactions.C | 41 +- .../makeLangmuirHinshelwoodReactions.C | 8 +- .../reaction/reactions/makeReactionJanaf.H | 118 ------ .../reaction/reactions/makeReactionThermo.H | 158 ++++++++ 50 files changed, 2687 insertions(+), 1031 deletions(-) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel.C => ODEChemistryModel/ODEChemistryModel.C} (64%) create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H delete mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H rename src/thermophysicalModels/chemistryModel/chemistryModel/{ => chemistryModel}/chemistryModelI.H (65%) create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C create mode 100644 src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C rename src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/{hMixtureThermo/hMixtureThermo.C => hPsiMixtureThermo/hPsiMixtureThermo.C} (91%) rename src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/{hMixtureThermo/hMixtureThermo.H => hPsiMixtureThermo/hPsiMixtureThermo.H} (89%) create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H rename src/thermophysicalModels/specie/include/{transportTypes.H => thermoPhysicsTypes.H} (90%) delete mode 100644 src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H create mode 100644 src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index 542393735c..73bd57812c 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -1,12 +1,7 @@ -chemistryModel = chemistryModel -chemistrySolver = chemistrySolver +chemistryModel/chemistryModel/chemistryModel.C +chemistryModel/chemistryModel/newChemistryModel.C +chemistryModel/chemistryModel/chemistryModels.C -$(chemistryModel)/chemistryModel.C - -$(chemistrySolver)/chemistrySolver/chemistrySolver.C -$(chemistrySolver)/chemistrySolver/newChemistrySolver.C -$(chemistrySolver)/sequential/sequential.C -$(chemistrySolver)/EulerImplicit/EulerImplicit.C -$(chemistrySolver)/ode/ode.C +chemistrySolver/chemistrySolver/makeChemistrySolvers.C LIB = $(FOAM_LIBBIN)/libchemistryModel diff --git a/src/thermophysicalModels/chemistryModel/Make/options b/src/thermophysicalModels/chemistryModel/Make/options index 80ca3a7c6d..3cdfbc22ac 100644 --- a/src/thermophysicalModels/chemistryModel/Make/options +++ b/src/thermophysicalModels/chemistryModel/Make/options @@ -1,15 +1,16 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/functions/Polynomial \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude LIB_LIBS = \ - -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lbasicThermophysicalModels \ + -lreactionThermophysicalModels \ + -lspecie \ -lthermophysicalFunctions \ - -lspecie \ - -lODE + -lODE diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C similarity index 64% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 78ce070b19..3ece5e2ee9 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C @@ -24,96 +24,78 @@ License \*---------------------------------------------------------------------------*/ -#include "chemistryModel.H" +#include "ODEChemistryModel.H" #include "chemistrySolver.H" -#include "multiComponentMixture.H" +#include "reactingMixture.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::chemistryModel::chemistryModel -( - hCombustionThermo& thermo, - const volScalarField& rho -) +template +Foam::ODEChemistryModel::ODEChemistryModel(const fvMesh& mesh) : - thermo_(thermo), + chemistryModel(mesh), - Y_(thermo.composition().Y()), - rho_(rho), + ODE(), - chemistryProperties_ + Y_(this->thermo().composition().Y()), + + reactions_ ( - IOobject - ( - "chemistryProperties", - rho_.time().constant(), - rho_.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE - ) + dynamic_cast&>(this->thermo()) ), - chemistry_(chemistryProperties_.lookup("chemistry")), - - reactions_(dynamic_cast(thermo)), - specieThermo_(dynamic_cast(thermo).speciesData()), - - Ns_(thermo.composition().Y().size()), - Nr_(reactions_.size()), - - solver_ + specieThermo_ ( - chemistrySolver::New - ( - chemistryProperties_, - *this - ) + dynamic_cast&> + (this->thermo()).speciesData() ), - deltaTChem_ - ( - rho_.size(), - readScalar(chemistryProperties_.lookup("initialChemicalTimeStep")) - ) + + nSpecie_(Y_.size()), + nReaction_(reactions_.size()), + + solver_(chemistrySolver::New(*this)), + + RR_(nSpecie_) { - // set the size of the chemistry sources - RR_.setSize(Ns()); - for(label i=0; imesh_.time().timeName(), + this->mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - rho_.mesh(), - dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0), + this->mesh_, + dimensionedScalar("zero", dimTime, 0.0), zeroGradientFvPatchScalarField::typeName ) ); @@ -522,37 +507,89 @@ Foam::tmp Foam::chemistryModel::tc() const } -Foam::label Foam::chemistryModel::nEqns() const +template +Foam::tmp +Foam::ODEChemistryModel::dQ() const { - // nEqns = number of species + temperature + pressure - return Ns_ + 2; + tmp tdQ + ( + new volScalarField + ( + IOobject + ( + "dQ", + this->mesh_.time().timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar + ( + "zero", + dimensionSet(1, -3, -1 , 0, 0, 0, 0), + 0.0 + ) + ) + ); + + if (chemistry_) + { + scalarField& dQ = tdQ(); + + scalarField cp(dQ.size(), 0.0); + + forAll(Y_, i) + { + forAll(dQ, cellI) + { + scalar Ti = this->thermo().T()[cellI]; + cp[cellI] += Y_[i][cellI]*specieThermo_[i].Cp(Ti); + scalar hi = specieThermo_[i].h(Ti); + dQ[cellI] -= hi*RR_[i][cellI]; + } + } + + dQ /= cp; + } + + return tdQ; } -void Foam::chemistryModel::calculate() +template +Foam::label Foam::ODEChemistryModel::nEqns() const { - for(label i=0; i +void Foam::ODEChemistryModel::calculate() +{ + for (label i=0; ithermo().rho()().size()); } if (chemistry_) { - for(label celli=0; cellithermo().rho()(), celli) { - for(label i=0; ithermo().rho()()[celli]; + scalar Ti = this->thermo().T()[celli]; + scalar pi = this->thermo().p()[celli]; - scalarField c(Ns_); + scalarField c(nSpecie_); scalarField dcdt(nEqns(), 0.0); - for(label i=0; i +Foam::scalar Foam::ODEChemistryModel::solve +( + const scalar t0, + const scalar deltaT +) { - for(label i=0; ithermo().rho()().size()); } if (!chemistry_) @@ -583,23 +625,23 @@ Foam::scalar Foam::chemistryModel::solve(const scalar t0, const scalar deltaT) scalar deltaTMin = GREAT; - for(label celli=0; cellithermo().rho()(), celli) { - for(label i=0; ithermo().rho()()[celli]; + scalar Ti = this->thermo().T()[celli]; + scalar hi = this->thermo().h()[celli]; + scalar pi = this->thermo().p()[celli]; - scalarField c(Ns_); - scalarField c0(Ns_); - scalarField dc(Ns_, 0.0); + scalarField c(nSpecie_); + scalarField c0(nSpecie_); + scalarField dc(nSpecie_, 0.0); - for(label i=0; i +class chemistrySolver; + +/*---------------------------------------------------------------------------*\ + Class ODEChemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class ODEChemistryModel +: + public chemistryModel, + public ODE +{ + // Private Member Functions + + //- Disallow default bitwise assignment + void operator=(const ODEChemistryModel&); + + +protected: + + // Private data + + //- Reference to the field of specie mass fractions + PtrList& Y_; + + //- Reactions + const PtrList >& reactions_; + + //- Thermodynamic data of the species + const PtrList& specieThermo_; + + //- Number of species + label nSpecie_; + + //- Number of reactions + label nReaction_; + + //- Chemistry solver + autoPtr > solver_; + + //- Chemical source term + PtrList RR_; + + + // Protected Member Functions + + //- Write access to chemical source terms + // (e.g. for multi-chemistry model) + inline PtrList& RR(); + + +public: + + //- Runtime type information + TypeName("ODEChemistryModel"); + + + // Constructors + + //- Construct from components + ODEChemistryModel(const fvMesh& mesh); + + + //- Destructor + virtual ~ODEChemistryModel(); + + + // Member Functions + + //- The reactions + inline const PtrList >& reactions() const; + + //- Thermodynamic data of the species + inline const PtrList& specieThermo() const; + + //- The number of species + inline label nSpecie() const; + + //- The number of reactions + inline label nReaction() const; + + //- Return the chemisty solver + inline const chemistrySolver& solver() const; + + //- dc/dt = omega, rate of change in concentration, for each species + virtual scalarField omega + ( + const scalarField& c, + const scalar T, + const scalar p + ) const; + + //- Return the reaction rate for reaction r and the reference + // species and charateristic times + virtual scalar omega + ( + const Reaction& r, + const scalarField& c, + const scalar T, + const scalar p, + scalar& pf, + scalar& cf, + label& lRef, + scalar& pr, + scalar& cr, + label& rRef + ) const; + + //- Calculates the reaction rates + virtual void calculate(); + + + // Chemistry model functions (overriding abstract functions in + // chemistryModel.H) + + //- Return const access to the chemical source terms + inline tmp RR(const label i) const; + + //- Solve the reaction system for the given start time and time + // step and return the characteristic time + virtual scalar solve(const scalar t0, const scalar deltaT); + + //- Return the chemical time scale + virtual tmp tc() const; + + //- Return the heat release + virtual tmp dQ() const; + + + // ODE functions (overriding abstract functions in ODE.H) + + //- Number of ODE's to solve + virtual label nEqns() const; + + virtual void derivatives + ( + const scalar t, + const scalarField& c, + scalarField& dcdt + ) const; + + virtual void jacobian + ( + const scalar t, + const scalarField& c, + scalarField& dcdt, + scalarSquareMatrix& dfdc + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "ODEChemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ODEChemistryModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H new file mode 100644 index 0000000000..4fb0ee5a6d --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "zeroGradientFvPatchFields.H" + +template +inline Foam::PtrList& +Foam::ODEChemistryModel::RR() +{ + return RR_; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline const Foam::PtrList >& +Foam::ODEChemistryModel::reactions() const +{ + return reactions_; +} + + +template +inline const Foam::PtrList& +Foam::ODEChemistryModel::specieThermo() const +{ + return specieThermo_; +} + + +template +inline Foam::label Foam::ODEChemistryModel::nSpecie() const +{ + return nSpecie_; +} + + +template +inline Foam::label Foam::ODEChemistryModel::nReaction() const +{ + return nReaction_; +} + + +template +inline const Foam::chemistrySolver& +Foam::ODEChemistryModel::solver() const +{ + return solver_; +} + + +template +inline Foam::tmp +Foam::ODEChemistryModel::RR +( + const label i +) const +{ + tmp tRR + ( + new volScalarField + ( + IOobject + ( + "RR(" + this->Y_[i].name() + ')', + this->thermo().rho()().mesh().time().timeName(), + this->thermo().rho()().mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->thermo().rho()().mesh(), + dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0), + zeroGradientFvPatchScalarField::typeName + ) + ); + + if (chemistry_) + { + tRR().internalField() = RR_[i]; + tRR().correctBoundaryConditions(); + } + return tRR; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H deleted file mode 100644 index 7527cd480c..0000000000 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H +++ /dev/null @@ -1,287 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::chemistryModel - -Description - Foam::chemistryModel - -SourceFiles - chemistryModelI.H - chemistryModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef chemistryModel_H -#define chemistryModel_H - -#include "hCombustionThermo.H" -#include "reactingMixture.H" -#include "ODE.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -class chemistrySolver; - -/*---------------------------------------------------------------------------*\ - Class chemistryModel Declaration -\*---------------------------------------------------------------------------*/ - -class chemistryModel -: - public ODE -{ - -public: - - typedef reactingMixture::reaction reaction; - typedef reactingMixture::reactionThermo reactionThermo; - - -private: - - // Private data - - //- Reference to the thermo package - const hCombustionThermo& thermo_; - - //- Reference to the field of specie mass fractions - PtrList& Y_; - - //- Reference to the density field - const volScalarField& rho_; - - //- Chemistry properties dictionary - IOdictionary chemistryProperties_; - - //- Flag to activate the chemistry (or not) - Switch chemistry_; - - //- List of reactions - const PtrList& reactions_; - - //- Thermodynamic data of the species - const PtrList& specieThermo_; - - //- Number of species - label Ns_; - - //- Number of reactions - label Nr_; - - //- Chemistry solver - autoPtr solver_; - - //- Chemical source term - PtrList RR_; - - //- Latest estimation of integration step - scalarField deltaTChem_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator=(const chemistryModel&); - - -protected: - - // Protected Member Functions - - //- Write access to chemical source terms - // (eg, for multi-chemistry model) - PtrList& RR() - { - return RR_; - } - - //- Return the latest estimation of integration step - // (eg, for multi-chemistry model) - scalarField& deltaTChem() - { - return deltaTChem_; - } - -public: - - // Constructors - - //- Construct from components - chemistryModel - ( - hCombustionThermo& thermo, - const volScalarField& rho - ); - - - // Destructor - - virtual ~chemistryModel(); - - - // Member Functions - - //- Return the thermodynamics model - const hCombustionThermo& thermo() const - { - return thermo_; - } - - //- Access the mass fractions of the species - const PtrList& Y() const - { - return Y_; - } - - //- Access the density field - const volScalarField& rho() const - { - return rho_; - } - - //- Return the chemistry properties - inline const IOdictionary& chemistryProperties() const - { - return chemistryProperties_; - } - - //- Do the chemistry or not. - inline Switch chemistry() const - { - return chemistry_; - } - - inline const PtrList& reactions() const - { - return reactions_; - } - - inline const PtrList& specieThermo() const - { - return specieThermo_; - } - - //- The number of species - inline label Ns() const - { - return Ns_; - } - - //- The number of reactions - inline label Nr() const - { - return Nr_; - } - - // Return the chemisty solver - inline const chemistrySolver& solver() const - { - return solver_; - } - - //- Return the chemical source terms - inline tmp RR(const label i) const; - - //- Return the latest estimation of integration step - const scalarField& deltaTChem() const - { - return deltaTChem_; - } - - //- The chemical time scale - tmp tc() const; - - //- dc/dt = omega, rate of change in concentration, for each species - scalarField omega - ( - const scalarField& c, - const scalar T, - const scalar p - ) const; - - //- return the reaction rate for reaction r and the reference - // species and charateristic times - scalar omega - ( - const reaction& r, - const scalarField& c, - const scalar T, - const scalar p, - scalar& pf, - scalar& cf, - label& lRef, - scalar& pr, - scalar& cr, - label& rRef - ) const; - - //- The number of ODE to solve - label nEqns() const; - - void derivatives - ( - const scalar t, - const scalarField& c, - scalarField& dcdt - ) const; - - void jacobian - ( - const scalar t, - const scalarField& c, - scalarField& dcdt, - scalarSquareMatrix& dfdc - ) const; - - //- Calculates the reaction rates - void calculate(); - - //- Solve the reaction system for the given start time and time-step - // and return the characteristic time - scalar solve - ( - const scalar t0, - const scalar deltaT - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "chemistryModelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C new file mode 100644 index 0000000000..47181a4d06 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "chemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(chemistryModel, 0); + defineRunTimeSelectionTable(chemistryModel, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::chemistryModel::chemistryModel(const fvMesh& mesh) +: + IOdictionary + ( + IOobject + ( + "chemistryProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + mesh_(mesh), + thermo_(hCombustionThermo::New(mesh)), + chemistry_(lookup("chemistry")), + deltaTChem_ + ( + mesh.nCells(), + readScalar(lookup("initialChemicalTimeStep")) + ) +{ + Info<< "chemistryModel(const fvMesh&)" << endl; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::chemistryModel::~chemistryModel() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H new file mode 100644 index 0000000000..91b5186da4 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H @@ -0,0 +1,182 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::chemistryModel + +Description + Foam::chemistryModel + +SourceFiles + chemistryModelI.H + chemistryModel.C + newChemistryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef chemistryModel_H +#define chemistryModel_H + +#include "IOdictionary.H" +#include "Switch.H" +#include "scalarField.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "hCombustionThermo.H" +//#include "basicMultiComponentMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class fvMesh; + +/*---------------------------------------------------------------------------*\ + class chemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +class chemistryModel +: + public IOdictionary +{ + // Private Member Functions + + //- Construct as copy (not implemented) + chemistryModel(const chemistryModel&); + + //- Disallow default bitwise assignment + void operator=(const chemistryModel&); + + +protected: + + // Protected data + + //- Reference to the mesh database + const fvMesh& mesh_; + + //- Thermo package + autoPtr thermo_; + + //- Chemistry activation switch + Switch chemistry_; + + //- Latest estimation of integration step + scalarField deltaTChem_; + + + // Protected member functions + + //- Return non-const access to the latest estimation of integration + // step, e.g. for multi-chemistry model + scalarField& deltaTChem(); + + +public: + + //- Runtime type information + TypeName("chemistryModel"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + chemistryModel, + fvMesh, + ( + const fvMesh& mesh + ), + (mesh) + ); + + + // Constructors + + //- Construct from mesh + chemistryModel(const fvMesh& mesh); + + + //- Selector + static autoPtr New(const fvMesh& mesh); + + //- Destructor + virtual ~chemistryModel(); + + + // Member Functions + + //- Return const access to the mesh database + inline const fvMesh& mesh() const; + + //- Return access to the thermo package + inline hCombustionThermo& thermo(); + + //- Return const access to the thermo package + inline const hCombustionThermo& thermo() const; + + //- Chemistry activation switch + inline Switch chemistry() const; + + //- Return the latest estimation of integration step + inline const scalarField& deltaTChem() const; + + + // Functions to be derived in derived classes + + // Fields + + //- Return const access to chemical source terms + virtual tmp RR(const label i) const = 0; + + + // Chemistry solution + + //- Solve the reaction system for the given start time and + // timestep and return the characteristic time + virtual scalar solve(const scalar t0, const scalar deltaT) = 0; + + //- Return the chemical time scale + virtual tmp tc() const = 0; + + //- Return the heat release + virtual tmp dQ() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "chemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H similarity index 65% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModelI.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H index cec949f5cb..d37b4afc80 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H @@ -24,39 +24,41 @@ License \*---------------------------------------------------------------------------*/ -#include "zeroGradientFvPatchFields.H" - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::tmp Foam::chemistryModel::RR -( - const label i -) const +inline const Foam::fvMesh& Foam::chemistryModel::mesh() const { - tmp tRR - ( - new volScalarField - ( - IOobject - ( - "RR(" + Y_[i].name() + ')', - rho_.time().timeName(), - rho_.db(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - rho_.mesh(), - dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0), - zeroGradientFvPatchScalarField::typeName - ) - ); + return mesh_; +} - if (chemistry_) - { - tRR().internalField() = RR_[i]; - tRR().correctBoundaryConditions(); - } - return tRR; + +inline Foam::hCombustionThermo& Foam::chemistryModel::thermo() +{ + return thermo_(); +} + + +inline const Foam::hCombustionThermo& Foam::chemistryModel::thermo() const +{ + return thermo_(); +} + + +inline Foam::Switch Foam::chemistryModel::chemistry() const +{ + return chemistry_; +} + + +inline const Foam::scalarField& Foam::chemistryModel::deltaTChem() const +{ + return deltaTChem_; +} + + +inline Foam::scalarField& Foam::chemistryModel::deltaTChem() +{ + return deltaTChem_; } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C new file mode 100644 index 0000000000..2a2ccc2994 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::chemistryModel + +Description + Creates chemistry model instances templated on the type of thermodynamics + +\*---------------------------------------------------------------------------*/ + +#include "thermoPhysicsTypes.H" +#include "makeChemistryModel.H" +#include "ODEChemistryModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeChemistryModel(ODEChemistryModel, gasThermoPhysics); + makeChemistryModel(ODEChemistryModel, icoPoly8ThermoPhysics); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H new file mode 100644 index 0000000000..c042ef7153 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::chemistryModel + +Description + Macros for instantiating chemistry models based on transport type + +\*---------------------------------------------------------------------------*/ + +#ifndef makeChemistryModel_H +#define makeChemistryModel_H + +#include "chemistryModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeChemistryModel(SS, Transport) \ + \ +typedef SS SS##Transport; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + SS##Transport, \ + #SS"<"#Transport">", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + chemistryModel, \ + SS##Transport, \ + fvMesh \ +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C new file mode 100644 index 0000000000..1197051acc --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "chemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::chemistryModel::New +( + const fvMesh& mesh +) +{ + word chemistryModelType; + + // Enclose the creation of the chemistrtyProperties to ensure it is + // deleted before the chemistrtyProperties is created otherwise the + // dictionary is entered in the database twice + { + IOdictionary chemistryPropertiesDict + ( + IOobject + ( + "chemistryProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + chemistryPropertiesDict.lookup("chemistryModel") >> chemistryModelType; + } + + Info<< "Selecting chemistryModel " << chemistryModelType << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(chemistryModelType); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("chemistryModelBase::New(const mesh&)") + << "Unknown chemistryModel type " << chemistryModelType << nl << nl + << "Valid chemistryModel types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C index 53398178a7..5699a75f78 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C @@ -28,30 +28,16 @@ License #include "addToRunTimeSelectionTable.H" #include "simpleMatrix.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(EulerImplicit, 0); - addToRunTimeSelectionTable - ( - chemistrySolver, - EulerImplicit, - dictionary - ); -}; - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::EulerImplicit::EulerImplicit +template +Foam::EulerImplicit::EulerImplicit ( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry + ODEChemistryModel& model ) : - chemistrySolver(dict, chemistry), - coeffsDict_(dict.subDict(typeName + "Coeffs")), + chemistrySolver(model), + coeffsDict_(model.subDict(typeName + "Coeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), equil_(coeffsDict_.lookup("equilibriumRateLimiter")) {} @@ -59,13 +45,15 @@ Foam::EulerImplicit::EulerImplicit // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::EulerImplicit::~EulerImplicit() +template +Foam::EulerImplicit::~EulerImplicit() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::EulerImplicit::solve +template +Foam::scalar Foam::EulerImplicit::solve ( scalarField &c, const scalar T, @@ -74,28 +62,27 @@ Foam::scalar Foam::EulerImplicit::solve const scalar dt ) const { - scalar pf, cf, pr, cr; label lRef, rRef; - label Ns = chemistry_.Ns(); - simpleMatrix RR(Ns); - - for(label i=0; imodel_.nSpecie(); + simpleMatrix RR(nSpecie); + + for (label i=0; imodel_.reactions().size(); i++) { - const chemistryModel::reaction& R = chemistry_.reactions()[i]; + const Reaction& R = this->model_.reactions()[i]; - scalar omegai = chemistry_.omega + scalar omegai = this->model_.omega ( R, c, T, p, pf, cf, lRef, pr, cr, rRef ); @@ -113,59 +100,59 @@ Foam::scalar Foam::EulerImplicit::solve } } - for(label s=0; smodel_.nEqns(); + scalarField c1(nEqns, 0.0); - for(label i=0; imodel_.derivatives(0.0, c1, dcdt); - scalarField dcdt(n, 0.0); - chemistry_.derivatives(0.0, c1, dcdt); - scalar sumC = sum(c); - for(label i=0; i class EulerImplicit : - public chemistrySolver + public chemistrySolver { // Private data dictionary coeffsDict_; - // model constants - + // Model constants + scalar cTauChem_; Switch equil_; @@ -70,16 +71,11 @@ public: // Constructors //- Construct from components - EulerImplicit - ( - const dictionary& dict, - chemistryModel& chemistry - ); + EulerImplicit(ODEChemistryModel& chemistry); - // Destructor - - ~EulerImplicit(); + //- Destructor + virtual ~EulerImplicit(); // Member Functions @@ -102,6 +98,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "EulerImplicit.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C index 4b3463f03e..23dbfcd033 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C @@ -29,29 +29,22 @@ License namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(chemistrySolver, 0); -defineRunTimeSelectionTable(chemistrySolver, dictionary); - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::chemistrySolver::chemistrySolver +template +Foam::chemistrySolver::chemistrySolver ( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry + ODEChemistryModel& model ) : - dict_(dict), - chemistry_(chemistry) + model_(model) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::chemistrySolver::~chemistrySolver() +template +Foam::chemistrySolver::~chemistrySolver() {} diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H index 6a1a9f6ade..b21b692b91 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H @@ -36,7 +36,7 @@ SourceFiles #ifndef chemistrySolver_H #define chemistrySolver_H -#include "chemistryModel.H" +#include "ODEChemistryModel.H" #include "IOdictionary.H" #include "scalarField.H" #include "autoPtr.H" @@ -48,16 +48,18 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class chemistrySolver Declaration + Class chemistrySolver Declaration \*---------------------------------------------------------------------------*/ +template class chemistrySolver { - protected: - const dictionary& dict_; - chemistryModel& chemistry_; + // Protected data + + //- Reference to the chemistry model + ODEChemistryModel& model_; public: @@ -73,35 +75,27 @@ public: chemistrySolver, dictionary, ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel& model ), - (dict, chemistry) + (model) ); // Constructors //- Construct from components - chemistrySolver - ( - const dictionary& dict, - chemistryModel& chemistry - ); + chemistrySolver(ODEChemistryModel& model); - // Selectors - - static autoPtr New - ( - const dictionary& dict, - chemistryModel& chemistry - ); + //- Selector + static autoPtr New + ( + ODEChemistryModel& model + ); - // Destructor - - virtual ~chemistrySolver(); + //- Destructor + virtual ~chemistrySolver(); // Member Functions @@ -124,6 +118,34 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#define makeChemistrySolver(Thermo) \ + \ +defineTemplateTypeNameAndDebug \ +( \ + chemistrySolver, \ + 0 \ +); \ + \ +defineTemplateRunTimeSelectionTable(chemistrySolver, dictionary); + + +#define makeChemistrySolverType(SS, Thermo) \ + \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ + \ + chemistrySolver::adddictionaryConstructorToTable > \ + add##SS##Thermo##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "chemistrySolver.C" +# include "newChemistrySolver.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C new file mode 100644 index 0000000000..9bfa6c50a2 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "thermoPhysicsTypes.H" +#include "chemistrySolver.H" + +#include "EulerImplicit.H" +#include "ode.H" +#include "sequential.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeChemistrySolver(gasThermoPhysics) + makeChemistrySolverType(EulerImplicit, gasThermoPhysics) + makeChemistrySolverType(ode, gasThermoPhysics) + makeChemistrySolverType(sequential, gasThermoPhysics) + + makeChemistrySolver(icoPoly8ThermoPhysics) + makeChemistrySolverType(EulerImplicit, icoPoly8ThermoPhysics) + makeChemistrySolverType(ode, icoPoly8ThermoPhysics) + makeChemistrySolverType(sequential, icoPoly8ThermoPhysics) +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C index 37869dcf30..f868fd3055 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C @@ -26,33 +26,33 @@ License #include "chemistrySolver.H" - // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::chemistrySolver::New +template +Foam::autoPtr > +Foam::chemistrySolver::New ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel& model ) { - word chemistrySolverType(dict.lookup("chemistrySolver")); + word chemistrySolverType(model.chemistryModel::lookup("chemistrySolver")); - dictionaryConstructorTable::iterator cstrIter = + typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(chemistrySolverType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( - "chemistrySolver::New(const dictionary&, const chemistryModel&)" - ) << "Unknown chemistrySolverType type " << chemistrySolverType - << endl << endl - << "Valid chemistrySolverType types are :" << endl - << dictionaryConstructorTablePtr_->toc() + "chemistrySolver::New(const dictionary&, const ODEChemistryModel&)" + ) << "Unknown chemistrySolver type " << chemistrySolverType + << nl << nl + << "Valid chemistrySolver types are:" << nl + << dictionaryConstructorTablePtr_->toc() << nl << exit(FatalError); } - return autoPtr(cstrIter()(dict, chemistry)); + return autoPtr >(cstrIter()(model)); } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C index dcc05caaf1..946567477f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C @@ -25,36 +25,17 @@ License \*---------------------------------------------------------------------------*/ #include "ode.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(ode, 0); - addToRunTimeSelectionTable - ( - chemistrySolver, - ode, - dictionary - ); -} - +#include "ODEChemistryModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::ode::ode -( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry -) +template +Foam::ode::ode(ODEChemistryModel& model) : - chemistrySolver(dict, chemistry), - chemistry_(chemistry), - coeffsDict_(dict.subDict(typeName + "Coeffs")), + chemistrySolver(model), + coeffsDict_(model.subDict(typeName + "Coeffs")), solverName_(coeffsDict_.lookup("ODESolver")), - odeSolver_(ODESolver::New(solverName_, chemistry)), + odeSolver_(ODESolver::New(solverName_, model)), eps_(readScalar(coeffsDict_.lookup("eps"))), scale_(readScalar(coeffsDict_.lookup("scale"))) {} @@ -62,14 +43,15 @@ Foam::ode::ode // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::ode::~ode() +template +Foam::ode::~ode() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::ode::solve +template +Foam::scalar Foam::ode::solve ( scalarField& c, const scalar T, @@ -78,22 +60,22 @@ Foam::scalar Foam::ode::solve const scalar dt ) const { - label Ns = chemistry_.Ns(); - scalarField c1(chemistry_.nEqns(), 0.0); + label nSpecie = this->model_.nSpecie(); + scalarField c1(this->model_.nEqns(), 0.0); // copy the concentration, T and P to the total solve-vector - for(label i=0; isolve ( - chemistry_, + this->model_, t0, t0 + dt, c1, @@ -101,7 +83,7 @@ Foam::scalar Foam::ode::solve dtEst ); - for(label i=0; i class ode : - public chemistrySolver + public chemistrySolver { // Private data - chemistryModel& chemistry_; - dictionary coeffsDict_; const word solverName_; autoPtr odeSolver_; - // model constants - + // Model constants + scalar eps_; scalar scale_; @@ -75,16 +74,11 @@ public: // Constructors //- Construct from components - ode - ( - const dictionary& dict, - chemistryModel& chemistry - ); + ode(ODEChemistryModel& model); - // Destructor - - ~ode(); + //- Destructor + virtual ~ode(); // Member Functions @@ -106,6 +100,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "ode.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C index 1837f533db..6266ea32f0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C @@ -27,31 +27,13 @@ License #include "sequential.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(sequential, 0); - addToRunTimeSelectionTable - ( - chemistrySolver, - sequential, - dictionary - ); -}; - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::sequential::sequential -( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry -) +template +Foam::sequential::sequential(ODEChemistryModel& model) : - chemistrySolver(dict, chemistry), - coeffsDict_(dict.subDict(typeName + "Coeffs")), + chemistrySolver(model), + coeffsDict_(model.subDict(typeName + "Coeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), equil_(coeffsDict_.lookup("equilibriumRateLimiter")) {} @@ -59,13 +41,15 @@ Foam::sequential::sequential // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::sequential::~sequential() +template +Foam::sequential::~sequential() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::sequential::solve +template +Foam::scalar Foam::sequential::solve ( scalarField &c, const scalar T, @@ -79,11 +63,11 @@ Foam::scalar Foam::sequential::solve scalar pf, cf, pb, cb; label lRef, rRef; - for(label i=0; imodel_.reactions().size(); i++) { - const chemistryModel::reaction& R = chemistry_.reactions()[i]; + const Reaction& R = this->model_.reactions()[i]; - scalar om0 = chemistry_.omega + scalar om0 = this->model_.omega ( R, c, T, p, pf, cf, lRef, pb, cb, rRef ); @@ -108,23 +92,23 @@ Foam::scalar Foam::sequential::solve // update species - for(label s=0; s class sequential : - public chemistrySolver + public chemistrySolver { // Private data dictionary coeffsDict_; - // model constants + // Model constants scalar cTauChem_; Switch equil_; @@ -73,16 +74,11 @@ public: //- Construct from components - sequential - ( - const dictionary& dict, - chemistryModel& chemistry - ); + sequential(ODEChemistryModel& model); - // Destructor - - ~sequential(); + //- Destructor + virtual ~sequential(); // Member Functions @@ -105,6 +101,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "sequential.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files index 177a2efd1e..9d41df7349 100644 --- a/src/thermophysicalModels/reactionThermo/Make/files +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -1,10 +1,8 @@ -chemistryReaders/chemistryReader/chemistryReader.C -chemistryReaders/foamChemistryReader/foamChemistryReader.C chemistryReaders/chemkinReader/chemkinReader.C -chemistryReaders/chemkinReader/chemkinLexer.L +chemistryReaders/chemkinReader/chemkinLexer.C +chemistryReaders/chemistryReader/makeChemistryReaders.C -/* mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C */ -mixtures/reactingMixture/reactingMixture.C +mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C combustion/hCombustionThermo/hCombustionThermo.C combustion/hCombustionThermo/newhCombustionThermo.C @@ -14,6 +12,11 @@ combustion/hhuCombustionThermo/hhuCombustionThermo.C combustion/hhuCombustionThermo/newhhuCombustionThermo.C combustion/hhuCombustionThermo/hhuCombustionThermos.C +reactionThermo/hReactionThermo/hReactionThermo.C +reactionThermo/hReactionThermo/newhReactionThermo.C +reactionThermo/hReactionThermo/hReactionThermos.C + + derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index 38ad6e1f98..e178bd0338 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -26,17 +26,11 @@ License #include "chemistryReader.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(chemistryReader, 0); - defineRunTimeSelectionTable(chemistryReader, dictionary); -}; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::chemistryReader::New +template +Foam::autoPtr > +Foam::chemistryReader::New ( const dictionary& thermoDict ) @@ -50,9 +44,8 @@ Foam::autoPtr Foam::chemistryReader::New Info<< "Selecting chemistryReader " << chemistryReaderTypeName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_ - ->find(chemistryReaderTypeName); + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(chemistryReaderTypeName); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -60,13 +53,13 @@ Foam::autoPtr Foam::chemistryReader::New ( "chemistryReader::New(const dictionary& thermoDict)" ) << "Unknown chemistryReader type " - << chemistryReaderTypeName << endl << endl - << "Valid chemistryReaders are : " << endl + << chemistryReaderTypeName << nl << nl + << "Valid chemistryReaders are: " << nl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } - return autoPtr(cstrIter()(thermoDict)); + return autoPtr >(cstrIter()(thermoDict)); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H index bd5f4eaa1a..550d44c79a 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H @@ -39,10 +39,6 @@ SourceFiles #include "typeInfo.H" #include "runTimeSelectionTables.H" #include "Reaction.H" -#include "sutherlandTransport.H" -#include "specieThermo.H" -#include "janafThermo.H" -#include "perfectGas.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,23 +46,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class chemistryReader Declaration + Class chemistryReader Declaration \*---------------------------------------------------------------------------*/ +template class chemistryReader { - -public: - - // Public data types - - typedef sutherlandTransport > > - reactionThermo; - - typedef Reaction reaction; - -private: - // Private Member Functions //- Disallow default bitwise copy construct @@ -81,6 +66,9 @@ public: //- Runtime type information TypeName("chemistryReader"); + //- The type of thermo package the reader was instantiated for + typedef ThermoType thermoType; + // Constructors @@ -109,17 +97,18 @@ public: static autoPtr New(const dictionary& thermoDict); - // Destructor - - virtual ~chemistryReader() - {} + //- Destructor + virtual ~chemistryReader() + {} // Member Functions virtual const speciesTable& species() const = 0; - virtual const HashPtrTable& speciesThermo() const = 0; - virtual const SLPtrList& reactions() const = 0; + + virtual const HashPtrTable& speciesThermo() const = 0; + + virtual const SLPtrList >& reactions() const = 0; }; @@ -129,6 +118,41 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#define makeChemistryReader(Thermo) \ + \ +defineTemplateTypeNameAndDebug \ +( \ + chemistryReader, \ + 0 \ +); \ + \ +defineTemplateRunTimeSelectionTable(chemistryReader, dictionary); + + +#define makeChemistryReaderType(SS, Thermo) \ + \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ + \ + chemistryReader::adddictionaryConstructorToTable > \ + add##SS##Thermo##ConstructorToTable_; + + +#define addChemistryReaderType(SS, Thermo) \ + \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ + \ + chemistryReader::adddictionaryConstructorToTable \ + add##SS##Thermo##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "chemistryReader.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C new file mode 100644 index 0000000000..35ab18220b --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "makeReactionThermo.H" +#include "thermoPhysicsTypes.H" + +#include "chemistryReader.H" +#include "foamChemistryReader.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeChemistryReader(gasThermoPhysics); +makeChemistryReader(icoPoly8ThermoPhysics); + +makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L index d32e172dae..f7ec61e331 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------*\ +/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | @@ -306,13 +306,13 @@ List currentSpecieComposition(5); scalar currentLowT = 0; scalar currentHighT = 0; scalar currentCommonT = 0; -reactionThermo::coeffArray highCpCoeffs; -reactionThermo::coeffArray lowCpCoeffs; +gasThermoPhysics::coeffArray highCpCoeffs; +gasThermoPhysics::coeffArray lowCpCoeffs; -reaction::specieCoeffs currentSpecieCoeff; +gasReaction::specieCoeffs currentSpecieCoeff; -DynamicList lhs; -DynamicList rhs; +DynamicList lhs; +DynamicList rhs; scalarList ArrheniusCoeffs(3); DynamicList reactionCoeffs; @@ -322,7 +322,7 @@ label currentThirdBodyIndex = -1; word reactionCoeffsName = word::null; HashTable reactionCoeffsTable; -DynamicList *lrhsPtr = &lhs; +DynamicList *lrhsPtr = &lhs; reactionType rType = unknownReactionType; reactionRateType rrType = Arrhenius; @@ -614,7 +614,7 @@ bool finishReaction = false; {thermoLineLabel4} { - HashPtrTable::iterator specieThermoIter + HashPtrTable::iterator specieThermoIter ( speciesThermo_.find(currentSpecieName) ); @@ -627,7 +627,7 @@ bool finishReaction = false; speciesThermo_.insert ( currentSpecieName, - new reactionThermo + new gasThermoPhysics ( janafThermo ( @@ -863,7 +863,7 @@ bool finishReaction = false; { case unimolecularFallOffReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "LOW keyword given for a unimolecular fall-off" @@ -898,7 +898,7 @@ bool finishReaction = false; case chemicallyActivatedBimolecularReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "HIGH keyword given for a chemically" @@ -935,7 +935,7 @@ bool finishReaction = false; case TroeReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "TROE keyword given for a" @@ -969,7 +969,7 @@ bool finishReaction = false; case SRIReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "SRI keyword given for a" @@ -1434,7 +1434,7 @@ bool finishReaction = false; {reactionCoeff}{endReactionCoeffs} { - DynamicList& lrhs = *lrhsPtr; + DynamicList& lrhs = *lrhsPtr; bool found = false; @@ -1535,5 +1535,5 @@ bool finishReaction = false; %% /* ------------------------------------------------------------------------- *\ - ------ End of STLToFoam.L + ------ End of chemkinLexer.L \* ------------------------------------------------------------------------- */ diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index f04995cd3e..a684124122 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -46,8 +46,7 @@ License namespace Foam { - defineTypeNameAndDebug(chemkinReader, 0); - addToRunTimeSelectionTable(chemistryReader, chemkinReader, dictionary); + addChemistryReaderType(chemkinReader, gasThermoPhysics); }; /* * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * */ @@ -164,8 +163,8 @@ template void Foam::chemkinReader::addReactionType ( const reactionType rType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const ReactionRateType& rr ) { @@ -175,9 +174,9 @@ void Foam::chemkinReader::addReactionType { reactions_.append ( - new IrreversibleReaction + new IrreversibleReaction ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -194,9 +193,9 @@ void Foam::chemkinReader::addReactionType { reactions_.append ( - new ReversibleReaction + new ReversibleReaction ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -234,8 +233,8 @@ void Foam::chemkinReader::addPressureDependentReaction ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& efficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -417,8 +416,8 @@ void Foam::chemkinReader::addPressureDependentReaction void Foam::chemkinReader::addReaction ( - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& efficiencies, const reactionType rType, const reactionRateType rrType, @@ -493,9 +492,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -546,9 +545,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -651,9 +650,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -797,7 +796,7 @@ void Foam::chemkinReader::read const fileName& thermoFileName ) { - if (thermoFileName.size()) + if (thermoFileName != fileName::null) { std::ifstream thermoStream(thermoFileName.c_str()); diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index cdb9bc9095..de67910380 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -47,6 +47,8 @@ SourceFiles #include "speciesTable.H" #include "atomicWeights.H" +#include "reactionTypes.H" + #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -55,12 +57,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class chemkin Declaration + Class chemkinReader Declaration \*---------------------------------------------------------------------------*/ class chemkinReader : - public chemistryReader, + public chemistryReader, public yyFlexLexer { @@ -198,13 +200,13 @@ private: HashTable speciePhase_; //- Table of the thermodynamic data given in the CHEMKIN file - HashPtrTable speciesThermo_; + HashPtrTable speciesThermo_; //- Table of species composition HashTable > specieComposition_; //- List of the reactions - SLPtrList reactions_; + SLPtrList reactions_; // Private Member Functions @@ -256,8 +258,8 @@ private: void addReactionType ( const reactionType rType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const ReactionRateType& rr ); @@ -266,8 +268,8 @@ private: ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& thirdBodyEfficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -279,8 +281,8 @@ private: void addReaction ( - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& thirdBodyEfficiencies, const reactionType rType, const reactionRateType rrType, @@ -363,7 +365,7 @@ public: } //- Table of the thermodynamic data given in the CHEMKIN file - const HashPtrTable& speciesThermo() const + const HashPtrTable& speciesThermo() const { return speciesThermo_; } @@ -375,7 +377,7 @@ public: } //- List of the reactions - const SLPtrList& reactions() const + const SLPtrList& reactions() const { return reactions_; } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C index e0913fe3d1..7e06956ab5 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C @@ -28,36 +28,33 @@ License #include "IFstream.H" #include "addToRunTimeSelectionTable.H" -/* * * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * */ - -namespace Foam -{ - defineTypeNameAndDebug(foamChemistryReader, 0); - addToRunTimeSelectionTable(chemistryReader, foamChemistryReader, dictionary); -}; - // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // -// Construct from components -Foam::foamChemistryReader::foamChemistryReader +template +Foam::foamChemistryReader::foamChemistryReader ( const fileName& reactionsFileName, const fileName& thermoFileName ) : + chemistryReader(), speciesThermo_(IFstream(thermoFileName)()), speciesTable_(dictionary(IFstream(reactionsFileName)()).lookup("species")), reactions_ ( dictionary(IFstream(reactionsFileName)()).lookup("reactions"), - reaction::iNew(speciesTable_, speciesThermo_) + Reaction::iNew(speciesTable_, speciesThermo_) ) {} -// Construct from components -Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) +template +Foam::foamChemistryReader::foamChemistryReader +( + const dictionary& thermoDict +) : + chemistryReader(), speciesThermo_ ( IFstream @@ -84,7 +81,7 @@ Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) fileName(thermoDict.lookup("foamChemistryFile")).expand() )() ).lookup("reactions"), - reaction::iNew(speciesTable_, speciesThermo_) + typename Reaction::iNew(speciesTable_, speciesThermo_) ) {} diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H index 2fa851462d..129cf1c811 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H @@ -51,21 +51,22 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class foamChemistry Declaration + Class foamChemistry Declaration \*---------------------------------------------------------------------------*/ +template class foamChemistryReader : - public chemistryReader + public chemistryReader { //- Table of the thermodynamic data given in the foamChemistry file - HashPtrTable speciesThermo_; + HashPtrTable speciesThermo_; //- Table of species speciesTable speciesTable_; //- List of the reactions - SLPtrList reactions_; + SLPtrList > reactions_; // Private Member Functions @@ -97,10 +98,9 @@ public: foamChemistryReader(const dictionary& thermoDict); - // Destructor - - virtual ~foamChemistryReader() - {} + //- Destructor + virtual ~foamChemistryReader() + {} // Member functions @@ -112,13 +112,13 @@ public: } //- Table of the thermodynamic data given in the foamChemistry file - const HashPtrTable& speciesThermo() const + const HashPtrTable& speciesThermo() const { return speciesThermo_; } //- List of the reactions - const SLPtrList& reactions() const + const SLPtrList >& reactions() const { return reactions_; } @@ -131,6 +131,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "foamChemistryReader.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C index 81d28944b2..0828938c01 100644 --- a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C +++ b/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "hCombustionThermo.H" -#include "hMixtureThermo.H" +#include "hPsiMixtureThermo.H" #include "makeCombustionThermo.H" #include "addToRunTimeSelectionTable.H" @@ -46,7 +46,7 @@ License #include "multiComponentMixture.H" #include "reactingMixture.H" -#include "transportTypes.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ namespace Foam makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, homogeneousMixture, constTransport, hConstThermo, @@ -68,7 +68,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, inhomogeneousMixture, constTransport, hConstThermo, @@ -78,7 +78,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, veryInhomogeneousMixture, constTransport, hConstThermo, @@ -88,7 +88,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, homogeneousMixture, sutherlandTransport, janafThermo, @@ -98,7 +98,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, inhomogeneousMixture, sutherlandTransport, janafThermo, @@ -108,7 +108,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, veryInhomogeneousMixture, sutherlandTransport, janafThermo, @@ -118,32 +118,21 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, dieselMixture, sutherlandTransport, janafThermo, perfectGas ); -makeCombustionThermo -( - hCombustionThermo, - hMixtureThermo, - multiComponentMixture, - sutherlandTransport, - janafThermo, - perfectGas -); - - // Multi-component thermo makeCombustionMixtureThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, multiComponentMixture, - gasTransport + gasThermoPhysics ); @@ -152,9 +141,9 @@ makeCombustionMixtureThermo makeCombustionMixtureThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, reactingMixture, - gasTransport + gasThermoPhysics ); diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C similarity index 91% rename from src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C index 57d054ad43..7ca8690461 100644 --- a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C @@ -24,49 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "hMixtureThermo.H" +#include "hPsiMixtureThermo.H" #include "fvMesh.H" #include "fixedValueFvPatchFields.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::hMixtureThermo::hMixtureThermo(const fvMesh& mesh) -: - hCombustionThermo(mesh), - MixtureType(*this, mesh) -{ - scalarField& hCells = h_.internalField(); - const scalarField& TCells = T_.internalField(); - - forAll(hCells, celli) - { - hCells[celli] = this->cellMixture(celli).H(TCells[celli]); - } - - forAll(h_.boundaryField(), patchi) - { - h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); - } - - hBoundaryCorrection(h_); - - calculate(); - psi_.oldTime(); // Switch on saving old time -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::hMixtureThermo::~hMixtureThermo() -{} - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::hMixtureThermo::calculate() +void Foam::hPsiMixtureThermo::calculate() { const scalarField& hCells = h_.internalField(); const scalarField& pCells = p_.internalField(); @@ -131,14 +96,51 @@ void Foam::hMixtureThermo::calculate() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::hPsiMixtureThermo::hPsiMixtureThermo(const fvMesh& mesh) +: + hCombustionThermo(mesh), + MixtureType(*this, mesh) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); + + // Switch on saving old time + psi_.oldTime(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::hPsiMixtureThermo::~hPsiMixtureThermo() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::hMixtureThermo::correct() +void Foam::hPsiMixtureThermo::correct() { if (debug) { - Info<< "entering hMixtureThermo::correct()" << endl; + Info<< "entering hPsiMixtureThermo::correct()" << endl; } // force the saving of the old-time values @@ -148,14 +150,14 @@ void Foam::hMixtureThermo::correct() if (debug) { - Info<< "exiting hMixtureThermo::correct()" << endl; + Info<< "exiting hPsiMixtureThermo::correct()" << endl; } } template Foam::tmp -Foam::hMixtureThermo::hs() const +Foam::hPsiMixtureThermo::hs() const { const fvMesh& mesh = T_.mesh(); @@ -202,7 +204,7 @@ Foam::hMixtureThermo::hs() const template Foam::tmp -Foam::hMixtureThermo::hc() const +Foam::hPsiMixtureThermo::hc() const { const fvMesh& mesh = T_.mesh(); @@ -247,7 +249,7 @@ Foam::hMixtureThermo::hc() const template Foam::tmp -Foam::hMixtureThermo::h +Foam::hPsiMixtureThermo::h ( const scalarField& T, const labelList& cells @@ -267,7 +269,7 @@ Foam::hMixtureThermo::h template Foam::tmp -Foam::hMixtureThermo::h +Foam::hPsiMixtureThermo::h ( const scalarField& T, const label patchi @@ -287,7 +289,7 @@ Foam::hMixtureThermo::h template Foam::tmp -Foam::hMixtureThermo::Cp +Foam::hPsiMixtureThermo::Cp ( const scalarField& T, const label patchi @@ -308,7 +310,7 @@ Foam::hMixtureThermo::Cp template Foam::tmp -Foam::hMixtureThermo::Cp() const +Foam::hPsiMixtureThermo::Cp() const { const fvMesh& mesh = T_.mesh(); @@ -349,7 +351,7 @@ Foam::hMixtureThermo::Cp() const template -bool Foam::hMixtureThermo::read() +bool Foam::hPsiMixtureThermo::read() { if (hCombustionThermo::read()) { diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H similarity index 89% rename from src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H index 217109a310..6450328447 100644 --- a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H @@ -23,18 +23,18 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::hMixtureThermo + Foam::hPsiMixtureThermo Description - Foam::hMixtureThermo + Foam::hPsiMixtureThermo SourceFiles - hMixtureThermo.C + hPsiMixtureThermo.C \*---------------------------------------------------------------------------*/ -#ifndef hMixtureThermo_H -#define hMixtureThermo_H +#ifndef hPsiMixtureThermo_H +#define hPsiMixtureThermo_H #include "hCombustionThermo.H" @@ -44,11 +44,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hMixtureThermo Declaration + Class hPsiMixtureThermo Declaration \*---------------------------------------------------------------------------*/ template -class hMixtureThermo +class hPsiMixtureThermo : public hCombustionThermo, public MixtureType @@ -58,23 +58,23 @@ class hMixtureThermo void calculate(); //- Construct as copy (not implemented) - hMixtureThermo(const hMixtureThermo&); + hPsiMixtureThermo(const hPsiMixtureThermo&); public: //- Runtime type information - TypeName("hMixtureThermo"); + TypeName("hPsiMixtureThermo"); // Constructors //- Construct from mesh - hMixtureThermo(const fvMesh&); + hPsiMixtureThermo(const fvMesh&); //- Destructor - virtual ~hMixtureThermo(); + virtual ~hPsiMixtureThermo(); // Member functions @@ -140,7 +140,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "hMixtureThermo.C" +# include "hPsiMixtureThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H index 3d331417cc..5e9834e86c 100644 --- a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H @@ -36,7 +36,7 @@ SourceFiles #ifndef hhuMixtureThermo_H #define hhuMixtureThermo_H -#include "hMixtureThermo.H" +//#include "hPsiMixtureThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C index 1e381f4ec0..0247c643df 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C @@ -29,32 +29,38 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::reactingMixture::reactingMixture +template +Foam::reactingMixture::reactingMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - autoPtr(chemistryReader::New(thermoDict)), - multiComponentMixture + autoPtr > + ( + chemistryReader::New(thermoDict) + ), + multiComponentMixture ( thermoDict, - autoPtr::operator()().species(), - autoPtr::operator()().speciesThermo(), + autoPtr >::operator()().species(), + autoPtr >::operator()().speciesThermo(), mesh ), - PtrList + PtrList > ( - autoPtr::operator()().reactions(), species_ + autoPtr >::operator()().reactions(), + this->species_ ) { - autoPtr::clear(); + autoPtr >::clear(); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::reactingMixture::read(const dictionary& thermoDict) +template +void Foam::reactingMixture::read(const dictionary& thermoDict) {} diff --git a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H index 632230cd01..be8aa476c5 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H @@ -48,21 +48,13 @@ namespace Foam Class reactingMixture Declaration \*---------------------------------------------------------------------------*/ +template class reactingMixture : - public autoPtr, - public multiComponentMixture, - public PtrList + public autoPtr >, + public multiComponentMixture, + public PtrList > { - -public: - - typedef chemistryReader::reaction reaction; - typedef chemistryReader::reactionThermo reactionThermo; - - -private: - // Private member functions //- Disallow default bitwise copy construct @@ -74,6 +66,10 @@ private: public: + //- The type of thermo package this mixture is instantiated for + typedef ThermoType thermoType; + + // Constructors //- Construct from dictionary and mesh @@ -98,6 +94,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "reactingMixture.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C new file mode 100644 index 0000000000..73e810479c --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hReactionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(hReactionThermo, 0); + defineRunTimeSelectionTable(hReactionThermo, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::hReactionThermo::hReactionThermo(const fvMesh& mesh) +: + basicRhoThermo(mesh), + + h_ + ( + IOobject + ( + "h", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->hBoundaryTypes() + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::hReactionThermo::~hReactionThermo() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H new file mode 100644 index 0000000000..6523dcdb48 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::hReactionThermo + +Description + Foam::hReactionThermo + +SourceFiles + hReactionThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hReactionThermo_H +#define hReactionThermo_H + +#include "basicRhoThermo.H" +#include "basicMultiComponentMixture.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hReactionThermo Declaration +\*---------------------------------------------------------------------------*/ + +class hReactionThermo +: + public basicRhoThermo +{ + +protected: + + // Protected data + + //- Enthalpy field + volScalarField h_; + + +public: + + //- Runtime type information + TypeName("hReactionThermo"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + hReactionThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + + + // Constructors + + //- Construct from dictionary and mesh + hReactionThermo(const fvMesh&); + + + //- Selector + static autoPtr New(const fvMesh&); + + + //- Destructor + virtual ~hReactionThermo(); + + + // Member functions + + //- Return the composition of the multi-component mixture + virtual basicMultiComponentMixture& composition() = 0; + + //- Return the composition of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const = 0; + + + // Access to thermodynamic state variables + + //- Enthalpy [J/kg] + // Non-const access allowed for transport equations + virtual volScalarField& h() + { + return h_; + } + + //- Enthalpy [J/kg] + virtual const volScalarField& h() const + { + return h_; + } + + + //- Sensible enthalpy [J/kg] + virtual tmp hs() const = 0; + + //- Chemical enthalpy [J/kg] + virtual tmp hc() const = 0; + + //- Update properties + virtual void correct() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C new file mode 100644 index 0000000000..5e0057feb6 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hReactionThermo.H" +#include "hRhoMixtureThermo.H" + +#include "makeReactionThermo.H" +#include "addToRunTimeSelectionTable.H" + +#include "multiComponentMixture.H" +#include "reactingMixture.H" + +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Multi-component thermo + +makeReactionMixtureThermo +( + hReactionThermo, + hRhoMixtureThermo, + multiComponentMixture, + icoPoly8ThermoPhysics +); + + +// Multi-component reaction thermo + +makeReactionMixtureThermo +( + hReactionThermo, + hRhoMixtureThermo, + reactingMixture, + icoPoly8ThermoPhysics +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H new file mode 100644 index 0000000000..3d35dcdf30 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::hReactionThermo + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactionThermo_H +#define makeReactionThermo_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ + \ +typedef MixtureThermo \ + > > > > \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + #MixtureThermo \ + "<"#Mixture"<"#Transport">>>>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +) + + +#define makeReactionMixtureThermo(CThermo,MixtureThermo,Mixture,Transport) \ + \ +typedef MixtureThermo > MixtureThermo##Mixture##Transport; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##Transport, \ + #MixtureThermo"<"#Mixture"<"#Transport">>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + MixtureThermo##Mixture##Transport, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##Transport, \ + fvMesh \ +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C new file mode 100644 index 0000000000..50ac8bdf66 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hReactionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::hReactionThermo::New +( + const fvMesh& mesh +) +{ + word hReactionThermoTypeName; + + // Enclose the creation of the thermophysicalProperties to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary thermoDict + ( + IOobject + ( + "thermophysicalProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + thermoDict.lookup("thermoType") >> hReactionThermoTypeName; + } + + Info<< "Selecting thermodynamics package " << hReactionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hReactionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hReactionThermo::New(const fvMesh&)") + << "Unknown hReactionThermo type " + << hReactionThermoTypeName << nl << nl + << "Valid hReactionThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C new file mode 100644 index 0000000000..3e4679bf6b --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C @@ -0,0 +1,367 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hRhoMixtureThermo.H" +#include "fvMesh.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::hRhoMixtureThermo::calculate() +{ + const scalarField& hCells = h_.internalField(); + const scalarField& pCells = p_.internalField(); + + scalarField& TCells = T_.internalField(); + scalarField& psiCells = psi_.internalField(); + scalarField& rhoCells = rho_.internalField(); + scalarField& muCells = mu_.internalField(); + scalarField& alphaCells = alpha_.internalField(); + + forAll(TCells, celli) + { + const typename MixtureType::thermoType& mixture_ = + this->cellMixture(celli); + + TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); + psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); + rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); + + muCells[celli] = mixture_.mu(TCells[celli]); + alphaCells[celli] = mixture_.alpha(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + fvPatchScalarField& pp = p_.boundaryField()[patchi]; + fvPatchScalarField& pT = T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& prho = rho_.boundaryField()[patchi]; + + fvPatchScalarField& ph = h_.boundaryField()[patchi]; + + fvPatchScalarField& pmu_ = mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha_ = alpha_.boundaryField()[patchi]; + + if (pT.fixesValue()) + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + ph[facei] = mixture_.H(pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu_[facei] = mixture_.mu(pT[facei]); + palpha_[facei] = mixture_.alpha(pT[facei]); + } + } + else + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + pT[facei] = mixture_.TH(ph[facei], pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu_[facei] = mixture_.mu(pT[facei]); + palpha_[facei] = mixture_.alpha(pT[facei]); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::hRhoMixtureThermo::hRhoMixtureThermo(const fvMesh& mesh) +: + hReactionThermo(mesh), + MixtureType(*this, mesh) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::hRhoMixtureThermo::~hRhoMixtureThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::hRhoMixtureThermo::correct() +{ + if (debug) + { + Info<< "entering hRhoMixtureThermo::correct()" << endl; + } + + calculate(); + + if (debug) + { + Info<< "exiting hRhoMixtureThermo::correct()" << endl; + } +} + + +template +Foam::tmp +Foam::hRhoMixtureThermo::hs() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp ths + ( + new volScalarField + ( + IOobject + ( + "hs", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + h_.dimensions() + ) + ); + + volScalarField& hsf = ths(); + scalarField& hsCells = hsf.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(TCells, celli) + { + hsCells[celli] = this->cellMixture(celli).Hs(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + scalarField& hsp = hsf.boundaryField()[patchi]; + const scalarField& Tp = T_.boundaryField()[patchi]; + + forAll(Tp, facei) + { + hsp[facei] = this->patchFaceMixture(patchi, facei).Hs(Tp[facei]); + } + } + + return ths; +} + + +template +Foam::tmp +Foam::hRhoMixtureThermo::hc() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp thc + ( + new volScalarField + ( + IOobject + ( + "hc", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + h_.dimensions() + ) + ); + + volScalarField& hcf = thc(); + scalarField& hcCells = hcf.internalField(); + + forAll(hcCells, celli) + { + hcCells[celli] = this->cellMixture(celli).Hc(); + } + + forAll(hcf.boundaryField(), patchi) + { + scalarField& hcp = hcf.boundaryField()[patchi]; + + forAll(hcp, facei) + { + hcp[facei] = this->patchFaceMixture(patchi, facei).Hc(); + } + } + + return thc; +} + + +template +Foam::tmp +Foam::hRhoMixtureThermo::h +( + const scalarField& T, + const labelList& cells +) const +{ + tmp th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, celli) + { + h[celli] = this->cellMixture(cells[celli]).H(T[celli]); + } + + return th; +} + + +template +Foam::tmp +Foam::hRhoMixtureThermo::h +( + const scalarField& T, + const label patchi +) const +{ + tmp th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, facei) + { + h[facei] = this->patchFaceMixture(patchi, facei).H(T[facei]); + } + + return th; +} + + +template +Foam::tmp +Foam::hRhoMixtureThermo::Cp +( + const scalarField& T, + const label patchi +) const +{ + tmp tCp(new scalarField(T.size())); + + scalarField& cp = tCp(); + + forAll(T, facei) + { + cp[facei] = this->patchFaceMixture(patchi, facei).Cp(T[facei]); + } + + return tCp; +} + + +template +Foam::tmp +Foam::hRhoMixtureThermo::Cp() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp tCp + ( + new volScalarField + ( + IOobject + ( + "Cp", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, -1, 0) + ) + ); + + volScalarField& cp = tCp(); + + scalarField& cpCells = cp.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(TCells, celli) + { + cpCells[celli] = this->cellMixture(celli).Cp(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + cp.boundaryField()[patchi] = Cp(T_.boundaryField()[patchi], patchi); + } + + return tCp; +} + + +template +bool Foam::hRhoMixtureThermo::read() +{ + if (hReactionThermo::read()) + { + MixtureType::read(*this); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H new file mode 100644 index 0000000000..17c4d8b22e --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::hRhoMixtureThermo + +Description + Foam::hRhoMixtureThermo + +SourceFiles + hRhoMixtureThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hRhoMixtureThermo_H +#define hRhoMixtureThermo_H + +#include "hReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hRhoMixtureThermo Declaration +\*---------------------------------------------------------------------------*/ + +template +class hRhoMixtureThermo +: + public hReactionThermo, + public MixtureType +{ + // Private member functions + + void calculate(); + + //- Construct as copy (not implemented) + hRhoMixtureThermo(const hRhoMixtureThermo&); + + +public: + + //- Runtime type information + TypeName("hRhoMixtureThermo"); + + + // Constructors + + //- Construct from mesh + hRhoMixtureThermo(const fvMesh&); + + + //- Destructor + virtual ~hRhoMixtureThermo(); + + + // Member functions + + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() + { + return *this; + } + + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const + { + return *this; + } + + //- Update properties + virtual void correct(); + + //- Sensible enthalpy [J/kg] + virtual tmp hs() const; + + //- Chemical enthalpy [J/kg] + virtual tmp hc() const; + + + // Fields derived from thermodynamic state variables + + //- Enthalpy for cell-set [J/kg] + virtual tmp h + ( + const scalarField& T, + const labelList& cells + ) const; + + //- Enthalpy for patch [J/kg] + virtual tmp h + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure for patch [J/kg/K] + virtual tmp Cp + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure [J/kg/K] + virtual tmp Cp() const; + + + //- Read thermophysicalProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "hRhoMixtureThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H index 9e153436b3..531c9760bf 100644 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -33,7 +33,7 @@ Description #ifndef reactionTypes_H #define reactionTypes_H -#include "transportTypes.H" +#include "thermoPhysicsTypes.H" #include "Reaction.H" #include "icoPolynomial.H" @@ -44,11 +44,11 @@ Description namespace Foam { - typedef Reaction gasReaction; + typedef Reaction gasReaction; - typedef Reaction constGasReaction; + typedef Reaction constGasReaction; - typedef Reaction icoPoly8Reaction; + typedef Reaction icoPoly8Reaction; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/include/transportTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H similarity index 90% rename from src/thermophysicalModels/specie/include/transportTypes.H rename to src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index 0786bb9b05..2b85b22474 100644 --- a/src/thermophysicalModels/specie/include/transportTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -23,15 +23,15 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Typedefs - Foam::transportTypes + Foam::thermoPhysicsTypes Description - Type definitions for reacting transport models + Type definitions for thermo-physics models \*---------------------------------------------------------------------------*/ -#ifndef transportTypes_H -#define transportTypes_H +#ifndef thermoPhysicsTypes_H +#define thermoPhysicsTypes_H #include "perfectGas.H" #include "hConstThermo.H" @@ -49,10 +49,10 @@ Description namespace Foam { typedef sutherlandTransport > > - gasTransport; + gasThermoPhysics; typedef constTransport > > - constGasTransport; + constGasThermoPhysics; typedef polynomialTransport < @@ -66,7 +66,7 @@ namespace Foam >, 8 > - icoPoly8Transport; + icoPoly8ThermoPhysics; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C index 3bd2e3d0de..3756f2e365 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C @@ -26,7 +26,8 @@ Description \*---------------------------------------------------------------------------*/ -#include "makeReactionJanaf.H" +#include "reactionTypes.H" +#include "makeReactionThermo.H" #include "ArrheniusReactionRate.H" #include "thirdBodyArrheniusReactionRate.H" @@ -47,21 +48,39 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTemplateTypeNameAndDebug(reaction, 0); -defineTemplateRunTimeSelectionTable(reaction, Istream); +defineTemplateTypeNameAndDebug(gasReaction, 0); +defineTemplateRunTimeSelectionTable(gasReaction, Istream); // * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * // -makeIRNReactions(ArrheniusReactionRate) -makeIRNReactions(LandauTellerReactionRate) -makeIRNReactions(thirdBodyArrheniusReactionRate) -makeIRReactions(JanevReactionRate) -makeIRReactions(powerSeriesReactionRate) +makeIRNReactions(gasThermoPhysics, ArrheniusReactionRate) +makeIRNReactions(gasThermoPhysics, LandauTellerReactionRate) +makeIRNReactions(gasThermoPhysics, thirdBodyArrheniusReactionRate) +makeIRReactions(gasThermoPhysics, JanevReactionRate) +makeIRReactions(gasThermoPhysics, powerSeriesReactionRate) + +makePressureDependentReactions +( + gasThermoPhysics, + ArrheniusReactionRate, + LindemannFallOffFunction +) + +makePressureDependentReactions +( + gasThermoPhysics, + ArrheniusReactionRate, + TroeFallOffFunction +) + +makePressureDependentReactions +( + gasThermoPhysics, + ArrheniusReactionRate, + SRIFallOffFunction +) -makePressureDependentReactions(ArrheniusReactionRate, LindemannFallOffFunction) -makePressureDependentReactions(ArrheniusReactionRate, TroeFallOffFunction) -makePressureDependentReactions(ArrheniusReactionRate, SRIFallOffFunction) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C index 8a4b2f6ad8..c340278a73 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C @@ -26,17 +26,15 @@ Description \*---------------------------------------------------------------------------*/ -#include "makeReactionJanaf.H" +#include "makeReactionThermo.H" +#include "reactionTypes.H" #include "LangmuirHinshelwoodReactionRate.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - - makeIRReactions(LangmuirHinshelwoodReactionRate) - + makeIRReactions(gasThermoPhysics, LangmuirHinshelwoodReactionRate) } // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H b/src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H deleted file mode 100644 index 7a4de043f6..0000000000 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H +++ /dev/null @@ -1,118 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::makeReactionJanaf - -Description - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactionJanaf_H -#define makeReactionJanaf_H - -#include "Reaction.H" - -#include "IrreversibleReaction.H" -#include "ReversibleReaction.H" -#include "NonEquilibriumReversibleReaction.H" - -#include "sutherlandTransport.H" -#include "specieThermo.H" -#include "janafThermo.H" -#include "perfectGas.H" - -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef sutherlandTransport > > - reactionThermo; - -typedef Reaction - reaction; - -#define makeReaction(Reaction, ReactionRate) \ - \ - typedef Reaction \ - Reaction##ReactionRate; \ - \ - template<> \ - const word Reaction##ReactionRate::typeName \ - ( \ - Reaction::typeName_() \ - + ReactionRate::type() \ - + reaction::typeName_() \ - ); \ - \ - addToRunTimeSelectionTable(reaction, Reaction##ReactionRate, Istream); - -#define makePressureDependentReaction(Reaction, PressureDependentReactionRate, ReactionRate, FallOffFunction) \ - \ - typedef PressureDependentReactionRate \ - PressureDependentReactionRate##ReactionRate##FallOffFunction; \ - \ - makeReaction \ - (Reaction, PressureDependentReactionRate##ReactionRate##FallOffFunction) - -#define makeIRReactions(ReactionRate) \ - makeReaction(IrreversibleReaction, ReactionRate) \ - makeReaction(ReversibleReaction, ReactionRate) - -#define makeIRNReactions(ReactionRate) \ - makeIRReactions(ReactionRate) \ - makeReaction(NonEquilibriumReversibleReaction, ReactionRate) - -#define makePressureDependentReactions(ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (IrreversibleReaction, FallOffReactionRate, \ - ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (ReversibleReaction, FallOffReactionRate, \ - ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (IrreversibleReaction, ChemicallyActivatedReactionRate, \ - ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (ReversibleReaction, ChemicallyActivatedReactionRate, \ - ReactionRate, FallOffFunction) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H new file mode 100644 index 0000000000..89cf9875d0 --- /dev/null +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::makeReactionThermo + +Description + Macros for instantiating reactions on given thermo packages + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactionTherno_H +#define makeReactionThermo_H + +#include "Reaction.H" + +#include "IrreversibleReaction.H" +#include "ReversibleReaction.H" +#include "NonEquilibriumReversibleReaction.H" + +#include "specieThermo.H" + +#include "sutherlandTransport.H" +#include "janafThermo.H" +#include "perfectGas.H" + +#include "polynomialTransport.H" +#include "polynomialThermo.H" +#include "icoPolynomial.H" + +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReaction(Thermo, ReactionType, ReactionRate) \ + \ + typedef Reaction Reaction##Thermo; \ + \ + typedef ReactionType \ + ReactionType##Thermo##ReactionRate; \ + \ + template<> \ + const word ReactionType##Thermo##ReactionRate::typeName \ + ( \ + ReactionType::typeName_() \ + + ReactionRate::type() \ + + Reaction##Thermo::typeName_() \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + Reaction##Thermo, \ + ReactionType##Thermo##ReactionRate, \ + Istream \ + ); + + +#define makePressureDependentReaction(Thermo, Reaction, PressureDependentReactionRate, ReactionRate, FallOffFunction) \ + \ + typedef PressureDependentReactionRate \ + PressureDependentReactionRate##ReactionRate##FallOffFunction; \ + \ + makeReaction \ + ( \ + Thermo, \ + Reaction, \ + PressureDependentReactionRate##ReactionRate##FallOffFunction \ + ) + + +#define makeIRReactions(Thermo, ReactionRate) \ + \ + makeReaction(Thermo, IrreversibleReaction, ReactionRate) \ + \ + makeReaction(Thermo, ReversibleReaction, ReactionRate) + + +#define makeIRNReactions(Thermo, ReactionRate) \ + \ + makeIRReactions(Thermo, ReactionRate) \ + \ + makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate) + + +#define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + IrreversibleReaction, \ + FallOffReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + ReversibleReaction, \ + FallOffReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + IrreversibleReaction, \ + ChemicallyActivatedReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + ReversibleReaction, \ + ChemicallyActivatedReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 8b78d2de93f1d82962351243459808b9b52e9e60 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 19:37:23 +0100 Subject: [PATCH 08/74] renamed combustion->combustionThermo --- .../hCombustionThermo/hCombustionThermo.C | 0 .../hCombustionThermo/hCombustionThermo.H | 0 .../hCombustionThermo/hCombustionThermos.C | 0 .../hCombustionThermo/makeCombustionThermo.H | 0 .../hCombustionThermo/newhCombustionThermo.C | 0 .../hhuCombustionThermo/hhuCombustionThermo.C | 0 .../hhuCombustionThermo/hhuCombustionThermo.H | 0 .../hhuCombustionThermo/hhuCombustionThermos.C | 0 .../hhuCombustionThermo/newhhuCombustionThermo.C | 0 .../mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C | 0 .../mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H | 0 .../mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C | 0 .../mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hCombustionThermo/hCombustionThermo.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hCombustionThermo/hCombustionThermo.H (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hCombustionThermo/hCombustionThermos.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hCombustionThermo/makeCombustionThermo.H (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hCombustionThermo/newhCombustionThermo.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hhuCombustionThermo/hhuCombustionThermo.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hhuCombustionThermo/hhuCombustionThermo.H (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hhuCombustionThermo/hhuCombustionThermos.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/hhuCombustionThermo/newhhuCombustionThermo.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C (100%) rename src/thermophysicalModels/reactionThermo/{combustion => combustionThermo}/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H (100%) diff --git a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.H similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.H diff --git a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/hCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/makeCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/makeCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H diff --git a/src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/newhCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hCombustionThermo/newhCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.H similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.H diff --git a/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/hhuCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/newhhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/hhuCombustionThermo/newhhuCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C diff --git a/src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H similarity index 100% rename from src/thermophysicalModels/reactionThermo/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H From c3c36e6b164f5b82502605a41f54e950f0cd376f Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 19:37:52 +0100 Subject: [PATCH 09/74] updated name change of combustion->reaction lib --- .../Lagrangian/reactingParcelFoam/Make/options | 4 ++-- .../uncoupledKinematicParcelFoam/Make/options | 2 +- applications/solvers/combustion/PDRFoam/Make/options | 4 ++-- applications/solvers/combustion/XiFoam/Make/options | 4 ++-- .../combustion/coalChemistryFoam/Make/options | 4 ++-- .../solvers/combustion/coldEngineFoam/Make/options | 2 +- .../solvers/combustion/dieselEngineFoam/Make/options | 6 +++--- .../solvers/combustion/dieselFoam/Make/options | 6 +++--- .../solvers/combustion/engineFoam/Make/options | 4 ++-- .../solvers/combustion/reactingFoam/Make/options | 4 ++-- applications/test/readCHEMKINIII/Make/options | 4 ++-- .../miscellaneous/foamDebugSwitches/Make/options | 2 +- .../postProcessing/wall/wallHeatFlux/Make/options | 4 ++-- .../thermophysical/chemkinToFoam/Make/options | 4 ++-- src/thermophysicalModels/Allwmake | 2 +- .../laminarFlameSpeed/Make/options | 2 +- src/thermophysicalModels/reactionThermo/Make/files | 12 ++++++------ src/thermophysicalModels/specie/Make/files | 1 + 18 files changed, 36 insertions(+), 35 deletions(-) diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/options b/applications/solvers/Lagrangian/reactingParcelFoam/Make/options index 7d9fba6143..d10253a8fa 100644 --- a/applications/solvers/Lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/Lagrangian/reactingParcelFoam/Make/options @@ -12,7 +12,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude @@ -31,7 +31,7 @@ EXE_LIBS = \ -lsolids \ -lsolidMixture \ -lthermophysicalFunctions \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ -lODE diff --git a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options index 818e371778..83ef9251c5 100644 --- a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index e765e61574..4e5b8fb9a0 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -8,7 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ @@ -23,7 +23,7 @@ EXE_LIBS = \ -lmeshTools \ -lcompressibleRASModels \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ -lfiniteVolume \ diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options index bc89c0a716..c328b2c1b3 100644 --- a/applications/solvers/combustion/XiFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -13,7 +13,7 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ -lfiniteVolume \ diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/options b/applications/solvers/combustion/coalChemistryFoam/Make/options index 21575a94ae..9a670369f0 100644 --- a/applications/solvers/combustion/coalChemistryFoam/Make/options +++ b/applications/solvers/combustion/coalChemistryFoam/Make/options @@ -13,7 +13,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude @@ -34,7 +34,7 @@ EXE_LIBS = \ -lsolids \ -lsolidMixture \ -lthermophysicalFunctions \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ -lODE diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options index 028498cc63..53aa22b25a 100644 --- a/applications/solvers/combustion/coldEngineFoam/Make/options +++ b/applications/solvers/combustion/coldEngineFoam/Make/options @@ -4,7 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/combustion/dieselEngineFoam/Make/options index 20f008d331..60558513fe 100644 --- a/applications/solvers/combustion/dieselEngineFoam/Make/options +++ b/applications/solvers/combustion/dieselEngineFoam/Make/options @@ -7,10 +7,10 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/../applications/solvers/combustion/XiFoam \ + -I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/engine/lnInclude \ @@ -20,7 +20,7 @@ EXE_LIBS = \ -lengine \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lfiniteVolume \ -llagrangian \ -ldieselSpray \ diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options index 44d527b062..28605eb830 100644 --- a/applications/solvers/combustion/dieselFoam/Make/options +++ b/applications/solvers/combustion/dieselFoam/Make/options @@ -8,17 +8,17 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/../applications/solvers/combustion/XiFoam \ + -I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -llagrangian \ -ldieselSpray \ -lliquids \ diff --git a/applications/solvers/combustion/engineFoam/Make/options b/applications/solvers/combustion/engineFoam/Make/options index 3ee7cc666f..31775e03d6 100644 --- a/applications/solvers/combustion/engineFoam/Make/options +++ b/applications/solvers/combustion/engineFoam/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude @@ -13,7 +13,7 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ -lfiniteVolume diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options index 908472524a..e982f635a1 100644 --- a/applications/solvers/combustion/reactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I../XiFoam \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ @@ -11,7 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -lbasicThermophysicalModels \ -lchemistryModel \ diff --git a/applications/test/readCHEMKINIII/Make/options b/applications/test/readCHEMKINIII/Make/options index dcc48758d3..233d9fa2ef 100644 --- a/applications/test/readCHEMKINIII/Make/options +++ b/applications/test/readCHEMKINIII/Make/options @@ -1,8 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude EXE_LIBS = \ -lspecie \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels + -lreactionThermophysicalModels diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index de8242a89f..ed65d15437 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -1,7 +1,7 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lchemistryModel \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lcompressibleLESModels \ -ldecompositionMethods \ -ldieselSpray \ diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options index 64ac829917..8cdfe23fd1 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options @@ -2,13 +2,13 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -lcompressibleRASModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lfiniteVolume \ -lspecie \ -lbasicThermophysicalModels diff --git a/applications/utilities/thermophysical/chemkinToFoam/Make/options b/applications/utilities/thermophysical/chemkinToFoam/Make/options index d4d6f35e08..7fe5ba4077 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/Make/options +++ b/applications/utilities/thermophysical/chemkinToFoam/Make/options @@ -1,8 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude EXE_LIBS = \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lbasicThermophysicalModels \ -lspecie diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake index 62175e440f..7fbee69034 100755 --- a/src/thermophysicalModels/Allwmake +++ b/src/thermophysicalModels/Allwmake @@ -10,7 +10,7 @@ wmake libso solids wmake libso solidMixture wmake libso basic -wmake libso combustion +wmake libso reactionThermo wmake libso laminarFlameSpeed wmake libso chemistryModel wmake libso pdfs diff --git a/src/thermophysicalModels/laminarFlameSpeed/Make/options b/src/thermophysicalModels/laminarFlameSpeed/Make/options index d3f9e6993d..fe682dabab 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/Make/options +++ b/src/thermophysicalModels/laminarFlameSpeed/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude LIB_LIBS = \ -lfiniteVolume diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files index 9d41df7349..c2f9612ec5 100644 --- a/src/thermophysicalModels/reactionThermo/Make/files +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -4,13 +4,13 @@ chemistryReaders/chemistryReader/makeChemistryReaders.C mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C -combustion/hCombustionThermo/hCombustionThermo.C -combustion/hCombustionThermo/newhCombustionThermo.C -combustion/hCombustionThermo/hCombustionThermos.C +combustionThermo/hCombustionThermo/hCombustionThermo.C +combustionThermo/hCombustionThermo/newhCombustionThermo.C +combustionThermo/hCombustionThermo/hCombustionThermos.C -combustion/hhuCombustionThermo/hhuCombustionThermo.C -combustion/hhuCombustionThermo/newhhuCombustionThermo.C -combustion/hhuCombustionThermo/hhuCombustionThermos.C +combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C +combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C +combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C reactionThermo/hReactionThermo/hReactionThermo.C reactionThermo/hReactionThermo/newhReactionThermo.C diff --git a/src/thermophysicalModels/specie/Make/files b/src/thermophysicalModels/specie/Make/files index ad4f7e0639..d5ea884797 100644 --- a/src/thermophysicalModels/specie/Make/files +++ b/src/thermophysicalModels/specie/Make/files @@ -10,6 +10,7 @@ $(speciesTable)/speciesTable.C $(equationOfState)/perfectGas/perfectGas.C $(equationOfState)/icoPolynomial/makeIcoPolynomials.C $(reactions)/makeChemkinReactions.C +$(reactions)/makeReactionThermoReactions.C $(reactions)/makeLangmuirHinshelwoodReactions.C LIB = $(FOAM_LIBBIN)/libspecie From bed5801c995427973f53b6ef099ad363b2e9bac8 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 10 Jun 2009 19:48:58 +0100 Subject: [PATCH 10/74] adding reactionThermo reactions --- .../reactions/makeReactionThermoReactions.C | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C new file mode 100644 index 0000000000..1a054b1124 --- /dev/null +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + +\*---------------------------------------------------------------------------*/ + +#include "reactionTypes.H" +#include "makeReactionThermo.H" + +#include "ArrheniusReactionRate.H" +#include "thirdBodyArrheniusReactionRate.H" +#include "FallOffReactionRate.H" +#include "ChemicallyActivatedReactionRate.H" +#include "LindemannFallOffFunction.H" +#include "TroeFallOffFunction.H" +#include "SRIFallOffFunction.H" +#include "LandauTellerReactionRate.H" +#include "JanevReactionRate.H" +#include "powerSeriesReactionRate.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTemplateTypeNameAndDebug(icoPoly8Reaction, 0); +defineTemplateRunTimeSelectionTable(icoPoly8Reaction, Istream); + + +// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * // + +makeIRNReactions(icoPoly8ThermoPhysics, ArrheniusReactionRate) +makeIRNReactions(icoPoly8ThermoPhysics, LandauTellerReactionRate) +makeIRNReactions(icoPoly8ThermoPhysics, thirdBodyArrheniusReactionRate) +makeIRReactions(icoPoly8ThermoPhysics, JanevReactionRate) +makeIRReactions(icoPoly8ThermoPhysics, powerSeriesReactionRate) + +makePressureDependentReactions +( + icoPoly8ThermoPhysics, + ArrheniusReactionRate, + LindemannFallOffFunction +) + +makePressureDependentReactions +( + icoPoly8ThermoPhysics, + ArrheniusReactionRate, + TroeFallOffFunction +) + +makePressureDependentReactions +( + icoPoly8ThermoPhysics, + ArrheniusReactionRate, + SRIFallOffFunction +) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // From 17a78e7392769584266e5b6844fb5f8a9ad28153 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Jun 2009 11:29:40 +0100 Subject: [PATCH 11/74] further updates --- src/thermophysicalModels/basic/Make/files | 3 +- .../basic/basicThermo/basicThermo.C | 1 - .../basic/basicThermo/basicThermo.H | 16 ---- .../psiThermo/basicPsiThermo/basicPsiThermo.C | 1 + .../psiThermo/basicPsiThermo/basicPsiThermo.H | 21 ++++- .../basicPsiThermo/makeBasicPsiThermo.H | 66 ++++++++++++++ .../basicPsiThermo/newBasicPsiThermo.C} | 85 ++++++++---------- .../basic/psiThermo/ePsiThermo/ePsiThermos.C | 13 ++- .../basic/psiThermo/hPsiThermo/hPsiThermos.C | 13 ++- .../rhoThermo/basicRhoThermo/basicRhoThermo.C | 1 + .../rhoThermo/basicRhoThermo/basicRhoThermo.H | 19 +++- .../basicRhoThermo/makeBasicRhoThermo.H} | 15 ++-- .../basicRhoThermo/newBasicRhoThermo.C} | 26 +++--- .../basic/rhoThermo/hRhoThermo/hRhoThermos.C | 13 ++- .../hCombustionThermo/hCombustionThermos.C | 5 +- .../hCombustionThermo/makeCombustionThermo.H | 20 +++-- .../hReactionThermo/hReactionThermos.C | 87 ++++++++++++++++++- .../hReactionThermo/makeReactionThermo.H | 20 +++-- 18 files changed, 290 insertions(+), 135 deletions(-) create mode 100644 src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H rename src/thermophysicalModels/basic/{rhoThermo/basicRhoThermo/basicRhoThermos.C => psiThermo/basicPsiThermo/newBasicPsiThermo.C} (52%) rename src/thermophysicalModels/basic/{basicThermo/makeBasicThermo.H => rhoThermo/basicRhoThermo/makeBasicRhoThermo.H} (89%) rename src/thermophysicalModels/basic/{basicThermo/newBasicThermo.C => rhoThermo/basicRhoThermo/newBasicRhoThermo.C} (76%) diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index b93d6f7867..dcf9c8f4c0 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -2,13 +2,14 @@ mixtures/basicMixture/basicMixture.C mixtures/basicMixture/basicMixtures.C basicThermo/basicThermo.C -basicThermo/newBasicThermo.C psiThermo/basicPsiThermo/basicPsiThermo.C +psiThermo/basicPsiThermo/newBasicPsiThermo.C psiThermo/hPsiThermo/hPsiThermos.C psiThermo/ePsiThermo/ePsiThermos.C rhoThermo/basicRhoThermo/basicRhoThermo.C +rhoThermo/basicRhoThermo/newBasicRhoThermo.C rhoThermo/hRhoThermo/hRhoThermos.C derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 2339d34f89..4a1e7f19f9 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -40,7 +40,6 @@ License namespace Foam { defineTypeNameAndDebug(basicThermo, 0); - defineRunTimeSelectionTable(basicThermo, fvMesh); } // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 0c4a042312..1b54258525 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -41,7 +41,6 @@ SourceFiles #include "typeInfo.H" #include "IOdictionary.H" #include "autoPtr.H" -#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -111,27 +110,12 @@ public: TypeName("basicThermo"); - //- Declare run-time constructor selection table - declareRunTimeSelectionTable - ( - autoPtr, - basicThermo, - fvMesh, - (const fvMesh& mesh), - (mesh) - ); - - // Constructors //- Construct from mesh basicThermo(const fvMesh&); - //- Selector - static autoPtr New(const fvMesh&); - - //- Destructor virtual ~basicThermo(); diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C index 0675043caf..6464e9e71b 100644 --- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C @@ -31,6 +31,7 @@ License namespace Foam { defineTypeNameAndDebug(basicPsiThermo, 0); + defineRunTimeSelectionTable(basicPsiThermo, fvMesh); } diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H index f7a141e66e..df6d21b9ab 100644 --- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H @@ -26,10 +26,11 @@ Class Foam::basicPsiThermo Description - Basic thermodynamic properties based in compressibility + Basic thermodynamic properties based on compressibility SourceFiles - basicRhoThermo.C + basicPsiThermo.C + newBasicPsiThermo.C \*---------------------------------------------------------------------------*/ @@ -37,6 +38,7 @@ SourceFiles #define basicPsiThermo_H #include "basicThermo.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -66,12 +68,25 @@ public: TypeName("basicPsiThermo"); + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + basicPsiThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + // Constructors //- Construct from mesh basicPsiThermo(const fvMesh&); + //- Selector + static autoPtr New(const fvMesh&); + //- Destructor virtual ~basicPsiThermo(); @@ -80,7 +95,7 @@ public: // Fields derived from thermodynamic state variables - //- Density [kg/m^3] + //- Density [kg/m^3] - uses current value of pressure virtual tmp rho() const { return p_*psi(); diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H new file mode 100644 index 0000000000..c36ec8da91 --- /dev/null +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::basicPsiThermo + +Description + Macros for creating 'basic' compresibility-based thermo packages + +\*---------------------------------------------------------------------------*/ + +#ifndef makeBasicPsiThermo_H +#define makeBasicPsiThermo_H + +#include "basicPsiThermo.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeBasicPsiThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ + \ +typedef Cthermo > > > > \ + Cthermo##Mixture##Transport##Thermo##EqnOfState; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ + #Cthermo \ + "<"#Mixture"<"#Transport">>>>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicPsiThermo, \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermos.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C similarity index 52% rename from src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermos.C rename to src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C index 2407a9490d..3f9c43a0f9 100644 --- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C @@ -22,67 +22,54 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for enthalpy based thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "basicThermo.H" -#include "makeBasicThermo.H" - -#include "perfectGas.H" - -#include "hConstThermo.H" -#include "janafThermo.H" -#include "specieThermo.H" - -#include "constTransport.H" -#include "sutherlandTransport.H" - -#include "hThermo.H" -#include "pureMixture.H" - -#include "addToRunTimeSelectionTable.H" +#include "basicPsiThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +Foam::autoPtr Foam::basicPsiThermo::New +( + const fvMesh& mesh +) { + word thermoTypeName; -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + // Enclose the creation of the thermophysicalProperties to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary thermoDict + ( + IOobject + ( + "thermophysicalProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); -makeBasicThermo -( - hThermo, - pureMixture, - constTransport, - hConstThermo, - perfectGas -); + thermoDict.lookup("thermoType") >> thermoTypeName; + } -makeBasicThermo -( - hThermo, - pureMixture, - sutherlandTransport, - hConstThermo, - perfectGas -); + Info<< "Selecting thermodynamics package " << thermoTypeName << endl; -makeBasicThermo -( - hThermo, - pureMixture, - sutherlandTransport, - janafThermo, - perfectGas -); + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(thermoTypeName); + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("basicPsiThermo::New(const fvMesh&)") + << "Unknown basicPsiThermo type " << thermoTypeName << nl << nl + << "Valid basicPsiThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + return autoPtr(cstrIter()(mesh)); +} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C index eded615214..2849a29ea7 100644 --- a/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C @@ -22,12 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for internal energy based thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "makeBasicThermo.H" +#include "makeBasicPsiThermo.H" #include "perfectGas.H" @@ -48,8 +45,7 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeBasicThermo +makeBasicPsiThermo ( ePsiThermo, pureMixture, @@ -58,7 +54,7 @@ makeBasicThermo perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( ePsiThermo, pureMixture, @@ -67,7 +63,7 @@ makeBasicThermo perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( ePsiThermo, pureMixture, @@ -76,6 +72,7 @@ makeBasicThermo perfectGas ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C index 78dba26e9b..04ed4722ad 100644 --- a/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C @@ -22,12 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for enthalpy based thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "makeBasicThermo.H" +#include "makeBasicPsiThermo.H" #include "perfectGas.H" @@ -48,8 +45,7 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeBasicThermo +makeBasicPsiThermo ( hPsiThermo, pureMixture, @@ -58,7 +54,7 @@ makeBasicThermo perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( hPsiThermo, pureMixture, @@ -67,7 +63,7 @@ makeBasicThermo perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( hPsiThermo, pureMixture, @@ -76,6 +72,7 @@ makeBasicThermo perfectGas ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C index 4b1cdd5062..c16a67371a 100644 --- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C @@ -31,6 +31,7 @@ License namespace Foam { defineTypeNameAndDebug(basicRhoThermo, 0); + defineRunTimeSelectionTable(basicRhoThermo, fvMesh); } diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H index 68645c4ffd..6e7545f463 100644 --- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H @@ -26,10 +26,11 @@ Class Foam::basicRhoThermo Description - Basic thermodynamic properties based in density + Basic thermodynamic properties based on density SourceFiles basicRhoThermo.C + newBasicRhoThermo.C \*---------------------------------------------------------------------------*/ @@ -37,6 +38,7 @@ SourceFiles #define basicRhoThermo_H #include "basicThermo.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,12 +75,27 @@ public: TypeName("basicRhoThermo"); + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + basicRhoThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + + // Constructors //- Construct from mesh basicRhoThermo(const fvMesh&); + //- Selector + static autoPtr New(const fvMesh&); + + //- Destructor virtual ~basicRhoThermo(); diff --git a/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H similarity index 89% rename from src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H rename to src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H index 847ea8aa16..e6302bea8c 100644 --- a/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H @@ -23,22 +23,22 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA InClass - Foam::basicThermo + Foam::basicRhoThermo Description - Macros for creating 'basic' thermo packages + Macros for creating 'basic' density-based thermo packages \*---------------------------------------------------------------------------*/ -#ifndef makeBasicThermo_H -#define makeBasicThermo_H +#ifndef makeBasicRhoThermo_H +#define makeBasicRhoThermo_H -#include "basicThermo.H" +#include "basicRhoThermo.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeBasicThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ +#define makeBasicRhoThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ \ typedef Cthermo > > > > \ Cthermo##Mixture##Transport##Thermo##EqnOfState; \ @@ -53,11 +53,12 @@ defineTemplateTypeNameAndDebugWithName \ \ addToRunTimeSelectionTable \ ( \ - basicThermo, \ + basicRhoThermo, \ Cthermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ ) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C similarity index 76% rename from src/thermophysicalModels/basic/basicThermo/newBasicThermo.C rename to src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C index 84b9724790..9a7ec5ac86 100644 --- a/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C @@ -23,18 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for 'basic' thermodynamics package. + Selection function for 'basic' density-based thermodynamics \*---------------------------------------------------------------------------*/ -#include "basicThermo.H" -#include "fvMesh.H" +#include "basicRhoThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::basicThermo::New(const fvMesh& mesh) +Foam::autoPtr Foam::basicRhoThermo::New +( + const fvMesh& mesh +) { - word basicThermoTypeName; + word thermoTypeName; // Enclose the creation of the thermophysicalProperties to ensure it is // deleted before the turbulenceModel is created otherwise the dictionary @@ -52,24 +54,24 @@ Foam::autoPtr Foam::basicThermo::New(const fvMesh& mesh) ) ); - thermoDict.lookup("thermoType") >> basicThermoTypeName; + thermoDict.lookup("thermoType") >> thermoTypeName; } - Info<< "Selecting thermodynamics package " << basicThermoTypeName << endl; + Info<< "Selecting thermodynamics package " << thermoTypeName << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(basicThermoTypeName); + fvMeshConstructorTablePtr_->find(thermoTypeName); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("basicThermo::New(const fvMesh&)") - << "Unknown basicThermo type " << basicThermoTypeName << nl << nl - << "Valid basicThermo types are:" << nl + FatalErrorIn("basicRhoThermo::New(const fvMesh&)") + << "Unknown basicRhoThermo type " << thermoTypeName << nl << nl + << "Valid basicRhoThermo types are:" << nl << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } - return autoPtr(cstrIter()(mesh)); + return autoPtr(cstrIter()(mesh)); } diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C index 0c44cc3af9..233ee905dc 100644 --- a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C @@ -22,12 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for enthalpy thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "makeBasicThermo.H" +#include "makeBasicRhoThermo.H" #include "perfectGas.H" @@ -48,8 +45,7 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeBasicThermo +makeBasicRhoThermo ( hRhoThermo, pureMixture, @@ -58,7 +54,7 @@ makeBasicThermo perfectGas ); -makeBasicThermo +makeBasicRhoThermo ( hRhoThermo, pureMixture, @@ -67,7 +63,7 @@ makeBasicThermo perfectGas ); -makeBasicThermo +makeBasicRhoThermo ( hRhoThermo, pureMixture, @@ -76,6 +72,7 @@ makeBasicThermo perfectGas ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C index 0828938c01..94846bb75c 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C @@ -24,12 +24,11 @@ License \*---------------------------------------------------------------------------*/ +#include "makeCombustionThermo.H" + #include "hCombustionThermo.H" #include "hPsiMixtureThermo.H" -#include "makeCombustionThermo.H" -#include "addToRunTimeSelectionTable.H" - #include "perfectGas.H" #include "hConstThermo.H" diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H index 4faa218141..4ee0c2a022 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H @@ -32,6 +32,9 @@ Description #ifndef makeCombustionThermo_H #define makeCombustionThermo_H +#include "addToRunTimeSelectionTable.H" +#include "basicPsiThermo.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define makeCombustionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ @@ -50,7 +53,7 @@ defineTemplateTypeNameAndDebugWithName \ \ addToRunTimeSelectionTable \ ( \ - basicThermo, \ + basicPsiThermo, \ MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ ); \ @@ -63,28 +66,29 @@ addToRunTimeSelectionTable \ ) -#define makeCombustionMixtureThermo(CThermo,MixtureThermo,Mixture,Transport) \ +#define makeCombustionMixtureThermo(CThermo,MixtureThermo,Mixture,ThermoPhys) \ \ -typedef MixtureThermo > MixtureThermo##Mixture##Transport; \ +typedef MixtureThermo > \ + MixtureThermo##Mixture##ThermoPhys; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - MixtureThermo##Mixture##Transport, \ - #MixtureThermo"<"#Mixture"<"#Transport">>", \ + MixtureThermo##Mixture##ThermoPhys, \ + #MixtureThermo"<"#Mixture"<"#ThermoPhys">>", \ 0 \ ); \ \ addToRunTimeSelectionTable \ ( \ - basicThermo, \ - MixtureThermo##Mixture##Transport, \ + basicPsiThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ fvMesh \ ); \ \ addToRunTimeSelectionTable \ ( \ CThermo, \ - MixtureThermo##Mixture##Transport, \ + MixtureThermo##Mixture##ThermoPhys, \ fvMesh \ ); diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C index 5e0057feb6..25a517bce3 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C @@ -24,12 +24,24 @@ License \*---------------------------------------------------------------------------*/ +#include "makeReactionThermo.H" + #include "hReactionThermo.H" #include "hRhoMixtureThermo.H" -#include "makeReactionThermo.H" -#include "addToRunTimeSelectionTable.H" +#include "perfectGas.H" +#include "hConstThermo.H" +#include "janafThermo.H" +#include "specieThermo.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "homogeneousMixture.H" +#include "inhomogeneousMixture.H" +#include "veryInhomogeneousMixture.H" +#include "dieselMixture.H" #include "multiComponentMixture.H" #include "reactingMixture.H" @@ -42,6 +54,77 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + homogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + inhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + veryInhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + homogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + inhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + veryInhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + dieselMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + + // Multi-component thermo makeReactionMixtureThermo diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H index 3d35dcdf30..15b058e485 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H @@ -32,6 +32,9 @@ Description #ifndef makeReactionThermo_H #define makeReactionThermo_H +#include "addToRunTimeSelectionTable.H" +#include "basicRhoThermo.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define makeReactionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ @@ -50,7 +53,7 @@ defineTemplateTypeNameAndDebugWithName \ \ addToRunTimeSelectionTable \ ( \ - basicThermo, \ + basicRhoThermo, \ MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ ); \ @@ -63,28 +66,29 @@ addToRunTimeSelectionTable \ ) -#define makeReactionMixtureThermo(CThermo,MixtureThermo,Mixture,Transport) \ +#define makeReactionMixtureThermo(CThermo,MixtureThermo,Mixture,ThermoPhys) \ \ -typedef MixtureThermo > MixtureThermo##Mixture##Transport; \ +typedef MixtureThermo > \ + MixtureThermo##Mixture##ThermoPhys; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - MixtureThermo##Mixture##Transport, \ - #MixtureThermo"<"#Mixture"<"#Transport">>", \ + MixtureThermo##Mixture##ThermoPhys, \ + #MixtureThermo"<"#Mixture"<"#ThermoPhys">>", \ 0 \ ); \ \ addToRunTimeSelectionTable \ ( \ - basicThermo, \ - MixtureThermo##Mixture##Transport, \ + basicRhoThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ fvMesh \ ); \ \ addToRunTimeSelectionTable \ ( \ CThermo, \ - MixtureThermo##Mixture##Transport, \ + MixtureThermo##Mixture##ThermoPhys, \ fvMesh \ ); From bfb499125bc0ead73ac76aa29e80b75623615e4c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Jun 2009 14:58:31 +0100 Subject: [PATCH 12/74] templated chemistry and chemistry solver on compressibility type --- .../chemistryModel/Make/files | 7 +- .../ODEChemistryModel/ODEChemistryModel.C | 63 ++++---- .../ODEChemistryModel/ODEChemistryModel.H | 11 +- .../ODEChemistryModel/ODEChemistryModelI.H | 38 ++--- .../basicChemistryModel.C} | 17 +-- .../basicChemistryModel.H} | 59 ++------ .../basicChemistryModelI.H} | 20 +-- .../makeChemistryModel.H | 18 +-- .../newPsiChemistryModel.C} | 23 ++- .../psiChemistryModel/psiChemistryModel.C | 54 +++++++ .../psiChemistryModel/psiChemistryModel.H | 134 ++++++++++++++++++ .../psiChemistryModel/psiChemistryModelI.H | 41 ++++++ .../psiChemistryModels.C} | 20 ++- .../EulerImplicit/EulerImplicit.C | 16 +-- .../EulerImplicit/EulerImplicit.H | 10 +- .../chemistrySolver/chemistrySolver.C | 10 +- .../chemistrySolver/chemistrySolver.H | 54 ++++--- .../chemistrySolver/makeChemistrySolvers.C | 30 ++-- .../chemistrySolver/newChemistrySolver.C | 12 +- .../chemistryModel/chemistrySolver/ode/ode.C | 17 ++- .../chemistryModel/chemistrySolver/ode/ode.H | 10 +- .../chemistrySolver/sequential/sequential.C | 17 ++- .../chemistrySolver/sequential/sequential.H | 10 +- 23 files changed, 469 insertions(+), 222 deletions(-) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModel.C => basicChemistryModel/basicChemistryModel.C} (81%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModel.H => basicChemistryModel/basicChemistryModel.H} (75%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModelI.H => basicChemistryModel/basicChemistryModelI.H} (76%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel => basicChemistryModel}/makeChemistryModel.H (84%) rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/newChemistryModel.C => psiChemistryModel/newPsiChemistryModel.C} (76%) create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H rename src/thermophysicalModels/chemistryModel/chemistryModel/{chemistryModel/chemistryModels.C => psiChemistryModel/psiChemistryModels.C} (84%) diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index 73bd57812c..3bfd31a8b1 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -1,6 +1,7 @@ -chemistryModel/chemistryModel/chemistryModel.C -chemistryModel/chemistryModel/newChemistryModel.C -chemistryModel/chemistryModel/chemistryModels.C +chemistryModel/basicChemistryModel/basicChemistryModel.C +chemistryModel/psiChemistryModel/psiChemistryModel.C +chemistryModel/psiChemistryModel/newPsiChemistryModel.C +chemistryModel/psiChemistryModel/psiChemistryModels.C chemistrySolver/chemistrySolver/makeChemistrySolvers.C diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 3ece5e2ee9..498bc9ada2 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C @@ -30,10 +30,13 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::ODEChemistryModel::ODEChemistryModel(const fvMesh& mesh) +template +Foam::ODEChemistryModel::ODEChemistryModel +( + const fvMesh& mesh +) : - chemistryModel(mesh), + CompType(mesh), ODE(), @@ -52,7 +55,7 @@ Foam::ODEChemistryModel::ODEChemistryModel(const fvMesh& mesh) nSpecie_(Y_.size()), nReaction_(reactions_.size()), - solver_(chemistrySolver::New(*this)), + solver_(chemistrySolver::New(*this)), RR_(nSpecie_) { @@ -73,15 +76,15 @@ Foam::ODEChemistryModel::ODEChemistryModel(const fvMesh& mesh) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::ODEChemistryModel::~ODEChemistryModel() +template +Foam::ODEChemistryModel::~ODEChemistryModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -Foam::scalarField Foam::ODEChemistryModel::omega +template +Foam::scalarField Foam::ODEChemistryModel::omega ( const scalarField& c, const scalar T, @@ -121,8 +124,8 @@ Foam::scalarField Foam::ODEChemistryModel::omega } -template -Foam::scalar Foam::ODEChemistryModel::omega +template +Foam::scalar Foam::ODEChemistryModel::omega ( const Reaction& R, const scalarField& c, @@ -241,8 +244,8 @@ Foam::scalar Foam::ODEChemistryModel::omega } -template -void Foam::ODEChemistryModel::derivatives +template +void Foam::ODEChemistryModel::derivatives ( const scalar time, const scalarField &c, @@ -292,8 +295,8 @@ void Foam::ODEChemistryModel::derivatives } -template -void Foam::ODEChemistryModel::jacobian +template +void Foam::ODEChemistryModel::jacobian ( const scalar t, const scalarField& c, @@ -434,9 +437,9 @@ void Foam::ODEChemistryModel::jacobian } -template +template Foam::tmp -Foam::ODEChemistryModel::tc() const +Foam::ODEChemistryModel::tc() const { scalar pf,cf,pr,cr; label lRef, rRef; @@ -446,7 +449,7 @@ Foam::ODEChemistryModel::tc() const scalarField t(nCells, SMALL); - if (chemistry_) + if (this->chemistry_) { for (label celli=0; celli::tc() const } -template +template Foam::tmp -Foam::ODEChemistryModel::dQ() const +Foam::ODEChemistryModel::dQ() const { tmp tdQ ( @@ -533,7 +536,7 @@ Foam::ODEChemistryModel::dQ() const ) ); - if (chemistry_) + if (this->chemistry_) { scalarField& dQ = tdQ(); @@ -557,23 +560,23 @@ Foam::ODEChemistryModel::dQ() const } -template -Foam::label Foam::ODEChemistryModel::nEqns() const +template +Foam::label Foam::ODEChemistryModel::nEqns() const { // nEqns = number of species + temperature + pressure return nSpecie_ + 2; } -template -void Foam::ODEChemistryModel::calculate() +template +void Foam::ODEChemistryModel::calculate() { for (label i=0; ithermo().rho()().size()); } - if (chemistry_) + if (this->chemistry_) { forAll(this->thermo().rho()(), celli) { @@ -606,8 +609,8 @@ void Foam::ODEChemistryModel::calculate() } -template -Foam::scalar Foam::ODEChemistryModel::solve +template +Foam::scalar Foam::ODEChemistryModel::solve ( const scalar t0, const scalar deltaT @@ -618,7 +621,7 @@ Foam::scalar Foam::ODEChemistryModel::solve RR_[i].setSize(this->thermo().rho()().size()); } - if (!chemistry_) + if (!this->chemistry_) { return GREAT; } @@ -648,7 +651,7 @@ Foam::scalar Foam::ODEChemistryModel::solve c0 = c; scalar t = t0; - scalar tauC = deltaTChem_[celli]; + scalar tauC = this->deltaTChem_[celli]; scalar dt = min(deltaT, tauC); scalar timeLeft = deltaT; @@ -670,7 +673,7 @@ Foam::scalar Foam::ODEChemistryModel::solve Ti = mixture.TH(hi, Ti); timeLeft -= dt; - deltaTChem_[celli] = tauC; + this->deltaTChem_[celli] = tauC; dt = min(timeLeft, tauC); dt = max(dt, SMALL); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H index c4a394e207..d281dbf2c7 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H @@ -41,7 +41,6 @@ SourceFiles #include "hCombustionThermo.H" #include "Reaction.H" -#include "chemistryModel.H" #include "ODE.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,17 +49,17 @@ namespace Foam { // Forward declaration of classes -template +template class chemistrySolver; /*---------------------------------------------------------------------------*\ Class ODEChemistryModel Declaration \*---------------------------------------------------------------------------*/ -template +template class ODEChemistryModel : - public chemistryModel, + public CompType, public ODE { // Private Member Functions @@ -89,7 +88,7 @@ protected: label nReaction_; //- Chemistry solver - autoPtr > solver_; + autoPtr > solver_; //- Chemical source term PtrList RR_; @@ -133,7 +132,7 @@ public: inline label nReaction() const; //- Return the chemisty solver - inline const chemistrySolver& solver() const; + inline const chemistrySolver& solver() const; //- dc/dt = omega, rate of change in concentration, for each species virtual scalarField omega diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H index 4fb0ee5a6d..f0097c4fbf 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H @@ -26,57 +26,59 @@ License #include "zeroGradientFvPatchFields.H" -template +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template inline Foam::PtrList& -Foam::ODEChemistryModel::RR() +Foam::ODEChemistryModel::RR() { return RR_; } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template +template inline const Foam::PtrList >& -Foam::ODEChemistryModel::reactions() const +Foam::ODEChemistryModel::reactions() const { return reactions_; } -template +template inline const Foam::PtrList& -Foam::ODEChemistryModel::specieThermo() const +Foam::ODEChemistryModel::specieThermo() const { return specieThermo_; } -template -inline Foam::label Foam::ODEChemistryModel::nSpecie() const +template +inline Foam::label +Foam::ODEChemistryModel::nSpecie() const { return nSpecie_; } -template -inline Foam::label Foam::ODEChemistryModel::nReaction() const +template +inline Foam::label +Foam::ODEChemistryModel::nReaction() const { return nReaction_; } -template -inline const Foam::chemistrySolver& -Foam::ODEChemistryModel::solver() const +template +inline const Foam::chemistrySolver& +Foam::ODEChemistryModel::solver() const { return solver_; } -template +template inline Foam::tmp -Foam::ODEChemistryModel::RR +Foam::ODEChemistryModel::RR ( const label i ) const @@ -99,7 +101,7 @@ Foam::ODEChemistryModel::RR ) ); - if (chemistry_) + if (this->chemistry_) { tRR().internalField() = RR_[i]; tRR().correctBoundaryConditions(); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C similarity index 81% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C index 47181a4d06..13364e9ee0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C @@ -24,21 +24,13 @@ License \*---------------------------------------------------------------------------*/ -#include "chemistryModel.H" +#include "basicChemistryModel.H" #include "fvMesh.H" #include "Time.H" -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ - defineTypeNameAndDebug(chemistryModel, 0); - defineRunTimeSelectionTable(chemistryModel, fvMesh); -} - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::chemistryModel::chemistryModel(const fvMesh& mesh) +Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh) : IOdictionary ( @@ -52,7 +44,6 @@ Foam::chemistryModel::chemistryModel(const fvMesh& mesh) ) ), mesh_(mesh), - thermo_(hCombustionThermo::New(mesh)), chemistry_(lookup("chemistry")), deltaTChem_ ( @@ -60,13 +51,13 @@ Foam::chemistryModel::chemistryModel(const fvMesh& mesh) readScalar(lookup("initialChemicalTimeStep")) ) { - Info<< "chemistryModel(const fvMesh&)" << endl; + Info<< "basicChemistryModel(const fvMesh&)" << endl; } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::chemistryModel::~chemistryModel() +Foam::basicChemistryModel::~basicChemistryModel() {} diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H similarity index 75% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H index 91b5186da4..1700bb4fd5 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H @@ -23,28 +23,24 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::chemistryModel + Foam::basicChemistryModel Description - Foam::chemistryModel + Base class for chemistry models SourceFiles - chemistryModelI.H - chemistryModel.C - newChemistryModel.C + basicChemistryModelI.H + basicChemistryModel.C \*---------------------------------------------------------------------------*/ -#ifndef chemistryModel_H -#define chemistryModel_H +#ifndef basicChemistryModel_H +#define basicChemistryModel_H #include "IOdictionary.H" #include "Switch.H" #include "scalarField.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" -#include "hCombustionThermo.H" -//#include "basicMultiComponentMixture.H" +#include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -55,20 +51,20 @@ namespace Foam class fvMesh; /*---------------------------------------------------------------------------*\ - class chemistryModel Declaration + class basicChemistryModel Declaration \*---------------------------------------------------------------------------*/ -class chemistryModel +class basicChemistryModel : public IOdictionary { // Private Member Functions //- Construct as copy (not implemented) - chemistryModel(const chemistryModel&); + basicChemistryModel(const basicChemistryModel&); //- Disallow default bitwise assignment - void operator=(const chemistryModel&); + void operator=(const basicChemistryModel&); protected: @@ -78,9 +74,6 @@ protected: //- Reference to the mesh database const fvMesh& mesh_; - //- Thermo package - autoPtr thermo_; - //- Chemistry activation switch Switch chemistry_; @@ -98,33 +91,17 @@ protected: public: //- Runtime type information - TypeName("chemistryModel"); - - - //- Declare run-time constructor selection tables - declareRunTimeSelectionTable - ( - autoPtr, - chemistryModel, - fvMesh, - ( - const fvMesh& mesh - ), - (mesh) - ); + TypeName("basicChemistryModel"); // Constructors //- Construct from mesh - chemistryModel(const fvMesh& mesh); + basicChemistryModel(const fvMesh& mesh); - //- Selector - static autoPtr New(const fvMesh& mesh); - //- Destructor - virtual ~chemistryModel(); + virtual ~basicChemistryModel(); // Member Functions @@ -132,12 +109,6 @@ public: //- Return const access to the mesh database inline const fvMesh& mesh() const; - //- Return access to the thermo package - inline hCombustionThermo& thermo(); - - //- Return const access to the thermo package - inline const hCombustionThermo& thermo() const; - //- Chemistry activation switch inline Switch chemistry() const; @@ -173,7 +144,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "chemistryModelI.H" +#include "basicChemistryModelI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H similarity index 76% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H index d37b4afc80..45b5e3e77c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H @@ -26,37 +26,25 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::fvMesh& Foam::chemistryModel::mesh() const +inline const Foam::fvMesh& Foam::basicChemistryModel::mesh() const { return mesh_; } -inline Foam::hCombustionThermo& Foam::chemistryModel::thermo() -{ - return thermo_(); -} - - -inline const Foam::hCombustionThermo& Foam::chemistryModel::thermo() const -{ - return thermo_(); -} - - -inline Foam::Switch Foam::chemistryModel::chemistry() const +inline Foam::Switch Foam::basicChemistryModel::chemistry() const { return chemistry_; } -inline const Foam::scalarField& Foam::chemistryModel::deltaTChem() const +inline const Foam::scalarField& Foam::basicChemistryModel::deltaTChem() const { return deltaTChem_; } -inline Foam::scalarField& Foam::chemistryModel::deltaTChem() +inline Foam::scalarField& Foam::basicChemistryModel::deltaTChem() { return deltaTChem_; } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H similarity index 84% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H index c042ef7153..0d32b6a45d 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/makeChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H @@ -23,17 +23,17 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA InClass - Foam::chemistryModel + Foam::psiChemistryModel Description - Macros for instantiating chemistry models based on transport type + Macros for instantiating chemistry models based on compressibility and + transport types \*---------------------------------------------------------------------------*/ #ifndef makeChemistryModel_H #define makeChemistryModel_H -#include "chemistryModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,21 +43,21 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeChemistryModel(SS, Transport) \ +#define makeChemistryModel(SS, Comp, Thermo) \ \ -typedef SS SS##Transport; \ +typedef SS SS##Comp##Thermo; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - SS##Transport, \ - #SS"<"#Transport">", \ + SS##Comp##Thermo, \ + #SS"<"#Comp","#Thermo">", \ 0 \ ); \ \ addToRunTimeSelectionTable \ ( \ - chemistryModel, \ - SS##Transport, \ + Comp, \ + SS##Comp##Thermo, \ fvMesh \ ); diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C similarity index 76% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C index 1197051acc..ad46e5b017 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/newChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C @@ -24,18 +24,16 @@ License \*---------------------------------------------------------------------------*/ -#include "chemistryModel.H" -#include "fvMesh.H" -#include "Time.H" +#include "psiChemistryModel.H" // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr Foam::chemistryModel::New +Foam::autoPtr Foam::psiChemistryModel::New ( const fvMesh& mesh ) { - word chemistryModelType; + word psiChemistryModelType; // Enclose the creation of the chemistrtyProperties to ensure it is // deleted before the chemistrtyProperties is created otherwise the @@ -53,24 +51,25 @@ Foam::autoPtr Foam::chemistryModel::New ) ); - chemistryPropertiesDict.lookup("chemistryModel") >> chemistryModelType; + chemistryPropertiesDict.lookup("psiChemistryModel") >> + psiChemistryModelType; } - Info<< "Selecting chemistryModel " << chemistryModelType << endl; + Info<< "Selecting psiChemistryModel " << psiChemistryModelType << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(chemistryModelType); + fvMeshConstructorTablePtr_->find(psiChemistryModelType); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("chemistryModelBase::New(const mesh&)") - << "Unknown chemistryModel type " << chemistryModelType << nl << nl - << "Valid chemistryModel types are:" << nl + FatalErrorIn("psiChemistryModelBase::New(const mesh&)") + << "Unknown psiChemistryModel type " << psiChemistryModelType + << nl << nl << "Valid psiChemistryModel types are:" << nl << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } - return autoPtr(cstrIter()(mesh)); + return autoPtr(cstrIter()(mesh)); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C new file mode 100644 index 0000000000..681616365d --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "psiChemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(psiChemistryModel, 0); + defineRunTimeSelectionTable(psiChemistryModel, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::psiChemistryModel::psiChemistryModel(const fvMesh& mesh) +: + basicChemistryModel(mesh), + thermo_(hCombustionThermo::New(mesh)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::psiChemistryModel::~psiChemistryModel() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H new file mode 100644 index 0000000000..b8e3ce5079 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H @@ -0,0 +1,134 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::psiChemistryModel + +Description + Chemistry model for compressibility-based thermodynamics + +SourceFiles + psiChemistryModelI.H + psiChemistryModel.C + newChemistryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef psiChemistryModel_H +#define psiChemistryModel_H + +#include "basicChemistryModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "hCombustionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class fvMesh; + +/*---------------------------------------------------------------------------*\ + class psiChemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +class psiChemistryModel +: + public basicChemistryModel +{ + // Private Member Functions + + //- Construct as copy (not implemented) + psiChemistryModel(const psiChemistryModel&); + + //- Disallow default bitwise assignment + void operator=(const psiChemistryModel&); + + +protected: + + // Protected data + + //- Thermo package + autoPtr thermo_; + + +public: + + //- Runtime type information + TypeName("psiChemistryModel"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + psiChemistryModel, + fvMesh, + ( + const fvMesh& mesh + ), + (mesh) + ); + + + // Constructors + + //- Construct from mesh + psiChemistryModel(const fvMesh& mesh); + + + //- Selector + static autoPtr New(const fvMesh& mesh); + + + //- Destructor + virtual ~psiChemistryModel(); + + + // Member Functions + + //- Return access to the thermo package + inline hCombustionThermo& thermo(); + + //- Return const access to the thermo package + inline const hCombustionThermo& thermo() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "psiChemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H new file mode 100644 index 0000000000..ce98c539e3 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() +{ + return thermo_(); +} + + +inline const Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() const +{ + return thermo_(); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C similarity index 84% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index 2a2ccc2994..711f308a66 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -23,23 +23,35 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA InClass - Foam::chemistryModel + Foam::psiChemistryModel Description Creates chemistry model instances templated on the type of thermodynamics \*---------------------------------------------------------------------------*/ -#include "thermoPhysicsTypes.H" #include "makeChemistryModel.H" + +#include "psiChemistryModel.H" #include "ODEChemistryModel.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeChemistryModel(ODEChemistryModel, gasThermoPhysics); - makeChemistryModel(ODEChemistryModel, icoPoly8ThermoPhysics); + makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + gasThermoPhysics + ); + makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + icoPoly8ThermoPhysics + ); } // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C index 5699a75f78..1290f23438 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C @@ -30,13 +30,13 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::EulerImplicit::EulerImplicit +template +Foam::EulerImplicit::EulerImplicit ( - ODEChemistryModel& model + ODEChemistryModel& model ) : - chemistrySolver(model), + chemistrySolver(model), coeffsDict_(model.subDict(typeName + "Coeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), equil_(coeffsDict_.lookup("equilibriumRateLimiter")) @@ -45,15 +45,15 @@ Foam::EulerImplicit::EulerImplicit // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::EulerImplicit::~EulerImplicit() +template +Foam::EulerImplicit::~EulerImplicit() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -Foam::scalar Foam::EulerImplicit::solve +template +Foam::scalar Foam::EulerImplicit::solve ( scalarField &c, const scalar T, diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H index 45fbb131b6..414fb85b42 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H @@ -43,14 +43,18 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template +class EulerImplicit; + /*---------------------------------------------------------------------------*\ Class EulerImplicit Declaration \*---------------------------------------------------------------------------*/ -template +template class EulerImplicit : - public chemistrySolver + public chemistrySolver { // Private data @@ -71,7 +75,7 @@ public: // Constructors //- Construct from components - EulerImplicit(ODEChemistryModel& chemistry); + EulerImplicit(ODEChemistryModel& chemistry); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C index 23dbfcd033..c0a24a1019 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C @@ -31,10 +31,10 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::chemistrySolver::chemistrySolver +template +Foam::chemistrySolver::chemistrySolver ( - ODEChemistryModel& model + ODEChemistryModel& model ) : model_(model) @@ -43,8 +43,8 @@ Foam::chemistrySolver::chemistrySolver // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::chemistrySolver::~chemistrySolver() +template +Foam::chemistrySolver::~chemistrySolver() {} diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H index b21b692b91..ff133123c7 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H @@ -26,7 +26,7 @@ Class Foam::chemistrySolver Description - An abstract class for solving chemistry + An abstract base class for solving chemistry SourceFiles chemistrySolver.C @@ -47,11 +47,15 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template +class chemistrySolver; + /*---------------------------------------------------------------------------*\ Class chemistrySolver Declaration \*---------------------------------------------------------------------------*/ -template +template class chemistrySolver { protected: @@ -59,7 +63,7 @@ protected: // Protected data //- Reference to the chemistry model - ODEChemistryModel& model_; + ODEChemistryModel& model_; public: @@ -75,7 +79,7 @@ public: chemistrySolver, dictionary, ( - ODEChemistryModel& model + ODEChemistryModel& model ), (model) ); @@ -84,13 +88,13 @@ public: // Constructors //- Construct from components - chemistrySolver(ODEChemistryModel& model); + chemistrySolver(ODEChemistryModel& model); //- Selector static autoPtr New ( - ODEChemistryModel& model + ODEChemistryModel& model ); @@ -118,23 +122,39 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeChemistrySolver(Thermo) \ +#define makeChemistrySolver(Comp, Thermo) \ \ -defineTemplateTypeNameAndDebug \ -( \ - chemistrySolver, \ - 0 \ -); \ + typedef chemistrySolver \ + chemistrySolver##Comp##Thermo; \ \ -defineTemplateRunTimeSelectionTable(chemistrySolver, dictionary); + defineTemplateTypeNameAndDebugWithName \ + ( \ + chemistrySolver##Comp##Thermo, \ + "chemistryModel<"#Comp","#Thermo">", \ + 0 \ + ); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + chemistrySolver##Comp##Thermo, \ + dictionary \ + ); -#define makeChemistrySolverType(SS, Thermo) \ +#define makeChemistrySolverType(SS, Comp, Thermo) \ \ - defineNamedTemplateTypeNameAndDebug(SS, 0); \ + typedef SS SS##Comp##Thermo; \ \ - chemistrySolver::adddictionaryConstructorToTable > \ - add##SS##Thermo##ConstructorToTable_; + defineTemplateTypeNameAndDebugWithName \ + ( \ + SS##Comp##Thermo, \ + #SS"<"#Comp","#Thermo">", \ + 0 \ + ); \ + \ + chemistrySolver:: \ + adddictionaryConstructorToTable > \ + add##SS##Comp##Thermo##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index 9bfa6c50a2..dd316e4444 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -27,6 +27,9 @@ License #include "thermoPhysicsTypes.H" #include "chemistrySolver.H" +#include "psiChemistryModel.H" +//#include "rhoChemistryModel.H" + #include "EulerImplicit.H" #include "ode.H" #include "sequential.H" @@ -35,15 +38,26 @@ License namespace Foam { - makeChemistrySolver(gasThermoPhysics) - makeChemistrySolverType(EulerImplicit, gasThermoPhysics) - makeChemistrySolverType(ode, gasThermoPhysics) - makeChemistrySolverType(sequential, gasThermoPhysics) + makeChemistrySolver(psiChemistryModel, gasThermoPhysics) + makeChemistrySolverType(EulerImplicit, psiChemistryModel, gasThermoPhysics) + makeChemistrySolverType(ode, psiChemistryModel, gasThermoPhysics) + makeChemistrySolverType(sequential, psiChemistryModel, gasThermoPhysics) - makeChemistrySolver(icoPoly8ThermoPhysics) - makeChemistrySolverType(EulerImplicit, icoPoly8ThermoPhysics) - makeChemistrySolverType(ode, icoPoly8ThermoPhysics) - makeChemistrySolverType(sequential, icoPoly8ThermoPhysics) + makeChemistrySolver(psiChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + EulerImplicit, + psiChemistryModel, + icoPoly8ThermoPhysics + ) + makeChemistrySolverType(ode, psiChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + sequential, + psiChemistryModel, + icoPoly8ThermoPhysics + ) } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C index f868fd3055..43273dba2b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C @@ -28,14 +28,14 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -template -Foam::autoPtr > -Foam::chemistrySolver::New +template +Foam::autoPtr > +Foam::chemistrySolver::New ( - ODEChemistryModel& model + ODEChemistryModel& model ) { - word chemistrySolverType(model.chemistryModel::lookup("chemistrySolver")); + word chemistrySolverType(model.CompType::lookup("chemistrySolver")); typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(chemistrySolverType); @@ -52,7 +52,7 @@ Foam::chemistrySolver::New << exit(FatalError); } - return autoPtr >(cstrIter()(model)); + return autoPtr >(cstrIter()(model)); } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C index 946567477f..803c588461 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C @@ -29,10 +29,13 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::ode::ode(ODEChemistryModel& model) +template +Foam::ode::ode +( + ODEChemistryModel& model +) : - chemistrySolver(model), + chemistrySolver(model), coeffsDict_(model.subDict(typeName + "Coeffs")), solverName_(coeffsDict_.lookup("ODESolver")), odeSolver_(ODESolver::New(solverName_, model)), @@ -43,15 +46,15 @@ Foam::ode::ode(ODEChemistryModel& model) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::ode::~ode() +template +Foam::ode::~ode() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -Foam::scalar Foam::ode::solve +template +Foam::scalar Foam::ode::solve ( scalarField& c, const scalar T, diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H index 9a09f4bbf7..8318b0bc3d 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H @@ -44,14 +44,18 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template +class ode; + /*---------------------------------------------------------------------------*\ Class ode Declaration \*---------------------------------------------------------------------------*/ -template +template class ode : - public chemistrySolver + public chemistrySolver { // Private data @@ -74,7 +78,7 @@ public: // Constructors //- Construct from components - ode(ODEChemistryModel& model); + ode(ODEChemistryModel& model); //- Destructor diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C index 6266ea32f0..aee8a25bf2 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C @@ -29,10 +29,13 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::sequential::sequential(ODEChemistryModel& model) +template +Foam::sequential::sequential +( + ODEChemistryModel& model +) : - chemistrySolver(model), + chemistrySolver(model), coeffsDict_(model.subDict(typeName + "Coeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), equil_(coeffsDict_.lookup("equilibriumRateLimiter")) @@ -41,15 +44,15 @@ Foam::sequential::sequential(ODEChemistryModel& model) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template -Foam::sequential::~sequential() +template +Foam::sequential::~sequential() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -Foam::scalar Foam::sequential::solve +template +Foam::scalar Foam::sequential::solve ( scalarField &c, const scalar T, diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H index e7668b5214..276d7d5341 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H @@ -45,14 +45,18 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template +class sequential; + /*---------------------------------------------------------------------------*\ Class sequential Declaration \*---------------------------------------------------------------------------*/ -template +template class sequential : - public chemistrySolver + public chemistrySolver { // Private data @@ -74,7 +78,7 @@ public: //- Construct from components - sequential(ODEChemistryModel& model); + sequential(ODEChemistryModel& model); //- Destructor From e171742b90666ceacb721000086dc9cb4d5f66a0 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Jun 2009 15:25:08 +0100 Subject: [PATCH 13/74] added density-based chemistry --- .../chemistryModel/Make/files | 5 + .../rhoChemistryModel/newRhoChemistryModel.C | 76 ++++++++++ .../rhoChemistryModel/rhoChemistryModel.C | 54 +++++++ .../rhoChemistryModel/rhoChemistryModel.H | 134 ++++++++++++++++++ .../rhoChemistryModel/rhoChemistryModelI.H | 41 ++++++ .../rhoChemistryModel/rhoChemistryModels.C | 57 ++++++++ .../chemistrySolver/makeChemistrySolvers.C | 22 ++- 7 files changed, 388 insertions(+), 1 deletion(-) create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H create mode 100644 src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index 3bfd31a8b1..b92108d63a 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -1,8 +1,13 @@ chemistryModel/basicChemistryModel/basicChemistryModel.C + chemistryModel/psiChemistryModel/psiChemistryModel.C chemistryModel/psiChemistryModel/newPsiChemistryModel.C chemistryModel/psiChemistryModel/psiChemistryModels.C +chemistryModel/rhoChemistryModel/rhoChemistryModel.C +chemistryModel/rhoChemistryModel/newRhoChemistryModel.C +chemistryModel/rhoChemistryModel/rhoChemistryModels.C + chemistrySolver/chemistrySolver/makeChemistrySolvers.C LIB = $(FOAM_LIBBIN)/libchemistryModel diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C new file mode 100644 index 0000000000..1d37ee09ac --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "rhoChemistryModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::rhoChemistryModel::New +( + const fvMesh& mesh +) +{ + word rhoChemistryModelType; + + // Enclose the creation of the chemistrtyProperties to ensure it is + // deleted before the chemistrtyProperties is created otherwise the + // dictionary is entered in the database twice + { + IOdictionary chemistryPropertiesDict + ( + IOobject + ( + "chemistryProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + chemistryPropertiesDict.lookup("rhoChemistryModel") >> + rhoChemistryModelType; + } + + Info<< "Selecting rhoChemistryModel " << rhoChemistryModelType << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(rhoChemistryModelType); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("rhoChemistryModelBase::New(const mesh&)") + << "Unknown rhoChemistryModel type " << rhoChemistryModelType + << nl << nl << "Valid rhoChemistryModel types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C new file mode 100644 index 0000000000..821d63b2b7 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "rhoChemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(rhoChemistryModel, 0); + defineRunTimeSelectionTable(rhoChemistryModel, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::rhoChemistryModel::rhoChemistryModel(const fvMesh& mesh) +: + basicChemistryModel(mesh), + thermo_(hReactionThermo::New(mesh)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::rhoChemistryModel::~rhoChemistryModel() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H new file mode 100644 index 0000000000..cc192b9b68 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H @@ -0,0 +1,134 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::rhoChemistryModel + +Description + Chemistry model for compressibility-based thermodynamics + +SourceFiles + rhoChemistryModelI.H + rhoChemistryModel.C + newChemistryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef rhoChemistryModel_H +#define rhoChemistryModel_H + +#include "basicChemistryModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "hReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class fvMesh; + +/*---------------------------------------------------------------------------*\ + class rhoChemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +class rhoChemistryModel +: + public basicChemistryModel +{ + // Private Member Functions + + //- Construct as copy (not implemented) + rhoChemistryModel(const rhoChemistryModel&); + + //- Disallow default bitwise assignment + void operator=(const rhoChemistryModel&); + + +protected: + + // Protected data + + //- Thermo package + autoPtr thermo_; + + +public: + + //- Runtime type information + TypeName("rhoChemistryModel"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + rhoChemistryModel, + fvMesh, + ( + const fvMesh& mesh + ), + (mesh) + ); + + + // Constructors + + //- Construct from mesh + rhoChemistryModel(const fvMesh& mesh); + + + //- Selector + static autoPtr New(const fvMesh& mesh); + + + //- Destructor + virtual ~rhoChemistryModel(); + + + // Member Functions + + //- Return access to the thermo package + inline hReactionThermo& thermo(); + + //- Return const access to the thermo package + inline const hReactionThermo& thermo() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "rhoChemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H new file mode 100644 index 0000000000..29affe5999 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() +{ + return thermo_(); +} + + +inline const Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() const +{ + return thermo_(); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C new file mode 100644 index 0000000000..6eee751cbe --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::rhoChemistryModel + +Description + Creates chemistry model instances templated on the type of thermodynamics + +\*---------------------------------------------------------------------------*/ + +#include "makeChemistryModel.H" + +#include "rhoChemistryModel.H" +#include "ODEChemistryModel.H" +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + gasThermoPhysics + ); + makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + icoPoly8ThermoPhysics + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index dd316e4444..b371931f5f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -28,7 +28,7 @@ License #include "chemistrySolver.H" #include "psiChemistryModel.H" -//#include "rhoChemistryModel.H" +#include "rhoChemistryModel.H" #include "EulerImplicit.H" #include "ode.H" @@ -57,6 +57,26 @@ namespace Foam psiChemistryModel, icoPoly8ThermoPhysics ) + + makeChemistrySolver(rhoChemistryModel, gasThermoPhysics) + makeChemistrySolverType(EulerImplicit, rhoChemistryModel, gasThermoPhysics) + makeChemistrySolverType(ode, rhoChemistryModel, gasThermoPhysics) + makeChemistrySolverType(sequential, rhoChemistryModel, gasThermoPhysics) + + makeChemistrySolver(rhoChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + EulerImplicit, + rhoChemistryModel, + icoPoly8ThermoPhysics + ) + makeChemistrySolverType(ode, rhoChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + sequential, + rhoChemistryModel, + icoPoly8ThermoPhysics + ) } From 89f1e6d149028f5d461b436d4aeb64dd56e0fe14 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Jun 2009 17:19:41 +0100 Subject: [PATCH 14/74] updates/cosmetics --- .../coalChemistryFoam/additionalOutput.H | 48 ------------------- .../coalChemistryFoam/coalChemistryFoam.C | 12 ++--- .../coalChemistryFoam/createClouds.H | 10 ++-- .../coalChemistryFoam/createFields.H | 46 ++++++++---------- .../combustion/coalChemistryFoam/hEqn.H | 4 +- .../combustion/coalChemistryFoam/pEqn.H | 4 +- .../functions/Polynomial/Polynomial.C | 2 +- .../functions/Polynomial/Polynomial.H | 2 +- .../functions/Polynomial/PolynomialIO.C | 2 +- .../Polynomial/makePolynomialsOrder7.C | 2 +- src/lagrangian/coalCombustion/Make/options | 4 +- src/lagrangian/intermediate/Make/options | 4 +- .../ODEChemistryModel/ODEChemistryModel.C | 2 +- .../ODEChemistryModel/ODEChemistryModel.H | 2 +- .../ODEChemistryModel/ODEChemistryModelI.H | 2 +- .../basicChemistryModel/basicChemistryModel.C | 9 +++- .../basicChemistryModel/basicChemistryModel.H | 2 +- .../basicChemistryModelI.H | 2 +- .../basicChemistryModel/makeChemistryModel.H | 2 +- .../psiChemistryModel/newPsiChemistryModel.C | 2 +- .../psiChemistryModel/psiChemistryModel.C | 2 +- .../psiChemistryModel/psiChemistryModel.H | 2 +- .../psiChemistryModel/psiChemistryModelI.H | 2 +- .../psiChemistryModel/psiChemistryModels.C | 2 +- .../rhoChemistryModel/newRhoChemistryModel.C | 2 +- .../rhoChemistryModel/rhoChemistryModel.C | 2 +- .../rhoChemistryModel/rhoChemistryModel.H | 2 +- .../rhoChemistryModel/rhoChemistryModelI.H | 2 +- .../rhoChemistryModel/rhoChemistryModels.C | 2 +- ...iffusiveRadiationMixedFvPatchScalarField.C | 2 +- ...iffusiveRadiationMixedFvPatchScalarField.H | 2 +- ...iffusiveRadiationMixedFvPatchScalarField.C | 2 +- ...iffusiveRadiationMixedFvPatchScalarField.H | 2 +- .../fvDOM/absorptionCoeffs/absorptionCoeffs.C | 2 +- .../fvDOM/absorptionCoeffs/absorptionCoeffs.H | 2 +- .../absorptionCoeffs/absorptionCoeffsI.H | 2 +- .../blackBodyEmission/blackBodyEmission.C | 2 +- .../blackBodyEmission/blackBodyEmission.H | 2 +- .../radiationModel/fvDOM/fvDOM/fvDOM.C | 2 +- .../radiationModel/fvDOM/fvDOM/fvDOM.H | 2 +- .../radiationModel/fvDOM/fvDOM/fvDOMI.H | 2 +- .../interpolationLookUpTable.C | 2 +- .../interpolationLookUpTable.H | 2 +- .../interpolationLookUpTableI.H | 2 +- .../radiativeIntensityRay.C | 2 +- .../radiativeIntensityRay.H | 2 +- .../radiativeIntensityRayI.H | 2 +- .../greyMeanAbsorptionEmission.C | 2 +- .../greyMeanAbsorptionEmission.H | 2 +- .../wideBandAbsorptionEmission.C | 2 +- .../wideBandAbsorptionEmission.H | 2 +- .../hReactionThermo/hReactionThermo.C | 2 +- .../hReactionThermo/hReactionThermo.H | 2 +- .../hReactionThermo/hReactionThermos.C | 2 +- .../hReactionThermo/makeReactionThermo.H | 2 +- .../hReactionThermo/newhReactionThermo.C | 2 +- .../hRhoMixtureThermo/hRhoMixtureThermo.C | 2 +- .../hRhoMixtureThermo/hRhoMixtureThermo.H | 2 +- 58 files changed, 96 insertions(+), 143 deletions(-) delete mode 100644 applications/solvers/combustion/coalChemistryFoam/additionalOutput.H diff --git a/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H b/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H deleted file mode 100644 index 9edd35eb7c..0000000000 --- a/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H +++ /dev/null @@ -1,48 +0,0 @@ -{ - tmp tdQ - ( - new volScalarField - ( - IOobject - ( - "dQ", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar - ( - "zero", - dimensionSet(1, -3, -1, 0, 0, 0, 0), - 0.0 - ) - ) - ); - - scalarField& dQ = tdQ(); - - scalarField cp(dQ.size(), 0.0); - - forAll(Y, i) - { - volScalarField RRi = chemistry.RR(i); - - forAll(h, celli) - { - scalar Ti = T[celli]; - cp[celli] += Y[i][celli]*chemistry.specieThermo()[i].Cp(Ti); - scalar hi = chemistry.specieThermo()[i].h(Ti); - scalar RR = RRi[celli]; - dQ[celli] -= hi*RR; - } - } - - forAll(dQ, celli) - { - dQ[celli] /= cp[celli]; - } - - tdQ().write(); -} diff --git a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C index 3bccc682d3..3883b48f55 100644 --- a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C @@ -36,9 +36,10 @@ Description #include "turbulenceModel.H" #include "basicThermoCloud.H" #include "coalCloud.H" -#include "chemistryModel.H" +#include "psiChemistryModel.H" #include "chemistrySolver.H" -#include "ReactingCloudThermoTypes.H" +#include "thermoPhysicsTypes.H" +//#include "ReactingCloudThermoTypes.H" #include "timeActivatedExplicitSource.H" #include "radiationModel.H" @@ -115,12 +116,9 @@ int main(int argc, char *argv[]) enthalpySource.update(); - rho = thermo->rho(); + rho = thermo.rho(); - if (runTime.write()) - { - #include "additionalOutput.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/combustion/coalChemistryFoam/createClouds.H b/applications/solvers/combustion/coalChemistryFoam/createClouds.H index 34398f6b82..88f789eb92 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createClouds.H +++ b/applications/solvers/combustion/coalChemistryFoam/createClouds.H @@ -17,15 +17,15 @@ forAll(gasProperties, i) ); } */ -PtrList gasProperties(Y.size()); +PtrList gasProperties(Y.size()); forAll(gasProperties, i) { gasProperties.set ( i, - new specieReactingProperties + new gasThermoPhysics ( - dynamic_cast(thermo()).speciesData()[i] + dynamic_cast&>(thermo).speciesData()[i] ) ); } @@ -37,7 +37,7 @@ coalCloud coalParcels rho, U, g, - thermo(), + thermo, gasProperties ); @@ -48,5 +48,5 @@ basicThermoCloud limestoneParcels rho, U, g, - thermo() + thermo ); diff --git a/applications/solvers/combustion/coalChemistryFoam/createFields.H b/applications/solvers/combustion/coalChemistryFoam/createFields.H index ebd8a44ab6..194ae9f758 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createFields.H +++ b/applications/solvers/combustion/coalChemistryFoam/createFields.H @@ -1,19 +1,30 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr thermo + autoPtr pChemistry ( - hCombustionThermo::New(mesh) + psiChemistryModel::New(mesh) ); + psiChemistryModel& chemistry = pChemistry(); - combustionMixture& composition = thermo->composition(); + hCombustionThermo& thermo = chemistry.thermo(); + + basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo->lookup("inertSpecie")); + word inertSpecie(thermo.lookup("inertSpecie")); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& T = thermo->T(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& T = thermo.T(); + const volScalarField& psi = thermo.psi(); + + multivariateSurfaceInterpolationScheme::fieldTable fields; + + forAll (Y, i) + { + fields.add(Y[i]); + } + fields.add(h); volScalarField rho ( @@ -25,7 +36,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); // lagrangian effective density field - used externally (optional) @@ -97,7 +108,7 @@ rho, U, phi, - thermo() + thermo ) ); @@ -112,18 +123,3 @@ mesh, h.dimensions()*phi.dimensions()/mesh.V().dimensions() ); - - Info << "Constructing chemical mechanism" << endl; - chemistryModel chemistry - ( - thermo(), - rho - ); - - multivariateSurfaceInterpolationScheme::fieldTable fields; - - forAll (Y, i) - { - fields.add(Y[i]); - } - fields.add(h); diff --git a/applications/solvers/combustion/coalChemistryFoam/hEqn.H b/applications/solvers/combustion/coalChemistryFoam/hEqn.H index 6f0d532437..434177e136 100644 --- a/applications/solvers/combustion/coalChemistryFoam/hEqn.H +++ b/applications/solvers/combustion/coalChemistryFoam/hEqn.H @@ -9,14 +9,14 @@ + coalParcels.Sh() + limestoneParcels.Sh() + enthalpySource.Su() - + radiation->Sh(thermo()) + + radiation->Sh(thermo) ); hEqn.relax(); hEqn.solve(); - thermo->correct(); + thermo.correct(); radiation->correct(); } diff --git a/applications/solvers/combustion/coalChemistryFoam/pEqn.H b/applications/solvers/combustion/coalChemistryFoam/pEqn.H index 4a94c725bc..b31ad45ed4 100644 --- a/applications/solvers/combustion/coalChemistryFoam/pEqn.H +++ b/applications/solvers/combustion/coalChemistryFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); @@ -8,7 +8,7 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi()) + fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C index f3621eabc0..8c814e2acf 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H index 0ade28b2c8..061b4af377 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C index e7c1fd452a..2a0d2187aa 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C b/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C index 0d502964a8..ae8f43fb5c 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/coalCombustion/Make/options b/src/lagrangian/coalCombustion/Make/options index 21dc5327f1..965409487a 100755 --- a/src/lagrangian/coalCombustion/Make/options +++ b/src/lagrangian/coalCombustion/Make/options @@ -10,7 +10,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ @@ -30,6 +30,6 @@ LIB_LIBS = \ -lliquidMixture \ -lsolids \ -lsolidMixture \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lcompressibleRASModels \ -lcompressibleLESModels diff --git a/src/lagrangian/intermediate/Make/options b/src/lagrangian/intermediate/Make/options index e9d4852aa0..f352597282 100644 --- a/src/lagrangian/intermediate/Make/options +++ b/src/lagrangian/intermediate/Make/options @@ -9,7 +9,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ @@ -28,6 +28,6 @@ LIB_LIBS = \ -lsolidMixture \ -lspecie \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lcompressibleRASModels \ -lcompressibleLESModels diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 498bc9ada2..727bbb442f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H index d281dbf2c7..cd23400744 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H index f0097c4fbf..5abb1591a5 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C index 13364e9ee0..99f60ccf9b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,6 +28,13 @@ License #include "fvMesh.H" #include "Time.H" +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(basicChemistryModel, 0); +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh) diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H index 1700bb4fd5..c8fcdd9863 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H index 45b5e3e77c..214d17bac1 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H index 0d32b6a45d..d0b893629e 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C index ad46e5b017..39ff8ed1fc 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C index 681616365d..4354b7ecbc 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H index b8e3ce5079..c1a16d7ca7 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H index ce98c539e3..a6122b8b68 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index 711f308a66..819156ee51 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C index 1d37ee09ac..fd87c3539f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C index 821d63b2b7..46a6827b4b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H index cc192b9b68..2e164f8bc2 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H index 29affe5999..d96171001b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C index 6eee751cbe..69d3f75a66 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 567eff9daf..80c3c2dc69 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index 005fe76865..cad873ab72 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index b3669bd6fa..08dbb061ed 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 9d170131b2..60ba567ba3 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C index 3452797b3e..eeec89cef8 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H index 1a79e310b9..685d105219 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H index c7759db477..9ae17155cd 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C index dee5647366..bc21f3bfe0 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H index 01719e5076..958f6d6d7e 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index 296b99ff9e..bfcf1309e8 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H index f91163805a..183ce1b9a8 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H index 594b5bee0a..0995efa436 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C index f000e43fa3..b9af5e65b6 100755 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H index 6140ae4bc3..7768fb48ca 100755 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H index 5829db3148..8019d1c64f 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index 7441b900d6..ff22c63359 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H index 1e558c8f3c..c139a36334 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H index 0efd423a6d..649f5b7c9e 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C index dccbbbad25..cdb57c0f53 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H index 2c24af42c4..a5921d7c40 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C index a96deeb0b4..1665519e3e 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H index 21e10c400b..5a0dd1d20e 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C index 73e810479c..fca95dff16 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H index 6523dcdb48..82d653048b 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C index 25a517bce3..006e45b588 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H index 15b058e485..a74bded0bf 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C index 50ac8bdf66..104c66f613 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C index 3e4679bf6b..0c763fd78a 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H index 17c4d8b22e..570f696bac 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License From f27c151a675ec12f66ffbe79e1243cd71543e99a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Jun 2009 18:25:07 +0100 Subject: [PATCH 15/74] updates needed for compatibility with new thermo descriptions - more needed... --- .../coalChemistryFoam/coalChemistryFoam.C | 4 +- .../coalChemistryFoam/createClouds.H | 6 +- .../reactingParcelFoam/reactingParcelFoam.C | 2 +- .../include/createCoalParcelTypes.H | 6 +- .../makeCoalParcelSurfaceReactionModels.H | 6 +- src/lagrangian/dieselSpray/Make/options | 2 +- src/lagrangian/dieselSpray/parcel/parcel.C | 9 +- .../dieselSpray/parcel/setRelaxationTimes.C | 18 +- src/lagrangian/dieselSpray/spray/spray.C | 4 +- src/lagrangian/dieselSpray/spray/spray.H | 8 +- src/lagrangian/dieselSpray/spray/sprayI.H | 41 ++++- .../atomizationModel/LISA/LISA.C | 172 +++++++++--------- .../blobsSheetAtomization.C | 2 +- .../noAtomization/noAtomization.C | 2 +- .../breakupModel/reitzDiwakar/reitzDiwakar.C | 2 +- .../clouds/include/createReactingCloudTypes.H | 6 +- .../createReactingMultiphaseParcelTypes.H | 6 +- .../include/createReactingParcelTypes.H | 6 +- .../createTrackedReactingParcelTypes.H | 4 +- ...eactingMultiphaseParcelCompositionModels.H | 6 +- ...ngMultiphaseParcelDevolatilisationModels.H | 6 +- ...eReactingMultiphaseParcelInjectionModels.H | 6 +- ...ingMultiphaseParcelSurfaceReactionModels.H | 6 +- .../makeReactingParcelCompositionModels.H | 6 +- .../makeReactingParcelDispersionModels.H | 6 +- .../include/makeReactingParcelDragModels.H | 6 +- .../makeReactingParcelHeatTransferModels.H | 6 +- .../makeReactingParcelInjectionModels.H | 6 +- ...makeReactingParcelPatchInteractionModels.H | 6 +- .../makeReactingParcelPhaseChangeModels.H | 6 +- .../makeReactingParcelPostProcessingModels.H | 6 +- .../parcels/include/reactingThermoTypes.H | 58 ------ .../InjectionModel/InjectionModel.C | 2 +- 33 files changed, 209 insertions(+), 229 deletions(-) delete mode 100644 src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H diff --git a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C index 1bf6ddd46d..9c40b73b5d 100644 --- a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C @@ -35,11 +35,11 @@ Description #include "hCombustionThermo.H" #include "turbulenceModel.H" #include "basicThermoCloud.H" -#include "coalCloud.H" +#include "CoalCloud.H" #include "psiChemistryModel.H" #include "chemistrySolver.H" #include "thermoPhysicsTypes.H" -#include "timeActivatedExplicitSource.H" +#include "timeActivatedExplicitCellSource.H" #include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/coalChemistryFoam/createClouds.H b/applications/solvers/combustion/coalChemistryFoam/createClouds.H index 4ed459b150..0a5fd91b75 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createClouds.H +++ b/applications/solvers/combustion/coalChemistryFoam/createClouds.H @@ -1,11 +1,11 @@ Info<< "\nConstructing coal cloud" << endl; -CoalCloud coalParcels +CoalCloud coalParcels ( "coalCloud1", rho, U, g, - thermo() + thermo ); Info<< "\nConstructing limestone cloud" << endl; @@ -15,5 +15,5 @@ basicThermoCloud limestoneParcels rho, U, g, - thermo() + thermo ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index 3c2182d2bc..d93b823661 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -37,7 +37,7 @@ Description #include "BasicReactingCloud.H" #include "chemistryModel.H" #include "chemistrySolver.H" -#include "reactingThermoTypes.H" +#include "thermoPhsyicsTypes.H" #include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H index 4c06686683..c8eff9ab19 100644 --- a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H +++ b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H @@ -28,7 +28,7 @@ License #define createCoalParcelTypes_H #include "makeParcelIOList.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "CoalCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -38,12 +38,12 @@ License createCoalParcelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ createCoalParcelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ ); diff --git a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H index 1f60f47d9d..a2ca0bb16b 100644 --- a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H +++ b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingMultiphaseCloud.H" #include "NoSurfaceReaction.H" @@ -44,12 +44,12 @@ License makeCoalSurfaceReactionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeCoalSurfaceReactionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ ); diff --git a/src/lagrangian/dieselSpray/Make/options b/src/lagrangian/dieselSpray/Make/options index d0817503ce..454c4f15bf 100644 --- a/src/lagrangian/dieselSpray/Make/options +++ b/src/lagrangian/dieselSpray/Make/options @@ -11,7 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude LIB_LIBS = \ diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index 4d19f332fd..0dd861683b 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -34,15 +34,14 @@ License #include "wallPolyPatch.H" #include "wedgePolyPatch.H" #include "processorPolyPatch.H" -#include "combustionMixture.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + namespace Foam { -defineParticleTypeNameAndDebug(parcel, 0); -defineTemplateTypeNameAndDebug(Cloud, 0); + defineParticleTypeNameAndDebug(parcel, 0); + defineTemplateTypeNameAndDebug(Cloud, 0); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C index 058ae4252e..131e9f885f 100644 --- a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C +++ b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C @@ -30,7 +30,7 @@ License #include "dragModel.H" #include "evaporationModel.H" #include "heatTransferModel.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,7 +93,7 @@ void parcel::setRelaxationTimes for(label i=0; i 0.5) { // no drag for parcels in the liquid core.. tauMomentum = GREAT; } else - { + { tauMomentum = sDB.drag().relaxationTime ( Urel(Up), @@ -218,10 +218,10 @@ void parcel::setRelaxationTimes { scalar Nusselt = sDB.heatTransfer().Nu(Reynolds, Prandtl); - + // calculating the boiling temperature of the liquid at ambient pressure scalar tBoilingSurface = Td; - + label Niter = 0; scalar deltaT = 10.0; scalar dp0 = fuels.properties()[i].pv(pressure, tBoilingSurface) - pressure; @@ -255,16 +255,16 @@ void parcel::setRelaxationTimes } dp0 = dp; } - + scalar vapourSurfaceEnthalpy = 0.0; scalar vapourFarEnthalpy = 0.0; - + for(label k = 0; k < sDB.gasProperties().size(); k++) { vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface); vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature); } - + scalar kLiquid = fuels.properties()[i].K(pressure, 0.5*(tBoilingSurface+T())); tauBoiling[i] = sDB.evaporation().boilingTime diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index 1f4b1a242f..4845d8a2e5 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -36,7 +36,7 @@ License #include "injectorModel.H" #include "wallModel.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" @@ -56,7 +56,7 @@ Foam::spray::spray const volScalarField& rho, const volScalarField& p, const volScalarField& T, - const combustionMixture& composition, + const basicMultiComponentMixture& composition, const PtrList& gasProperties, const dictionary&, const dictionary& environmentalProperties diff --git a/src/lagrangian/dieselSpray/spray/spray.H b/src/lagrangian/dieselSpray/spray/spray.H index be9c49e67a..cc1e0ac382 100644 --- a/src/lagrangian/dieselSpray/spray/spray.H +++ b/src/lagrangian/dieselSpray/spray/spray.H @@ -58,7 +58,7 @@ class injectorModel; class heatTransferModel; class wallModel; -class combustionMixture; +class basicMultiComponentMixture; /*---------------------------------------------------------------------------*\ Class spray Declaration @@ -128,7 +128,7 @@ class spray // Composition properties const PtrList& gasProperties_; - const combustionMixture& composition_; + const basicMultiComponentMixture& composition_; List