From 320b8708c2df647d4fb45cda4afe9a024ceb151c Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Fri, 5 Jun 2015 08:19:13 +0100 Subject: [PATCH] combustionModels: Added multiphase-phase support by naming fields including the phase name is needed --- src/combustionModels/FSD/FSD.C | 18 ++++++---- src/combustionModels/FSD/FSD.H | 6 ++-- .../consumptionSpeed/consumptionSpeed.C | 26 ++++++++------- .../consumptionSpeed/consumptionSpeed.H | 5 ++- .../reactionRateFlameArea.C | 12 +++---- .../relaxation/relaxation.H | 4 +-- src/combustionModels/PaSR/PaSR.C | 29 +++++++++------- src/combustionModels/PaSR/PaSR.H | 4 +-- .../combustionModel/combustionModel.C | 10 +++--- .../combustionModel/combustionModel.H | 33 ++++++++++--------- src/combustionModels/diffusion/diffusion.C | 11 +++++-- src/combustionModels/diffusion/diffusion.H | 11 +++++-- .../infinitelyFastChemistry.C | 11 +++++-- .../infinitelyFastChemistry.H | 11 +++++-- src/combustionModels/laminar/laminar.C | 14 ++++---- src/combustionModels/laminar/laminar.H | 11 +++++-- .../noCombustion/noCombustion.C | 9 ++--- .../noCombustion/noCombustion.H | 7 ++-- .../psiChemistryCombustion.C | 9 ++--- .../psiChemistryCombustion.H | 9 +++-- .../psiCombustionModel/psiCombustionModel.C | 7 ++-- .../psiCombustionModel/psiCombustionModel.H | 24 ++++++++++---- .../psiCombustionModelNew.C | 9 ++--- .../psiThermoCombustion/psiThermoCombustion.C | 9 ++--- .../psiThermoCombustion/psiThermoCombustion.H | 11 +++++-- .../rhoChemistryCombustion.C | 9 ++--- .../rhoChemistryCombustion.H | 9 +++-- .../rhoCombustionModel/rhoCombustionModel.C | 8 ++--- .../rhoCombustionModel/rhoCombustionModel.H | 24 ++++++++++---- .../rhoCombustionModelNew.C | 9 ++--- .../rhoThermoCombustion/rhoThermoCombustion.C | 9 ++--- .../rhoThermoCombustion/rhoThermoCombustion.H | 11 +++++-- .../singleStepCombustion.C | 15 +++++---- .../singleStepCombustion.H | 11 +++++-- .../perfectFluid/perfectFluidI.H | 1 + 35 files changed, 262 insertions(+), 154 deletions(-) diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index 7717c73c70b..9d79904cd40 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -40,10 +40,16 @@ template<class CombThermoType, class ThermoType> FSD<CombThermoType, ThermoType>::FSD ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh), + singleStepCombustion<CombThermoType, ThermoType> + ( + modelType, + mesh, + phaseName + ), reactionRateFlameArea_ ( reactionRateFlameArea::New @@ -57,7 +63,7 @@ FSD<CombThermoType, ThermoType>::FSD ( IOobject ( - "ft", + IOobject::groupName("ft", phaseName), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -144,7 +150,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() ( IOobject ( - "Pc", + IOobject::groupName("Pc", this->phaseName_), U.time().timeName(), U.db(), IOobject::NO_READ, @@ -163,7 +169,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() ( IOobject ( - "omegaFuelBar", + IOobject::groupName("omegaFuelBar", this->phaseName_), U.time().timeName(), U.db(), IOobject::NO_READ, @@ -291,7 +297,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() ( IOobject ( - "products", + IOobject::groupName("products", this->phaseName_), U.time().timeName(), U.db(), IOobject::NO_READ, diff --git a/src/combustionModels/FSD/FSD.H b/src/combustionModels/FSD/FSD.H index f9156edcbd0..6e3609abdb9 100644 --- a/src/combustionModels/FSD/FSD.H +++ b/src/combustionModels/FSD/FSD.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,7 +136,7 @@ public: // Constructors //- Construct from components - FSD(const word& modelType, const fvMesh& mesh); + FSD(const word& modelType, const fvMesh& mesh, const word& phaseName); // Destructor @@ -149,7 +149,7 @@ public: virtual void correct(); - // I-O + // IO //- Update properties virtual bool read(); diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C index 1ff3208491f..2a5cbbd7daf 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,17 +60,18 @@ Foam::scalar Foam::consumptionSpeed::omega0Sigma scalar a ) const { - scalar omega0 = 0.0; - if (sigma < sigmaExt_) - { - omega0 = - max - ( - a*omega0_*(1.0 - exp(eta_*max(sigma, 0.0))), - omegaMin_ - ) ; - } - return omega0; + scalar omega0 = 0.0; + + if (sigma < sigmaExt_) + { + omega0 = max + ( + a*omega0_*(1.0 - exp(eta_*max(sigma, 0.0))), + omegaMin_ + ) ; + } + + return omega0; } @@ -137,4 +138,5 @@ void Foam::consumptionSpeed::read(const dictionary& dict) dict.lookup("omegaMin") >> omegaMin_; } + // ************************************************************************* // diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H b/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H index d56216903cb..c7f35d0c7de 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,6 @@ class consumptionSpeed { // Private Data - //- Maximum consumption speed scalar omega0_; @@ -122,7 +121,7 @@ public: } - // I-O + // IO //- Update properties void read(const dictionary& dict); diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C index bc9f4481a8e..06dca4d56ce 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameArea.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,8 +59,7 @@ Foam::reactionRateFlameArea::reactionRateFlameArea ), mesh_ ) -{ -} +{} Foam::reactionRateFlameArea::reactionRateFlameArea @@ -87,8 +86,8 @@ Foam::reactionRateFlameArea::reactionRateFlameArea ), mesh_ ) -{ -} +{} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -101,8 +100,9 @@ Foam::reactionRateFlameArea::~reactionRateFlameArea() bool Foam::reactionRateFlameArea::read(const dictionary& dict) { dict.lookup("fuel") >> fuel_; - return true; + return true; } + // ************************************************************************* // diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H b/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H index b647997ddac..33cead008ce 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/relaxation/relaxation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,7 +103,7 @@ public: virtual void correct(const volScalarField& sigma); - // I-O + // IO //- Update properties from given dictionary virtual bool read(const dictionary& dictProperties); diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index 9e14ce1d27a..581e1556719 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -32,17 +32,18 @@ template<class Type> Foam::combustionModels::PaSR<Type>::PaSR ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - laminar<Type>(modelType, mesh), + laminar<Type>(modelType, mesh, phaseName), Cmix_(readScalar(this->coeffs().lookup("Cmix"))), turbulentReaction_(this->coeffs().lookup("turbulentReaction")), kappa_ ( IOobject ( - "PaSR:kappa", + IOobject::groupName("PaSR:kappa", phaseName), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -116,11 +117,14 @@ template<class Type> Foam::tmp<Foam::volScalarField> Foam::combustionModels::PaSR<Type>::dQ() const { - return - tmp<volScalarField> + return tmp<volScalarField> + ( + new volScalarField ( - new volScalarField("PaSR:dQ", kappa_*laminar<Type>::dQ()) - ); + IOobject::groupName("PaSR:dQ", this->phaseName_), + kappa_*laminar<Type>::dQ() + ) + ); } @@ -128,11 +132,14 @@ template<class Type> Foam::tmp<Foam::volScalarField> Foam::combustionModels::PaSR<Type>::Sh() const { - return - tmp<volScalarField> + return tmp<volScalarField> + ( + new volScalarField ( - new volScalarField("PaSR:Sh", kappa_*laminar<Type>::Sh()) - ); + IOobject::groupName("PaSR:Sh", this->phaseName_), + kappa_*laminar<Type>::Sh() + ) + ); } diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H index 7ca8a510748..f0d8344af15 100644 --- a/src/combustionModels/PaSR/PaSR.H +++ b/src/combustionModels/PaSR/PaSR.H @@ -86,7 +86,7 @@ public: // Constructors //- Construct from components - PaSR(const word& modelType, const fvMesh& mesh); + PaSR(const word& modelType, const fvMesh& mesh, const word& phaseName); //- Destructor @@ -110,7 +110,7 @@ public: virtual tmp<volScalarField> Sh() const; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/combustionModels/combustionModel/combustionModel.C b/src/combustionModels/combustionModel/combustionModel.C index 35bcec380c8..21e81beb912 100644 --- a/src/combustionModels/combustionModel/combustionModel.C +++ b/src/combustionModels/combustionModel/combustionModel.C @@ -37,14 +37,15 @@ namespace Foam Foam::combustionModel::combustionModel ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : IOdictionary ( IOobject ( - "combustionProperties", + IOobject::groupName("combustionProperties", phaseName), mesh.time().constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, @@ -55,7 +56,8 @@ Foam::combustionModel::combustionModel mesh_(mesh), active_(lookupOrDefault<Switch>("active", true)), coeffs_(subDict(modelType + "Coeffs")), - modelType_(modelType) + modelType_(modelType), + phaseName_(phaseName) {} @@ -96,7 +98,7 @@ Foam::tmp<Foam::volScalarField> Foam::combustionModel::Sh() const ( IOobject ( - "Sh", + IOobject::groupName("Sh", phaseName_), mesh_.time().timeName(), mesh_, IOobject::NO_READ, diff --git a/src/combustionModels/combustionModel/combustionModel.H b/src/combustionModels/combustionModel/combustionModel.H index f46072820d9..7c30881fd21 100644 --- a/src/combustionModels/combustionModel/combustionModel.H +++ b/src/combustionModels/combustionModel/combustionModel.H @@ -51,6 +51,14 @@ class combustionModel : public IOdictionary { + // Private Member Functions + + //- Disallow copy construct + combustionModel(const combustionModel&); + + //- Disallow default bitwise assignment + void operator=(const combustionModel&); + protected: @@ -68,19 +76,11 @@ protected: //- Dictionary of the model dictionary coeffs_; - //- Model name + //- Model type const word modelType_; - -private: - - // Private Member Functions - - //- Disallow copy construct - combustionModel(const combustionModel&); - - //- Disallow default bitwise assignment - void operator=(const combustionModel&); + //- Phase name + const word phaseName_; public: @@ -91,9 +91,13 @@ public: // Constructors - //- Construct from components - combustionModel(const word& modelType, const fvMesh& mesh); + combustionModel + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName=word::null + ); //- Destructor @@ -104,7 +108,6 @@ public: // Access - //- Return const access to the mesh database inline const fvMesh& mesh() const; @@ -145,7 +148,7 @@ public: virtual tmp<volScalarField> Sh() const; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C index 387dbe90e1e..f78194cc494 100644 --- a/src/combustionModels/diffusion/diffusion.C +++ b/src/combustionModels/diffusion/diffusion.C @@ -36,10 +36,17 @@ namespace combustionModels template<class CombThermoType, class ThermoType> diffusion<CombThermoType, ThermoType>::diffusion ( - const word& modelType, const fvMesh& mesh + const word& modelType, + const fvMesh& mesh, + const word& phaseName ) : - singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh), + singleStepCombustion<CombThermoType, ThermoType> + ( + modelType, + mesh, + phaseName + ), C_(readScalar(this->coeffs().lookup("C"))), oxidantName_(this->coeffs().template lookupOrDefault<word>("oxidant", "O2")) {} diff --git a/src/combustionModels/diffusion/diffusion.H b/src/combustionModels/diffusion/diffusion.H index add1a643a48..b2a3516188a 100644 --- a/src/combustionModels/diffusion/diffusion.H +++ b/src/combustionModels/diffusion/diffusion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,12 @@ public: // Constructors //- Construct from components - diffusion(const word& modelType, const fvMesh& mesh); + diffusion + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor @@ -97,7 +102,7 @@ public: virtual void correct(); - // I-O + // IO //- Update properties virtual bool read(); diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C index c7ab4ef7365..62626826188 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -35,10 +35,17 @@ namespace combustionModels template<class CombThermoType, class ThermoType> infinitelyFastChemistry<CombThermoType, ThermoType>::infinitelyFastChemistry ( - const word& modelType, const fvMesh& mesh + const word& modelType, + const fvMesh& mesh, + const word& phaseName ) : - singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh), + singleStepCombustion<CombThermoType, ThermoType> + ( + modelType, + mesh, + phaseName + ), C_(readScalar(this->coeffs().lookup("C"))) {} diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H index 0e10e9347e8..69fb847e266 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,7 +79,12 @@ public: // Constructors //- Construct from components - infinitelyFastChemistry(const word& modelType, const fvMesh& mesh); + infinitelyFastChemistry + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor @@ -94,7 +99,7 @@ public: virtual void correct(); - // I-O + // IO //- Update properties virtual bool read(); diff --git a/src/combustionModels/laminar/laminar.C b/src/combustionModels/laminar/laminar.C index 07bffa5c4cf..7203a715e80 100644 --- a/src/combustionModels/laminar/laminar.C +++ b/src/combustionModels/laminar/laminar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,10 +33,11 @@ template<class Type> Foam::combustionModels::laminar<Type>::laminar ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - Type(modelType, mesh), + Type(modelType, mesh, phaseName), integrateReactionRate_ ( this->coeffs().lookupOrDefault("integrateReactionRate", true) @@ -128,7 +129,8 @@ Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const if (this->active()) { - const label specieI = this->thermo().composition().species()[Y.name()]; + const label specieI = + this->thermo().composition().species()[Y.member()]; Su += this->chemistryPtr_->RR(specieI); } @@ -147,7 +149,7 @@ Foam::combustionModels::laminar<Type>::dQ() const ( IOobject ( - typeName + ":dQ", + IOobject::groupName(typeName + ":dQ", this->phaseName_), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -179,7 +181,7 @@ Foam::combustionModels::laminar<Type>::Sh() const ( IOobject ( - typeName + ":Sh", + IOobject::groupName(typeName + ":Sh", this->phaseName_), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/combustionModels/laminar/laminar.H b/src/combustionModels/laminar/laminar.H index b7568433945..6abd8978faa 100644 --- a/src/combustionModels/laminar/laminar.H +++ b/src/combustionModels/laminar/laminar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,7 +84,12 @@ public: // Constructors //- Construct from components - laminar(const word& modelType, const fvMesh& mesh); + laminar + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor @@ -108,7 +113,7 @@ public: virtual tmp<volScalarField> Sh() const; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/combustionModels/noCombustion/noCombustion.C b/src/combustionModels/noCombustion/noCombustion.C index 3699bd751aa..838edd169cb 100644 --- a/src/combustionModels/noCombustion/noCombustion.C +++ b/src/combustionModels/noCombustion/noCombustion.C @@ -32,10 +32,11 @@ template<class CombThermoType> Foam::combustionModels::noCombustion<CombThermoType>::noCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - CombThermoType(modelType, mesh) + CombThermoType(modelType, mesh, phaseName) {} @@ -81,7 +82,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::dQ() const ( IOobject ( - "dQ", + IOobject::groupName("dQ", this->phaseName_), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -108,7 +109,7 @@ Foam::combustionModels::noCombustion<CombThermoType>::Sh() const ( IOobject ( - "Sh", + IOobject::groupName("Sh", this->phaseName_), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/combustionModels/noCombustion/noCombustion.H b/src/combustionModels/noCombustion/noCombustion.H index 835317268c8..1a93461c39f 100644 --- a/src/combustionModels/noCombustion/noCombustion.H +++ b/src/combustionModels/noCombustion/noCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,7 +71,8 @@ public: noCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ); @@ -95,7 +96,7 @@ public: //- Return source for enthalpy equation [kg/m/s3] virtual tmp<volScalarField> Sh() const; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C index dc591860403..be0ccfabfbd 100644 --- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C +++ b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,12 @@ License Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - psiCombustionModel(modelType, mesh), - chemistryPtr_(psiChemistryModel::New(mesh)) + psiCombustionModel(modelType, mesh, phaseName), + chemistryPtr_(psiChemistryModel::New(mesh, phaseName)) {} diff --git a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H index 81c7a91139a..e3725d35d34 100644 --- a/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H +++ b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,7 +76,12 @@ public: // Constructors //- Construct from components and thermo - psiChemistryCombustion(const word& modelType, const fvMesh& mesh); + psiChemistryCombustion + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C index 287f1021013..1ecc201dd31 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,10 +41,11 @@ namespace combustionModels Foam::combustionModels::psiCombustionModel::psiCombustionModel ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - combustionModel(modelType, mesh) + combustionModel(modelType, mesh, phaseName) {} diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H index 0206a5e70ca..64c5234bfc4 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,21 +81,31 @@ public: dictionary, ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ), - (modelType, mesh) + (modelType, mesh, phaseName) ); // Constructors - //- Construct from components and thermo - psiCombustionModel(const word& modelType, const fvMesh& mesh); + //- Construct from components + psiCombustionModel + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Selector - static autoPtr<psiCombustionModel> New(const fvMesh& mesh); + static autoPtr<psiCombustionModel> New + ( + const fvMesh& mesh, + const word& phaseName=word::null + ); //- Destructor @@ -114,7 +124,7 @@ public: virtual tmp<volScalarField> rho() const = 0; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C index b3ca2cc74b9..42a000e1870 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,8 @@ License Foam::autoPtr<Foam::combustionModels::psiCombustionModel> Foam::combustionModels::psiCombustionModel::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { const word combModelName @@ -39,7 +40,7 @@ Foam::combustionModels::psiCombustionModel::New ( IOobject ( - "combustionProperties", + IOobject::groupName("combustionProperties", phaseName), mesh.time().constant(), mesh, IOobject::MUST_READ, @@ -70,7 +71,7 @@ Foam::combustionModels::psiCombustionModel::New const word className = combModelName(0, tempOpen); - return autoPtr<psiCombustionModel>(cstrIter()(className, mesh)); + return autoPtr<psiCombustionModel>(cstrIter()(className, mesh, phaseName)); } diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C index 89a4a5daa7a..6d45d60ef5f 100644 --- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C +++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,12 @@ License Foam::combustionModels::psiThermoCombustion::psiThermoCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - psiCombustionModel(modelType, mesh), - thermoPtr_(psiReactionThermo::New(mesh)) + psiCombustionModel(modelType, mesh, phaseName), + thermoPtr_(psiReactionThermo::New(mesh, phaseName)) {} diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H index 8a294718a33..44a55155ada 100644 --- a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H +++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,8 +75,13 @@ public: // Constructors - //- Construct from components and thermo - psiThermoCombustion(const word& modelType, const fvMesh& mesh); + //- Construct from components + psiThermoCombustion + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C index 22495abb4af..70ce698d7be 100644 --- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C +++ b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,12 @@ License Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - rhoCombustionModel(modelType, mesh), - chemistryPtr_(rhoChemistryModel::New(mesh)) + rhoCombustionModel(modelType, mesh, phaseName), + chemistryPtr_(rhoChemistryModel::New(mesh, phaseName)) {} diff --git a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H index 7010cb5389e..2a37812e05b 100644 --- a/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H +++ b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,7 +76,12 @@ public: // Constructors //- Construct from components and thermo - rhoChemistryCombustion(const word& modelType, const fvMesh& mesh); + rhoChemistryCombustion + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C index 55655caeeb6..531b169d7d4 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,14 +38,14 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - Foam::combustionModels::rhoCombustionModel::rhoCombustionModel ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - combustionModel(modelType, mesh) + combustionModel(modelType, mesh, phaseName) {} diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H index 04cf1f56ab8..341b5b6dcd6 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,22 +81,32 @@ public: dictionary, ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ), - (modelType, mesh) + (modelType, mesh, phaseName) ); // Constructors - //- Construct from components and thermo - rhoCombustionModel(const word& modelType, const fvMesh& mesh); + //- Construct from components + rhoCombustionModel + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Selector - static autoPtr<rhoCombustionModel> New(const fvMesh& mesh); + static autoPtr<rhoCombustionModel> New + ( + const fvMesh& mesh, + const word& phaseName=word::null + ); //- Destructor @@ -121,7 +131,7 @@ public: virtual tmp<volScalarField> rho() const = 0; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C index 71de8ee57a4..2c94b399313 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,8 @@ License Foam::autoPtr<Foam::combustionModels::rhoCombustionModel> Foam::combustionModels::rhoCombustionModel::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { const word combTypeName @@ -39,7 +40,7 @@ Foam::combustionModels::rhoCombustionModel::New ( IOobject ( - "combustionProperties", + IOobject::groupName("combustionProperties", phaseName), mesh.time().constant(), mesh, IOobject::MUST_READ, @@ -70,7 +71,7 @@ Foam::combustionModels::rhoCombustionModel::New const word className = combTypeName(0, tempOpen); - return autoPtr<rhoCombustionModel> (cstrIter()(className, mesh)); + return autoPtr<rhoCombustionModel> (cstrIter()(className, mesh, phaseName)); } diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C index da06dfda611..ef95710f2a4 100644 --- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C +++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,11 +30,12 @@ License Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - rhoCombustionModel(modelType, mesh), - thermoPtr_(rhoReactionThermo::New(mesh)) + rhoCombustionModel(modelType, mesh, phaseName), + thermoPtr_(rhoReactionThermo::New(mesh, phaseName)) {} diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H index 1a144406064..6982569fa6f 100644 --- a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H +++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,8 +75,13 @@ public: // Constructors - //- Construct from components and thermo - rhoThermoCombustion(const word& modelType, const fvMesh& mesh); + //- Construct from components + rhoThermoCombustion + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C index 5954bf1b93a..65a41fcada6 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C @@ -37,16 +37,17 @@ template<class CombThermoType, class ThermoType> singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion ( const word& modelType, - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - CombThermoType(modelType, mesh), + CombThermoType(modelType, mesh, phaseName), singleMixturePtr_(NULL), wFuel_ ( IOobject ( - "wFuel", + IOobject::groupName("wFuel", phaseName), this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -73,7 +74,8 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion "singleStepCombustion" "(" "const word&, " - "const fvMesh&" + "const fvMesh& " + "const word&" ")" ) << "Inconsistent thermo package for " << this->type() << " model:\n" @@ -108,7 +110,8 @@ tmp<fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R volScalarField& Y ) const { - const label specieI = this->thermoPtr_->composition().species()[Y.name()]; + const label specieI = + this->thermoPtr_->composition().species()[Y.member()]; volScalarField wSpecie ( @@ -152,7 +155,7 @@ singleStepCombustion<CombThermoType, ThermoType>::dQ() const ( IOobject ( - "dQ", + IOobject::groupName("dQ", this->phaseName_), this->mesh_.time().timeName(), this->mesh_, IOobject::NO_READ, diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.H b/src/combustionModels/singleStepCombustion/singleStepCombustion.H index cafa24f6d3d..6fd81ea0985 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.H +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,7 +81,12 @@ public: // Constructors //- Construct from components - singleStepCombustion(const word& modelType, const fvMesh& mesh); + singleStepCombustion + ( + const word& modelType, + const fvMesh& mesh, + const word& phaseName + ); //- Destructor @@ -102,7 +107,7 @@ public: virtual tmp<volScalarField> Sh() const; - // I-O + // IO //- Update properties from given dictionary virtual bool read(); diff --git a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H index 1de935d3503..338807ad02d 100644 --- a/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H +++ b/src/thermophysicalModels/specie/equationOfState/perfectFluid/perfectFluidI.H @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "perfectFluid.H" +#include "specie.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -- GitLab