From fdd659bd7750a6528c999879f9aa9c91c5bc0ca0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 22 Jan 2013 17:07:17 +0000 Subject: [PATCH 1/8] ENH: extrudeToRegionMesh: extrude patchFaceCentres, patchEdgeCentres --- .../extrude/extrudeToRegionMesh/Make/options | 2 + .../extrudeToRegionMesh/extrudeToRegionMesh.C | 279 +++++++++++++++++- 2 files changed, 280 insertions(+), 1 deletion(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options index 9a1bd9942c..49cad25f21 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/Make/options @@ -1,10 +1,12 @@ EXE_INC = \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/mesh/extrudeModel/lnInclude EXE_LIBS = \ + -lsurfMesh \ -lfiniteVolume \ -lmeshTools \ -ldynamicMesh \ diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index b159f9c096..79c295e0eb 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,6 +133,7 @@ Notes: #include "pointFields.H" //#include "ReadFields.H" #include "fvMeshTools.H" +#include "OBJstream.H" using namespace Foam; @@ -1233,6 +1234,252 @@ void setCouplingInfo } +// Extrude and write geometric properties +void extrudeGeometricProperties +( + const polyMesh& mesh, + const primitiveFacePatch& extrudePatch, + const createShellMesh& extruder, + const polyMesh& regionMesh, + const extrudeModel& model +) +{ + const pointIOField patchFaceCentres + ( + IOobject + ( + "patchFaceCentres", + mesh.pointsInstance(), + mesh.meshSubDir, + mesh, + IOobject::MUST_READ + ) + ); + + const pointIOField patchEdgeCentres + ( + IOobject + ( + "patchEdgeCentres", + mesh.pointsInstance(), + mesh.meshSubDir, + mesh, + IOobject::MUST_READ + ) + ); + + //forAll(extrudePatch.edges(), edgeI) + //{ + // const edge& e = extrudePatch.edges()[edgeI]; + // Pout<< "Edge:" << e.centre(extrudePatch.localPoints()) << nl + // << "read:" << patchEdgeCentres[edgeI] + // << endl; + //} + + + // Determine edge normals on original patch + labelList patchEdges; + labelList coupledEdges; + PackedBoolList sameEdgeOrientation; + PatchTools::matchEdges + ( + extrudePatch, + mesh.globalData().coupledPatch(), + patchEdges, + coupledEdges, + sameEdgeOrientation + ); + + pointField patchEdgeNormals + ( + PatchTools::edgeNormals + ( + mesh, + extrudePatch, + patchEdges, + coupledEdges + ) + ); + + + pointIOField faceCentres + ( + IOobject + ( + "faceCentres", + regionMesh.pointsInstance(), + regionMesh.meshSubDir, + regionMesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + regionMesh.nFaces() + ); + + + // Work out layers. Guaranteed in columns so no fancy parallel bits. + + + forAll(extruder.faceToFaceMap(), faceI) + { + if (extruder.faceToFaceMap()[faceI] != 0) + { + // 'horizontal' face + label patchFaceI = mag(extruder.faceToFaceMap()[faceI])-1; + + label cellI = regionMesh.faceOwner()[faceI]; + if (regionMesh.isInternalFace(faceI)) + { + cellI = max(cellI, regionMesh.faceNeighbour()[faceI]); + } + + // Calculate layer from cell numbering (see createShellMesh) + label layerI = (cellI % model.nLayers()); + + if + ( + !regionMesh.isInternalFace(faceI) + && extruder.faceToFaceMap()[faceI] > 0 + ) + { + // Top face + layerI++; + } + + + // Recalculate based on extrusion model + faceCentres[faceI] = model + ( + patchFaceCentres[patchFaceI], + extrudePatch.faceNormals()[patchFaceI], + layerI + ); + } + else + { + // 'vertical face + label patchEdgeI = extruder.faceToEdgeMap()[faceI]; + label layerI = + ( + regionMesh.faceOwner()[faceI] + % model.nLayers() + ); + + // Extrude patch edge centre to this layer + point pt0 = model + ( + patchEdgeCentres[patchEdgeI], + patchEdgeNormals[patchEdgeI], + layerI + ); + // Extrude patch edge centre to next layer + point pt1 = model + ( + patchEdgeCentres[patchEdgeI], + patchEdgeNormals[patchEdgeI], + layerI+1 + ); + + // Interpolate + faceCentres[faceI] = 0.5*(pt0+pt1); + } + } + + pointIOField cellCentres + ( + IOobject + ( + "cellCentres", + regionMesh.pointsInstance(), + regionMesh.meshSubDir, + regionMesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + regionMesh.nCells() + ); + + forAll(extruder.cellToFaceMap(), cellI) + { + label patchFaceI = extruder.cellToFaceMap()[cellI]; + + // Calculate layer from cell numbering (see createShellMesh) + label layerI = (cellI % model.nLayers()); + + // Recalculate based on extrusion model + point pt0 = model + ( + patchFaceCentres[patchFaceI], + extrudePatch.faceNormals()[patchFaceI], + layerI + ); + point pt1 = model + ( + patchFaceCentres[patchFaceI], + extrudePatch.faceNormals()[patchFaceI], + layerI+1 + ); + + // Interpolate + cellCentres[cellI] = 0.5*(pt0+pt1); + } + + + // Bit of checking + if (false) + { + OBJstream faceStr(regionMesh.time().path()/"faceCentres.obj"); + OBJstream cellStr(regionMesh.time().path()/"cellCentres.obj"); + + forAll(faceCentres, faceI) + { + Pout<< "Model :" << faceCentres[faceI] << endl + << "regionMesh:" << regionMesh.faceCentres()[faceI] << endl; + faceStr.write + ( + linePointRef + ( + faceCentres[faceI], + regionMesh.faceCentres()[faceI] + ) + ); + } + forAll(cellCentres, cellI) + { + Pout<< "Model :" << cellCentres[cellI] << endl + << "regionMesh:" << regionMesh.cellCentres()[cellI] << endl; + cellStr.write + ( + linePointRef + ( + cellCentres[cellI], + regionMesh.cellCentres()[cellI] + ) + ); + } + } + + + + Info<< "Writing geometric properties for mesh " << regionMesh.name() + << " to " << regionMesh.pointsInstance() << nl + << endl; + + bool ok = faceCentres.write() && cellCentres.write(); + + if (!ok) + { + FatalErrorIn("extrudeGeometricProperties(..)") + << "Failed writing " << faceCentres.objectPath() + << " and " << cellCentres.objectPath() + << exit(FatalError); + } +} + + + // Main program: int main(int argc, char *argv[]) @@ -2393,6 +2640,36 @@ int main(int argc, char *argv[]) } + // See if we need to extrude coordinates as well + { + autoPtr patchFaceCentresPtr; + + IOobject io + ( + "patchFaceCentres", + mesh.pointsInstance(), + mesh.meshSubDir, + mesh, + IOobject::MUST_READ + ); + if (io.headerOk()) + { + // Read patchFaceCentres and patchEdgeCentres + Info<< "Reading patch face,edge centres : " + << io.name() << " and patchEdgeCentres" << endl; + + extrudeGeometricProperties + ( + mesh, + extrudePatch, + extruder, + regionMesh, + model() + ); + } + } + + // Insert baffles into original mesh From 4511f96d6db807cc98b3735872d8c5caad67655c Mon Sep 17 00:00:00 2001 From: sergio Date: Fri, 25 Jan 2013 14:45:27 +0000 Subject: [PATCH 2/8] ENH: Adding thermoPhysicsTypes for sensibleInternalEnergy and instanciating reactionThermos, Reactions, chemistrySolver solidChemistrySolvers and readers. chemkinReader uses the sensibleEnthalpy base of thermoType --- src/combustionModels/FSD/FSDs.C | 44 +++++- src/combustionModels/diffusion/diffusions.C | 45 +++++- .../infinitelyFastChemistrys.C | 46 +++++- .../psiChemistryModel/psiChemistryModels.C | 49 ++++++- .../rhoChemistryModel/rhoChemistryModels.C | 50 ++++++- .../chemistrySolver/makeChemistrySolvers.C | 59 ++++++-- .../chemistryReader/makeChemistryReaders.C | 53 +++++-- .../chemkinReader/chemkinLexer.L | 18 +-- .../chemkinReader/chemkinReader.C | 36 ++--- .../chemkinReader/chemkinReader.H | 24 ++-- .../psiReactionThermo/psiReactionThermos.C | 67 +++++++-- .../rhoReactionThermo/rhoReactionThermos.C | 133 ++++++++++++++++-- .../solidChemistryModels.C | 6 +- .../makeSolidChemistrySolvers.C | 6 +- .../specie/include/reactionTypes.H | 29 +++- .../specie/include/thermoPhysicsTypes.H | 84 ++++++++++- .../makeLangmuirHinshelwoodReactions.C | 9 +- .../specie/reaction/reactions/makeReactions.C | 25 +++- 18 files changed, 643 insertions(+), 140 deletions(-) diff --git a/src/combustionModels/FSD/FSDs.C b/src/combustionModels/FSD/FSDs.C index 4ee6d7bb36..aed10a40a1 100644 --- a/src/combustionModels/FSD/FSDs.C +++ b/src/combustionModels/FSD/FSDs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,11 +38,12 @@ namespace Foam { namespace combustionModels { + // Combustion models based on sensibleEnthalpy makeCombustionTypesThermo ( FSD, psiThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, psiCombustionModel ); @@ -50,7 +51,7 @@ namespace combustionModels ( FSD, psiThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, psiCombustionModel ); @@ -58,7 +59,7 @@ namespace combustionModels ( FSD, rhoThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, rhoCombustionModel ); @@ -66,7 +67,40 @@ namespace combustionModels ( FSD, rhoThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, + rhoCombustionModel + ); + + // Combustion models based on sensibleInternalEnergy + makeCombustionTypesThermo + ( + FSD, + psiThermoCombustion, + gasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + psiThermoCombustion, + constGasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + rhoThermoCombustion, + gasEThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + FSD, + rhoThermoCombustion, + constGasEThermoPhysics, rhoCombustionModel ); } diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C index 73c201f0fc..0376a91bf9 100644 --- a/src/combustionModels/diffusion/diffusions.C +++ b/src/combustionModels/diffusion/diffusions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,11 +36,12 @@ namespace Foam { namespace combustionModels { + // Combustion models based on sensibleEnthalpy makeCombustionTypesThermo ( diffusion, psiThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, psiCombustionModel ); @@ -48,7 +49,7 @@ namespace combustionModels ( diffusion, psiThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, psiCombustionModel ); @@ -56,7 +57,7 @@ namespace combustionModels ( diffusion, rhoThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, rhoCombustionModel ); @@ -64,7 +65,41 @@ namespace combustionModels ( diffusion, rhoThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, + rhoCombustionModel + ); + + // Combustion models based on sensibleInternalEnergy + + makeCombustionTypesThermo + ( + diffusion, + psiThermoCombustion, + gasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + psiThermoCombustion, + constGasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + rhoThermoCombustion, + gasEThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + rhoThermoCombustion, + constGasEThermoPhysics, rhoCombustionModel ); } diff --git a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C index b8a48ed0ce..89ea70d85c 100644 --- a/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C +++ b/src/combustionModels/infinitelyFastChemistry/infinitelyFastChemistrys.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,11 +36,13 @@ namespace Foam { namespace combustionModels { + // Combustion models based on sensibleEnthalpy + makeCombustionTypesThermo ( infinitelyFastChemistry, psiThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, psiCombustionModel ); @@ -48,7 +50,7 @@ namespace combustionModels ( infinitelyFastChemistry, psiThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, psiCombustionModel ); @@ -56,7 +58,7 @@ namespace combustionModels ( infinitelyFastChemistry, rhoThermoCombustion, - gasThermoPhysics, + gasHThermoPhysics, rhoCombustionModel ); @@ -64,7 +66,41 @@ namespace combustionModels ( infinitelyFastChemistry, rhoThermoCombustion, - constGasThermoPhysics, + constGasHThermoPhysics, + rhoCombustionModel + ); + + // Combustion models based on sensibleInternalEnergy + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + psiThermoCombustion, + gasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + psiThermoCombustion, + constGasEThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + rhoThermoCombustion, + gasEThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + infinitelyFastChemistry, + rhoThermoCombustion, + constGasEThermoPhysics, rhoCombustionModel ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C index b4a973a708..62e40e215b 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,39 +39,76 @@ Description namespace Foam { + // Chemistry moldels based on sensibleEnthalpy makeChemistryModel ( chemistryModel, psiChemistryModel, - constGasThermoPhysics + constGasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - gasThermoPhysics + gasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - incompressibleGasThermoPhysics + incompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, psiChemistryModel, - icoPoly8ThermoPhysics + icoPoly8HThermoPhysics + ); + + // Chemistry moldels based on sensibleInternalEnergy + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + constGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + gasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + incompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + psiChemistryModel, + icoPoly8EThermoPhysics ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C index e5be84743c..5ecc84043a 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,39 +39,77 @@ Description namespace Foam { + // Chemistry moldels based on sensibleEnthalpy makeChemistryModel ( chemistryModel, rhoChemistryModel, - constGasThermoPhysics + constGasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - gasThermoPhysics + gasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - incompressibleGasThermoPhysics + incompressibleGasHThermoPhysics ); makeChemistryModel ( chemistryModel, rhoChemistryModel, - icoPoly8ThermoPhysics + icoPoly8HThermoPhysics + ); + + + // Chemistry moldels based on sensibleInternalEnergy + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + constGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + gasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + constIncompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + incompressibleGasEThermoPhysics + ); + + makeChemistryModel + ( + chemistryModel, + rhoChemistryModel, + icoPoly8EThermoPhysics ); } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C index 189d43bdfa..ed2c8c2ba6 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,24 +33,61 @@ License namespace Foam { - makeChemistrySolverTypes(psiChemistryModel, constGasThermoPhysics); - makeChemistrySolverTypes(psiChemistryModel, gasThermoPhysics); + // Chemistry solvers based on sensibleEnthalpy + makeChemistrySolverTypes(psiChemistryModel, constGasHThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, gasHThermoPhysics); makeChemistrySolverTypes ( psiChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); - makeChemistrySolverTypes(psiChemistryModel, incompressibleGasThermoPhysics); - makeChemistrySolverTypes(psiChemistryModel, icoPoly8ThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, constGasThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, gasThermoPhysics); + makeChemistrySolverTypes + ( + psiChemistryModel, + incompressibleGasHThermoPhysics) + ; + makeChemistrySolverTypes(psiChemistryModel, icoPoly8HThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, constGasHThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, gasHThermoPhysics); makeChemistrySolverTypes ( rhoChemistryModel, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); - makeChemistrySolverTypes(rhoChemistryModel, incompressibleGasThermoPhysics); - makeChemistrySolverTypes(rhoChemistryModel, icoPoly8ThermoPhysics); + makeChemistrySolverTypes + ( + rhoChemistryModel, + incompressibleGasHThermoPhysics + ); + makeChemistrySolverTypes(rhoChemistryModel, icoPoly8HThermoPhysics); + + // Chemistry solvers based on sensibleInternalEnergy + makeChemistrySolverTypes(psiChemistryModel, constGasEThermoPhysics); + makeChemistrySolverTypes(psiChemistryModel, gasEThermoPhysics); + makeChemistrySolverTypes + ( + psiChemistryModel, + constIncompressibleGasEThermoPhysics + ); + makeChemistrySolverTypes + ( + psiChemistryModel, + incompressibleGasEThermoPhysics + ); + makeChemistrySolverTypes(psiChemistryModel, icoPoly8EThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, constGasEThermoPhysics); + makeChemistrySolverTypes(rhoChemistryModel, gasEThermoPhysics); + makeChemistrySolverTypes + ( + rhoChemistryModel, + constIncompressibleGasEThermoPhysics + ); + makeChemistrySolverTypes + ( + rhoChemistryModel, + incompressibleGasEThermoPhysics + ); + makeChemistrySolverTypes(rhoChemistryModel, icoPoly8EThermoPhysics); } diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index b7474a9faf..b90e447c0b 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,23 +37,50 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makeChemistryReader(constGasThermoPhysics); -makeChemistryReader(gasThermoPhysics); -makeChemistryReader(constIncompressibleGasThermoPhysics); -makeChemistryReader(incompressibleGasThermoPhysics); -makeChemistryReader(icoPoly8ThermoPhysics); -makeChemistryReader(hConstSolidThermoPhysics); -makeChemistryReader(hExponentialSolidThermoPhysics); +// Solid chemistry readers based on sensibleEnthalpy -makeChemistryReaderType(foamChemistryReader, constGasThermoPhysics); -makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); +makeChemistryReader(constGasHThermoPhysics); +makeChemistryReader(gasHThermoPhysics); +makeChemistryReader(constIncompressibleGasHThermoPhysics); +makeChemistryReader(incompressibleGasHThermoPhysics); +makeChemistryReader(icoPoly8HThermoPhysics); + +makeChemistryReaderType(foamChemistryReader, constGasHThermoPhysics); +makeChemistryReaderType(foamChemistryReader, gasHThermoPhysics); makeChemistryReaderType ( foamChemistryReader, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); -makeChemistryReaderType(foamChemistryReader, incompressibleGasThermoPhysics); -makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); +makeChemistryReaderType(foamChemistryReader, incompressibleGasHThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8HThermoPhysics); + + + +// Solid chemistry readers based on sensibleInternalEnergy + +makeChemistryReader(constGasEThermoPhysics); +makeChemistryReader(gasEThermoPhysics); +makeChemistryReader(constIncompressibleGasEThermoPhysics); +makeChemistryReader(incompressibleGasEThermoPhysics); +makeChemistryReader(icoPoly8EThermoPhysics); + +makeChemistryReaderType(foamChemistryReader, constGasEThermoPhysics); +makeChemistryReaderType(foamChemistryReader, gasEThermoPhysics); +makeChemistryReaderType +( + foamChemistryReader, + constIncompressibleGasEThermoPhysics +); +makeChemistryReaderType(foamChemistryReader, incompressibleGasEThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8EThermoPhysics); + + +// Solid chemistry readers for solids based on sensibleInternalEnergy + +makeChemistryReader(hConstSolidThermoPhysics); +makeChemistryReader(hExponentialSolidThermoPhysics); + makeChemistryReaderType(foamChemistryReader, hConstSolidThermoPhysics); makeChemistryReaderType(foamChemistryReader, hExponentialSolidThermoPhysics); diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L index c0cce76a2a..678300a172 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L @@ -296,13 +296,13 @@ List currentSpecieComposition(5); scalar currentLowT = 0; scalar currentHighT = 0; scalar currentCommonT = 0; -gasThermoPhysics::coeffArray highCpCoeffs(scalarList(7)); -gasThermoPhysics::coeffArray lowCpCoeffs(scalarList(7)); +gasHThermoPhysics::coeffArray highCpCoeffs(scalarList(7)); +gasHThermoPhysics::coeffArray lowCpCoeffs(scalarList(7)); -gasReaction::specieCoeffs currentSpecieCoeff; +gasHReaction::specieCoeffs currentSpecieCoeff; -DynamicList lhs; -DynamicList rhs; +DynamicList lhs; +DynamicList rhs; scalarList ArrheniusCoeffs(3); DynamicList reactionCoeffs; @@ -312,7 +312,7 @@ label currentThirdBodyIndex = -1; word reactionCoeffsName = word::null; HashTable reactionCoeffsTable; -DynamicList *lrhsPtr = &lhs; +DynamicList *lrhsPtr = &lhs; reactionType rType = unknownReactionType; reactionRateType rrType = Arrhenius; @@ -609,7 +609,7 @@ bool finishReaction = false; {thermoLineLabel4} { - HashPtrTable::iterator specieThermoIter + HashPtrTable::iterator specieThermoIter ( speciesThermo_.find(currentSpecieName) ); @@ -622,7 +622,7 @@ bool finishReaction = false; speciesThermo_.insert ( currentSpecieName, - new gasThermoPhysics + new gasHThermoPhysics ( janafThermo > ( @@ -1429,7 +1429,7 @@ bool finishReaction = false; {reactionCoeff}{endReactionCoeffs} { - DynamicList& lrhs = *lrhsPtr; + DynamicList& lrhs = *lrhsPtr; bool found = false; diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index 922c1227b9..5ee2a03ac3 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ License namespace Foam { - addChemistryReaderType(chemkinReader, gasThermoPhysics); + addChemistryReaderType(chemkinReader, gasHThermoPhysics); } @@ -168,8 +168,8 @@ template void Foam::chemkinReader::addReactionType ( const reactionType rType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const ReactionRateType& rr ) { @@ -180,9 +180,9 @@ void Foam::chemkinReader::addReactionType reactions_.append ( new IrreversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -200,9 +200,9 @@ void Foam::chemkinReader::addReactionType reactions_.append ( new ReversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -240,8 +240,8 @@ void Foam::chemkinReader::addPressureDependentReaction ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& efficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -423,8 +423,8 @@ void Foam::chemkinReader::addPressureDependentReaction void Foam::chemkinReader::addReaction ( - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& efficiencies, const reactionType rType, const reactionRateType rrType, @@ -499,9 +499,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -554,11 +554,11 @@ void Foam::chemkinReader::addReaction new NonEquilibriumReversibleReaction < Reaction, - gasThermoPhysics, + gasHThermoPhysics, thirdBodyArrheniusReactionRate > ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), @@ -661,9 +661,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - + ( - Reaction + Reaction ( speciesTable_, lhs.shrink(), diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index 6e0d4dc5c1..4cd84f59a5 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ namespace Foam class chemkinReader : - public chemistryReader, + public chemistryReader, public yyFlexLexer { @@ -199,13 +199,13 @@ private: HashTable speciePhase_; //- Table of the thermodynamic data given in the CHEMKIN file - HashPtrTable speciesThermo_; + HashPtrTable speciesThermo_; //- Table of species composition HashTable > specieComposition_; //- List of the reactions - ReactionList reactions_; + ReactionList reactions_; // Private Member Functions @@ -257,8 +257,8 @@ private: void addReactionType ( const reactionType rType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const ReactionRateType& rr ); @@ -267,8 +267,8 @@ private: ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& thirdBodyEfficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -280,8 +280,8 @@ private: void addReaction ( - DynamicList& lhs, - DynamicList& rhs, + DynamicList& lhs, + DynamicList& rhs, const scalarList& thirdBodyEfficiencies, const reactionType rType, const reactionRateType rrType, @@ -364,7 +364,7 @@ public: } //- Table of the thermodynamic data given in the CHEMKIN file - const HashPtrTable& speciesThermo() const + const HashPtrTable& speciesThermo() const { return speciesThermo_; } @@ -376,7 +376,7 @@ public: } //- List of the reactions - const ReactionList& reactions() const + const ReactionList& reactions() const { return reactions_; } diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C index 4e65f3a24c..ed1e0abf81 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,7 +179,7 @@ makeReactionThermo ); -// Multi-component thermo +// Multi-component thermo for sensible enthalpy makeReactionMixtureThermo ( @@ -187,7 +187,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, multiComponentMixture, - constGasThermoPhysics + constGasHThermoPhysics ); makeReactionMixtureThermo @@ -196,11 +196,32 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, multiComponentMixture, - gasThermoPhysics + gasHThermoPhysics ); -// Multi-component reaction thermo +// Multi-component thermo for internal energy + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + multiComponentMixture, + constGasEThermoPhysics +); + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + multiComponentMixture, + gasEThermoPhysics +); + + +// Multi-component reaction thermo for sensible enthalpy makeReactionMixtureThermo ( @@ -208,7 +229,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, reactingMixture, - constGasThermoPhysics + constGasHThermoPhysics ); makeReactionMixtureThermo @@ -217,7 +238,7 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, reactingMixture, - gasThermoPhysics + gasHThermoPhysics ); makeReactionMixtureThermo @@ -226,7 +247,37 @@ makeReactionMixtureThermo psiReactionThermo, hePsiThermo, singleStepReactingMixture, - gasThermoPhysics + gasHThermoPhysics +); + + +// Multi-component reaction thermo for internal energy + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + reactingMixture, + constGasEThermoPhysics +); + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + reactingMixture, + gasEThermoPhysics +); + +makeReactionMixtureThermo +( + psiThermo, + psiReactionThermo, + hePsiThermo, + singleStepReactingMixture, + gasEThermoPhysics ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C index 6dbf589bce..a6a880ca76 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -213,7 +213,7 @@ makeReactionThermo ); -// Multi-component thermo +// Multi-component thermo for internal energy makeReactionMixtureThermo ( @@ -221,7 +221,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - constGasThermoPhysics + constGasEThermoPhysics ); makeReactionMixtureThermo @@ -230,7 +230,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - gasThermoPhysics + gasEThermoPhysics ); makeReactionMixtureThermo @@ -239,7 +239,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - constIncompressibleGasThermoPhysics + constIncompressibleGasEThermoPhysics ); makeReactionMixtureThermo @@ -248,7 +248,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - incompressibleGasThermoPhysics + incompressibleGasEThermoPhysics ); makeReactionMixtureThermo @@ -257,7 +257,114 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, multiComponentMixture, - icoPoly8ThermoPhysics + icoPoly8EThermoPhysics +); + + + // Multi-component reaction thermo + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constGasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + gasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + constIncompressibleGasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + incompressibleGasEThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + reactingMixture, + icoPoly8EThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + singleStepReactingMixture, + gasEThermoPhysics +); + + + + +// Multi-component thermo for sensible enthalpy + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + constGasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + gasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + constIncompressibleGasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + incompressibleGasHThermoPhysics +); + +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + icoPoly8HThermoPhysics ); @@ -269,7 +376,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - constGasThermoPhysics + constGasHThermoPhysics ); makeReactionMixtureThermo @@ -278,7 +385,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - gasThermoPhysics + gasHThermoPhysics ); makeReactionMixtureThermo @@ -287,7 +394,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - constIncompressibleGasThermoPhysics + constIncompressibleGasHThermoPhysics ); makeReactionMixtureThermo @@ -296,7 +403,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - incompressibleGasThermoPhysics + incompressibleGasHThermoPhysics ); makeReactionMixtureThermo @@ -305,7 +412,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, reactingMixture, - icoPoly8ThermoPhysics + icoPoly8HThermoPhysics ); makeReactionMixtureThermo @@ -314,7 +421,7 @@ makeReactionMixtureThermo rhoReactionThermo, heRhoThermo, singleStepReactingMixture, - gasThermoPhysics + gasHThermoPhysics ); diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C index 104fa11a7d..d51976f196 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ namespace Foam ODESolidChemistryModel, solidChemistryModel, hConstSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ); makeSolidChemistryModel @@ -54,7 +54,7 @@ namespace Foam ODESolidChemistryModel, solidChemistryModel, hExponentialSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ); } diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C index 9c8a6df052..3b6f13f486 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolvers.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ namespace Foam ode, solidChemistryModel, hConstSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ) makeSolidChemistrySolverType @@ -49,7 +49,7 @@ namespace Foam ode, solidChemistryModel, hExponentialSolidThermoPhysics, - gasThermoPhysics + gasHThermoPhysics ) } diff --git a/src/thermophysicalModels/specie/include/reactionTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H index 8b0a5f20d5..e6af91d896 100644 --- a/src/thermophysicalModels/specie/include/reactionTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,16 +43,31 @@ Description namespace Foam { - typedef Reaction constGasReaction; + // sensible enthalpy based reactions + typedef Reaction constGasHReaction; - typedef Reaction gasReaction; + typedef Reaction gasHReaction; - typedef Reaction - constIncompressibleGasReaction; + typedef Reaction + constIncompressibleGasHReaction; - typedef Reaction incompressibleGasReaction; + typedef Reaction + incompressibleGasHReaction; - typedef Reaction icoPoly8Reaction; + typedef Reaction icoPoly8HReaction; + + // internal ennergy based reactions + typedef Reaction constGasEReaction; + + typedef Reaction gasEReaction; + + typedef Reaction + constIncompressibleGasEReaction; + + typedef Reaction + incompressibleGasEReaction; + + typedef Reaction icoPoly8EReaction; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index a3a276b926..cb17a56a14 100644 --- a/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,9 @@ Description #include "incompressiblePerfectGas.H" #include "hConstThermo.H" #include "janafThermo.H" + #include "sensibleEnthalpy.H" +#include "sensibleInternalEnergy.H" #include "thermo.H" #include "sutherlandTransport.H" #include "constTransport.H" @@ -50,6 +52,7 @@ Description namespace Foam { + // thermo physics types based on sensibleEnthalpy typedef constTransport < @@ -61,7 +64,7 @@ namespace Foam >, sensibleEnthalpy > - > constGasThermoPhysics; + > constGasHThermoPhysics; typedef sutherlandTransport @@ -74,7 +77,7 @@ namespace Foam >, sensibleEnthalpy > - > gasThermoPhysics; + > gasHThermoPhysics; typedef constTransport @@ -87,7 +90,7 @@ namespace Foam >, sensibleEnthalpy > - > constIncompressibleGasThermoPhysics; + > constIncompressibleGasHThermoPhysics; typedef sutherlandTransport @@ -100,7 +103,7 @@ namespace Foam >, sensibleEnthalpy > - > incompressibleGasThermoPhysics; + > incompressibleGasHThermoPhysics; typedef polynomialTransport @@ -115,7 +118,76 @@ namespace Foam sensibleEnthalpy >, 8 - > icoPoly8ThermoPhysics; + > icoPoly8HThermoPhysics; + + + // thermo physics types based on sensibleInternalEnergy + typedef + constTransport + < + species::thermo + < + hConstThermo + < + perfectGas + >, + sensibleInternalEnergy + > + > constGasEThermoPhysics; + + typedef + sutherlandTransport + < + species::thermo + < + janafThermo + < + perfectGas + >, + sensibleInternalEnergy + > + > gasEThermoPhysics; + + typedef + constTransport + < + species::thermo + < + hConstThermo + < + incompressiblePerfectGas + >, + sensibleInternalEnergy + > + > constIncompressibleGasEThermoPhysics; + + typedef + sutherlandTransport + < + species::thermo + < + janafThermo + < + incompressiblePerfectGas + >, + sensibleInternalEnergy + > + > incompressibleGasEThermoPhysics; + + typedef + polynomialTransport + < + species::thermo + < + hPolynomialThermo + < + icoPolynomial, + 8 + >, + sensibleInternalEnergy + >, + 8 + > icoPoly8EThermoPhysics; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C index 6f98a4bc35..b5d8c0ad1d 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,11 @@ License namespace Foam { - makeIRReactions(gasThermoPhysics, LangmuirHinshelwoodReactionRate) - makeIRReactions(icoPoly8ThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(gasHThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(icoPoly8HThermoPhysics, LangmuirHinshelwoodReactionRate) + + makeIRReactions(gasEThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(icoPoly8EThermoPhysics, LangmuirHinshelwoodReactionRate) } // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C index ff13e68b69..4dfd73d6a0 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,15 +83,26 @@ License namespace Foam { - makeReactions(constGasThermoPhysics, constGasReaction) - makeReactions(gasThermoPhysics, gasReaction) + // sensible enthalpy based reactions + makeReactions(constGasHThermoPhysics, constGasHReaction) + makeReactions(gasHThermoPhysics, gasHReaction) makeReactions ( - constIncompressibleGasThermoPhysics, - constIncompressibleGasReaction + constIncompressibleGasHThermoPhysics, + constIncompressibleGasHReaction ) - makeReactions(incompressibleGasThermoPhysics, incompressibleGasReaction) - makeReactions(icoPoly8ThermoPhysics, icoPoly8Reaction) + makeReactions(incompressibleGasHThermoPhysics, incompressibleGasHReaction) + makeReactions(icoPoly8HThermoPhysics, icoPoly8HReaction) + + makeReactions(constGasEThermoPhysics, constGasEReaction) + makeReactions(gasEThermoPhysics, gasEReaction) + makeReactions + ( + constIncompressibleGasEThermoPhysics, + constIncompressibleGasEReaction + ) + makeReactions(incompressibleGasEThermoPhysics, incompressibleGasEReaction) + makeReactions(icoPoly8EThermoPhysics, icoPoly8EReaction) } // ************************************************************************* // From cf5317d6bcd0eb90e169b76c3d8124da942b9e73 Mon Sep 17 00:00:00 2001 From: sergio Date: Mon, 28 Jan 2013 10:49:35 +0000 Subject: [PATCH 3/8] ENH: Updating solver chemFoam and fireFoam tutorials to use new naming for gasThermoType based on type of energy solved --- .../solvers/combustion/chemFoam/readInitialConditions.H | 6 +++--- .../les/oppositeBurningPanels/constant/combustionProperties | 2 +- .../les/smallPoolFire2D/constant/combustionProperties | 5 ++--- .../les/smallPoolFire3D/constant/combustionProperties | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/applications/solvers/combustion/chemFoam/readInitialConditions.H b/applications/solvers/combustion/chemFoam/readInitialConditions.H index d929b14128..b25fd944c5 100644 --- a/applications/solvers/combustion/chemFoam/readInitialConditions.H +++ b/applications/solvers/combustion/chemFoam/readInitialConditions.H @@ -15,15 +15,15 @@ } label nSpecie = Y.size(); - PtrList specieData(Y.size()); + PtrList specieData(Y.size()); forAll(specieData, i) { specieData.set ( i, - new gasThermoPhysics + new gasHThermoPhysics ( - dynamic_cast&> + dynamic_cast&> (thermo).speciesData()[i] ) ); diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties index 30c31c7471..643c593447 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/combustionProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel infinitelyFastChemistry; +combustionModel infinitelyFastChemistry; active true; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties index 1576592b91..51e80f82d6 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/combustionProperties @@ -15,9 +15,8 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -//combustionModel noCombustion; -combustionModel infinitelyFastChemistry; -//combustionModel FSD; +combustionModel infinitelyFastChemistry; +//combustionModel FSD; active true; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties index 689dc54c62..cedf34b411 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/combustionProperties @@ -16,7 +16,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel infinitelyFastChemistry; +combustionModel infinitelyFastChemistry; active on; From 2405f213d7728d34c40be7a666b8d00266e782ee Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 28 Jan 2013 14:09:58 +0000 Subject: [PATCH 4/8] BUG: polyTopoChange: sort faces before rotating --- .../polyTopoChange/polyTopoChange/polyTopoChange.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index 12e4ebb6eb..49ee1a445e 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -2052,6 +2052,9 @@ void Foam::polyTopoChange::reorderCoupledFaces if (anyChanged) { + // Reorder faces according to oldToNew. + reorderCompactFaces(oldToNew.size(), oldToNew); + // Rotate faces (rotation is already in new face indices). forAll(rotation, faceI) { @@ -2060,9 +2063,6 @@ void Foam::polyTopoChange::reorderCoupledFaces inplaceRotateList(faces_[faceI], rotation[faceI]); } } - - // Reorder faces according to oldToNew. - reorderCompactFaces(oldToNew.size(), oldToNew); } } From 26f9bc471bb6258d2447e83c180667f4201abbca Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 28 Jan 2013 14:21:23 +0000 Subject: [PATCH 5/8] ENH: extrudeMesh: update to new PatchTools api --- .../extrude/extrudeMesh/extrudeMesh.C | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C index bafe305504..cdd6f52d15 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -383,12 +383,7 @@ int main(int argc, char *argv[]) // Determine extrudePatch normal pointField extrudePatchPointNormals ( - PatchTools::pointNormals //calcNormals - ( - mesh, - extrudePatch, - meshFaces - ) + PatchTools::pointNormals(mesh, extrudePatch) ); @@ -629,12 +624,13 @@ int main(int argc, char *argv[]) const labelListList& layerFaces = layerExtrude.layerFaces(); backPatchFaces.setSize(layerFaces.size()); frontPatchFaces.setSize(layerFaces.size()); - forAll(backPatchFaces, i) + forAll(backPatchFaces, patchFaceI) { - backPatchFaces[i] = layerFaces[i].first(); - frontPatchFaces[i] = layerFaces[i].last(); + backPatchFaces[patchFaceI] = layerFaces[patchFaceI].first(); + frontPatchFaces[patchFaceI] = layerFaces[patchFaceI].last(); } + // Create dummy fvSchemes, fvSolution createDummyFvMeshFiles(mesh, regionDir); @@ -654,6 +650,13 @@ int main(int argc, char *argv[]) mesh ); + layerExtrude.updateMesh + ( + map(), + identity(extrudePatch.size()), + identity(extrudePatch.nPoints()) + ); + // Calculate face labels for front and back. frontPatchFaces = renumber ( From d0cc2813276cb5a0377be6ea8f08d7137080d468 Mon Sep 17 00:00:00 2001 From: laurence Date: Mon, 28 Jan 2013 14:44:59 +0000 Subject: [PATCH 6/8] BUG: static variable initialisation: Cannot rely on other static variables to be initialised when initialising a static variable --- src/OpenFOAM/primitives/triad/triad.C | 43 ++++++++++++++++++++------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/OpenFOAM/primitives/triad/triad.C b/src/OpenFOAM/primitives/triad/triad.C index 2382e2c321..10c77307b4 100644 --- a/src/OpenFOAM/primitives/triad/triad.C +++ b/src/OpenFOAM/primitives/triad/triad.C @@ -32,23 +32,48 @@ License namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - template<> const char* const triad::Vector::typeName = "triad"; template<> const char* triad::Vector::componentNames[] = {"x", "y", "z"}; -const triad triad::zero(vector::zero, vector::zero, vector::zero); +const triad triad::zero +( + vector(0, 0, 0), + vector(0, 0, 0), + vector(0, 0, 0) +); -const triad triad::one(vector::one, vector::one, vector::one); +const triad triad::one +( + vector(1, 1, 1), + vector(1, 1, 1), + vector(1, 1, 1) +); -const triad triad::max(vector::max, vector::max, vector::max); +const triad triad::max +( + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT) +); -const triad triad::min(vector::min, vector::min, vector::min); +const triad triad::min +( + vector(-VGREAT, -VGREAT, -VGREAT), + vector(-VGREAT, -VGREAT, -VGREAT), + vector(-VGREAT, -VGREAT, -VGREAT) +); -const triad triad::unset(triad::max); +const triad triad::unset +( + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT), + vector(VGREAT, VGREAT, VGREAT) +); + +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -348,8 +373,4 @@ void Foam::triad::operator=(const tensor& t) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // From 3eab66f0a6150de6d9f2052079335eac5a4036bb Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 28 Jan 2013 14:58:13 +0000 Subject: [PATCH 7/8] COMP: extrudeToRegionMesh: missing include --- .../generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 79c295e0eb..112de47faf 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -134,6 +134,7 @@ Notes: //#include "ReadFields.H" #include "fvMeshTools.H" #include "OBJstream.H" +#include "PatchTools.H" using namespace Foam; From 0686c5c9b9f4c250201d7561da6e7b138b5805d4 Mon Sep 17 00:00:00 2001 From: laurence Date: Mon, 28 Jan 2013 14:58:25 +0000 Subject: [PATCH 8/8] BUG: static variable initialisation cannot depend on other static variables --- src/OpenFOAM/primitives/quaternion/quaternion.C | 4 ++-- src/OpenFOAM/primitives/septernion/septernion.C | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/primitives/quaternion/quaternion.C b/src/OpenFOAM/primitives/quaternion/quaternion.C index cedbb56c32..8f6bf087a3 100644 --- a/src/OpenFOAM/primitives/quaternion/quaternion.C +++ b/src/OpenFOAM/primitives/quaternion/quaternion.C @@ -30,8 +30,8 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::quaternion::typeName = "quaternion"; -const Foam::quaternion Foam::quaternion::zero(0, vector::zero); -const Foam::quaternion Foam::quaternion::I(1, vector::zero); +const Foam::quaternion Foam::quaternion::zero(0, vector(0, 0, 0)); +const Foam::quaternion Foam::quaternion::I(1, vector(0, 0, 0)); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/septernion/septernion.C b/src/OpenFOAM/primitives/septernion/septernion.C index 4bbdf82802..5a90f8de2d 100644 --- a/src/OpenFOAM/primitives/septernion/septernion.C +++ b/src/OpenFOAM/primitives/septernion/septernion.C @@ -30,8 +30,16 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const char* const Foam::septernion::typeName = "septernion"; -const Foam::septernion Foam::septernion::zero(vector::zero, quaternion::zero); -const Foam::septernion Foam::septernion::I(vector::zero, quaternion::I); +const Foam::septernion Foam::septernion::zero +( + vector(0, 0, 0), + quaternion(0, vector(0, 0, 0)) +); +const Foam::septernion Foam::septernion::I +( + vector(0, 0, 0), + quaternion(1, vector(0, 0, 0)) +); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //