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/mesh/conversion/foamToStarMesh/foamToStarMesh.C b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C index 9df568f1b5..ad9bb424eb 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C +++ b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,16 +39,6 @@ Usage Specify an alternative geometry scaling factor. The default is @b 1000 (scale @em [m] to @em [mm]). - @param -surface \n - Extract the surface of the volume mesh only. - This can be useful, for example, for surface morphing in an external - package. - - @param -tri \n - Extract a triangulated surface. - The @b -surface options is implicitly selected. - - Note The cellTable information available in the files @c constant/cellTable and @c constant/polyMesh/cellTableId @@ -87,34 +77,13 @@ int main(int argc, char *argv[]) "noBnd", "suppress writing the .bnd file" ); - argList::addBoolOption - ( - "tri", - "Extract a triangulated surface. Implies -surface" - ); - argList::addBoolOption - ( - "surface", - "extract the surface of the volume mesh only" - ); # include "setRootCase.H" # include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); - bool surfaceOnly = false; - if (args.optionFound("surface") || args.optionFound("tri")) - { - surfaceOnly = true; - } - fileName exportName = meshWriter::defaultMeshName; - if (surfaceOnly) - { - exportName = meshWriter::defaultSurfaceName; - } - if (args.optionFound("case")) { exportName += '-' + args.globalCaseName(); @@ -132,7 +101,6 @@ int main(int argc, char *argv[]) # include "createPolyMesh.H" - forAll(timeDirs, timeI) { runTime.setTime(timeDirs[timeI], timeI); @@ -156,21 +124,7 @@ int main(int argc, char *argv[]) meshName += '_' + runTime.timeName(); } - if (surfaceOnly) - { - if (args.optionFound("tri")) - { - writer.writeSurface(meshName, true); - } - else - { - writer.writeSurface(meshName); - } - } - else - { - writer.write(meshName); - } + writer.write(meshName); } Info<< nl << endl; diff --git a/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C b/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C index f9a255c502..b1c55e3769 100644 --- a/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C +++ b/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C @@ -36,6 +36,9 @@ Usage Specify an alternative geometry scaling factor. Eg, use @b 1000 to scale @em [m] to @em [mm]. + @param -tri \n + Triangulate surface. + \*---------------------------------------------------------------------------*/ #include "argList.H" @@ -62,6 +65,11 @@ int main(int argc, char *argv[]) "scale", "specify geometry scaling factor" ); + argList::addBoolOption + ( + "tri", + "triangulate surface" + ); # include "setRootCase.H" @@ -69,6 +77,7 @@ int main(int argc, char *argv[]) scalar scaleFactor = 0; args.optionReadIfPresent("scale", scaleFactor); + const bool doTriangulate = args.optionFound("tri"); fileName exportName(params[0]); @@ -107,6 +116,12 @@ int main(int argc, char *argv[]) surf.scalePoints(scaleFactor); Info<< "writing " << exportName; + if (doTriangulate) + { + Info<< " triangulated"; + surf.triangulate(); + } + if (scaleFactor <= 0) { Info<< " without scaling" << endl; diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C index 017085c499..8267db2a49 100644 --- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C +++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,6 +50,9 @@ Usage @param -to \ \n Specify a coordinate System when writing files. + @param -tri \n + Triangulate surface. + Note The filename extensions are used to determine the file format type. @@ -73,13 +76,47 @@ int main(int argc, char *argv[]) argList::validArgs.append("inputFile"); argList::validArgs.append("outputFile"); - argList::addBoolOption("clean"); + argList::addBoolOption + ( + "clean", + "perform some surface checking/cleanup on the input surface" + ); + argList::addOption + ( + "scaleIn", + "scale", + "specify input geometry scaling factor" + ); + argList::addOption + ( + "scaleOut", + "scale", + "specify output geometry scaling factor" + ); + argList::addOption + ( + "dict", + "file", + "specify alternative dictionary for the coordinateSystems descriptions" + ); + argList::addOption + ( + "from", + "system", + "specify the source coordinate system, applied after '-scaleIn'" + ); + argList::addOption + ( + "to", + "system", + "specify the target coordinate system, applied before '-scaleOut'" + ); + argList::addBoolOption + ( + "tri", + "triangulate surface" + ); - argList::addOption("scaleIn", "scale"); - argList::addOption("scaleOut", "scale"); - argList::addOption("dict", "coordinateSystemsDict"); - argList::addOption("from", "sourceCoordinateSystem"); - argList::addOption("to", "targetCoordinateSystem"); argList args(argc, argv); Time runTime(args.rootPath(), args.caseName()); @@ -242,6 +279,12 @@ int main(int argc, char *argv[]) surf.scalePoints(scaleOut); } + if (args.optionFound("tri")) + { + Info<< "triangulate" << endl; + surf.triangulate(); + } + Info<< "writing " << exportName; surf.write(exportName); } diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 60b40255d2..24bfa9887d 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -35,7 +35,7 @@ # determine the cmake to be used unset CMAKE_HOME -for cmake in cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 +for cmake in cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 do cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH if [ -r $cmake ] diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index d22f25012d..2cbfa0e281 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -35,7 +35,7 @@ # determine the cmake to be used unsetenv CMAKE_HOME -foreach cmake ( cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 ) +foreach cmake ( cmake-2.8.0 cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 ) set cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH if ( -r $cmake ) then setenv CMAKE_HOME $cmake diff --git a/src/conversion/meshWriter/meshWriter.C b/src/conversion/meshWriter/meshWriter.C index 67a6054658..a51675adf1 100644 --- a/src/conversion/meshWriter/meshWriter.C +++ b/src/conversion/meshWriter/meshWriter.C @@ -29,6 +29,9 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +Foam::string Foam::meshWriter::defaultMeshName = "meshExport"; + + const Foam::cellModel* Foam::meshWriter::unknownModel = Foam::cellModeller:: lookup ( @@ -64,10 +67,6 @@ lookup ); -Foam::string Foam::meshWriter::defaultMeshName = "meshExport"; -Foam::string Foam::meshWriter::defaultSurfaceName = "surfExport"; - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::meshWriter::meshWriter(const polyMesh& mesh, const scalar scaleFactor) diff --git a/src/conversion/meshWriter/meshWriter.H b/src/conversion/meshWriter/meshWriter.H index e86a74cc46..7e367cb67b 100644 --- a/src/conversion/meshWriter/meshWriter.H +++ b/src/conversion/meshWriter/meshWriter.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class meshWriter Declaration + Class meshWriter Declaration \*---------------------------------------------------------------------------*/ class meshWriter @@ -133,13 +133,12 @@ public: // Static data members + //- Specify a default mesh name static string defaultMeshName; - static string defaultSurfaceName; - // Constructors - //- Ccreate a writer obejct + //- Create a writer obejct meshWriter ( const polyMesh&, @@ -167,26 +166,14 @@ public: writeBoundary_ = false; } - // Write - //- Write volume mesh - // subclass must to supply this method + //- Write volume mesh. Subclass must supply this method virtual bool write ( const fileName& timeName = fileName::null ) const = 0; - //- Write surface mesh with optional triangulation - // subclass could supply this information - virtual bool writeSurface - ( - const fileName& timeName = fileName::null, - const bool triangulate = false - ) const - { - return false; - } }; diff --git a/src/conversion/meshWriter/starcd/STARCDMeshWriter.C b/src/conversion/meshWriter/starcd/STARCDMeshWriter.C index 630dd20f43..17e6d117dd 100644 --- a/src/conversion/meshWriter/starcd/STARCDMeshWriter.C +++ b/src/conversion/meshWriter/starcd/STARCDMeshWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -527,201 +527,4 @@ bool Foam::meshWriters::STARCD::write(const fileName& meshName) const } -bool Foam::meshWriters::STARCD::writeSurface -( - const fileName& meshName, - const bool triangulate -) const -{ - fileName baseName(meshName); - - if (baseName.empty()) - { - baseName = meshWriter::defaultSurfaceName; - - if - ( - mesh_.time().timeName() != "0" - && mesh_.time().timeName() != "constant" - ) - { - baseName += "_" + mesh_.time().timeName(); - } - } - - rmFiles(baseName); - - OFstream celFile(baseName + ".cel"); - writeHeader(celFile, "CELL"); - - Info<< "Writing " << celFile.name() << endl; - - // mesh and patch info - const pointField& points = mesh_.points(); - const labelList& owner = mesh_.faceOwner(); - const faceList& meshFaces = mesh_.faces(); - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - - label shapeId = 3; // shell/baffle element - label typeId = 4; // 4(shell) - - // remember which points need to be written - labelHashSet pointHash; - - // write boundary faces as normal STAR-CD mesh - if (triangulate) - { - // cell Id has no particular meaning - just increment - // use the cellTable id from the patch Number - label cellId = 0; - - forAll(patches, patchI) - { - label patchStart = patches[patchI].start(); - label patchSize = patches[patchI].size(); - - label ctableId = patchI + 1; - - for - ( - label faceI = patchStart; - faceI < (patchStart + patchSize); - ++faceI - ) - { - const face& f = meshFaces[faceI]; - - label nTri = f.nTriangles(points); - faceList triFaces; - - // triangulate polygons, but not quads - if (nTri <= 2) - { - triFaces.setSize(1); - triFaces[0] = f; - } - else - { - triFaces.setSize(nTri); - nTri = 0; - f.triangles(points, nTri, triFaces); - } - - forAll(triFaces, faceI) - { - const labelList& vrtList = triFaces[faceI]; - - celFile - << cellId + 1 << " " - << shapeId << " " - << vrtList.size() << " " - << ctableId << " " - << typeId; - - // must be 3 (triangle) but could be quad - label count = 0; - forAll(vrtList, i) - { - if ((count % 8) == 0) - { - celFile - << nl - << " " << cellId + 1; - } - // remember which points we'll need to write - pointHash.insert(vrtList[i]); - celFile << " " << vrtList[i] + 1; - count++; - } - celFile << endl; - - cellId++; - } - } - } - } - else - { - // cell Id is the OpenFOAM face Id - // use the cellTable id from the face owner - // - allows separation of parts - forAll(patches, patchI) - { - label patchStart = patches[patchI].start(); - label patchSize = patches[patchI].size(); - - for - ( - label faceI = patchStart; - faceI < (patchStart + patchSize); - ++faceI - ) - { - const labelList& vrtList = meshFaces[faceI]; - label cellId = faceI; - - celFile - << cellId + 1 << " " - << shapeId << " " - << vrtList.size() << " " - << cellTableId_[owner[faceI]] << " " - << typeId; - - // likely <= 8 vertices, but prevent overrun anyhow - label count = 0; - forAll(vrtList, i) - { - if ((count % 8) == 0) - { - celFile - << nl - << " " << cellId + 1; - } - // remember which points we'll need to write - pointHash.insert(vrtList[i]); - celFile << " " << vrtList[i] + 1; - count++; - } - celFile << endl; - } - } - } - - OFstream vrtFile(baseName + ".vrt"); - writeHeader(vrtFile, "VERTEX"); - - vrtFile.precision(10); - vrtFile.setf(std::ios::showpoint); // force decimal point for Fortran - - Info<< "Writing " << vrtFile.name() << endl; - - // build sorted table of contents - SortableList