diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 9e02c8de2e935055b0010192f19859cdfdad6057..21a7fac1e79057ce2698fce1c4224292913fd824 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating reaction model\n" << endl; -autoPtr<combustionModels::psiChemistryCombustionModel> reaction +autoPtr<combustionModels::psiCombustionModel> reaction ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); -psiChemistryModel& chemistry = reaction->pChemistry(); - -psiReactionThermo& thermo = chemistry.thermo(); +psiReactionThermo& thermo = reaction->thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList<volScalarField>& Y = composition.Y(); diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 5344eea3beb07d9e52fe9a24dcad59a7f576c560..f2517529e2a53f7901ec66141471efffbc27eaf0 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -31,7 +31,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index 5d71e0f0756815c1040516feac21eb6ab6740ba6..f58e6e71bd68d5f2f6aa2db1adeff2cb84a6a7d4 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating reaction model\n" << endl; -autoPtr<combustionModels::rhoChemistryCombustionModel> reaction +autoPtr<combustionModels::rhoCombustionModel> reaction ( - combustionModels::rhoChemistryCombustionModel::New - ( - mesh - ) + combustionModels::rhoCombustionModel::New(mesh) ); -rhoChemistryModel& chemistry = reaction->pChemistry(); - -rhoReactionThermo& thermo = chemistry.thermo(); +rhoReactionThermo& thermo = reaction->thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList<volScalarField>& Y = composition.Y(); diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index aa8f1a55015b510945dceb6b35f40c9cacb51f81..f3bab92f2ffd6bc666c80695044b5f2dd1eee6d0 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "rhoChemistryCombustionModel.H" +#include "rhoCombustionModel.H" #include "turbulenceModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 4c368e7cdd63cd73496df281f6aa0c8914b2597e..6f41f328a3a27d51267a81fb98ab70beeedaf927 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingMultiphaseCloud.H" -#include "rhoChemistryCombustionModel.H" +#include "rhoCombustionModel.H" #include "radiationModel.H" #include "porousZones.H" #include "IObasicSourceList.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H index 25ceef7aa6c98861bd0b2f0910ec4d01ae261cf5..b78aeea132576150cb8e6b608b04bfbf004ad1ba 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr<combustionModels::rhoChemistryCombustionModel> combustion + autoPtr<combustionModels::rhoCombustionModel> combustion ( - combustionModels::rhoChemistryCombustionModel::New - ( - mesh - ) + combustionModels::rhoCombustionModel::New(mesh) ); - rhoChemistryModel& chemistry = combustion->pChemistry(); - - rhoReactionThermo& thermo = chemistry.thermo(); + rhoReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index d6c61074e119ace542c4aa729b802cdbb6ea9ae0..7b9dff602e77a2ba68d4103f9682a84ee199549e 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ Description #include "turbulenceModel.H" #include "basicThermoCloud.H" #include "coalCloud.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "IObasicSourceList.H" #include "radiationModel.H" #include "SLGThermo.H" diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 9a2b17f1af5d6748d9bdd24c4842ff932c50c178..22451ca1088043e0a620d3f309cefe89d41053ba 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr<combustionModels::psiChemistryCombustionModel> combustion + autoPtr<combustionModels::psiCombustionModel> combustion ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); - psiChemistryModel& chemistry = combustion->pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + psiReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index 52ed1508080e364f2af140f1e315f93c91272417..1dfb6aa284a62111e1ea7d8eb019462b1ce11695 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr<combustionModels::rhoChemistryCombustionModel> combustion + autoPtr<combustionModels::rhoCombustionModel> combustion ( - combustionModels::rhoChemistryCombustionModel::New - ( - mesh - ) + combustionModels::rhoCombustionModel::New(mesh) ); - rhoChemistryModel& chemistry = combustion->pChemistry(); - - rhoReactionThermo& thermo = chemistry.thermo(); + rhoReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index 8d97ec99ff21a0a538e37083883afa542179b11e..61533fcd6b517d1be68659a6de7ba61bd3bdd002 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Application porousExplicitSourceReactingParcelFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for compressible, laminar or turbulent flow with reacting multiphase Lagrangian parcels for porous media, including explicit sources for mass, momentum and energy @@ -42,7 +42,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingMultiphaseCloud.H" -#include "rhoChemistryCombustionModel.H" +#include "rhoCombustionModel.H" #include "radiationModel.H" #include "porousZones.H" #include "IObasicSourceList.H" diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 433e3d0182312afd99904c026be5af464780528c..6b0dd8655f74942f5499de6ee9373933c806a01f 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr<combustionModels::psiChemistryCombustionModel> combustion + autoPtr<combustionModels::psiCombustionModel> combustion ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); - psiChemistryModel& chemistry = combustion->pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + psiReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C index 06ef5ddac3b96bf372dd5a43cd93fa079d1b0cc8..9badba12b74b0b1c6220ff12dc7d7b72b112b53d 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Application reactingParcelFilmFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for compressible, laminar or turbulent flow with reacting Lagrangian parcels, and surface film modelling. \*---------------------------------------------------------------------------*/ @@ -34,7 +34,7 @@ Description #include "turbulenceModel.H" #include "basicReactingCloud.H" #include "surfaceFilmModel.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index 655510006de49544e492c09d7868dc90cae082b9..da5568da10957105c31d2cf9caa5718676be8d30 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr<combustionModels::psiChemistryCombustionModel> combustion + autoPtr<combustionModels::psiCombustionModel> combustion ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); - psiChemistryModel& chemistry = combustion->pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + psiReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index a46cb30f80c8a529c10705bfc071d780af8895da..3cfbcb907cfb1b043e7e4a9ba8c1c8cdb4859a86 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Application reactingParcelFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for compressible, laminar or turbulent flow with reacting Lagrangian parcels. \*---------------------------------------------------------------------------*/ @@ -33,7 +33,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingCloud.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 0bc6773518e380a46abf872e27e8633af0e7efcc..d02da85df5d058c4d2682275ea203f6ad16e62f5 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,9 +41,9 @@ int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "setRootCase.H" -# include "createTime.H" + #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMesh.H" + #include "createMesh.H" forAll(timeDirs, timeI) { @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) mesh ); -# include "createPhi.H" + #include "createPhi.H" singlePhaseTransportModel laminarTransport(U, phi); @@ -124,8 +124,8 @@ int main(int argc, char *argv[]) Info<< "Patch " << patchi << " named " << currPatch.name() - << " y+ : min: " << min(Yp) << " max: " << max(Yp) - << " average: " << average(Yp) << nl << endl; + << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp) + << " average: " << gAverage(Yp) << nl << endl; } } diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index c8de884de96c61ff6ba1571fecd27f6ebfe60746..7af0a901af9b620e123846614459e65eed925757 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C @@ -86,8 +86,8 @@ void calcIncompressibleYPlus Info<< "Patch " << patchi << " named " << nutPw.patch().name() - << " y+ : min: " << min(Yp) << " max: " << max(Yp) - << " average: " << average(Yp) << nl << endl; + << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp) + << " average: " << gAverage(Yp) << nl << endl; } } @@ -166,8 +166,8 @@ void calcCompressibleYPlus Info<< "Patch " << patchi << " named " << mutPw.patch().name() - << " y+ : min: " << min(Yp) << " max: " << max(Yp) - << " average: " << average(Yp) << nl << endl; + << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp) + << " average: " << gAverage(Yp) << nl << endl; } } diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index c7b646d8bbd275c11b708fdfe910ccaab13d0627..26f58505a7e60cf39920e6f68f990128291f3608 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,8 @@ namespace combustionModels template<class CombThermoType, class ThermoType> FSD<CombThermoType, ThermoType>::FSD ( - const word& modelType, const fvMesh& mesh + const word& modelType, + const fvMesh& mesh ) : singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh), @@ -62,14 +63,8 @@ FSD<CombThermoType, ThermoType>::FSD this->mesh(), dimensionedScalar("zero", dimless, 0.0) ), - YFuelFuelStream_ - ( - dimensionedScalar("YFuelStream", dimless, 1.0) - ), - YO2OxiStream_ - ( - dimensionedScalar("YOxiStream", dimless, 0.23) - ), + YFuelFuelStream_(dimensionedScalar("YFuelStream", dimless, 1.0)), + YO2OxiStream_(dimensionedScalar("YOxiStream", dimless, 0.23)), Cv_(readScalar(this->coeffs().lookup("Cv"))), C_(5.0), ftMin_(0.0), @@ -91,15 +86,15 @@ FSD<CombThermoType, ThermoType>::~FSD() template<class CombThermoType, class ThermoType> void FSD<CombThermoType, ThermoType>::calculateSourceNorm() { - this->singleMixture_.fresCorrect(); + this->singleMixturePtr_->fresCorrect(); - const label fuelI = this->singleMixture_.fuelIndex(); + const label fuelI = this->singleMixturePtr_->fuelIndex(); - const volScalarField& YFuel = this->thermo_->composition().Y()[fuelI]; + const volScalarField& YFuel = this->thermoPtr_->composition().Y()[fuelI]; - const volScalarField& YO2 = this->thermo_->composition().Y("O2"); + const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2"); - const dimensionedScalar s = this->singleMixture_.s(); + const dimensionedScalar s = this->singleMixturePtr_->s(); ft_ = (s*YFuel - (YO2 - YO2OxiStream_))/(s*YFuelFuelStream_ + YO2OxiStream_); @@ -195,7 +190,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() volScalarField deltaF ( - lesModel.delta()/dimensionedScalar("flame",dimLength, 1.5e-3) + lesModel.delta()/dimensionedScalar("flame", dimLength, 1.5e-3) ); // Linear correlation between delta and flame thickness @@ -205,33 +200,33 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() forAll(ft_, cellI) { - if(ft_[cellI] > ftMin_ && ft_[cellI] < ftMax_) + if (ft_[cellI] > ftMin_ && ft_[cellI] < ftMax_) { scalar ftCell = ft_[cellI]; - if(ftVar[cellI] > ftVarMin_) //sub-grid beta pdf of ft_ + if (ftVar[cellI] > ftVarMin_) //sub-grid beta pdf of ft_ { scalar ftVarc = ftVar[cellI]; scalar a = max(ftCell*(ftCell*(1.0 - ftCell)/ftVarc - 1.0), 0.0); scalar b = max(a/ftCell - a, 0.0); - for(int i=1; i<ftDim_; i++) + for (int i=1; i<ftDim_; i++) { scalar ft = i*deltaFt; pc[cellI] += pow(ft, a-1.0)*pow(1.0 - ft, b - 1.0)*deltaFt; } - for(int i=1; i<ftDim_; i++) + for (int i=1; i<ftDim_; i++) { scalar ft = i*deltaFt; omegaFuelBar[cellI] += omegaFuel[cellI]/omegaF[cellI] *exp - ( - -sqr(ft - ftStoich) - /(2.0*sqr(0.01*omegaF[cellI])) - ) + ( + -sqr(ft - ftStoich) + /(2.0*sqr(0.01*omegaF[cellI])) + ) *pow(ft, a - 1.0) *pow(1.0 - ft, b - 1.0) *deltaFt; @@ -241,31 +236,25 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() else { omegaFuelBar[cellI] = - (omegaFuel[cellI]/omegaF[cellI]) - *exp - ( - -sqr(ftCell - ftStoich)/(2.0*sqr(0.01*omegaF[cellI])) - ); + omegaFuel[cellI]/omegaF[cellI] + *exp(-sqr(ftCell - ftStoich)/(2.0*sqr(0.01*omegaF[cellI]))); } - } else { - omegaFuelBar[cellI] = 0.0; + omegaFuelBar[cellI] = 0.0; } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Combustion progress variable (c). -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // Combustion progress variable, c List<label> productsIndex(2, label(-1)); { label i = 0; - forAll (this->singleMixture_.specieProd(), specieI) + forAll(this->singleMixturePtr_->specieProd(), specieI) { - if (this->singleMixture_.specieProd()[specieI] < 0) + if (this->singleMixturePtr_->specieProd()[specieI] < 0) { productsIndex[i] = specieI; i++; @@ -276,9 +265,9 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() // Flamelet probability of the progress c based on IFC (reuse pc) scalar YprodTotal = 0; - forAll (productsIndex, j) + forAll(productsIndex, j) { - YprodTotal += this->singleMixture_.Yprod0()[productsIndex[j]]; + YprodTotal += this->singleMixturePtr_->Yprod0()[productsIndex[j]]; } forAll(ft_, cellI) @@ -312,10 +301,10 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() volScalarField& products = tproducts(); - forAll (productsIndex, j) + forAll(productsIndex, j) { label specieI = productsIndex[j]; - const volScalarField& Yp = this->thermo_->composition().Y()[specieI]; + const volScalarField& Yp = this->thermoPtr_->composition().Y()[specieI]; products += Yp; } @@ -326,7 +315,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() pc = min(C_*c, scalar(1)); - const volScalarField fres(this->singleMixture_.fres(fuelI)); + const volScalarField fres(this->singleMixturePtr_->fres(fuelI)); this->wFuel_ == mgft*pc*omegaFuelBar; } diff --git a/src/combustionModels/FSD/FSDs.C b/src/combustionModels/FSD/FSDs.C index 19facf7ab5b6285151724d847172a0cde3b94108..4ee6d7bb36e1af69b21c4e1473738dee389015fa 100644 --- a/src/combustionModels/FSD/FSDs.C +++ b/src/combustionModels/FSD/FSDs.C @@ -27,6 +27,9 @@ License #include "thermoPhysicsTypes.H" #include "psiCombustionModel.H" +#include "psiThermoCombustion.H" +#include "rhoCombustionModel.H" +#include "rhoThermoCombustion.H" #include "FSD.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -38,10 +41,34 @@ namespace combustionModels makeCombustionTypesThermo ( FSD, - psiCombustionModel, - gasThermoPhysics + psiThermoCombustion, + gasThermoPhysics, + psiCombustionModel ); + makeCombustionTypesThermo + ( + FSD, + psiThermoCombustion, + constGasThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + rhoThermoCombustion, + gasThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + rhoThermoCombustion, + constGasThermoPhysics, + rhoCombustionModel + ); } } diff --git a/src/combustionModels/Make/files b/src/combustionModels/Make/files index 325fa1dde13c4e5e97fc6c15bac7da772c661b0a..20de91ecc6ff731a1adc6a14a1ce782ddc5bfbba 100644 --- a/src/combustionModels/Make/files +++ b/src/combustionModels/Make/files @@ -1,19 +1,17 @@ combustionModel/combustionModel.C -psiCombustionModel/psiCombustionModel.C -psiCombustionModel/psiCombustionModelNew.C +psiCombustionModel/psiCombustionModel/psiCombustionModel.C +psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C +psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C -rhoCombustionModel/rhoCombustionModel.C -rhoCombustionModel/rhoCombustionModelNew.C +rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C +rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C +rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C infinitelyFastChemistry/infinitelyFastChemistrys.C -psiChemistryCombustionModel/psiChemistryCombustionModel.C -psiChemistryCombustionModel/psiChemistryCombustionModelNew.C - -rhoChemistryCombustionModel/rhoChemistryCombustionModel.C -rhoChemistryCombustionModel/rhoChemistryCombustionModelNew.C - PaSR/PaSRs.C FSD/reactionRateFlameAreaModels/consumptionSpeed/consumptionSpeed.C diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index 16720de35b93f78792fb0ea77af5f23729bcab2b..cd12d896e0dc8bf29841b843595c53761c3d1e6d 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -25,29 +25,27 @@ License #include "PaSR.H" #include "fvmSup.H" - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class CombThermoType> -Foam::combustionModels::PaSR<CombThermoType>::PaSR +template<class Type> +Foam::combustionModels::PaSR<Type>::PaSR ( const word& modelType, const fvMesh& mesh ) : - CombThermoType(modelType, mesh), - Cmix_(this->coeffs().lookup("Cmix")), + Type(modelType, mesh), + Cmix_(readScalar(this->coeffs().lookup("Cmix"))), turbulentReaction_(this->coeffs().lookup("turbulentReaction")), kappa_ ( IOobject ( - "kappa", + "PaSR::kappa", mesh.time().timeName(), mesh, IOobject::NO_READ, - IOobject::AUTO_WRITE, - false + IOobject::AUTO_WRITE ), mesh, dimensionedScalar("kappa", dimless, 0.0) @@ -63,24 +61,22 @@ Foam::combustionModels::PaSR<CombThermoType>::PaSR // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class CombThermoType> -Foam::combustionModels::PaSR<CombThermoType>::~PaSR() +template<class Type> +Foam::combustionModels::PaSR<Type>::~PaSR() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template<class CombThermoType> -Foam::tmp<Foam::volScalarField> -Foam::combustionModels::PaSR<CombThermoType>::tc() const +template<class Type> +Foam::tmp<Foam::volScalarField> Foam::combustionModels::PaSR<Type>::tc() const { - return this->pChemistry_->tc(); + return this->chemistryPtr_->tc(); } -template<class CombThermoType> -void Foam::combustionModels::PaSR<CombThermoType>::correct() +template<class Type> +void Foam::combustionModels::PaSR<Type>::correct() { if (this->active()) { @@ -89,11 +85,11 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct() if (!useReactionRate_) { - this->pChemistry_->solve(t - dt, dt); + this->chemistryPtr_->solve(t - dt, dt); } else { - this->pChemistry_->calculate(); + this->chemistryPtr_->calculate(); } if (turbulentReaction_) @@ -108,20 +104,12 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct() tmp<volScalarField> ttc(tc()); const volScalarField& tc = ttc(); - const dimensionedScalar e0 - ( - "e0", - sqr(dimLength)/pow3(dimTime), - SMALL - ); - forAll(epsilon, i) { if (epsilon[i] > 0) { scalar tk = - Cmix_.value() - *Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + e0.value())); + Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL)); // Chalmers PaSR model if (!useReactionRate_) @@ -148,9 +136,9 @@ void Foam::combustionModels::PaSR<CombThermoType>::correct() } -template<class CombThermoType> +template<class Type> Foam::tmp<Foam::fvScalarMatrix> -Foam::combustionModels::PaSR<CombThermoType>::R(const volScalarField& Y) const +Foam::combustionModels::PaSR<Type>::R(const volScalarField& Y) const { tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime)); @@ -160,16 +148,16 @@ Foam::combustionModels::PaSR<CombThermoType>::R(const volScalarField& Y) const { const label specieI = this->thermo().composition().species()[Y.name()]; - Su += kappa_*this->pChemistry_->RR(specieI); + Su += kappa_*this->chemistryPtr_->RR(specieI); } return tSu; } -template<class CombThermoType> +template<class Type> Foam::tmp<Foam::volScalarField> -Foam::combustionModels::PaSR<CombThermoType>::dQ() const +Foam::combustionModels::PaSR<Type>::dQ() const { tmp<volScalarField> tdQ ( @@ -193,16 +181,16 @@ Foam::combustionModels::PaSR<CombThermoType>::dQ() const if (this->active()) { volScalarField& dQ = tdQ(); - dQ = kappa_*this->pChemistry_->dQ(); + dQ = kappa_*this->chemistryPtr_->dQ(); } return tdQ; } -template<class CombThermoType> +template<class Type> Foam::tmp<Foam::volScalarField> -Foam::combustionModels::PaSR<CombThermoType>::Sh() const +Foam::combustionModels::PaSR<Type>::Sh() const { tmp<volScalarField> tSh ( @@ -226,17 +214,17 @@ Foam::combustionModels::PaSR<CombThermoType>::Sh() const if (this->active()) { scalarField& Sh = tSh(); - Sh = kappa_*this->pChemistry_->Sh(); + Sh = kappa_*this->chemistryPtr_->Sh(); } return tSh; } -template<class CombThermoType> -bool Foam::combustionModels::PaSR<CombThermoType>::read() +template<class Type> +bool Foam::combustionModels::PaSR<Type>::read() { - if (CombThermoType::read()) + if (Type::read()) { this->coeffs().lookup("Cmix") >> Cmix_; this->coeffs().lookup("turbulentReaction") >> turbulentReaction_; diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H index 125c9182c6ca0cbba5509e1cbe7b8239d9280909..4c4c3347e5e31fec3c7aab3fab66f32cea01e84f 100644 --- a/src/combustionModels/PaSR/PaSR.H +++ b/src/combustionModels/PaSR/PaSR.H @@ -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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,15 +47,15 @@ namespace combustionModels Class PaSR Declaration \*---------------------------------------------------------------------------*/ -template<class CombThermoType> +template<class Type> class PaSR : - public CombThermoType + public Type { // Private data //- Mixing constant - dimensionedScalar Cmix_; + scalar Cmix_; //- Turbulent reaction switch Switch turbulentReaction_; @@ -88,11 +88,7 @@ public: // Constructors //- Construct from components - PaSR - ( - const word& modelType, - const fvMesh& mesh - ); + PaSR(const word& modelType, const fvMesh& mesh); //- Destructor @@ -115,6 +111,7 @@ public: //- Return source for enthalpy equation [kg/m/s3] virtual tmp<volScalarField> Sh() const; + // I-O //- Update properties from given dictionary diff --git a/src/combustionModels/PaSR/PaSRs.C b/src/combustionModels/PaSR/PaSRs.C index 435fffb09473a7f003398fb9645014900bb7ab39..24978b55c4baf4bb87da1f7bdf5e017b55f20fc7 100644 --- a/src/combustionModels/PaSR/PaSRs.C +++ b/src/combustionModels/PaSR/PaSRs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,8 +25,8 @@ License #include "makeCombustionTypes.H" -#include "psiChemistryCombustionModel.H" -#include "rhoChemistryCombustionModel.H" +#include "psiChemistryCombustion.H" +#include "rhoChemistryCombustion.H" #include "PaSR.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -35,19 +35,10 @@ namespace Foam { namespace combustionModels { - makeCombustionTypes - ( - PaSR, - psiChemistryCombustionModel - ); - - makeCombustionTypes - ( - PaSR, - rhoChemistryCombustionModel - ); + makeCombustionTypes(PaSR, psiChemistryCombustion, psiCombustionModel); + makeCombustionTypes(PaSR, rhoChemistryCombustion, rhoCombustionModel); } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/combustionModels/combustionModel/makeCombustionTypes.H b/src/combustionModels/combustionModel/makeCombustionTypes.H index da6bbc3e3e82cfb0f5a4dd223ad159b1c6a04253..31f2e8400686916accb44482fbdc80e4839e6a90 100644 --- a/src/combustionModels/combustionModel/makeCombustionTypes.H +++ b/src/combustionModels/combustionModel/makeCombustionTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,45 +30,44 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeCombustionTypesThermo(CombModel, Comb, Thermo) \ - \ - typedef CombModel<Comb, Thermo> CombModel##Comb##Thermo; \ +#define makeCombustionTypesThermo(CombModel, CombType, Thermo, Table) \ \ + typedef CombModel<CombType, Thermo> CombModel##CombType##Thermo; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - CombModel##Comb##Thermo, \ - #CombModel"<"#Comb","#Thermo">", \ + CombModel##CombType##Thermo, \ + #CombModel"<"#CombType","#Thermo">", \ 0 \ ); \ \ - \ addToRunTimeSelectionTable \ ( \ - Comb, \ - CombModel##Comb##Thermo, \ + Table, \ + CombModel##CombType##Thermo, \ dictionary \ ); -#define makeCombustionTypes(CombModel, CombThermoType) \ + +#define makeCombustionTypes(CombModel, CombType, Table) \ \ - typedef CombModel<CombThermoType> \ - CombModel##CombThermoType; \ + typedef CombModel<CombType> CombModel##CombType; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ - CombModel##CombThermoType, \ - #CombModel"<"#CombThermoType">", \ + CombModel##CombType, \ + #CombModel"<"#CombType">", \ 0 \ ); \ \ addToRunTimeSelectionTable \ ( \ - CombThermoType, \ - CombModel##CombThermoType, \ + Table, \ + CombModel##CombType, \ dictionary \ ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C index ceee9ce28d2dcd7f4a966cf8801b1741e3a7aa85..558ec8b274549e529dd82481042c38c6e18e39ff 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,21 +59,22 @@ void infinitelyFastChemistry<CombThermoType, ThermoType>::correct() if (this->active()) { - this->singleMixture_.fresCorrect(); + this->singleMixturePtr_->fresCorrect(); - const label fuelI = this->singleMixture_.fuelIndex(); + const label fuelI = this->singleMixturePtr_->fuelIndex(); - const volScalarField& YFuel = this->thermo_->composition().Y()[fuelI]; + const volScalarField& YFuel = + this->thermoPtr_->composition().Y()[fuelI]; - const dimensionedScalar s = this->singleMixture_.s(); + const dimensionedScalar s = this->singleMixturePtr_->s(); - if (this->thermo_->composition().contains("O2")) + if (this->thermoPtr_->composition().contains("O2")) { - const volScalarField& YO2 = this->thermo_->composition().Y("O2"); + const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2"); this->wFuel_ == - this->rho()/(this->mesh().time().deltaT()*C_) - *min(YFuel, YO2/s.value()); + this->rho()/(this->mesh().time().deltaT()*C_) + *min(YFuel, YO2/s.value()); } } } diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.H index c17f058e835d1afadafb3a38d2477433ec289364..778670ce4c6a9d7c116d25863bacd7bac34ce99c 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 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ SourceFiles #ifndef infinitelyFastChemistry_H #define infinitelyFastChemistry_H + #include "singleStepCombustion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,7 +52,7 @@ namespace combustionModels template<class CombThermoType, class ThermoType> class infinitelyFastChemistry : - public singleStepCombustion <CombThermoType, ThermoType> + public singleStepCombustion<CombThermoType, ThermoType> { // Private data @@ -77,10 +78,7 @@ public: // Constructors //- Construct from components - infinitelyFastChemistry - ( - const word& modelType, const fvMesh& mesh - ); + infinitelyFastChemistry(const word& modelType, const fvMesh& mesh); //- Destructor @@ -95,7 +93,7 @@ public: virtual void correct(); - // I-O + // I-O //- Update properties virtual bool read(); diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C index 0dc939fd2bb126a57762842374333340724308c8..b8a48ed0ce879b214d4ee34883971f1eeb2fd5b4 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,10 +26,9 @@ License #include "makeCombustionTypes.H" #include "thermoPhysicsTypes.H" -#include "psiCombustionModel.H" -#include "rhoCombustionModel.H" +#include "psiThermoCombustion.H" +#include "rhoThermoCombustion.H" #include "infinitelyFastChemistry.H" -#include "singleStepCombustion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -37,26 +36,36 @@ namespace Foam { namespace combustionModels { + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + psiThermoCombustion, + gasThermoPhysics, + psiCombustionModel + ); makeCombustionTypesThermo ( infinitelyFastChemistry, - psiCombustionModel, - gasThermoPhysics + psiThermoCombustion, + constGasThermoPhysics, + psiCombustionModel ); makeCombustionTypesThermo ( infinitelyFastChemistry, - psiCombustionModel, - constGasThermoPhysics + rhoThermoCombustion, + gasThermoPhysics, + rhoCombustionModel ); makeCombustionTypesThermo ( infinitelyFastChemistry, - rhoCombustionModel, - gasThermoPhysics + rhoThermoCombustion, + constGasThermoPhysics, + rhoCombustionModel ); } } diff --git a/src/combustionModels/noCombustion/noCombustions.C b/src/combustionModels/noCombustion/noCombustions.C index dba5597f1e46847fa52d3291fb70742223d384ef..b5a986b9ed5123cef3a98f6a46c37a8ac512edca 100644 --- a/src/combustionModels/noCombustion/noCombustions.C +++ b/src/combustionModels/noCombustion/noCombustions.C @@ -27,6 +27,9 @@ License #include "psiCombustionModel.H" #include "rhoCombustionModel.H" +#include "psiThermoCombustion.H" +#include "rhoThermoCombustion.H" + #include "noCombustion.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -38,12 +41,14 @@ namespace combustionModels makeCombustionTypes ( noCombustion, + psiThermoCombustion, psiCombustionModel ); makeCombustionTypes ( noCombustion, + rhoThermoCombustion, rhoCombustionModel ); } diff --git a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelNew.C b/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelNew.C deleted file mode 100644 index 1ccba3fc8ae8f3d8ade4f362a9fe4ca2d43993ee..0000000000000000000000000000000000000000 --- a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelNew.C +++ /dev/null @@ -1,78 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "psiChemistryCombustionModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::combustionModels::psiChemistryCombustionModel> -Foam::combustionModels::psiChemistryCombustionModel::New -( - const fvMesh& mesh -) -{ - const word combModelName - ( - IOdictionary - ( - IOobject - ( - "combustionProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ).lookup("combustionModel") - ); - - Info<< "Selecting combustion model " << combModelName << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combModelName); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "psiChemistryCombustionModel::New" - ) << "Unknown psiChemistryCombustionModel type " - << combModelName << endl << endl - << "Valid combustionModels are : " << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); - } - - const label tempOpen = combModelName.find('<'); - - const word className = combModelName(0, tempOpen); - - return autoPtr<psiChemistryCombustionModel> - (cstrIter()(className, mesh)); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModel.C b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C similarity index 60% rename from src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModel.C rename to src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.C index e78febd0544866667e086b80febd0aafc6f8fddb..dc591860403f0388de11fad0d234070382aad3bf 100644 --- a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModel.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) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,54 +23,48 @@ License \*---------------------------------------------------------------------------*/ -#include "psiChemistryCombustionModel.H" - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ -namespace combustionModels -{ - defineTypeNameAndDebug(psiChemistryCombustionModel, 0); - defineRunTimeSelectionTable(psiChemistryCombustionModel, dictionary); - - +#include "psiChemistryCombustion.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -psiChemistryCombustionModel::psiChemistryCombustionModel +Foam::combustionModels::psiChemistryCombustion::psiChemistryCombustion ( const word& modelType, const fvMesh& mesh ) : - combustionModel(modelType, mesh), - pChemistry_(psiChemistryModel::New(mesh)) + psiCombustionModel(modelType, mesh), + chemistryPtr_(psiChemistryModel::New(mesh)) {} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -psiChemistryCombustionModel::~psiChemistryCombustionModel() +Foam::combustionModels::psiChemistryCombustion::~psiChemistryCombustion() {} + // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +Foam::psiReactionThermo& +Foam::combustionModels::psiChemistryCombustion::thermo() +{ + return chemistryPtr_->thermo(); +} + -bool psiChemistryCombustionModel::read() +const Foam::psiReactionThermo& +Foam::combustionModels::psiChemistryCombustion::thermo() const { - if (combustionModel::read()) - { - return true; - } - else - { - return false; - } + return chemistryPtr_->thermo(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam -} // End namespace combustionModels +Foam::tmp<Foam::volScalarField> +Foam::combustionModels::psiChemistryCombustion::rho() const +{ + return chemistryPtr_->thermo().rho(); +} + -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModel.H b/src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H similarity index 51% rename from src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModel.H rename to src/combustionModels/psiCombustionModel/psiChemistryCombustion/psiChemistryCombustion.H index bde6be81b838d595ef7897e74dd3d8dd2dbb5756..81c7a91139a3390ec67a2b9a455fe1d223912e7f 100644 --- a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModel.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) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,24 +22,21 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::psiChemistryCombustionModel + Foam::psiChemistryCombustion Description - Combustion models for compressibility-based thermodynamics + Compressibility-based chemistry model wrapper for combustion models SourceFiles - psiChemistryCombustionModelI.H - psiChemistryCombustionModel.C - psiChemistryCombustionModelNew.C + psiChemistryCombustion.C \*---------------------------------------------------------------------------*/ -#ifndef psiChemistryCombustionModel_H -#define psiChemistryCombustionModel_H +#ifndef psiChemistryCombustion_H +#define psiChemistryCombustion_H -#include "combustionModel.H" #include "autoPtr.H" -#include "runTimeSelectionTables.H" +#include "psiCombustionModel.H" #include "psiChemistryModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,108 +47,59 @@ namespace combustionModels { /*---------------------------------------------------------------------------*\ - class psiChemistryCombustionModel Declaration + class psiChemistryCombustion Declaration \*---------------------------------------------------------------------------*/ -class psiChemistryCombustionModel +class psiChemistryCombustion : - public combustionModel + public psiCombustionModel { - // Private Member Functions //- Construct as copy (not implemented) - psiChemistryCombustionModel(const psiChemistryCombustionModel&); + psiChemistryCombustion(const psiChemistryCombustion&); //- Disallow default bitwise assignment - void operator=(const psiChemistryCombustionModel&); + void operator=(const psiChemistryCombustion&); protected: // Protected data - //- Auto pointer to psiChemistry - autoPtr<psiChemistryModel> pChemistry_; + //- Pointer to chemistry model + autoPtr<psiChemistryModel> chemistryPtr_; public: - //- Runtime type information - TypeName("psiChemistryCombustionModel"); - - - //- Declare run-time constructor selection tables - declareRunTimeSelectionTable - ( - autoPtr, - psiChemistryCombustionModel, - dictionary, - ( - const word& modelType, - const fvMesh& mesh - ), - (modelType, mesh) - ); - - // Constructors - //- Construct from components and thermo - psiChemistryCombustionModel - ( - const word& modelType, - const fvMesh& mesh - ); - - - - //- Selector - static autoPtr<psiChemistryCombustionModel> New - ( - const fvMesh& mesh - ); + psiChemistryCombustion(const word& modelType, const fvMesh& mesh); //- Destructor - virtual ~psiChemistryCombustionModel(); + virtual ~psiChemistryCombustion(); // Member Functions - //- Return access to the thermo package - inline psiChemistryModel& pChemistry(); + virtual psiReactionThermo& thermo(); //- Return const access to the thermo package - inline const psiChemistryModel& pChemistry() const; + virtual const psiReactionThermo& thermo() const; - //- Return const access to rho - inline tmp<volScalarField> rho() const; - - //- Return const access to rho - inline const psiReactionThermo& thermo() const; - - //- Return non const access to rho - inline psiReactionThermo& thermo(); - - - // I-O - - //- Update properties from given dictionary - virtual bool read(); + //- Return const access to the density field + virtual tmp<volScalarField> rho() const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam } // End namespace combustionModels - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "psiChemistryCombustionModelI.H" +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C similarity index 91% rename from src/combustionModels/psiCombustionModel/psiCombustionModel.C rename to src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C index 906934ab70b30ef93e21febfc0e295fc2cf327bb..287f1021013054dd5345d38b69df48d8864f1359 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.C @@ -38,24 +38,23 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - Foam::combustionModels::psiCombustionModel::psiCombustionModel ( const word& modelType, const fvMesh& mesh ) : - combustionModel(modelType, mesh), - thermo_(psiReactionThermo::New(mesh)) + combustionModel(modelType, mesh) {} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::combustionModels::psiCombustionModel::~psiCombustionModel() {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::combustionModels::psiCombustionModel::read() { @@ -69,10 +68,5 @@ bool Foam::combustionModels::psiCombustionModel::read() } } -Foam::tmp<Foam::volScalarField> -Foam::combustionModels::psiCombustionModel::rho() const -{ - return thermo_->rho(); -} // ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel.H b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H similarity index 85% rename from src/combustionModels/psiCombustionModel/psiCombustionModel.H rename to src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H index e89e90d519f36d548a7b3ab88a2ffa33b9082128..0206a5e70ca68472e12f3fbaf12bc9f30ccf33dd 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel.H +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModel.H @@ -67,17 +67,6 @@ class psiCombustionModel void operator=(const psiCombustionModel&); -protected: - - // Protected data - - - //- Thermo package - autoPtr<psiReactionThermo> thermo_; - - - - public: //- Runtime type information @@ -100,21 +89,13 @@ public: // Constructors - //- Construct from components and thermo - psiCombustionModel - ( - const word& modelType, - const fvMesh& mesh - ); + psiCombustionModel(const word& modelType, const fvMesh& mesh); //- Selector - static autoPtr<psiCombustionModel> New - ( - const fvMesh& mesh - ); + static autoPtr<psiCombustionModel> New(const fvMesh& mesh); //- Destructor @@ -124,13 +105,14 @@ public: // Member Functions //- Return access to the thermo package - inline psiReactionThermo& thermo(); + virtual psiReactionThermo& thermo() = 0; //- Return const access to the thermo package - inline const psiReactionThermo& thermo() const; + virtual const psiReactionThermo& thermo() const = 0; //- Return tmp of rho - virtual tmp<volScalarField> rho() const; + virtual tmp<volScalarField> rho() const = 0; + // I-O @@ -141,12 +123,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam } // End namespace combustionModels - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "psiCombustionModelI.H" +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C similarity index 100% rename from src/combustionModels/psiCombustionModel/psiCombustionModelNew.C rename to src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModels.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModels.C similarity index 100% rename from src/combustionModels/psiCombustionModel/psiCombustionModels.C rename to src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModels.C diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModelI.H b/src/combustionModels/psiCombustionModel/psiCombustionModelI.H deleted file mode 100644 index ed7ed073ef82eb5160063d33fa7132cac9e74a6b..0000000000000000000000000000000000000000 --- a/src/combustionModels/psiCombustionModel/psiCombustionModelI.H +++ /dev/null @@ -1,42 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -inline Foam::psiReactionThermo& -Foam::combustionModels::psiCombustionModel::thermo() -{ - return thermo_(); -} - - -inline const Foam::psiReactionThermo& -Foam::combustionModels::psiCombustionModel::thermo() const -{ - return thermo_(); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModel.C b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C similarity index 60% rename from src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModel.C rename to src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.C index abcb275c151a744c2c9dfee5d3d4b48bd1d02faf..89a4a5daa7a3dbbf3e5105ba8daf8285c6cec629 100644 --- a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModel.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) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,54 +23,48 @@ License \*---------------------------------------------------------------------------*/ -#include "rhoChemistryCombustionModel.H" - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -namespace Foam -{ -namespace combustionModels -{ - defineTypeNameAndDebug(rhoChemistryCombustionModel, 0); - defineRunTimeSelectionTable(rhoChemistryCombustionModel, dictionary); - - +#include "psiThermoCombustion.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -rhoChemistryCombustionModel::rhoChemistryCombustionModel +Foam::combustionModels::psiThermoCombustion::psiThermoCombustion ( const word& modelType, const fvMesh& mesh ) : - combustionModel(modelType, mesh), - pChemistry_(rhoChemistryModel::New(mesh)) + psiCombustionModel(modelType, mesh), + thermoPtr_(psiReactionThermo::New(mesh)) {} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -rhoChemistryCombustionModel::~rhoChemistryCombustionModel() +Foam::combustionModels::psiThermoCombustion::~psiThermoCombustion() {} + // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +Foam::psiReactionThermo& +Foam::combustionModels::psiThermoCombustion::thermo() +{ + return thermoPtr_(); +} + -bool rhoChemistryCombustionModel::read() +const Foam::psiReactionThermo& +Foam::combustionModels::psiThermoCombustion::thermo() const { - if (combustionModel::read()) - { - return true; - } - else - { - return false; - } + return thermoPtr_(); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam -} // End namespace combustionModels +Foam::tmp<Foam::volScalarField> +Foam::combustionModels::psiThermoCombustion::rho() const +{ + return thermoPtr_->rho(); +} + -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H new file mode 100644 index 0000000000000000000000000000000000000000..8a294718a33f97d0d1f51128fbf5d0fcaaf109ac --- /dev/null +++ b/src/combustionModels/psiCombustionModel/psiThermoCombustion/psiThermoCombustion.H @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::psiThermoCombustion + +Description + Compressibility-based thermo model wrapper for combustion models + +SourceFiles + psiThermoCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef psiThermoCombustion_H +#define psiThermoCombustion_H + +#include "autoPtr.H" +#include "psiCombustionModel.H" +#include "psiReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + class psiThermoCombustion Declaration +\*---------------------------------------------------------------------------*/ + +class psiThermoCombustion +: + public psiCombustionModel +{ + // Private Member Functions + + //- Construct as copy (not implemented) + psiThermoCombustion(const psiThermoCombustion&); + + //- Disallow default bitwise assignment + void operator=(const psiThermoCombustion&); + + +protected: + + // Protected data + + //- Pointer to chemistry model + autoPtr<psiReactionThermo> thermoPtr_; + + +public: + + // Constructors + + //- Construct from components and thermo + psiThermoCombustion(const word& modelType, const fvMesh& mesh); + + + //- Destructor + virtual ~psiThermoCombustion(); + + + // Member Functions + + //- Return access to the thermo package + virtual psiReactionThermo& thermo(); + + //- Return const access to the thermo package + virtual const psiReactionThermo& thermo() const; + + //- Return const access to the density field + virtual tmp<volScalarField> rho() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelNew.C b/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelNew.C deleted file mode 100644 index 6bf82ede51bf1944f6c0480b76d2ed473e47ad8f..0000000000000000000000000000000000000000 --- a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelNew.C +++ /dev/null @@ -1,78 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "rhoChemistryCombustionModel.H" - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::combustionModels::rhoChemistryCombustionModel> -Foam::combustionModels::rhoChemistryCombustionModel::New -( - const fvMesh& mesh -) -{ - const word combModelName - ( - IOdictionary - ( - IOobject - ( - "combustionProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ).lookup("combustionModel") - ); - - Info<< "Selecting combustion model " << combModelName << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combModelName); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "rhoChemistryCombustionModel::New" - ) << "Unknown rhoChemistryCombustionModel type " - << combModelName << endl << endl - << "Valid combustionModels are : " << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); - } - - const label tempOpen = combModelName.find('<'); - - const word className = combModelName(0, tempOpen); - - return autoPtr<rhoChemistryCombustionModel> - (cstrIter()(className, mesh)); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C similarity index 54% rename from src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H rename to src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C index 19b997478994d5fc62cfa5293dfd2b6443bcc092..22495abb4af3198fb1bc29033a79258ec3c805e5 100644 --- a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H +++ 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) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,41 +23,47 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +#include "rhoChemistryCombustion.H" -inline Foam::rhoChemistryModel& -Foam::combustionModels::rhoChemistryCombustionModel::pChemistry() -{ - return pChemistry_(); -} +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::combustionModels::rhoChemistryCombustion::rhoChemistryCombustion +( + const word& modelType, + const fvMesh& mesh +) +: + rhoCombustionModel(modelType, mesh), + chemistryPtr_(rhoChemistryModel::New(mesh)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::combustionModels::rhoChemistryCombustion::~rhoChemistryCombustion() +{} -inline const Foam::rhoChemistryModel& -Foam::combustionModels::rhoChemistryCombustionModel:: -pChemistry() const -{ - return pChemistry_(); -} +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -inline Foam::tmp<Foam::volScalarField> -Foam::combustionModels::rhoChemistryCombustionModel::rho() const +Foam::rhoReactionThermo& +Foam::combustionModels::rhoChemistryCombustion::thermo() { - return pChemistry_->thermo().rho(); + return chemistryPtr_->thermo(); } -inline const Foam::rhoReactionThermo& -Foam::combustionModels::rhoChemistryCombustionModel::thermo() const +const Foam::rhoReactionThermo& +Foam::combustionModels::rhoChemistryCombustion::thermo() const { - return pChemistry_->thermo(); + return chemistryPtr_->thermo(); } -inline Foam::rhoReactionThermo& -Foam::combustionModels::rhoChemistryCombustionModel::thermo() +Foam::tmp<Foam::volScalarField> +Foam::combustionModels::rhoChemistryCombustion::rho() const { - return pChemistry_->thermo(); + return chemistryPtr_->thermo().rho(); } diff --git a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModel.H b/src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H similarity index 51% rename from src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModel.H rename to src/combustionModels/rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.H index 9a7aa0af3d90e386babf4119afe56411d8e41801..7010cb5389ecc86a1a5960caf9ecccb3f4d6b64b 100644 --- a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModel.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) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,24 +22,21 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::rhoChemistryCombustionModel + Foam::rhoChemistryCombustion Description - Combustion models for compressibility-based thermodynamics + Density-based chemistry model wrapper for combustion models SourceFiles - rhoChemistryCombustionModelI.H - rhoChemistryCombustionModel.C - rhoChemistryCombustionModelNew.C + rhoChemistryCombustion.C \*---------------------------------------------------------------------------*/ -#ifndef rhoChemistryCombustionModel_H -#define rhoChemistryCombustionModel_H +#ifndef rhoChemistryCombustion_H +#define rhoChemistryCombustion_H -#include "combustionModel.H" #include "autoPtr.H" -#include "runTimeSelectionTables.H" +#include "rhoCombustionModel.H" #include "rhoChemistryModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,108 +47,59 @@ namespace combustionModels { /*---------------------------------------------------------------------------*\ - class rhoChemistryCombustionModel Declaration + class rhoChemistryCombustion Declaration \*---------------------------------------------------------------------------*/ -class rhoChemistryCombustionModel +class rhoChemistryCombustion : - public combustionModel + public rhoCombustionModel { - // Private Member Functions //- Construct as copy (not implemented) - rhoChemistryCombustionModel(const rhoChemistryCombustionModel&); + rhoChemistryCombustion(const rhoChemistryCombustion&); //- Disallow default bitwise assignment - void operator=(const rhoChemistryCombustionModel&); + void operator=(const rhoChemistryCombustion&); protected: // Protected data - //- Auto pointer to psiChemistry - autoPtr<rhoChemistryModel> pChemistry_; + //- Pointer to chemistry model + autoPtr<rhoChemistryModel> chemistryPtr_; public: - //- Runtime type information - TypeName("rhoChemistryCombustionModel"); - - - //- Declare run-time constructor selection tables - declareRunTimeSelectionTable - ( - autoPtr, - rhoChemistryCombustionModel, - dictionary, - ( - const word& modelType, - const fvMesh& mesh - ), - (modelType, mesh) - ); - - // Constructors - //- Construct from components and thermo - rhoChemistryCombustionModel - ( - const word& modelType, - const fvMesh& mesh - ); - - - - //- Selector - static autoPtr<rhoChemistryCombustionModel> New - ( - const fvMesh& mesh - ); + rhoChemistryCombustion(const word& modelType, const fvMesh& mesh); //- Destructor - virtual ~rhoChemistryCombustionModel(); + virtual ~rhoChemistryCombustion(); // Member Functions - //- Return access to the thermo package - inline rhoChemistryModel& pChemistry(); + virtual rhoReactionThermo& thermo(); //- Return const access to the thermo package - inline const rhoChemistryModel& pChemistry() const; + virtual const rhoReactionThermo& thermo() const; - //- Return const access to rho - inline tmp<volScalarField> rho() const; - - //- Return const access to rho - inline const rhoReactionThermo& thermo() const; - - //- Return non const access to rho - inline rhoReactionThermo& thermo(); - - - // I-O - - //- Update properties from given dictionary - virtual bool read(); + //- Return const access to the density field + virtual tmp<volScalarField> rho() const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam } // End namespace combustionModels - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "rhoChemistryCombustionModelI.H" +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C similarity index 91% rename from src/combustionModels/rhoCombustionModel/rhoCombustionModel.C rename to src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C index 7a0a83a64d3ea62eb1f0319c6f30a56c090dcef3..55655caeeb62c136ba708e152b8c0e528cf4e0d0 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.C @@ -45,23 +45,17 @@ Foam::combustionModels::rhoCombustionModel::rhoCombustionModel const fvMesh& mesh ) : - combustionModel(modelType, mesh), - thermo_(rhoReactionThermo::New(mesh)) + combustionModel(modelType, mesh) {} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::combustionModels::rhoCombustionModel::~rhoCombustionModel() {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -Foam::tmp<Foam::volScalarField> -Foam::combustionModels::rhoCombustionModel::rho() const -{ - return thermo_->rho(); -} +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::combustionModels::rhoCombustionModel::read() { @@ -75,4 +69,5 @@ bool Foam::combustionModels::rhoCombustionModel::read() } } + // ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H similarity index 85% rename from src/combustionModels/rhoCombustionModel/rhoCombustionModel.H rename to src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H index 8ab5e257405c5d86b5b7cc2e204f1b7b1bd91e27..04cf1f56ab8d0e42dc6c9566101ca7559a8dc149 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel.H +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModel.H @@ -67,14 +67,6 @@ class rhoCombustionModel void operator=(const rhoCombustionModel&); -protected: - - // Protected data - - //- Thermo package - autoPtr<rhoReactionThermo> thermo_; - - public: //- Runtime type information @@ -99,19 +91,12 @@ public: //- Construct from components and thermo - rhoCombustionModel - ( - const word& modelType, - const fvMesh& mesh - ); + rhoCombustionModel(const word& modelType, const fvMesh& mesh); //- Selector - static autoPtr<rhoCombustionModel> New - ( - const fvMesh& mesh - ); + static autoPtr<rhoCombustionModel> New(const fvMesh& mesh); //- Destructor @@ -127,13 +112,14 @@ public: //- Return access to the thermo package - inline rhoReactionThermo& thermo(); + virtual rhoReactionThermo& thermo() = 0; //- Return const access to the thermo package - inline const rhoReactionThermo& thermo() const; + virtual const rhoReactionThermo& thermo() const = 0; //- Return tmp of rho - virtual tmp<volScalarField> rho() const; + virtual tmp<volScalarField> rho() const = 0; + // I-O @@ -144,12 +130,8 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam } // End namespace combustionModels - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "rhoCombustionModelI.H" +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C similarity index 100% rename from src/combustionModels/rhoCombustionModel/rhoCombustionModelNew.C rename to src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H deleted file mode 100644 index 61dbcea2bd1407ef7517e263649a05296d5e55ee..0000000000000000000000000000000000000000 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H +++ /dev/null @@ -1,42 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -inline Foam::rhoReactionThermo& -Foam::combustionModels::rhoCombustionModel::thermo() -{ - return thermo_(); -} - - -inline const Foam::rhoReactionThermo& -Foam::combustionModels::rhoCombustionModel::thermo() const -{ - return thermo_(); -} - - -// ************************************************************************* // diff --git a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C similarity index 56% rename from src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H rename to src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C index 15235be7613abb6712a3ce488bf184e15bc57e1e..da06dfda61172f37569a2629aba08bd495c590d2 100644 --- a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H +++ 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) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,41 +23,47 @@ License \*---------------------------------------------------------------------------*/ -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +#include "rhoThermoCombustion.H" -inline Foam::psiChemistryModel& -Foam::combustionModels::psiChemistryCombustionModel::pChemistry() -{ - return pChemistry_(); -} +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::combustionModels::rhoThermoCombustion::rhoThermoCombustion +( + const word& modelType, + const fvMesh& mesh +) +: + rhoCombustionModel(modelType, mesh), + thermoPtr_(rhoReactionThermo::New(mesh)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::combustionModels::rhoThermoCombustion::~rhoThermoCombustion() +{} -inline const Foam::psiChemistryModel& -Foam::combustionModels::psiChemistryCombustionModel:: -pChemistry() const -{ - return pChemistry_(); -} +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -inline Foam::tmp<Foam::volScalarField> -Foam::combustionModels::psiChemistryCombustionModel::rho() const +Foam::rhoReactionThermo& +Foam::combustionModels::rhoThermoCombustion::thermo() { - return pChemistry_->thermo().rho(); + return thermoPtr_(); } -inline const Foam::psiReactionThermo& -Foam::combustionModels::psiChemistryCombustionModel::thermo() const +const Foam::rhoReactionThermo& +Foam::combustionModels::rhoThermoCombustion::thermo() const { - return pChemistry_->thermo(); + return thermoPtr_(); } -inline Foam::psiReactionThermo& -Foam::combustionModels::psiChemistryCombustionModel::thermo() +Foam::tmp<Foam::volScalarField> +Foam::combustionModels::rhoThermoCombustion::rho() const { - return pChemistry_->thermo(); + return thermoPtr_().rho(); } diff --git a/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H new file mode 100644 index 0000000000000000000000000000000000000000..1a144406064c927b55946c46820be0bc52ee092d --- /dev/null +++ b/src/combustionModels/rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.H @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::rhoThermoCombustion + +Description + Density-based thermo model wrapper for combustion models + +SourceFiles + rhoThermoCombustion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef rhoThermoCombustion_H +#define rhoThermoCombustion_H + +#include "autoPtr.H" +#include "rhoCombustionModel.H" +#include "rhoChemistryModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + class rhoThermoCombustion Declaration +\*---------------------------------------------------------------------------*/ + +class rhoThermoCombustion +: + public rhoCombustionModel +{ + // Private Member Functions + + //- Construct as copy (not implemented) + rhoThermoCombustion(const rhoThermoCombustion&); + + //- Disallow default bitwise assignment + void operator=(const rhoThermoCombustion&); + + +protected: + + // Protected data + + //- Pointer to thermo model + autoPtr<rhoReactionThermo> thermoPtr_; + + +public: + + // Constructors + + //- Construct from components and thermo + rhoThermoCombustion(const word& modelType, const fvMesh& mesh); + + + //- Destructor + virtual ~rhoThermoCombustion(); + + + // Member Functions + + //- Return access to the thermo package + virtual rhoReactionThermo& thermo(); + + //- Return const access to the thermo package + virtual const rhoReactionThermo& thermo() const; + + //- Return const access to the density field + virtual tmp<volScalarField> rho() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C index 319e5476b22a925676acbca5453f88f0981132cc..aab73f7abf5db863c814e3312a2e46bcd01cdd27 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,17 +33,14 @@ namespace combustionModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class CombThermoType, class ThermoType> -singleStepCombustion<CombThermoType, ThermoType> -::singleStepCombustion +singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion ( - const word& modelType, const fvMesh& mesh + const word& modelType, + const fvMesh& mesh ) : CombThermoType(modelType, mesh), - singleMixture_ - ( - dynamic_cast<singleStepReactingMixture<ThermoType>&>(this->thermo()) - ), + singleMixturePtr_(NULL), wFuel_ ( IOobject @@ -55,22 +52,45 @@ singleStepCombustion<CombThermoType, ThermoType> IOobject::NO_WRITE ), this->mesh(), - dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0) + dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) ) -{} +{ + if (isA<singleStepReactingMixture<ThermoType> >(this->thermo())) + { + singleMixturePtr_ = + &dynamic_cast<singleStepReactingMixture<ThermoType>&> + ( + this->thermo() + ); + } + else + { + FatalErrorIn + ( + "singleStepCombustion<CombThermoType, ThermoType>::" + "singleStepCombustion" + "(" + "const word&, " + "const fvMesh&" + ")" + ) + << "Inconsistent thermo package for " << this->type() << " model:\n" + << " " << this->thermo().type() << nl << nl + << "Please select a thermo package based on " + << "singleStepReactingMixture" << exit(FatalError); + } +} // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // template<class CombThermoType, class ThermoType> -singleStepCombustion<CombThermoType, ThermoType> -::~singleStepCombustion() +singleStepCombustion<CombThermoType, ThermoType>::~singleStepCombustion() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - template<class CombThermoType, class ThermoType> Foam::tmp<Foam::fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R @@ -78,11 +98,11 @@ singleStepCombustion<CombThermoType, ThermoType>::R const volScalarField& Y ) const { - const label specieI = this->thermo_->composition().species()[Y.name()]; + const label specieI = this->thermoPtr_->composition().species()[Y.name()]; const volScalarField wSpecie ( - wFuel_*singleMixture_.specieStoichCoeffs()[specieI] + wFuel_*singleMixturePtr_->specieStoichCoeffs()[specieI] ); return wSpecie + fvm::Sp(0.0*wSpecie, Y); @@ -93,10 +113,10 @@ template<class CombThermoType, class ThermoType> Foam::tmp<Foam::volScalarField> singleStepCombustion< CombThermoType, ThermoType>::Sh() const { - const label fuelI = singleMixture_.fuelIndex(); - const volScalarField& YFuel = this->thermo_->composition().Y(fuelI); + const label fuelI = singleMixturePtr_->fuelIndex(); + const volScalarField& YFuel = this->thermoPtr_->composition().Y(fuelI); - return -singleMixture_.qFuel()*(R(YFuel) & YFuel); + return -singleMixturePtr_->qFuel()*(R(YFuel) & YFuel); } diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.H b/src/combustionModels/singleStepCombustion/singleStepCombustion.H index 0d50dfaefec54a2dfd1c802370c8302ad12b5048..fd743247b3f3efd763acd76b94a5246e9a76f82f 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 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ namespace combustionModels { /*---------------------------------------------------------------------------*\ - Class singleStepCombustion Declaration + Class singleStepCombustion Declaration \*---------------------------------------------------------------------------*/ template<class CombThermoType, class ThermoType> @@ -52,39 +52,32 @@ class singleStepCombustion : public CombThermoType { + // Private Member Functions + + //- Disallow copy construct + singleStepCombustion(const singleStepCombustion&); + + //- Disallow default bitwise assignment + void operator=(const singleStepCombustion&); + protected: // Protected data - //- Reference to singleStepReactingMixture mixture - singleStepReactingMixture<ThermoType>& singleMixture_; + //- Pointer to singleStepReactingMixture mixture + singleStepReactingMixture<ThermoType>* singleMixturePtr_; //- Fuel consumption rate volScalarField wFuel_; -private: - - // Private Member Functions - - //- Disallow copy construct - singleStepCombustion(const singleStepCombustion&); - - //- Disallow default bitwise assignment - void operator=(const singleStepCombustion&); - - public: - // Constructors //- Construct from components - singleStepCombustion - ( - const word& modelType, const fvMesh& mesh - ); + singleStepCombustion(const word& modelType, const fvMesh& mesh); //- Destructor @@ -95,7 +88,6 @@ public: // Evolution - //- Fuel consumption rate matrix virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const; @@ -106,7 +98,7 @@ public: virtual tmp<volScalarField> Sh() const; - // I-O + // I-O //- Update properties from given dictionary virtual bool read(); @@ -120,7 +112,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #ifdef NoRepository # include "singleStepCombustion.C" #endif diff --git a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/combustionProperties b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/combustionProperties index f93dafc8435e27905be6aac10fbf2f9ecdcc8069..6c1f0e9cf336a2438a92d58257819d8eaeb20c32 100644 --- a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/combustionProperties +++ b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active true; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 0.1; + Cmix 0.1; turbulentReaction on; } diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/combustionProperties b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/combustionProperties index e531cc4a165a975bb00b602c6ef308124b5b445e..754f22dad2413790f2c0d850116ba562502f8e95 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/combustionProperties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<rhoChemistryCombustionModel>; +combustionModel PaSR<rhoChemistryCombustion>; active true; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 0.1; + Cmix 0.1; turbulentReaction on; useReactionRate true; } diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/combustionProperties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/combustionProperties index 6ab266d91f521aae4211d787c35fe8ddb50bfb18..5ede7572c37fca677e4af0a3151992688cdaaa60 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/combustionProperties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<rhoChemistryCombustionModel>; +combustionModel PaSR<rhoChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 0.1; + Cmix 0.1; turbulentReaction off; useReactionRate true; } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/combustionProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/combustionProperties index d2fe2410f0c02a3b43213fc86f9f3b72caa92281..1832dddf0ae1064fc9576ac9e6fb13272cb19582 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/combustionProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/combustionProperties @@ -15,14 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active true; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction on; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/combustionProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/combustionProperties index cec49a34e99b97b02701491decd4e35f10fffe9f..334391590cc303976e6e72e1e1c8ca7d474ada5a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/combustionProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<rhoChemistryCombustionModel>; +combustionModel PaSR<rhoChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/combustionProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/combustionProperties index cec49a34e99b97b02701491decd4e35f10fffe9f..334391590cc303976e6e72e1e1c8ca7d474ada5a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/combustionProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<rhoChemistryCombustionModel>; +combustionModel PaSR<rhoChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/combustionProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/combustionProperties index cec49a34e99b97b02701491decd4e35f10fffe9f..334391590cc303976e6e72e1e1c8ca7d474ada5a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/combustionProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<rhoChemistryCombustionModel>; +combustionModel PaSR<rhoChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/combustionProperties b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/combustionProperties index acda0a53d4eb5ac5e076859eba3db53794613c4a..4fe87a3132248510eb4e3fed4872731dab67886b 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/combustionProperties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction on; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/combustionProperties b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/combustionProperties index 3a7e78cb5577856279825023bb68cdbc4241a57f..87d04695b80d4473ba506612617dcfd603c65984 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/combustionProperties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/constant/combustionProperties b/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/constant/combustionProperties index 3a7e78cb5577856279825023bb68cdbc4241a57f..87d04695b80d4473ba506612617dcfd603c65984 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/constant/combustionProperties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/combustionProperties b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/combustionProperties index 3a7e78cb5577856279825023bb68cdbc4241a57f..87d04695b80d4473ba506612617dcfd603c65984 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/combustionProperties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties index 3a7e78cb5577856279825023bb68cdbc4241a57f..87d04695b80d4473ba506612617dcfd603c65984 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction off; } diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties index 906a38d81b02a525fd641df46e82e4ca53480ee4..8f326f366756a02663e3cfeaed1ea4a0f4e5ce2d 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/combustionProperties @@ -15,13 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +combustionModel PaSR<psiChemistryCombustion>; active false; PaSRCoeffs { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0; + Cmix 1.0; turbulentReaction yes; }