diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H index a75c6a7d07..37aeca4c09 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H @@ -6,7 +6,7 @@ autoPtr pChemistry ); psiChemistryModel& chemistry = pChemistry(); -hCombustionThermo& thermo = chemistry.thermo(); +hsCombustionThermo& thermo = chemistry.thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); @@ -50,7 +50,7 @@ volVectorField U volScalarField& p = thermo.p(); const volScalarField& psi = thermo.psi(); const volScalarField& T = thermo.T(); -volScalarField& h = thermo.h(); +volScalarField& hs = thermo.hs(); #include "compressibleCreatePhi.H" @@ -92,4 +92,18 @@ forAll(Y, i) { fields.add(Y[i]); } -fields.add(h); +fields.add(hs); + +DimensionedField chemistrySh +( + IOobject + ( + "chemistry::Sh", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) +); diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 6507c117a0..2e6a9c4b05 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - dieselFoam + dieselEngineFoam Description Solver for diesel engine spray and combustion. @@ -103,13 +103,15 @@ int main(int argc, char *argv[]) kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); } + chemistrySh = kappa*chemistry.Sh()(); + #include "rhoEqn.H" #include "UEqn.H" for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) { #include "YEqn.H" - #include "hEqn.H" + #include "hsEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) diff --git a/applications/solvers/combustion/dieselEngineFoam/hEqn.H b/applications/solvers/combustion/dieselEngineFoam/hEqn.H deleted file mode 100644 index 0406f7fbd4..0000000000 --- a/applications/solvers/combustion/dieselEngineFoam/hEqn.H +++ /dev/null @@ -1,13 +0,0 @@ -{ - solve - ( - fvm::ddt(rho, h) - + mvConvection->fvmDiv(phi, h) - - fvm::laplacian(turbulence->alphaEff(), h) - == - DpDt - + dieselSpray.heatTransferSource() - ); - - thermo.correct(); -} diff --git a/applications/solvers/combustion/dieselEngineFoam/hsEqn.H b/applications/solvers/combustion/dieselEngineFoam/hsEqn.H new file mode 100644 index 0000000000..7ae59feb81 --- /dev/null +++ b/applications/solvers/combustion/dieselEngineFoam/hsEqn.H @@ -0,0 +1,14 @@ +{ + solve + ( + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) + == + DpDt + + dieselSpray.heatTransferSource()().dimensionedInternalField() + + chemistrySh + ); + + thermo.correct(); +} diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 4769a00c77..1e6ddfe0c1 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) { #include "YEqn.H" - #include "hEqn.H" + #include "hsEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) diff --git a/applications/solvers/combustion/fireFoam/Allwclean b/applications/solvers/combustion/fireFoam/Allwclean index 5c39709363..713a055201 100755 --- a/applications/solvers/combustion/fireFoam/Allwclean +++ b/applications/solvers/combustion/fireFoam/Allwclean @@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # run from this directory set -x wclean libso combustionModels -wclean all sensibleEnthalpyCombustionThermophysicalModels wclean # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/combustion/fireFoam/Allwmake b/applications/solvers/combustion/fireFoam/Allwmake index ada80d6666..f32c72860d 100755 --- a/applications/solvers/combustion/fireFoam/Allwmake +++ b/applications/solvers/combustion/fireFoam/Allwmake @@ -2,7 +2,6 @@ cd ${0%/*} || exit 1 # run from this directory set -x -sensibleEnthalpyCombustionThermophysicalModels/Allwmake wmake libso combustionModels wmake 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 \ 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/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/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options index e982f635a1..d85350297a 100644 --- a/applications/solvers/combustion/reactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - -I../XiFoam \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ diff --git a/applications/solvers/combustion/reactingFoam/UEqn.H b/applications/solvers/combustion/reactingFoam/UEqn.H new file mode 100644 index 0000000000..9697c6e1ed --- /dev/null +++ b/applications/solvers/combustion/reactingFoam/UEqn.H @@ -0,0 +1,15 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + rho*g + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/combustion/reactingFoam/chemistry.H b/applications/solvers/combustion/reactingFoam/chemistry.H index a1a978210d..8bfa872d7b 100644 --- a/applications/solvers/combustion/reactingFoam/chemistry.H +++ b/applications/solvers/combustion/reactingFoam/chemistry.H @@ -21,4 +21,6 @@ { kappa = 1.0; } + + chemistrySh = kappa*chemistry.Sh()(); } diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 0b2238031c..bd8f7ea1fb 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -5,7 +5,7 @@ autoPtr pChemistry ); psiChemistryModel& chemistry = pChemistry(); -hCombustionThermo& thermo = chemistry.thermo(); +hsCombustionThermo& thermo = chemistry.thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); @@ -40,8 +40,8 @@ volVectorField U volScalarField& p = thermo.p(); const volScalarField& psi = thermo.psi(); -volScalarField& h = thermo.h(); - +volScalarField& hs = thermo.hs(); +const volScalarField& T = thermo.T(); #include "compressibleCreatePhi.H" @@ -81,5 +81,18 @@ forAll(Y, i) { fields.add(Y[i]); } -fields.add(h); +fields.add(hs); +DimensionedField chemistrySh +( + IOobject + ( + "chemistry::Sh", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) +); diff --git a/applications/solvers/combustion/reactingFoam/hsEqn.H b/applications/solvers/combustion/reactingFoam/hsEqn.H new file mode 100644 index 0000000000..e3fa4e7a13 --- /dev/null +++ b/applications/solvers/combustion/reactingFoam/hsEqn.H @@ -0,0 +1,20 @@ +{ + fvScalarMatrix hsEqn + ( + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) +// - fvm::laplacian(turbulence->muEff(), hs) // unit lewis no. + == + DpDt + + chemistrySh + ); + + hsEqn.relax(); + hsEqn.solve(); + + thermo.correct(); + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; +} diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H new file mode 100644 index 0000000000..9443f909a3 --- /dev/null +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -0,0 +1,68 @@ +rho = thermo.rho(); + +volScalarField rUA = 1.0/UEqn.A(); +U = rUA*UEqn.H(); + +if (transonic) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(psi) + *( + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi) + ) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvm::div(phid, p) + - fvm::laplacian(rho*rUA, p) + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi == pEqn.flux(); + } + } +} +else +{ + phi = + fvc::interpolate(rho) + *( + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvc::div(phi) + - fvm::laplacian(rho*rUA, p) + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); + } + } +} + +#include "rhoEqn.H" +#include "compressibleContinuityErrs.H" + +U -= rUA*fvc::grad(p); +U.correctBoundaryConditions(); + +DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 2d4ae7589a..e9fe757e3b 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -73,9 +73,7 @@ int main(int argc, char *argv[]) { #include "UEqn.H" #include "YEqn.H" - - #define Db turbulence->alphaEff() - #include "hEqn.H" + #include "hsEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) diff --git a/applications/solvers/combustion/rhoReactingFoam/Make/options b/applications/solvers/combustion/rhoReactingFoam/Make/options index e982f635a1..d85350297a 100644 --- a/applications/solvers/combustion/rhoReactingFoam/Make/options +++ b/applications/solvers/combustion/rhoReactingFoam/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - -I../XiFoam \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ diff --git a/applications/solvers/combustion/rhoReactingFoam/UEqn.H b/applications/solvers/combustion/rhoReactingFoam/UEqn.H new file mode 100644 index 0000000000..9697c6e1ed --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/UEqn.H @@ -0,0 +1,15 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + rho*g + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/combustion/rhoReactingFoam/chemistry.H b/applications/solvers/combustion/rhoReactingFoam/chemistry.H index a1a978210d..8bfa872d7b 100644 --- a/applications/solvers/combustion/rhoReactingFoam/chemistry.H +++ b/applications/solvers/combustion/rhoReactingFoam/chemistry.H @@ -21,4 +21,6 @@ { kappa = 1.0; } + + chemistrySh = kappa*chemistry.Sh()(); } diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index d2f6f5e4d4..d4119b8c92 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -5,7 +5,7 @@ autoPtr pChemistry ); rhoChemistryModel& chemistry = pChemistry(); -hReactionThermo& thermo = chemistry.thermo(); +hsReactionThermo& thermo = chemistry.thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); @@ -40,7 +40,8 @@ volVectorField U volScalarField& p = thermo.p(); const volScalarField& psi = thermo.psi(); -volScalarField& h = thermo.h(); +volScalarField& hs = thermo.hs(); +const volScalarField& T = thermo.T(); #include "compressibleCreatePhi.H" @@ -81,5 +82,18 @@ forAll(Y, i) { fields.add(Y[i]); } -fields.add(h); +fields.add(hs); +DimensionedField chemistrySh +( + IOobject + ( + "chemistry::Sh", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) +); diff --git a/applications/solvers/combustion/rhoReactingFoam/hsEqn.H b/applications/solvers/combustion/rhoReactingFoam/hsEqn.H new file mode 100644 index 0000000000..81bd6ea9d7 --- /dev/null +++ b/applications/solvers/combustion/rhoReactingFoam/hsEqn.H @@ -0,0 +1,19 @@ +{ + fvScalarMatrix hsEqn + ( + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) + == + DpDt + + chemistrySh + ); + + hsEqn.relax(); + hsEqn.solve(); + + thermo.correct(); + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; +} diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index cc37dd09c1..79b76e014d 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) { #include "UEqn.H" #include "YEqn.H" - #include "hEqn.H" + #include "hsEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H index 5489dfefba..50fc7f575b 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H @@ -22,4 +22,6 @@ { kappa = 1.0; } + + chemistrySh = kappa*chemistry.Sh()(); } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index 389a065935..872664f3a5 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -84,16 +84,8 @@ int main(int argc, char *argv[]) coalParcels.evolve(); - coalParcels.info(); - - Info<< endl; - limestoneParcels.evolve(); - limestoneParcels.info(); - - Info<< endl; - #include "chemistry.H" #include "rhoEqn.H" @@ -102,16 +94,13 @@ int main(int argc, char *argv[]) { #include "UEqn.H" #include "YEqn.H" - #include "hEqn.H" + #include "hsEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { #include "pEqn.H" } - - Info<< "T gas min/max = " << min(T).value() << ", " - << max(T).value() << endl; } turbulence->correct(); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index d0a284a0e1..65be09775c 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -6,7 +6,7 @@ ); psiChemistryModel& chemistry = pChemistry(); - hCombustionThermo& thermo = chemistry.thermo(); + hsCombustionThermo& thermo = chemistry.thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); @@ -22,7 +22,7 @@ } volScalarField& p = thermo.p(); - volScalarField& h = thermo.h(); + volScalarField& hs = thermo.hs(); const volScalarField& T = thermo.T(); const volScalarField& psi = thermo.psi(); @@ -32,7 +32,7 @@ { fields.add(Y[i]); } - fields.add(h); + fields.add(hs); volScalarField rho ( @@ -133,5 +133,19 @@ "energy", mesh, dimEnergy/dimTime/dimVolume, - "h" + "hs" + ); + + DimensionedField chemistrySh + ( + IOobject + ( + "chemistry::Sh", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) ); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/hEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/hEqn.H deleted file mode 100644 index 2eaf6315cf..0000000000 --- a/applications/solvers/lagrangian/coalChemistryFoam/hEqn.H +++ /dev/null @@ -1,22 +0,0 @@ -{ - fvScalarMatrix hEqn - ( - fvm::ddt(rho, h) - + mvConvection->fvmDiv(phi, h) - - fvm::laplacian(turbulence->alphaEff(), h) - == - DpDt - + coalParcels.Sh() - + limestoneParcels.Sh() - + enthalpySource.Su() - + radiation->Sh(thermo) - ); - - hEqn.relax(); - - hEqn.solve(); - - thermo.correct(); - - radiation->correct(); -} diff --git a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H new file mode 100644 index 0000000000..ced6b64004 --- /dev/null +++ b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H @@ -0,0 +1,26 @@ +{ + fvScalarMatrix hsEqn + ( + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) + == + DpDt + + coalParcels.Sh() + + limestoneParcels.Sh() + + enthalpySource.Su() + + radiation->Shs(thermo) + + chemistrySh + ); + + hsEqn.relax(); + + hsEqn.solve(); + + thermo.correct(); + + radiation->correct(); + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; +} diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H index 5489dfefba..50fc7f575b 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H @@ -22,4 +22,6 @@ { kappa = 1.0; } + + chemistrySh = kappa*chemistry.Sh()(); } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index 68c0f8aee8..cf3f484bdb 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -6,7 +6,7 @@ ); rhoChemistryModel& chemistry = pChemistry(); - hReactionThermo& thermo = chemistry.thermo(); + hsReactionThermo& thermo = chemistry.thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); @@ -22,7 +22,7 @@ } volScalarField& p = thermo.p(); - volScalarField& h = thermo.h(); + volScalarField& hs = thermo.hs(); const volScalarField& T = thermo.T(); const volScalarField& psi = thermo.psi(); @@ -88,4 +88,18 @@ { fields.add(Y[i]); } - fields.add(h); + fields.add(hs); + + DimensionedField chemistrySh + ( + IOobject + ( + "chemistry::Sh", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) + ); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H similarity index 83% rename from applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H index 0715989df7..73c276c294 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H @@ -32,14 +32,15 @@ { solve ( - fvm::ddt(rho, h) - + mvConvection->fvmDiv(phi, h) - - fvm::laplacian(turbulence->alphaEff(), h) + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) == pWork() + parcels.Sh() - + radiation->Sh(thermo) + + radiation->Shs(thermo) + energySource.Su() + + chemistrySh ); thermo.correct(); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index b345ffe28a..436fda7a8b 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -33,7 +33,7 @@ Description The solver includes: - reacting multiphase parcel cloud - porous media - - point mass sources + - mass, momentum and energy sources - polynomial based, incompressible thermodynamics (f(T)) Note: ddtPhiCorr not used here when porous zones are active @@ -89,13 +89,11 @@ int main(int argc, char *argv[]) parcels.evolve(); - parcels.info(); - #include "chemistry.H" #include "rhoEqn.H" #include "UEqn.H" #include "YEqn.H" - #include "hEqn.H" + #include "hsEqn.H" // --- PISO loop for (int corr=0; corr& Y = composition.Y(); @@ -22,7 +22,7 @@ } volScalarField& p = thermo.p(); - volScalarField& h = thermo.h(); + volScalarField& hs = thermo.hs(); const volScalarField& T = thermo.T(); const volScalarField& psi = thermo.psi(); @@ -94,4 +94,18 @@ { fields.add(Y[i]); } - fields.add(h); + fields.add(hs); + + DimensionedField chemistrySh + ( + IOobject + ( + "chemistry::Sh", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("chemistry::Sh", dimEnergy/dimTime/dimVolume, 0.0) + ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H deleted file mode 100644 index d686e452f4..0000000000 --- a/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H +++ /dev/null @@ -1,20 +0,0 @@ -{ - fvScalarMatrix hEqn - ( - fvm::ddt(rho, h) - + mvConvection->fvmDiv(phi, h) - - fvm::laplacian(turbulence->alphaEff(), h) - == - DpDt - + parcels.Sh() - + radiation->Sh(thermo) - ); - - hEqn.relax(); - - hEqn.solve(); - - thermo.correct(); - - radiation->correct(); -} diff --git a/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H new file mode 100644 index 0000000000..ce12ec3ad4 --- /dev/null +++ b/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H @@ -0,0 +1,24 @@ +{ + fvScalarMatrix hEqn + ( + fvm::ddt(rho, hs) + + mvConvection->fvmDiv(phi, hs) + - fvm::laplacian(turbulence->alphaEff(), hs) + == + DpDt + + parcels.Sh() + + radiation->Shs(thermo) + + chemistrySh + ); + + hEqn.relax(); + + hEqn.solve(); + + thermo.correct(); + + radiation->correct(); + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; +} diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index 4dfd367d09..ad3b5b461c 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -74,8 +74,6 @@ int main(int argc, char *argv[]) parcels.evolve(); - parcels.info(); - #include "chemistry.H" #include "rhoEqn.H" @@ -88,12 +86,9 @@ int main(int argc, char *argv[]) // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { - #include "hEqn.H" + #include "hsEqn.H" #include "pEqn.H" } - - Info<< "T gas min/max = " << min(T).value() << ", " - << max(T).value() << endl; } turbulence->correct(); diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index ee0088c397..ef1ccbd150 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -61,7 +61,6 @@ int main(int argc, char *argv[]) Info<< "Evolving " << kinematicCloud.name() << endl; kinematicCloud.evolve(); - kinematicCloud.info(); runTime.write(); diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index d105a8492a..d2dcd818ca 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -270,11 +270,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/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 48435c749b..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 @@ -1111,14 +1108,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 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) @@ -1601,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 c3650ccb5a..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