From 33f36f684fb1babf096cb82ca8b70a6d2b2216b2 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 10 Feb 2010 14:39:16 +0000 Subject: [PATCH 01/29] STYLE: removed extraneous printing. --- .../meshes/polyMesh/globalMeshData/globalMeshData.C | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 413429cddb..e97cada0f3 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -1743,12 +1743,12 @@ Foam::autoPtr Foam::globalMeshData::mergePoints label myUniquePoints = meshPoints.size() - nCoupledSlave; -Pout<< "Points :" << nl - << " patch : " << meshPoints.size() << nl - << " of which coupled : " << nCoupledMaster+nCoupledSlave << nl - << " of which master : " << nCoupledMaster << nl - << " of which slave : " << nCoupledSlave << nl - << endl; + //Pout<< "Points :" << nl + // << " patch : " << meshPoints.size() << nl + // << " of which coupled : " << nCoupledMaster+nCoupledSlave << nl + // << " of which master : " << nCoupledMaster << nl + // << " of which slave : " << nCoupledSlave << nl + // << endl; // 2. Create global indexing for unique points. From d4f73877e36f35148d32d480123027e63383a7e9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 10 Feb 2010 14:39:55 +0000 Subject: [PATCH 02/29] ENH: have field selection work for pointFields instead of just volFields. --- .../reconstructPar/reconstructPar.C | 30 +++++++++++++++---- .../reconstruct/pointFieldReconstructor.H | 6 +++- ...pointFieldReconstructorReconstructFields.C | 21 +++++++------ 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index c412010cbd..e2cd5edba2 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -260,11 +260,31 @@ int main(int argc, char *argv[]) procMeshes.boundaryProcAddressing() ); - pointReconstructor.reconstructFields(objects); - pointReconstructor.reconstructFields(objects); - pointReconstructor.reconstructFields(objects); - pointReconstructor.reconstructFields(objects); - pointReconstructor.reconstructFields(objects); + pointReconstructor.reconstructFields + ( + objects, + selectedFields + ); + pointReconstructor.reconstructFields + ( + objects, + selectedFields + ); + pointReconstructor.reconstructFields + ( + objects, + selectedFields + ); + pointReconstructor.reconstructFields + ( + objects, + selectedFields + ); + pointReconstructor.reconstructFields + ( + objects, + selectedFields + ); } else { diff --git a/src/parallel/reconstruct/pointFieldReconstructor.H b/src/parallel/reconstruct/pointFieldReconstructor.H index 7ab04c3d41..3be8ba3a7a 100644 --- a/src/parallel/reconstruct/pointFieldReconstructor.H +++ b/src/parallel/reconstruct/pointFieldReconstructor.H @@ -138,7 +138,11 @@ public: //- Reconstruct and write all fields template - void reconstructFields(const IOobjectList& objects); + void reconstructFields + ( + const IOobjectList& objects, + const HashSet& selectedFields + ); }; diff --git a/src/parallel/reconstruct/pointFieldReconstructorReconstructFields.C b/src/parallel/reconstruct/pointFieldReconstructorReconstructFields.C index c96fcfa7ed..9b8e161483 100644 --- a/src/parallel/reconstruct/pointFieldReconstructorReconstructFields.C +++ b/src/parallel/reconstruct/pointFieldReconstructorReconstructFields.C @@ -143,7 +143,8 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject) template void Foam::pointFieldReconstructor::reconstructFields ( - const IOobjectList& objects + const IOobjectList& objects, + const HashSet& selectedFields ) { word fieldClassName @@ -157,16 +158,18 @@ void Foam::pointFieldReconstructor::reconstructFields { Info<< " Reconstructing " << fieldClassName << "s\n" << endl; - for - ( - IOobjectList::iterator fieldIter = fields.begin(); - fieldIter != fields.end(); - ++fieldIter - ) + forAllConstIter(IOobjectList, fields, fieldIter) { - Info<< " " << fieldIter()->name() << endl; + if + ( + !selectedFields.size() + || selectedFields.found(fieldIter()->name()) + ) + { + Info<< " " << fieldIter()->name() << endl; - reconstructField(*fieldIter())().write(); + reconstructField(*fieldIter())().write(); + } } Info<< endl; From b6082c3005074703c30aa05d3452835f0b7cf4ef Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 11 Feb 2010 09:07:42 +0000 Subject: [PATCH 03/29] ENH: extraneous checking for empty list in ensightMesh. Already done elsewhere. --- .../dataConversion/foamToEnsight/ensightMesh.C | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 48435c749b..4542a60f2b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -1111,14 +1111,11 @@ void Foam::ensightMesh::writeAllFacePrimsBinary writeEnsDataBinary(key,ensightGeometryFile); writeEnsDataBinary(nPrims,ensightGeometryFile); - if (&prims != NULL) - { - writeFacePrimsBinary - ( - UIndirectList(patchFaces, prims)(), - ensightGeometryFile - ); - } + writeFacePrimsBinary + ( + UIndirectList(patchFaces, prims)(), + ensightGeometryFile + ); for (int slave=1; slave Date: Thu, 11 Feb 2010 12:01:23 +0000 Subject: [PATCH 04/29] STYLE: Minor corrections/additions to basicThermo.H --- .../basic/basicThermo/basicThermo.H | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 1c907edcf9..fe8384b3e1 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -145,17 +145,17 @@ public: // Non-const access allowed for transport equations virtual volScalarField& h(); - //- Enthalpy [J/kg] + //- Total enthalpy [J/kg] virtual const volScalarField& h() const; - //- Enthalpy for cell-set [J/kg] + //- Total enthalpy for cell-set [J/kg] virtual tmp h ( const scalarField& T, const labelList& cells ) const; - //- Enthalpy for patch [J/kg] + //- Total enthalpy for patch [J/kg] virtual tmp h ( const scalarField& T, @@ -166,17 +166,17 @@ public: // Non-const access allowed for transport equations virtual volScalarField& hs(); - //- Enthalpy [J/kg] + //- Sensible enthalpy [J/kg] virtual const volScalarField& hs() const; - //- Enthalpy for cell-set [J/kg] + //- Sensible enthalpy for cell-set [J/kg] virtual tmp hs ( const scalarField& T, const labelList& cells ) const; - //- Enthalpy for patch [J/kg] + //- Sensible enthalpy for patch [J/kg] virtual tmp hs ( const scalarField& T, @@ -197,7 +197,7 @@ public: const labelList& cells ) const; - //-Internal energy for patch [J/kg] + //- Internal energy for patch [J/kg] virtual tmp e ( const scalarField& T, From 92f46b2ab5c32945e9470acbdd45305f995be7fe Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Feb 2010 12:02:16 +0000 Subject: [PATCH 05/29] ENH: Added sensible enthalpy variant of reactionThermo --- .../reactionThermo/Make/files | 3 + .../hsReactionThermo/hsReactionThermo.C | 67 ++++ .../hsReactionThermo/hsReactionThermo.H | 147 ++++++++ .../hsReactionThermo/hsReactionThermos.C | 171 ++++++++++ .../hsReactionThermo/makeHsReactionThermo.H | 100 ++++++ .../hsReactionThermo/newhsReactionThermo.C | 151 +++++++++ .../hsRhoMixtureThermo/hsRhoMixtureThermo.C | 320 ++++++++++++++++++ .../hsRhoMixtureThermo/hsRhoMixtureThermo.H | 147 ++++++++ 8 files changed, 1106 insertions(+) create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.H create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermos.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/newhsReactionThermo.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.C create mode 100644 src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.H diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files index c2f9612ec5..a93fc9976e 100644 --- a/src/thermophysicalModels/reactionThermo/Make/files +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -16,6 +16,9 @@ reactionThermo/hReactionThermo/hReactionThermo.C reactionThermo/hReactionThermo/newhReactionThermo.C reactionThermo/hReactionThermo/hReactionThermos.C +reactionThermo/hsReactionThermo/hsReactionThermo.C +reactionThermo/hsReactionThermo/newhsReactionThermo.C +reactionThermo/hsReactionThermo/hsReactionThermos.C derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.C new file mode 100644 index 0000000000..7f255de38a --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.C @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hsReactionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(hsReactionThermo, 0); + defineRunTimeSelectionTable(hsReactionThermo, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::hsReactionThermo::hsReactionThermo(const fvMesh& mesh) +: + basicRhoThermo(mesh), + + hs_ + ( + IOobject + ( + "hs", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimEnergy/dimMass, + this->hBoundaryTypes() + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::hsReactionThermo::~hsReactionThermo() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.H new file mode 100644 index 0000000000..85a23c3a38 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermo.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::hsReactionThermo + +Description + Sensible enthalpy variant for reactionThermo + +SourceFiles + hReactionThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hsReactionThermo_H +#define hsReactionThermo_H + +#include "basicRhoThermo.H" +#include "basicMultiComponentMixture.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hsReactionThermo Declaration +\*---------------------------------------------------------------------------*/ + +class hsReactionThermo +: + public basicRhoThermo +{ + +protected: + + // Protected data + + //- Sensible enthalpy [J/kg] + volScalarField hs_; + + +public: + + //- Runtime type information + TypeName("hsReactionThermo"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + hsReactionThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + + + // Constructors + + //- Construct from dictionary and mesh + hsReactionThermo(const fvMesh&); + + + // Selectors + + //- Standard selection based on fvMesh + static autoPtr New(const fvMesh&); + + //- Select and check that package contains 'thermoType' + static autoPtr NewType + ( + const fvMesh&, + const word& thermoType + ); + + + //- Destructor + virtual ~hsReactionThermo(); + + + // Member functions + + //- Return the composition of the multi-component mixture + virtual basicMultiComponentMixture& composition() = 0; + + //- Return the composition of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const = 0; + + + // Access to thermodynamic state variables + + //- Sensible enthalpy [J/kg] + // Non-const access allowed for transport equations + virtual volScalarField& hs() + { + return hs_; + } + + //- Sensible enthalpy [J/kg] + virtual const volScalarField& hs() const + { + return hs_; + } + + + //- Chemical enthalpy [J/kg] + virtual tmp hc() const = 0; + + //- Update properties + virtual void correct() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermos.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermos.C new file mode 100644 index 0000000000..be0e7967de --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/hsReactionThermos.C @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "makeHsReactionThermo.H" + +#include "hsReactionThermo.H" +#include "hsRhoMixtureThermo.H" + +#include "perfectGas.H" + +#include "hConstThermo.H" +#include "janafThermo.H" +#include "specieThermo.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "homogeneousMixture.H" +#include "inhomogeneousMixture.H" +#include "veryInhomogeneousMixture.H" +#include "dieselMixture.H" +#include "multiComponentMixture.H" +#include "reactingMixture.H" + +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + homogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + inhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + veryInhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + homogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + inhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + veryInhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + + +makeHsReactionThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + dieselMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + + +// Multi-component thermo + +makeHsReactionMixtureThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + multiComponentMixture, + icoPoly8ThermoPhysics +); + +makeHsReactionMixtureThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + multiComponentMixture, + gasThermoPhysics +); + + +// Multi-component reaction thermo + +makeHsReactionMixtureThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + reactingMixture, + icoPoly8ThermoPhysics +); + +makeHsReactionMixtureThermo +( + hsReactionThermo, + hsRhoMixtureThermo, + reactingMixture, + gasThermoPhysics +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H new file mode 100644 index 0000000000..7c3fadbb70 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +InClass + Foam::hReactionThermo + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactionThermo_H +#define makeReactionThermo_H + +#include "addToRunTimeSelectionTable.H" +#include "basicRhoThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeHsReactionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState)\ + \ +typedef MixtureThermo \ + > > > > \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + #MixtureThermo \ + "<"#Mixture"<"#Transport">>>>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicRhoThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +) + + +#define makeHsReactionMixtureThermo(CThermo,MixtureThermo,Mixture,ThermoPhys) \ + \ +typedef MixtureThermo > \ + MixtureThermo##Mixture##ThermoPhys; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##ThermoPhys, \ + #MixtureThermo"<"#Mixture"<"#ThermoPhys">>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicRhoThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ + fvMesh \ +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/newhsReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/newhsReactionThermo.C new file mode 100644 index 0000000000..00457f5674 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/newhsReactionThermo.C @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hsReactionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::hsReactionThermo::New +( + const fvMesh& mesh +) +{ + word hsReactionThermoTypeName; + + // Enclose the creation of the thermophysicalProperties to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary thermoDict + ( + IOobject + ( + "thermophysicalProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + thermoDict.lookup("thermoType") >> hsReactionThermoTypeName; + } + + Info<< "Selecting thermodynamics package " << hsReactionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hsReactionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hsReactionThermo::New(const fvMesh&)") + << "Unknown hsReactionThermo type " + << hsReactionThermoTypeName << nl << nl + << "Valid hsReactionThermo types are:" << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); +} + + +Foam::autoPtr Foam::hsReactionThermo::NewType +( + const fvMesh& mesh, + const word& thermoType +) +{ + word hsReactionThermoTypeName; + + // Enclose the creation of the thermophysicalProperties to ensure it is + // deleted before the turbulenceModel is created otherwise the dictionary + // is entered in the database twice + { + IOdictionary thermoDict + ( + IOobject + ( + "thermophysicalProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + thermoDict.lookup("thermoType") >> hsReactionThermoTypeName; + + if (hsReactionThermoTypeName.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->sortedToc(); + DynamicList validModels; + forAll(allModels, i) + { + if (allModels[i].find(thermoType) != string::npos) + { + validModels.append(allModels[i]); + } + } + + FatalErrorIn + ( + "autoPtr hsReactionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << hsReactionThermoTypeName << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); + } + } + + Info<< "Selecting thermodynamics package " << hsReactionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hsReactionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hsReactionThermo::New(const fvMesh&)") + << "Unknown hsReactionThermo type " + << hsReactionThermoTypeName << nl << nl + << "Valid hsReactionThermo types are:" << nl + << fvMeshConstructorTablePtr_->sortedToc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.C new file mode 100644 index 0000000000..e17bd8d120 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.C @@ -0,0 +1,320 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "hsRhoMixtureThermo.H" +#include "fvMesh.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::hsRhoMixtureThermo::calculate() +{ + const scalarField& hsCells = hs_.internalField(); + const scalarField& pCells = p_.internalField(); + + scalarField& TCells = T_.internalField(); + scalarField& psiCells = psi_.internalField(); + scalarField& rhoCells = rho_.internalField(); + scalarField& muCells = mu_.internalField(); + scalarField& alphaCells = alpha_.internalField(); + + forAll(TCells, celli) + { + const typename MixtureType::thermoType& mixture = + this->cellMixture(celli); + + TCells[celli] = mixture.THs(hsCells[celli], TCells[celli]); + psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]); + rhoCells[celli] = mixture.rho(pCells[celli], TCells[celli]); + + muCells[celli] = mixture.mu(TCells[celli]); + alphaCells[celli] = mixture.alpha(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + fvPatchScalarField& pp = p_.boundaryField()[patchi]; + fvPatchScalarField& pT = T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& prho = rho_.boundaryField()[patchi]; + + fvPatchScalarField& phs = hs_.boundaryField()[patchi]; + + fvPatchScalarField& pmu_ = mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha_ = alpha_.boundaryField()[patchi]; + + if (pT.fixesValue()) + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture = + this->patchFaceMixture(patchi, facei); + + phs[facei] = mixture.Hs(pT[facei]); + + ppsi[facei] = mixture.psi(pp[facei], pT[facei]); + prho[facei] = mixture.rho(pp[facei], pT[facei]); + pmu_[facei] = mixture.mu(pT[facei]); + palpha_[facei] = mixture.alpha(pT[facei]); + } + } + else + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture = + this->patchFaceMixture(patchi, facei); + + pT[facei] = mixture.THs(phs[facei], pT[facei]); + + ppsi[facei] = mixture.psi(pp[facei], pT[facei]); + prho[facei] = mixture.rho(pp[facei], pT[facei]); + pmu_[facei] = mixture.mu(pT[facei]); + palpha_[facei] = mixture.alpha(pT[facei]); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::hsRhoMixtureThermo::hsRhoMixtureThermo(const fvMesh& mesh) +: + hsReactionThermo(mesh), + MixtureType(*this, mesh) +{ + scalarField& hsCells = hs_.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(hsCells, celli) + { + hsCells[celli] = this->cellMixture(celli).Hs(TCells[celli]); + } + + forAll(hs_.boundaryField(), patchi) + { + hs_.boundaryField()[patchi] == hs(T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(hs_); + + calculate(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::hsRhoMixtureThermo::~hsRhoMixtureThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::hsRhoMixtureThermo::correct() +{ + if (debug) + { + Info<< "entering hsRhoMixtureThermo::correct()" << endl; + } + + calculate(); + + if (debug) + { + Info<< "exiting hsRhoMixtureThermo::correct()" << endl; + } +} + + +template +Foam::tmp +Foam::hsRhoMixtureThermo::hc() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp thc + ( + new volScalarField + ( + IOobject + ( + "hc", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + hs_.dimensions() + ) + ); + + volScalarField& hcf = thc(); + scalarField& hcCells = hcf.internalField(); + + forAll(hcCells, celli) + { + hcCells[celli] = this->cellMixture(celli).Hc(); + } + + forAll(hcf.boundaryField(), patchi) + { + scalarField& hcp = hcf.boundaryField()[patchi]; + + forAll(hcp, facei) + { + hcp[facei] = this->patchFaceMixture(patchi, facei).Hc(); + } + } + + return thc; +} + + +template +Foam::tmp +Foam::hsRhoMixtureThermo::hs +( + const scalarField& T, + const labelList& cells +) const +{ + tmp ths(new scalarField(T.size())); + scalarField& hs = ths(); + + forAll(T, celli) + { + hs[celli] = this->cellMixture(cells[celli]).Hs(T[celli]); + } + + return ths; +} + + +template +Foam::tmp +Foam::hsRhoMixtureThermo::hs +( + const scalarField& T, + const label patchi +) const +{ + tmp ths(new scalarField(T.size())); + scalarField& hs = ths(); + + forAll(T, facei) + { + hs[facei] = this->patchFaceMixture(patchi, facei).Hs(T[facei]); + } + + return ths; +} + + +template +Foam::tmp +Foam::hsRhoMixtureThermo::Cp +( + const scalarField& T, + const label patchi +) const +{ + tmp tCp(new scalarField(T.size())); + + scalarField& cp = tCp(); + + forAll(T, facei) + { + cp[facei] = this->patchFaceMixture(patchi, facei).Cp(T[facei]); + } + + return tCp; +} + + +template +Foam::tmp +Foam::hsRhoMixtureThermo::Cp() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp tCp + ( + new volScalarField + ( + IOobject + ( + "Cp", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimEnergy/dimMass/dimTemperature + ) + ); + + volScalarField& cp = tCp(); + + scalarField& cpCells = cp.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(TCells, celli) + { + cpCells[celli] = this->cellMixture(celli).Cp(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + cp.boundaryField()[patchi] = Cp(T_.boundaryField()[patchi], patchi); + } + + return tCp; +} + + +template +bool Foam::hsRhoMixtureThermo::read() +{ + if (hsReactionThermo::read()) + { + MixtureType::read(*this); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.H new file mode 100644 index 0000000000..86e86a40a2 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hsRhoMixtureThermo/hsRhoMixtureThermo.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::hsRhoMixtureThermo + +Description + Foam::hsRhoMixtureThermo + +SourceFiles + hsRhoMixtureThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hsRhoMixtureThermo_H +#define hsRhoMixtureThermo_H + +#include "hsReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hsRhoMixtureThermo Declaration +\*---------------------------------------------------------------------------*/ + +template +class hsRhoMixtureThermo +: + public hsReactionThermo, + public MixtureType +{ + // Private member functions + + void calculate(); + + //- Construct as copy (not implemented) + hsRhoMixtureThermo(const hsRhoMixtureThermo&); + + +public: + + //- Runtime type information + TypeName("hsRhoMixtureThermo"); + + + // Constructors + + //- Construct from mesh + hsRhoMixtureThermo(const fvMesh&); + + + //- Destructor + virtual ~hsRhoMixtureThermo(); + + + // Member functions + + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() + { + return *this; + } + + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const + { + return *this; + } + + //- Update properties + virtual void correct(); + + //- Chemical enthalpy [J/kg] + virtual tmp hc() const; + + + // Fields derived from thermodynamic state variables + + //- Sensible nthalpy for cell-set [J/kg] + virtual tmp hs + ( + const scalarField& T, + const labelList& cells + ) const; + + //- Sensible enthalpy for patch [J/kg] + virtual tmp hs + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure for patch [J/kg/K] + virtual tmp Cp + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure [J/kg/K] + virtual tmp Cp() const; + + + //- Read thermophysicalProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "hsRhoMixtureThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From a567287f27b5ca873ffa57fb10cd9e298f0174ae Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Feb 2010 15:39:39 +0000 Subject: [PATCH 06/29] ENH: Updated lagrangian/intermediate library to operate using sensible enthalpy - removed support for total enthalpy - much cleaner/improved code for transfer terms --- .../Templates/ThermoCloud/ThermoCloud.C | 15 --- .../Templates/ThermoCloud/ThermoCloud.H | 21 +-- .../Templates/ThermoCloud/ThermoCloudI.H | 93 +------------ .../ReactingMultiphaseParcel.C | 21 +-- .../ReactingMultiphaseParcel.H | 1 - .../Templates/ReactingParcel/ReactingParcel.C | 9 +- .../Templates/ReactingParcel/ReactingParcel.H | 1 - .../CompositionModel/CompositionModel.C | 124 ++++++++++++++++++ .../CompositionModel/CompositionModel.H | 20 ++- 9 files changed, 153 insertions(+), 152 deletions(-) diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 0d12d286b9..f95394d51a 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -160,20 +160,6 @@ Foam::ThermoCloud::ThermoCloud ), this->mesh(), dimensionedScalar("zero", dimEnergy, 0.0) - ), - hcTrans_ - ( - IOobject - ( - this->name() + "hcTrans", - this->db().time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - this->mesh(), - dimensionedScalar("zero", dimEnergy, 0.0) ) { if (readFields) @@ -220,7 +206,6 @@ void Foam::ThermoCloud::resetSourceTerms() { KinematicCloud::resetSourceTerms(); hsTrans_.field() = 0.0; - hcTrans_.field() = 0.0; } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index c0e2d5864a..b5d9f27b8b 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -108,15 +108,9 @@ protected: // Sources - //- Sensible enthalpy transfer + //- Sensible enthalpy transfer [J/kg] DimensionedField hsTrans_; - //- Chemical enthalpy transfer - // - If solving for total enthalpy, the carrier phase enthalpy will - // receive the full enthalpy of reaction via creation of reaction - // products - DimensionedField hcTrans_; - // Protected member functions @@ -194,19 +188,10 @@ public: // Enthalpy - //- Return reference to sensible enthalpy source + //- Sensible enthalpy transfer [J/kg] inline DimensionedField& hsTrans(); - //- Return tmp total sensible enthalpy source term - inline tmp > Shs() const; - - //- Return reference to chemical enthalpy source - inline DimensionedField& hcTrans(); - - //- Return tmp chemical enthalpy source term - inline tmp > Shc() const; - - //- Return tmp total enthalpy source term + //- Return enthalpy source [J/kg/m3/s] inline tmp > Sh() const; diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index f537f6283a..249906311d 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -85,82 +85,6 @@ Foam::ThermoCloud::hsTrans() } -template -inline Foam::tmp > -Foam::ThermoCloud::Shs() const -{ - tmp > tShs - ( - new DimensionedField - ( - IOobject - ( - this->name() + "Shs", - this->db().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE, - false - ), - this->mesh(), - dimensionedScalar - ( - "zero", - dimMass/dimLength/pow3(dimTime), - 0.0 - ) - ) - ); - - scalarField& Shs = tShs().field(); - Shs = hsTrans_/(this->mesh().V()*this->db().time().deltaT()); - - return tShs; -} - - -template -inline Foam::DimensionedField& -Foam::ThermoCloud::hcTrans() -{ - return hcTrans_; -} - - -template -inline Foam::tmp > -Foam::ThermoCloud::Shc() const -{ - tmp > tShc - ( - new DimensionedField - ( - IOobject - ( - this->name() + "Shc", - this->db().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE, - false - ), - this->mesh(), - dimensionedScalar - ( - "zero", - dimMass/dimLength/pow3(dimTime), - 0.0 - ) - ) - ); - - scalarField& Shc = tShc().field(); - Shc = hcTrans_/(this->mesh().V()*this->db().time().deltaT()); - - return tShc; -} - - template inline Foam::tmp > Foam::ThermoCloud::Sh() const @@ -178,19 +102,10 @@ Foam::ThermoCloud::Sh() const IOobject::AUTO_WRITE, false ), - this->mesh(), - dimensionedScalar - ( - "zero", - dimMass/dimLength/pow3(dimTime), - 0.0 - ) + hsTrans_/(this->mesh().V()*this->db().time().deltaT()) ) ); - scalarField& Sh = tSh().field(); - Sh = (hsTrans_ + hcTrans_)/(this->mesh().V()*this->db().time().deltaT()); - return tSh; } @@ -205,7 +120,7 @@ Foam::ThermoCloud::Ep() const ( IOobject ( - this->name() + "radiationEp", + this->name() + "radiation::Ep", this->db().time().timeName(), this->db(), IOobject::NO_READ, @@ -248,7 +163,7 @@ Foam::ThermoCloud::ap() const ( IOobject ( - this->name() + "radiationAp", + this->name() + "radiation::ap", this->db().time().timeName(), this->db(), IOobject::NO_READ, @@ -291,7 +206,7 @@ Foam::ThermoCloud::sigmap() const ( IOobject ( - this->name() + "radiationSigmap", + this->name() + "radiation::sigmap", this->db().time().timeName(), this->db(), IOobject::NO_READ, diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index c1914e5ed5..8d32c6a709 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -267,7 +267,6 @@ void Foam::ReactingMultiphaseParcel::calc YLiquid_, dMassPC, Sh, - dhsTrans, Ne, NCpW, Cs @@ -296,7 +295,6 @@ void Foam::ReactingMultiphaseParcel::calc canCombust_, dMassDV, Sh, - dhsTrans, Ne, NCpW, Cs @@ -398,19 +396,11 @@ void Foam::ReactingMultiphaseParcel::calc { label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i]; - td.cloud().hcTrans()[cellI] += - np0 - *dMassGas[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } forAll(YLiquid_, i) { label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i]; - td.cloud().hcTrans()[cellI] += - np0 - *dMassLiquid[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } /* // No mapping between solid components and carrier phase @@ -418,19 +408,11 @@ void Foam::ReactingMultiphaseParcel::calc { label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i]; - td.cloud().hcTrans()[cellI] += - np0 - *dMassSolid[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } */ forAll(dMassSRCarrier, i) { td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i]; - td.cloud().hcTrans()[cellI] += - np0 - *dMassSRCarrier[i] - *td.cloud().mcCarrierThermo().speciesData()[i].Hc(); } // Update momentum transfer @@ -476,7 +458,7 @@ void Foam::ReactingMultiphaseParcel::calc */ td.cloud().UTrans()[cellI] += np0*mass1*U1; td.cloud().hsTrans()[cellI] += - np0*mass1*HEff(td, pc, T1, idG, idL, idS); + np0*mass1*HEff(td, pc, T1, idG, idL, idS); // using total h } } @@ -520,7 +502,6 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation bool& canCombust, scalarField& dMassDV, scalar& Sh, - scalar& dhsTrans, scalar& N, scalar& NCpW, scalarField& Cs diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index 1bc1ee99d7..3951688cc3 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -238,7 +238,6 @@ protected: bool& canCombust, // 'can combust' flag scalarField& dMassDV, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source - scalar& dhsTrans, // sensible enthalpy transfer to carrier scalar& N, // flux of species emitted from particle scalar& NCpW, // sum of N*Cp*W of emission species scalarField& Cs // carrier conc. of emission species diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 92525ea2b1..edfb377176 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -287,7 +287,6 @@ void Foam::ReactingParcel::calc Y_, dMassPC, Sh, - dhsTrans, Ne, NCpW, Cs @@ -341,10 +340,6 @@ void Foam::ReactingParcel::calc { label gid = td.cloud().composition().localToGlobalCarrierId(0, i); td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i]; - td.cloud().hcTrans()[cellI] += - np0 - *dMassPC[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } // Update momentum transfer @@ -371,7 +366,7 @@ void Foam::ReactingParcel::calc td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i]; } td.cloud().UTrans()[cellI] += np0*mass1*U1; - td.cloud().hcTrans()[cellI] += + td.cloud().hsTrans()[cellI] += np0*mass1*td.cloud().composition().H(0, Y_, pc_, T1); } } @@ -417,7 +412,6 @@ void Foam::ReactingParcel::calcPhaseChange const scalarField& YComponents, scalarField& dMassPC, scalar& Sh, - scalar& dhsTrans, // TODO: not used scalar& N, scalar& NCpW, scalarField& Cs @@ -469,6 +463,7 @@ void Foam::ReactingParcel::calcPhaseChange td.cloud().composition().localToGlobalCarrierId(idPhase, i); const label idl = td.cloud().composition().globalIds(idPhase)[i]; + // Calculate enthalpy transfer if ( td.cloud().phaseChange().enthalpyTransfer() diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 41d7c6d30c..1c7ed466d2 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -209,7 +209,6 @@ protected: const scalarField& YComponents, // component mass fractions scalarField& dMassPC, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source - scalar& dhsTrans, // sensible enthalpy transfer to carrier scalar& N, // flux of species emitted from particle scalar& NCpW, // sum of N*Cp*W of emission species scalarField& Cs // carrier conc. of emission species diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 6ae3dabb6f..e06b4925be 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -410,6 +410,130 @@ Foam::scalar Foam::CompositionModel::H } +template +Foam::scalar Foam::CompositionModel::Hs +( + const label phaseI, + const scalarField& Y, + const scalar p, + const scalar T +) const +{ + const phaseProperties& props = phaseProps_[phaseI]; + scalar HsMixture = 0.0; + switch (props.phase()) + { + case phaseProperties::GAS: + { + forAll(Y, i) + { + label gid = props.globalIds()[i]; + HsMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Hs(T); + } + break; + } + case phaseProperties::LIQUID: + { + forAll(Y, i) + { + label gid = props.globalIds()[i]; + HsMixture += + Y[i] + *( + this->liquids().properties()[gid].h(p, T) + - this->liquids().properties()[gid].h(p, 298.25) + ); + } + break; + } + case phaseProperties::SOLID: + { + forAll(Y, i) + { + label gid = props.globalIds()[i]; + HsMixture += Y[i]*this->solids().properties()[gid].cp()*T; + } + break; + } + default: + { + FatalErrorIn + ( + "Foam::scalar Foam::CompositionModel::Hs" + "(" + " const label, " + " const scalarField&, " + " const scalar, " + " const scalar" + ") const" + ) << "Unknown phase enumeration" << nl << abort(FatalError); + } + } + + return HsMixture; +} + + +template +Foam::scalar Foam::CompositionModel::Hc +( + const label phaseI, + const scalarField& Y, + const scalar p, + const scalar T +) const +{ + const phaseProperties& props = phaseProps_[phaseI]; + scalar HcMixture = 0.0; + switch (props.phase()) + { + case phaseProperties::GAS: + { + forAll(Y, i) + { + label gid = props.globalIds()[i]; + HcMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Hc(); + } + break; + } + case phaseProperties::LIQUID: + { + forAll(Y, i) + { + label gid = props.globalIds()[i]; + HcMixture += + Y[i]*this->liquids().properties()[gid].h(p, 298.15); + } + break; + } + case phaseProperties::SOLID: + { + forAll(Y, i) + { + label gid = props.globalIds()[i]; + HcMixture += Y[i]*this->solids().properties()[gid].Hf(); + } + break; + } + default: + { + FatalErrorIn + ( + "Foam::scalar Foam::CompositionModel::Hc" + "(" + " const label, " + " const scalarField&, " + " const scalar, " + " const scalar" + ") const" + ) << "Unknown phase enumeration" << nl << abort(FatalError); + } + } + + return HcMixture; +} + + template Foam::scalar Foam::CompositionModel::cp ( diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index b3f0949def..a3a8e9c724 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -226,7 +226,7 @@ public: // Evaluation - //- Return enthalpy for the phase phaseI + //- Return total enthalpy for the phase phaseI virtual scalar H ( const label phaseI, @@ -235,6 +235,24 @@ public: const scalar T ) const; + //- Return sensible enthalpy for the phase phaseI + virtual scalar Hs + ( + const label phaseI, + const scalarField& Y, + const scalar p, + const scalar T + ) const; + + //- Return chemical enthalpy for the phase phaseI + virtual scalar Hc + ( + const label phaseI, + const scalarField& Y, + const scalar p, + const scalar T + ) const; + //- Return specific heat caoacity for the phase phaseI virtual scalar cp ( From 73ec58d3e807094a4fbd870d1378989f984149ec Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Feb 2010 17:00:55 +0000 Subject: [PATCH 07/29] ENH: Update of hsCombustionThermo - moved sources from fireFoam solver into the thermophysicalModels library - code clean-up --- .../Allwmake | 8 -- .../basic/Make/files | 4 - .../basic/Make/options | 7 -- .../basicSensiblePsiThermo.C | 52 -------- .../basicSensiblePsiThermo.H | 114 ------------------ .../makeBasicSensiblePsiThermo.H | 66 ---------- .../newBasicSensiblePsiThermo.C | 75 ------------ .../reactionThermo/Make/files | 5 - .../reactionThermo/Make/options | 9 -- .../reactionThermo/Make/files | 4 + .../hCombustionThermo/makeCombustionThermo.H | 2 - .../hsCombustionThermo/hsCombustionThermo.C | 4 +- .../hsCombustionThermo/hsCombustionThermo.H | 8 +- .../hsCombustionThermo/hsCombustionThermos.C | 85 +++++++++++++ .../makeHsCombustionThermo.H | 8 +- .../newhsCombustionThermo.C | 0 .../hsPsiMixtureThermo/hsPsiMixtureThermo.C | 0 .../hsPsiMixtureThermo/hsPsiMixtureThermo.H | 2 +- .../hReactionThermo/makeReactionThermo.H | 2 - .../hsReactionThermo/makeHsReactionThermo.H | 2 - 20 files changed, 99 insertions(+), 358 deletions(-) delete mode 100755 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/Allwmake delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/files delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/options delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.C delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.H delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/makeBasicSensiblePsiThermo.H delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/newBasicSensiblePsiThermo.C delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/files delete mode 100644 applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/options rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C (96%) rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H (96%) rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C (59%) rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H (96%) rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/hsCombustionThermo/newhsCombustionThermo.C (100%) rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.C (100%) rename {applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels => src/thermophysicalModels}/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H (98%) diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/Allwmake b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/Allwmake deleted file mode 100755 index e59cf84715..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake libso basic -wmake libso reactionThermo - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/files b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/files deleted file mode 100644 index ca1ec78b98..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.C -psiThermo/basicSensiblePsiThermo/newBasicSensiblePsiThermo.C - -LIB = $(FOAM_LIBBIN)/libbasicSensibleEnthalpyThermophysicalModels diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/options b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/options deleted file mode 100644 index 8bdd75aecb..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/Make/options +++ /dev/null @@ -1,7 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude - -LIB_LIBS = \ - -lfiniteVolume diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.C b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.C deleted file mode 100644 index 5d41d00c93..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.C +++ /dev/null @@ -1,52 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "basicSensiblePsiThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(basicSensiblePsiThermo, 0); - defineRunTimeSelectionTable(basicSensiblePsiThermo, fvMesh); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::basicSensiblePsiThermo::basicSensiblePsiThermo(const fvMesh& mesh) -: - basicThermo(mesh) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::basicSensiblePsiThermo::~basicSensiblePsiThermo() -{} - - -// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.H b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.H deleted file mode 100644 index f2eadec321..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.H +++ /dev/null @@ -1,114 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::basicSensiblePsiThermo - -Description - Basic thermodynamic properties based on compressibility - -SourceFiles - basicSensiblePsiThermo.C - newBasicSensiblePsiThermo.C - -\*---------------------------------------------------------------------------*/ - -#ifndef basicSensiblePsiThermo_H -#define basicSensiblePsiThermo_H - -#include "basicThermo.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class basicSensiblePsiThermo Declaration -\*---------------------------------------------------------------------------*/ - -class basicSensiblePsiThermo -: - public basicThermo -{ - -protected: - - // Protected member functions - - //- Construct as copy (not implemented) - basicSensiblePsiThermo(const basicSensiblePsiThermo&); - - -public: - - //- Runtime type information - TypeName("basicSensiblePsiThermo"); - - - //- Declare run-time constructor selection table - declareRunTimeSelectionTable - ( - autoPtr, - basicSensiblePsiThermo, - fvMesh, - (const fvMesh& mesh), - (mesh) - ); - - // Constructors - - //- Construct from mesh - basicSensiblePsiThermo(const fvMesh&); - - - //- Selector - static autoPtr New(const fvMesh&); - - //- Destructor - virtual ~basicSensiblePsiThermo(); - - - // Member functions - - // Fields derived from thermodynamic state variables - - //- Density [kg/m^3] - uses current value of pressure - virtual tmp rho() const - { - return p_*psi(); - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/makeBasicSensiblePsiThermo.H b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/makeBasicSensiblePsiThermo.H deleted file mode 100644 index 7d0a078719..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/makeBasicSensiblePsiThermo.H +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -InClass - Foam::basicSensiblePsiThermo - -Description - Macros for creating 'basic' compresibility-based thermo packages - -\*---------------------------------------------------------------------------*/ - -#ifndef makeBasicSensiblePsiThermo_H -#define makeBasicSensiblePsiThermo_H - -#include "basicSensiblePsiThermo.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeBasicSensiblePsiThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ - \ -typedef Cthermo > > > > \ - Cthermo##Mixture##Transport##Thermo##EqnOfState; \ - \ -defineTemplateTypeNameAndDebugWithName \ -( \ - Cthermo##Mixture##Transport##Thermo##EqnOfState, \ - #Cthermo \ - "<"#Mixture"<"#Transport">>>>", \ - 0 \ -); \ - \ -addToRunTimeSelectionTable \ -( \ - basicSensiblePsiThermo, \ - Cthermo##Mixture##Transport##Thermo##EqnOfState, \ - fvMesh \ -) - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/newBasicSensiblePsiThermo.C b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/newBasicSensiblePsiThermo.C deleted file mode 100644 index 14fcbbff6a..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/basic/psiThermo/basicSensiblePsiThermo/newBasicSensiblePsiThermo.C +++ /dev/null @@ -1,75 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "basicSensiblePsiThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::basicSensiblePsiThermo::New -( - const fvMesh& mesh -) -{ - word thermoTypeName; - - // Enclose the creation of the thermophysicalProperties to ensure it is - // deleted before the turbulenceModel is created otherwise the dictionary - // is entered in the database twice - { - IOdictionary thermoDict - ( - IOobject - ( - "thermophysicalProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - thermoDict.lookup("thermoType") >> thermoTypeName; - } - - Info<< "Selecting thermodynamics package " << thermoTypeName << endl; - - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(thermoTypeName); - - if (cstrIter == fvMeshConstructorTablePtr_->end()) - { - FatalErrorIn("basicSensiblePsiThermo::New(const fvMesh&)") - << "Unknown basicSensiblePsiThermo type " << thermoTypeName << nl << nl - << "Valid basicSensiblePsiThermo types are:" << nl - << fvMeshConstructorTablePtr_->toc() << nl - << exit(FatalError); - } - - return autoPtr(cstrIter()(mesh)); -} - - -// ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/files b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/files deleted file mode 100644 index 39b2fa53b1..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/files +++ /dev/null @@ -1,5 +0,0 @@ -combustionThermo/hsCombustionThermo/hsCombustionThermo.C -combustionThermo/hsCombustionThermo/newhsCombustionThermo.C -combustionThermo/hsCombustionThermo/hsCombustionThermos.C - -LIB = $(FOAM_LIBBIN)/libreactionSensibleEnthalpyThermophysicalModels diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/options b/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/options deleted file mode 100644 index 9551ad0315..0000000000 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/Make/options +++ /dev/null @@ -1,9 +0,0 @@ -EXE_INC = \ - -I../basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -LIB_LIBS = \ - -lfiniteVolume diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files index a93fc9976e..471dbb114d 100644 --- a/src/thermophysicalModels/reactionThermo/Make/files +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -8,6 +8,10 @@ combustionThermo/hCombustionThermo/hCombustionThermo.C combustionThermo/hCombustionThermo/newhCombustionThermo.C combustionThermo/hCombustionThermo/hCombustionThermos.C +combustionThermo/hsCombustionThermo/hsCombustionThermo.C +combustionThermo/hsCombustionThermo/newhsCombustionThermo.C +combustionThermo/hsCombustionThermo/hsCombustionThermos.C + combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H index 4ee0c2a022..39079cfb31 100644 --- a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H @@ -25,8 +25,6 @@ License InClass Foam::hCombustionThermo -Description - \*---------------------------------------------------------------------------*/ #ifndef makeCombustionThermo_H diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C similarity index 96% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C index 2e50a2a64c..55d8984301 100644 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C @@ -39,7 +39,7 @@ namespace Foam Foam::hsCombustionThermo::hsCombustionThermo(const fvMesh& mesh) : - basicSensiblePsiThermo(mesh), + basicPsiThermo(mesh), hs_ ( @@ -52,7 +52,7 @@ Foam::hsCombustionThermo::hsCombustionThermo(const fvMesh& mesh) IOobject::NO_WRITE ), mesh, - dimensionSet(0, 2, -2, 0, 0), + dimEnergy/dimMass, this->hBoundaryTypes() ) {} diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H similarity index 96% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H index 44e4dfe433..bb34b41602 100644 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.H @@ -26,7 +26,7 @@ Class Foam::hsCombustionThermo Description - Foam::hsCombustionThermo + Sensible enthalpy variant of combustionThermo SourceFiles hsCombustionThermo.C @@ -36,7 +36,7 @@ SourceFiles #ifndef hsCombustionThermo_H #define hsCombustionThermo_H -#include "basicSensiblePsiThermo.H" +#include "basicPsiThermo.H" #include "basicMultiComponentMixture.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" @@ -52,14 +52,14 @@ namespace Foam class hsCombustionThermo : - public basicSensiblePsiThermo + public basicPsiThermo { protected: // Protected data - //- sensible enthalpy field + //- Sensible enthalpy field volScalarField hs_; diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C similarity index 59% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C index bf3bc4ebfe..e3332c7bb8 100644 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermos.C @@ -35,10 +35,15 @@ License #include "janafThermo.H" #include "specieThermo.H" +#include "constTransport.H" #include "sutherlandTransport.H" +#include "dieselMixture.H" +#include "homogeneousMixture.H" +#include "inhomogeneousMixture.H" #include "veryInhomogeneousMixture.H" +#include "reactingMixture.H" #include "multiComponentMixture.H" #include "thermoPhysicsTypes.H" @@ -50,6 +55,55 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +makeHsCombustionThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + homogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeHsCombustionThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + inhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeHsCombustionThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + veryInhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeHsCombustionThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + homogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeHsCombustionThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + inhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); makeHsCombustionThermo ( @@ -61,6 +115,37 @@ makeHsCombustionThermo perfectGas ); +makeHsCombustionThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + dieselMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +// Multi-component thermo + +makeHsCombustionMixtureThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + multiComponentMixture, + gasThermoPhysics +); + + +// Multi-component reaction thermo + +makeHsCombustionMixtureThermo +( + hsCombustionThermo, + hsPsiMixtureThermo, + reactingMixture, + gasThermoPhysics +); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H similarity index 96% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H index a1507ba35d..41962dfc54 100644 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/makeHsCombustionThermo.H @@ -25,15 +25,13 @@ License InClass Foam::hsCombustionThermo -Description - \*---------------------------------------------------------------------------*/ #ifndef makeHsCombustionThermo_H #define makeHsCombustionThermo_H #include "addToRunTimeSelectionTable.H" -#include "basicSensiblePsiThermo.H" +#include "basicPsiThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,7 +51,7 @@ defineTemplateTypeNameAndDebugWithName \ \ addToRunTimeSelectionTable \ ( \ - basicSensiblePsiThermo, \ + basicPsiThermo, \ MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ ); \ @@ -80,7 +78,7 @@ defineTemplateTypeNameAndDebugWithName \ \ addToRunTimeSelectionTable \ ( \ - basicSensiblePsiThermo, \ + basicPsiThermo, \ MixtureThermo##Mixture##ThermoPhys, \ fvMesh \ ); \ diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/newhsCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/newhsCombustionThermo.C similarity index 100% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/newhsCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/newhsCombustionThermo.C diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.C similarity index 100% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.C diff --git a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H similarity index 98% rename from applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H index e114b84734..382226f72b 100644 --- a/applications/solvers/combustion/fireFoam/sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hsPsiMixtureThermo/hsPsiMixtureThermo.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hsPsiMixtureThermo Declaration + Class hsPsiMixtureThermo Declaration \*---------------------------------------------------------------------------*/ template diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H index a74bded0bf..214602c844 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H @@ -25,8 +25,6 @@ License InClass Foam::hReactionThermo -Description - \*---------------------------------------------------------------------------*/ #ifndef makeReactionThermo_H diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H index 7c3fadbb70..321d2cc862 100644 --- a/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hsReactionThermo/makeHsReactionThermo.H @@ -25,8 +25,6 @@ License InClass Foam::hReactionThermo -Description - \*---------------------------------------------------------------------------*/ #ifndef makeReactionThermo_H From 7aa1f5ef43569883034581605af60d3879d15854 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Feb 2010 17:03:00 +0000 Subject: [PATCH 08/29] ENH: Updated chemistry models to use sensible enthalpy thermo --- .../chemistryModel/ODEChemistryModel/ODEChemistryModel.H | 4 +++- .../chemistryModel/ODEChemistryModel/ODEChemistryModelI.H | 1 + .../chemistryModel/psiChemistryModel/psiChemistryModel.C | 2 +- .../chemistryModel/psiChemistryModel/psiChemistryModel.H | 8 ++++---- .../chemistryModel/psiChemistryModel/psiChemistryModelI.H | 4 ++-- .../chemistryModel/rhoChemistryModel/rhoChemistryModel.C | 2 +- .../chemistryModel/rhoChemistryModel/rhoChemistryModel.H | 8 ++++---- .../chemistryModel/rhoChemistryModel/rhoChemistryModelI.H | 4 ++-- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H index 6a5820ff19..05e0d08e64 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H @@ -39,9 +39,9 @@ SourceFiles #ifndef ODEChemistryModel_H #define ODEChemistryModel_H -#include "hCombustionThermo.H" #include "Reaction.H" #include "ODE.H" +#include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,6 +49,8 @@ namespace Foam { // Forward declaration of classes +class fvMesh; + template class chemistrySolver; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H index b5264a28d4..e73f325bff 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ +#include "volFields.H" #include "zeroGradientFvPatchFields.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C index 7381d12a1d..11978f2ddb 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C @@ -45,7 +45,7 @@ Foam::psiChemistryModel::psiChemistryModel ) : basicChemistryModel(mesh), - thermo_(hCombustionThermo::NewType(mesh, thermoTypeName)) + thermo_(hsCombustionThermo::NewType(mesh, thermoTypeName)) {} diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H index 4cf7af58ec..617d627aab 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H @@ -41,7 +41,7 @@ SourceFiles #include "basicChemistryModel.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" -#include "hCombustionThermo.H" +#include "hsCombustionThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,7 +73,7 @@ protected: // Protected data //- Thermo package - autoPtr thermo_; + autoPtr thermo_; public: @@ -114,10 +114,10 @@ public: // Member Functions //- Return access to the thermo package - inline hCombustionThermo& thermo(); + inline hsCombustionThermo& thermo(); //- Return const access to the thermo package - inline const hCombustionThermo& thermo() const; + inline const hsCombustionThermo& thermo() const; }; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H index a6122b8b68..bea7731228 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H @@ -26,13 +26,13 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() +inline Foam::hsCombustionThermo& Foam::psiChemistryModel::thermo() { return thermo_(); } -inline const Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() const +inline const Foam::hsCombustionThermo& Foam::psiChemistryModel::thermo() const { return thermo_(); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C index 73a3f00e9c..9684adaf77 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C @@ -45,7 +45,7 @@ Foam::rhoChemistryModel::rhoChemistryModel ) : basicChemistryModel(mesh), - thermo_(hReactionThermo::NewType(mesh, thermoTypeName)) + thermo_(hsReactionThermo::NewType(mesh, thermoTypeName)) {} diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H index 8991f250f9..4f22904b8f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H @@ -41,7 +41,7 @@ SourceFiles #include "basicChemistryModel.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" -#include "hReactionThermo.H" +#include "hsReactionThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,7 +73,7 @@ protected: // Protected data //- Thermo package - autoPtr thermo_; + autoPtr thermo_; public: @@ -114,10 +114,10 @@ public: // Member Functions //- Return access to the thermo package - inline hReactionThermo& thermo(); + inline hsReactionThermo& thermo(); //- Return const access to the thermo package - inline const hReactionThermo& thermo() const; + inline const hsReactionThermo& thermo() const; }; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H index d96171001b..cff2455ebc 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H @@ -26,13 +26,13 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() +inline Foam::hsReactionThermo& Foam::rhoChemistryModel::thermo() { return thermo_(); } -inline const Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() const +inline const Foam::hsReactionThermo& Foam::rhoChemistryModel::thermo() const { return thermo_(); } From 34cd4b9310d4fbb683a36558cd2ce32296005b06 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Feb 2010 17:03:46 +0000 Subject: [PATCH 09/29] ENH: updated options file for fireFoam solver --- applications/solvers/combustion/fireFoam/Make/options | 4 ---- 1 file changed, 4 deletions(-) diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index 07d596f7f0..3b19a78173 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -1,7 +1,5 @@ EXE_INC = \ -I./combustionModels/lnInclude \ - -I./sensibleEnthalpyCombustionThermophysicalModels/basic/lnInclude \ - -I./sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ @@ -11,8 +9,6 @@ EXE_INC = \ EXE_LIBS = \ - -lbasicSensibleEnthalpyThermophysicalModels \ - -lreactionSensibleEnthalpyThermophysicalModels \ -lcombustionModels \ -lspecie \ -lreactionThermophysicalModels \ From 76036b5d8be84ba9336c7acc8dd91be780688c3b Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 11 Feb 2010 17:04:23 +0000 Subject: [PATCH 10/29] STYLE: newline at 80 chars --- src/lagrangian/dieselSpray/parcel/parcel.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index c091325845..080e1b9bf6 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -616,7 +616,8 @@ void Foam::parcel::updateParcelProperties { if (n>100) { - Info<< "n = " << n << ", T = " << Td << ", pv = " << pAtSurface << endl; + Info<< "n = " << n << ", T = " << Td << ", pv = " + << pAtSurface << endl; } } } From bd58fa5322c89790a8cd4c17a132ac1c3a4bc936 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 12 Feb 2010 12:45:00 +0000 Subject: [PATCH 11/29] BUG: globalMeshData::mergePoints was assuming patch was on master processor. Each collocated set of coupled points has a single master assigned to it. However when doing mergePoints on a patch the master does not have to be on the patch. So now it returns mesh point labels, not patch point labels. --- .../foamToEnsight/ensightMesh.C | 17 +- .../polyMesh/globalMeshData/globalMeshData.C | 224 +++++++++++------- .../polyMesh/globalMeshData/globalMeshData.H | 8 +- 3 files changed, 155 insertions(+), 94 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 4542a60f2b..19920b008a 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -30,13 +30,10 @@ License #include "fvMesh.H" #include "globalMeshData.H" #include "PstreamCombineReduceOps.H" -#include "processorPolyPatch.H" #include "cellModeller.H" #include "IOmanip.H" #include "itoa.H" #include "ensightWriteBinary.H" -#include "globalIndex.H" -#include "PackedBoolList.H" #include "mapDistribute.H" #include @@ -1345,17 +1342,18 @@ void Foam::ensightMesh::writeAscii // Renumber the patch points/faces into unique points labelList pointToGlobal; - labelList uniquePointLabels; + labelList uniqueMeshPointLabels; autoPtr globalPointsPtr = mesh_.globalData().mergePoints ( p.meshPoints(), p.meshPointMap(), pointToGlobal, - uniquePointLabels + uniqueMeshPointLabels ); - pointField uniquePoints(p.localPoints(), uniquePointLabels); + + pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels); // Renumber the patch faces faceList patchFaces(p.localFaces()); forAll(patchFaces, i) @@ -1598,16 +1596,17 @@ void Foam::ensightMesh::writeBinary // Renumber the patch points/faces into unique points labelList pointToGlobal; - labelList uniquePointLabels; + labelList uniqueMeshPointLabels; autoPtr globalPointsPtr = mesh_.globalData().mergePoints ( p.meshPoints(), p.meshPointMap(), pointToGlobal, - uniquePointLabels + uniqueMeshPointLabels ); - pointField uniquePoints(p.localPoints(), uniquePointLabels); + + pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels); // Renumber the patch faces faceList patchFaces(p.localFaces()); forAll(patchFaces, i) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index f5afcad872..6f9f311d11 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -1705,7 +1705,7 @@ Foam::autoPtr Foam::globalMeshData::mergePoints const labelList& meshPoints, const Map