From bc4824dcd960767a76ebe4319695f93888f0d38c Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 11 Jun 2012 14:27:23 +0100 Subject: [PATCH 1/9] ENH: Thermo film - added vapour recoil pressure effect --- .../surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index ecedee0485..1cb392eb6a 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -255,6 +255,9 @@ void thermoSingleLayer::updateSubmodels() // Update source fields hsSp_ += primaryEnergyPCTrans_/magSf()/time().deltaT(); rhoSp_ += primaryMassPCTrans_/magSf()/time().deltaT(); + + // Vapour recoil pressure + pSp_ -= sqr(primaryMassPCTrans_/magSf()/time_.deltaT())/2.0/rhoPrimary_; } From 1dc4d23d56c991cbf7b0aea66027de99e85e03cc Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 11 Jun 2012 15:47:46 +0100 Subject: [PATCH 2/9] STYLE: Centralised class name/comment in header file --- .../multivariateSurfaceInterpolationScheme.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H index 00bc2b8877..aaea76b2a9 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/multivariateSchemes/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationScheme.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 Foam { /*---------------------------------------------------------------------------*\ - Class multivariateSurfaceInterpolationScheme Declaration + Class multivariateSurfaceInterpolationScheme Declaration \*---------------------------------------------------------------------------*/ template From 84b8538c4b816da58d4aa11b1c21eb9c2e7d8677 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 11 Jun 2012 16:07:56 +0100 Subject: [PATCH 3/9] BUG: Corrected use og endl in vtkPV3FFoam --- .../graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C index 5a2e599a64..1e49db7505 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C @@ -811,7 +811,6 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show) } - void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const { os << indent << "Number of nodes: " @@ -821,9 +820,10 @@ void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const << (meshPtr_ ? meshPtr_->nCells() : 0) << "\n"; os << indent << "Number of available time steps: " - << (dbPtr_.valid() ? dbPtr_().times().size() : 0) << endl; + << (dbPtr_.valid() ? dbPtr_().times().size() : 0) << "\n"; os << indent << "mesh region: " << meshRegion_ << "\n"; } + // ************************************************************************* // From 2914258cd28dc2e65c7638bb551ee1bb8a16c854 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 12 Jun 2012 12:58:26 +0100 Subject: [PATCH 4/9] STYLE: Code formatting --- .../psiChemistryCombustionModelI.H | 5 +++++ .../psiCombustionModel/psiCombustionModelI.H | 1 + .../rhoChemistryCombustionModelI.H | 5 +++++ .../rhoCombustionModel/rhoCombustionModelI.H | 1 + 4 files changed, 12 insertions(+) diff --git a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H b/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H index 30d1801739..15235be761 100644 --- a/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H +++ b/src/combustionModels/psiChemistryCombustionModel/psiChemistryCombustionModelI.H @@ -31,6 +31,7 @@ Foam::combustionModels::psiChemistryCombustionModel::pChemistry() return pChemistry_(); } + inline const Foam::psiChemistryModel& Foam::combustionModels::psiChemistryCombustionModel:: pChemistry() const @@ -38,22 +39,26 @@ pChemistry() const return pChemistry_(); } + inline Foam::tmp Foam::combustionModels::psiChemistryCombustionModel::rho() const { return pChemistry_->thermo().rho(); } + inline const Foam::psiReactionThermo& Foam::combustionModels::psiChemistryCombustionModel::thermo() const { return pChemistry_->thermo(); } + inline Foam::psiReactionThermo& Foam::combustionModels::psiChemistryCombustionModel::thermo() { return pChemistry_->thermo(); } + // ************************************************************************* // diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModelI.H b/src/combustionModels/psiCombustionModel/psiCombustionModelI.H index 5df2365b9d..ed7ed073ef 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModelI.H +++ b/src/combustionModels/psiCombustionModel/psiCombustionModelI.H @@ -31,6 +31,7 @@ Foam::combustionModels::psiCombustionModel::thermo() return thermo_(); } + inline const Foam::psiReactionThermo& Foam::combustionModels::psiCombustionModel::thermo() const { diff --git a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H b/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H index 4551d2e108..19b9974789 100644 --- a/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H +++ b/src/combustionModels/rhoChemistryCombustionModel/rhoChemistryCombustionModelI.H @@ -31,6 +31,7 @@ Foam::combustionModels::rhoChemistryCombustionModel::pChemistry() return pChemistry_(); } + inline const Foam::rhoChemistryModel& Foam::combustionModels::rhoChemistryCombustionModel:: pChemistry() const @@ -38,22 +39,26 @@ pChemistry() const return pChemistry_(); } + inline Foam::tmp Foam::combustionModels::rhoChemistryCombustionModel::rho() const { return pChemistry_->thermo().rho(); } + inline const Foam::rhoReactionThermo& Foam::combustionModels::rhoChemistryCombustionModel::thermo() const { return pChemistry_->thermo(); } + inline Foam::rhoReactionThermo& Foam::combustionModels::rhoChemistryCombustionModel::thermo() { return pChemistry_->thermo(); } + // ************************************************************************* // diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H b/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H index cbf0a65693..61dbcea2bd 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModelI.H @@ -31,6 +31,7 @@ Foam::combustionModels::rhoCombustionModel::thermo() return thermo_(); } + inline const Foam::rhoReactionThermo& Foam::combustionModels::rhoCombustionModel::thermo() const { From 1e0a9c5ec8683f0f5555ad596deb9b2bf9d70c47 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 12 Jun 2012 13:16:40 +0100 Subject: [PATCH 5/9] ENH: Updated tutorial dictionary --- .../incompressible/icoFoam/elbow/system/foamDataToFluentDict | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/incompressible/icoFoam/elbow/system/foamDataToFluentDict b/tutorials/incompressible/icoFoam/elbow/system/foamDataToFluentDict index 2e4c170627..56e694db05 100644 --- a/tutorials/incompressible/icoFoam/elbow/system/foamDataToFluentDict +++ b/tutorials/incompressible/icoFoam/elbow/system/foamDataToFluentDict @@ -27,7 +27,7 @@ k 5; epsilon 6; -gamma 150; +alpha1 150; // ************************************************************************* // From f796258ff381c69ff6bd3f99f1177c80cf48ea21 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 12 Jun 2012 15:56:47 +0100 Subject: [PATCH 6/9] BUG: Corrected output from BC for parallel running --- .../waveSurfacePressureFvPatchScalarField.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index c9d50b8930..ccdf8f62ba 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -209,8 +209,8 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() << exit(FatalError); } - Info<< "min/max mag(zetap) = " << min(zetap & nf()) << ", " - << max(zetap & nf()) << endl; + Info<< "min/max mag(zetap) = " << gMin(zetap & nf()) << ", " + << gMax(zetap & nf()) << endl; fixedValueFvPatchScalarField::updateCoeffs(); } From 8594f475480c09ed27c53f1874fa6b91d56b75fc Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 12 Jun 2012 16:46:23 +0100 Subject: [PATCH 7/9] ENH: Updated output message --- .../waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index ccdf8f62ba..56a81e0f61 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -209,7 +209,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() << exit(FatalError); } - Info<< "min/max mag(zetap) = " << gMin(zetap & nf()) << ", " + Info<< "min/max(zetap) = " << gMin(zetap & nf()) << ", " << gMax(zetap & nf()) << endl; fixedValueFvPatchScalarField::updateCoeffs(); From c8b62e27f756205765459a9002709029f36c5829 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 12 Jun 2012 17:14:57 +0100 Subject: [PATCH 8/9] Thermodynamics: Instantiated isobaricPerfectGas packages --- etc/controlDict | 1 - .../psiChemistryModel/psiChemistryModels.C | 20 +- .../rhoChemistryModel/rhoChemistryModels.C | 20 +- .../chemistrySolver/makeChemistrySolvers.C | 10 +- .../chemistryReader/makeChemistryReaders.C | 9 +- .../mixtures/dieselMixture/dieselMixture.C | 134 -------------- .../mixtures/dieselMixture/dieselMixture.H | 174 ------------------ .../hePsiReactionThermos.C | 13 -- .../heheuReactionThermos.C | 4 - .../heRhoReactionThermos.C | 110 ++++++++++- src/thermophysicalModels/specie/Make/files | 1 - .../specie/include/reactionTypes.H | 9 +- .../specie/include/thermoPhysicsTypes.H | 100 ++++++---- .../reactions/makeReactionThermoReactions.C | 83 ++++----- .../specie/transport/const/constTransport.H | 9 + .../specie/transport/const/constTransportI.H | 39 ++++ 16 files changed, 311 insertions(+), 425 deletions(-) delete mode 100644 src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C delete mode 100644 src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H diff --git a/etc/controlDict b/etc/controlDict index 693a3f4dd2..5550a0961a 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -510,7 +510,6 @@ DebugSwitches gradientUnburntEnthalpy 0; granularPressureModel 0; hCombustionThermo 0; - hMixtureThermo>>>> 0; hMixtureThermo>>>> 0; hMixtureThermo>>>> 0; hMixtureThermo>>>> 0; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index 71e7d31ab9..a51aef04c7 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -43,14 +43,30 @@ namespace Foam ( ODEChemistryModel, psiChemistryModel, - gasThermoPhysics + constGasThermoPhysics ); + makeChemistryModel ( ODEChemistryModel, psiChemistryModel, - constGasThermoPhysics + gasThermoPhysics ); + + makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + constIsobaricGasThermoPhysics + ); + + makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + isobaricGasThermoPhysics + ); + makeChemistryModel ( ODEChemistryModel, diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C index 461e838b9a..f0cbbecec7 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -43,14 +43,30 @@ namespace Foam ( ODEChemistryModel, rhoChemistryModel, - gasThermoPhysics + constGasThermoPhysics ); + makeChemistryModel ( ODEChemistryModel, rhoChemistryModel, - constGasThermoPhysics + gasThermoPhysics ); + + makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + constIsobaricGasThermoPhysics + ); + + makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + isobaricGasThermoPhysics + ); + makeChemistryModel ( ODEChemistryModel, diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index aa3b58664b..54239f4957 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.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,11 +33,15 @@ License namespace Foam { - makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics); makeChemistrySolverTypes(psiChemistryModel, constGasThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, constIsobaricGasThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, isobaricGasThermoPhysics); makeChemistrySolverTypes(psiChemistryModel, icoPoly8ThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics); makeChemistrySolverTypes(rhoChemistryModel, constGasThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, constIsobaricGasThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, isobaricGasThermoPhysics); makeChemistrySolverTypes(rhoChemistryModel, icoPoly8ThermoPhysics); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index e731b5004d..61c0ae6fb5 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "makeReaction.H" +#include "makeReactionThermo.H" #include "thermoPhysicsTypes.H" #include "chemistryReader.H" @@ -38,9 +38,14 @@ namespace Foam makeChemistryReader(constGasThermoPhysics); makeChemistryReader(gasThermoPhysics); +makeChemistryReader(constIsobaricGasThermoPhysics); +makeChemistryReader(isobaricGasThermoPhysics); makeChemistryReader(icoPoly8ThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics); makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); +makeChemistryReaderType(foamChemistryReader, constIsobaricGasThermoPhysics); +makeChemistryReaderType(foamChemistryReader, isobaricGasThermoPhysics); makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C deleted file mode 100644 index 1b43304552..0000000000 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C +++ /dev/null @@ -1,134 +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 . - -\*---------------------------------------------------------------------------*/ - -#include "dieselMixture.H" -#include "fvMesh.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template -const char* Foam::dieselMixture::specieNames_[2] = {"ft", "fu"}; - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::dieselMixture::dieselMixture -( - const dictionary& thermoDict, - const fvMesh& mesh -) -: - basicMultiComponentMixture - ( - thermoDict, - speciesTable(nSpecies_, specieNames_), - mesh - ), - - stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), - - fuel_(thermoDict.subDict("fuel")), - oxidant_(thermoDict.subDict("oxidant")), - products_(thermoDict.subDict("burntProducts")), - - mixture_("mixture", fuel_), - - ft_(Y("ft")), - fu_(Y("fu")) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -const ThermoType& Foam::dieselMixture::mixture -( - const scalar ft, - const scalar fu -) const -{ - if (ft < 0.0001) - { - return oxidant_; - } - else - { - scalar ox = 1 - ft - (ft - fu)*stoicRatio().value(); - scalar pr = 1 - fu - ox; - - mixture_ = fu/fuel_.W()*fuel_; - mixture_ += ox/oxidant_.W()*oxidant_; - mixture_ += pr/products_.W()*products_; - - return mixture_; - } -} - - -template -void Foam::dieselMixture::read(const dictionary& thermoDict) -{ - fuel_ = ThermoType(thermoDict.subDict("fuel")); - oxidant_ = ThermoType(thermoDict.subDict("oxidant")); - products_ = ThermoType(thermoDict.subDict("burntProducts")); -} - - -template -const ThermoType& Foam::dieselMixture::getLocalThermo -( - const label specieI -) const -{ - if (specieI == 0) - { - return fuel_; - } - else if (specieI == 1) - { - return oxidant_; - } - else if (specieI == 2) - { - return products_; - } - else - { - FatalErrorIn - ( - "const ThermoType& Foam::dieselMixture::getLocalThermo" - "(" - "const label " - ") const" - ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" - << abort(FatalError); - - return fuel_; - } -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H deleted file mode 100644 index 3e0c15583d..0000000000 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H +++ /dev/null @@ -1,174 +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 . - -Class - Foam::dieselMixture - -Description - Foam::dieselMixture - -SourceFiles - dieselMixture.C - -\*---------------------------------------------------------------------------*/ - -#ifndef dieselMixture_H -#define dieselMixture_H - -#include "basicMultiComponentMixture.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class dieselMixture Declaration -\*---------------------------------------------------------------------------*/ - -template -class dieselMixture -: - public basicMultiComponentMixture -{ - // Private data - - static const int nSpecies_ = 2; - static const char* specieNames_[2]; - - dimensionedScalar stoicRatio_; - - ThermoType fuel_; - ThermoType oxidant_; - ThermoType products_; - - mutable ThermoType mixture_; - - volScalarField& ft_; - volScalarField& fu_; - - //- Construct as copy (not implemented) - dieselMixture(const dieselMixture&); - - -public: - - //- The type of thermodynamics this mixture is instantiated for - typedef ThermoType thermoType; - - - // Constructors - - //- Construct from dictionary and mesh - dieselMixture(const dictionary&, const fvMesh&); - - - //- Destructor - virtual ~dieselMixture() - {} - - - // Member functions - - const dimensionedScalar& stoicRatio() const - { - return stoicRatio_; - } - - const ThermoType& mixture(const scalar, const scalar) const; - - const ThermoType& cellMixture(const label celli) const - { - return mixture(ft_[celli], fu_[celli]); - } - - const ThermoType& patchFaceMixture - ( - const label patchi, - const label facei - ) const - { - return mixture - ( - ft_.boundaryField()[patchi][facei], - fu_.boundaryField()[patchi][facei] - ); - } - - const ThermoType& cellReactants(const label celli) const - { - return mixture(ft_[celli], ft_[celli]); - } - - const ThermoType& patchFaceReactants - ( - const label patchi, - const label facei - ) const - { - return mixture - ( - ft_.boundaryField()[patchi][facei], - ft_.boundaryField()[patchi][facei] - ); - } - - const ThermoType& cellProducts(const label celli) const - { - scalar ft = ft_[celli]; - return mixture(ft, fres(ft, stoicRatio().value())); - } - - const ThermoType& patchFaceProducts - ( - const label patchi, - const label facei - ) const - { - scalar ft = ft_.boundaryField()[patchi][facei]; - return mixture(ft, fres(ft, stoicRatio().value())); - } - - //- Read dictionary - void read(const dictionary&); - - //- Return thermo based on index - const ThermoType& getLocalThermo(const label specieI) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - -#ifdef NoRepository -# include "dieselMixture.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermos.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermos.C index 4a8438f9de..159a1e8ef0 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermos.C @@ -41,7 +41,6 @@ License #include "homogeneousMixture.H" #include "inhomogeneousMixture.H" #include "veryInhomogeneousMixture.H" -#include "dieselMixture.H" #include "multiComponentMixture.H" #include "reactingMixture.H" #include "singleStepReactingMixture.H" @@ -172,18 +171,6 @@ makeReactionThermo ); -makeReactionThermo -( - psiThermo, - psiReactionThermo, - hePsiReactionThermo, - dieselMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas -); - // Multi-component thermo makeReactionMixtureThermo diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermos.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermos.C index 3aad01b13b..bf42991d9c 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermos.C @@ -42,7 +42,6 @@ License #include "homogeneousMixture.H" #include "inhomogeneousMixture.H" #include "veryInhomogeneousMixture.H" -#include "dieselMixture.H" #include "multiComponentMixture.H" #include "egrMixture.H" @@ -126,7 +125,6 @@ makeReactionThermo perfectGas ); - makeReactionThermo ( psiThermo, @@ -139,8 +137,6 @@ makeReactionThermo perfectGas ); - - makeReactionThermo ( psiThermo, diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermos.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermos.C index fc26cdc892..74fb78cb16 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermos.C @@ -29,6 +29,7 @@ License #include "heRhoReactionThermo.H" #include "perfectGas.H" +#include "isobaricPerfectGas.H" #include "hConstThermo.H" #include "janafThermo.H" @@ -41,7 +42,6 @@ License #include "homogeneousMixture.H" #include "inhomogeneousMixture.H" #include "veryInhomogeneousMixture.H" -#include "dieselMixture.H" #include "multiComponentMixture.H" #include "reactingMixture.H" #include "singleStepReactingMixture.H" @@ -133,11 +133,71 @@ makeReactionThermo rhoThermo, rhoReactionThermo, heRhoReactionThermo, - dieselMixture, + homogeneousMixture, + constTransport, + sensibleEnthalpy, + hConstThermo, + isobaricPerfectGas +); + +makeReactionThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + inhomogeneousMixture, + constTransport, + sensibleEnthalpy, + hConstThermo, + isobaricPerfectGas +); + +makeReactionThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + veryInhomogeneousMixture, + constTransport, + sensibleEnthalpy, + hConstThermo, + isobaricPerfectGas +); + +makeReactionThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + homogeneousMixture, sutherlandTransport, sensibleEnthalpy, janafThermo, - perfectGas + isobaricPerfectGas +); + +makeReactionThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + inhomogeneousMixture, + sutherlandTransport, + sensibleEnthalpy, + janafThermo, + isobaricPerfectGas +); + +makeReactionThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + veryInhomogeneousMixture, + sutherlandTransport, + sensibleEnthalpy, + janafThermo, + isobaricPerfectGas ); @@ -158,7 +218,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoReactionThermo, multiComponentMixture, - icoPoly8ThermoPhysics + gasThermoPhysics ); makeReactionMixtureThermo @@ -167,7 +227,25 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoReactionThermo, multiComponentMixture, - gasThermoPhysics + constIsobaricGasThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + multiComponentMixture, + isobaricGasThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + multiComponentMixture, + icoPoly8ThermoPhysics ); @@ -188,7 +266,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoReactionThermo, reactingMixture, - icoPoly8ThermoPhysics + gasThermoPhysics ); makeReactionMixtureThermo @@ -197,7 +275,25 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoReactionThermo, reactingMixture, - gasThermoPhysics + constIsobaricGasThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + reactingMixture, + isobaricGasThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoReactionThermo, + reactingMixture, + icoPoly8ThermoPhysics ); makeReactionMixtureThermo diff --git a/src/thermophysicalModels/specie/Make/files b/src/thermophysicalModels/specie/Make/files index 87d6a0380f..0d1d4f73da 100644 --- a/src/thermophysicalModels/specie/Make/files +++ b/src/thermophysicalModels/specie/Make/files @@ -8,7 +8,6 @@ $(specie)/specie.C $(equationOfState)/perfectGas/perfectGas.C $(equationOfState)/incompressible/incompressible.C $(equationOfState)/isobaricPerfectGas/isobaricPerfectGas.C -$(reactions)/makeChemkinReactions.C $(reactions)/makeReactionThermoReactions.C $(reactions)/makeLangmuirHinshelwoodReactions.C diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H index c9e5b2bf5a..2d42804c68 100644 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.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 @@ -43,9 +43,13 @@ Description namespace Foam { + typedef Reaction constGasReaction; + typedef Reaction gasReaction; - typedef Reaction constGasReaction; + typedef Reaction constIsobaricGasReaction; + + typedef Reaction isobaricGasReaction; typedef Reaction icoPoly8Reaction; } @@ -55,4 +59,3 @@ namespace Foam #endif // ************************************************************************* // - diff --git a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index 6e2af6f8ff..e301be5614 100644 --- a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -33,6 +33,7 @@ Description #define thermoPhysicsTypes_H #include "perfectGas.H" +#include "isobaricPerfectGas.H" #include "hConstThermo.H" #include "janafThermo.H" #include "sensibleEnthalpy.H" @@ -49,48 +50,71 @@ Description namespace Foam { typedef - sutherlandTransport + constTransport + < + specieThermo < - specieThermo + hConstThermo < - janafThermo - < - perfectGas - >, - sensibleEnthalpy - > - > - gasThermoPhysics; - - typedef - constTransport - < - specieThermo - < - hConstThermo - < - perfectGas - >, - sensibleEnthalpy - > - > - constGasThermoPhysics; - - typedef - polynomialTransport - < - specieThermo - < - hPolynomialThermo - < - icoPolynomial<8>, - 8 - >, - sensibleEnthalpy + perfectGas >, - 8 + sensibleEnthalpy > - icoPoly8ThermoPhysics; + > constGasThermoPhysics; + + typedef + sutherlandTransport + < + specieThermo + < + janafThermo + < + perfectGas + >, + sensibleEnthalpy + > + > gasThermoPhysics; + + typedef + constTransport + < + specieThermo + < + hConstThermo + < + isobaricPerfectGas + >, + sensibleEnthalpy + > + > constIsobaricGasThermoPhysics; + + typedef + sutherlandTransport + < + specieThermo + < + janafThermo + < + isobaricPerfectGas + >, + sensibleEnthalpy + > + > isobaricGasThermoPhysics; + + typedef + polynomialTransport + < + specieThermo + < + hPolynomialThermo + < + icoPolynomial<8>, + 8 + >, + sensibleEnthalpy + >, + 8 + > icoPoly8ThermoPhysics; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C index 42f5af0ff2..5d7b3de1f2 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C @@ -43,50 +43,51 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTemplateTypeNameAndDebug(icoPoly8Reaction, 0); -defineTemplateRunTimeSelectionTable(icoPoly8Reaction, Istream); -defineTemplateRunTimeSelectionTable(icoPoly8Reaction, dictionary); - - -// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * // - -makeIRNReactions(icoPoly8ThermoPhysics, ArrheniusReactionRate) -makeIRNReactions(icoPoly8ThermoPhysics, infiniteReactionRate) -makeIRNReactions(icoPoly8ThermoPhysics, LandauTellerReactionRate) -makeIRNReactions(icoPoly8ThermoPhysics, thirdBodyArrheniusReactionRate) - -makeIRReactions(icoPoly8ThermoPhysics, JanevReactionRate) -makeIRReactions(icoPoly8ThermoPhysics, powerSeriesReactionRate) - -makePressureDependentReactions -( - icoPoly8ThermoPhysics, - ArrheniusReactionRate, - LindemannFallOffFunction -) - -makePressureDependentReactions -( - icoPoly8ThermoPhysics, - ArrheniusReactionRate, - TroeFallOffFunction -) - -makePressureDependentReactions -( - icoPoly8ThermoPhysics, - ArrheniusReactionRate, - SRIFallOffFunction -) +#define makeReactions(Thermo, Reaction) \ + \ + defineTemplateTypeNameAndDebug(Reaction, 0); \ + defineTemplateRunTimeSelectionTable(Reaction, Istream); \ + defineTemplateRunTimeSelectionTable(Reaction, dictionary); \ + \ + makeIRNReactions(Thermo, ArrheniusReactionRate) \ + makeIRNReactions(Thermo, infiniteReactionRate) \ + makeIRNReactions(Thermo, LandauTellerReactionRate) \ + makeIRNReactions(Thermo, thirdBodyArrheniusReactionRate) \ + \ + makeIRReactions(Thermo, JanevReactionRate) \ + makeIRReactions(Thermo, powerSeriesReactionRate) \ + \ + makePressureDependentReactions \ + ( \ + Thermo, \ + ArrheniusReactionRate, \ + LindemannFallOffFunction \ + ) \ + \ + makePressureDependentReactions \ + ( \ + Thermo, \ + ArrheniusReactionRate, \ + TroeFallOffFunction \ + ) \ + \ + makePressureDependentReactions \ + ( \ + Thermo, \ + ArrheniusReactionRate, \ + SRIFallOffFunction \ + ) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +namespace Foam +{ + makeReactions(constGasThermoPhysics, constGasReaction) + makeReactions(gasThermoPhysics, gasReaction) + makeReactions(constIsobaricGasThermoPhysics, constIsobaricGasReaction) + makeReactions(isobaricGasThermoPhysics, isobaricGasReaction) + makeReactions(icoPoly8ThermoPhysics, icoPoly8Reaction) +} // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/const/constTransport.H b/src/thermophysicalModels/specie/transport/const/constTransport.H index 6b750b5cbc..33ebaa3909 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransport.H +++ b/src/thermophysicalModels/specie/transport/const/constTransport.H @@ -125,6 +125,15 @@ public: //- Construct from dictionary constTransport(const dictionary& dict); + //- Construct and return a clone + inline autoPtr clone() const; + + // Selector from Istream + inline static autoPtr New(Istream& is); + + // Selector from dictionary + inline static autoPtr New(const dictionary& dict); + // Member functions diff --git a/src/thermophysicalModels/specie/transport/const/constTransportI.H b/src/thermophysicalModels/specie/transport/const/constTransportI.H index 9d6805eb0c..e58aa79efa 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransportI.H +++ b/src/thermophysicalModels/specie/transport/const/constTransportI.H @@ -52,6 +52,45 @@ inline Foam::constTransport::constTransport {} +template +inline Foam::autoPtr > +Foam::constTransport::clone() const +{ + return autoPtr > + ( + new constTransport(*this) + ); +} + + +template +inline Foam::autoPtr > +Foam::constTransport::New +( + Istream& is +) +{ + return autoPtr > + ( + new constTransport(is) + ); +} + + +template +inline Foam::autoPtr > +Foam::constTransport::New +( + const dictionary& dict +) +{ + return autoPtr > + ( + new constTransport(dict) + ); +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template From a24d8308498afe1d5ef8d0f0a1d0afb4f07ada01 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 12 Jun 2012 17:15:07 +0100 Subject: [PATCH 9/9] Updated headers --- .../chemistryModel/psiChemistryModel/psiChemistryModels.C | 2 +- .../chemistryModel/rhoChemistryModel/rhoChemistryModels.C | 2 +- .../chemistryReaders/chemistryReader/makeChemistryReaders.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index a51aef04c7..c84c43531b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C index f0cbbecec7..a5516752fd 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index 61c0ae6fb5..195cc764ed 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.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