diff --git a/README b/README index 093280c6fb..bcce7c5da9 100644 --- a/README +++ b/README @@ -14,11 +14,10 @@ General Public License terms under which you can copy the files. * System requirements - OpenFOAM is developed and tested on Linux, but should work with other Unix - style systems. To check your system setup, execute the foamSystemCheck script - in the bin/ directory of the OpenFOAM installation. If no problems are - reported, proceed to "3. Installation"; otherwise contact your system - administrator. + OpenFOAM is developed and tested on Linux, but should work with other POSIX + systems. To check your system setup, execute the foamSystemCheck script in + the bin/ directory of the OpenFOAM installation. If no problems are reported, + proceed to "3. Installation"; otherwise contact your system administrator. If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the section "Running OpenFOAM in 32-bit mode". diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files b/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files deleted file mode 100644 index a63fc64fa7..0000000000 --- a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -kinematicParcelFoam.C - -EXE = $(FOAM_APPBIN)/kinematicParcelFoam diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/files b/applications/solvers/Lagrangian/reactingParcelFoam/Make/files new file mode 100644 index 0000000000..ea13ecb0c5 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/Make/files @@ -0,0 +1,3 @@ +reactingParcelFoam.C + +EXE = $(FOAM_USER_APPBIN)/reactingParcelFoam diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/options b/applications/solvers/Lagrangian/reactingParcelFoam/Make/options new file mode 100644 index 0000000000..7d9fba6143 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/Make/options @@ -0,0 +1,37 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I${LIB_SRC}/meshTools/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -llagrangian \ + -llagrangianIntermediate \ + -lspecie \ + -lbasicThermophysicalModels \ + -lliquids \ + -lliquidMixture \ + -lsolids \ + -lsolidMixture \ + -lthermophysicalFunctions \ + -lcombustionThermophysicalModels \ + -lchemistryModel \ + -lradiation \ + -lODE diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/UEqn.H b/applications/solvers/Lagrangian/reactingParcelFoam/UEqn.H new file mode 100644 index 0000000000..3c4a927091 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/UEqn.H @@ -0,0 +1,16 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + rho.dimensionedInternalField()*g + + parcels.SU() + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/Lagrangian/reactingParcelFoam/YEqn.H new file mode 100644 index 0000000000..c7ade57fbe --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/YEqn.H @@ -0,0 +1,43 @@ +tmp > mvConvection +( + fv::convectionScheme::New + ( + mesh, + fields, + phi, + mesh.divScheme("div(phi,Yi_h)") + ) +); + + +{ + label inertIndex = -1; + volScalarField Yt = 0.0*Y[0]; + + for (label i=0; ifvmDiv(phi, Yi) + - fvm::laplacian(turbulence->muEff(), Yi) + == + parcels.Srho(i) + + kappa*chemistry.RR(i)().dimensionedInternalField() + ); + + Yi.max(0.0); + Yt += Yi; + } + else + { + inertIndex = i; + } + } + + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); +} diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/additionalOutput.H b/applications/solvers/Lagrangian/reactingParcelFoam/additionalOutput.H new file mode 100644 index 0000000000..9edd35eb7c --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/additionalOutput.H @@ -0,0 +1,48 @@ +{ + tmp tdQ + ( + new volScalarField + ( + IOobject + ( + "dQ", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar + ( + "zero", + dimensionSet(1, -3, -1, 0, 0, 0, 0), + 0.0 + ) + ) + ); + + scalarField& dQ = tdQ(); + + scalarField cp(dQ.size(), 0.0); + + forAll(Y, i) + { + volScalarField RRi = chemistry.RR(i); + + forAll(h, celli) + { + scalar Ti = T[celli]; + cp[celli] += Y[i][celli]*chemistry.specieThermo()[i].Cp(Ti); + scalar hi = chemistry.specieThermo()[i].h(Ti); + scalar RR = RRi[celli]; + dQ[celli] -= hi*RR; + } + } + + forAll(dQ, celli) + { + dQ[celli] /= cp[celli]; + } + + tdQ().write(); +} diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/chemistry.H b/applications/solvers/Lagrangian/reactingParcelFoam/chemistry.H new file mode 100644 index 0000000000..07b1e9953b --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/chemistry.H @@ -0,0 +1,25 @@ +{ + Info << "Solving chemistry" << endl; + + chemistry.solve + ( + runTime.value() - runTime.deltaT().value(), + runTime.deltaT().value() + ); + + // turbulent time scale + if (turbulentReaction) + { + DimensionedField tk = + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); + DimensionedField tc = + chemistry.tc()().dimensionedInternalField(); + + // Chalmers PaSR model + kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); + } + else + { + kappa = 1.0; + } +} diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/createClouds.H b/applications/solvers/Lagrangian/reactingParcelFoam/createClouds.H new file mode 100644 index 0000000000..b4ec5e4056 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/createClouds.H @@ -0,0 +1,40 @@ +Info << "\nConstructing gas properties" << endl; +/* +PtrList gasProperties(Y.size()); +forAll(gasProperties, i) +{ + gasProperties.set + ( + i, + new specieConstProperties + ( + dynamic_cast > > >&> + (thermo()).speciesData()[i] + ) + ); +} +*/ +PtrList gasProperties(Y.size()); +forAll(gasProperties, i) +{ + gasProperties.set + ( + i, + new specieReactingProperties + ( + dynamic_cast(thermo()).speciesData()[i] + ) + ); +} + +Info<< "\nConstructing reacting cloud" << endl; +basicReactingCloud parcels +( + "reactingCloud1", + rho, + U, + g, + thermo(), + gasProperties +); diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/Lagrangian/reactingParcelFoam/createFields.H new file mode 100644 index 0000000000..8f0d59e77d --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/createFields.H @@ -0,0 +1,90 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr thermo + ( + hCombustionThermo::New(mesh) + ); + + combustionMixture& composition = thermo->composition(); + PtrList& Y = composition.Y(); + + word inertSpecie(thermo->lookup("inertSpecie")); + + volScalarField& p = thermo->p(); + volScalarField& h = thermo->h(); + const volScalarField& T = thermo->T(); + const volScalarField& psi = thermo->psi(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + thermo->rho() + ); + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "compressibleCreatePhi.H" + + DimensionedField kappa + ( + IOobject + ( + "kappa", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimless, 0.0) + ); + + Info<< "Creating turbulence model\n" << endl; + autoPtr turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo() + ) + ); + + Info<< "Creating field DpDt\n" << endl; + volScalarField DpDt = + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + + Info << "Constructing chemical mechanism" << endl; + chemistryModel chemistry + ( + thermo(), + rho + ); + + multivariateSurfaceInterpolationScheme::fieldTable fields; + + forAll (Y, i) + { + fields.add(Y[i]); + } + fields.add(h); diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/hEqn.H b/applications/solvers/Lagrangian/reactingParcelFoam/hEqn.H new file mode 100644 index 0000000000..7909d8c67d --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/hEqn.H @@ -0,0 +1,20 @@ +{ + fvScalarMatrix hEqn + ( + fvm::ddt(rho, h) + + fvm::div(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/pEqn.H b/applications/solvers/Lagrangian/reactingParcelFoam/pEqn.H new file mode 100644 index 0000000000..63370f0cd4 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/pEqn.H @@ -0,0 +1,72 @@ +rho = thermo->rho(); + +volScalarField rUA = 1.0/UEqn.A(); +U = rUA*UEqn.H(); + +if (transonic) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(thermo->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) + == + parcels.Srho() + ); + + 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) + == + parcels.Srho() + ); + + 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/Lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/Lagrangian/reactingParcelFoam/reactingParcelFoam.C new file mode 100644 index 0000000000..ea57f0da0e --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + +Application + reactingParcelFoam + +Description + Transient PISO solver for compressible, laminar or turbulent flow with + reacting Lagrangian parcels. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "hCombustionThermo.H" +#include "turbulenceModel.H" +#include "basicReactingCloud.H" +#include "chemistryModel.H" +#include "chemistrySolver.H" +#include "ReactingCloudThermoTypes.H" +#include "radiationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "readChemistryProperties.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "createClouds.H" + #include "createRadiationModel.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + parcels.evolve(); + + parcels.info(); + + #include "chemistry.H" + #include "rhoEqn.H" + + // --- PIMPLE loop + for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) + { + #include "UEqn.H" + #include "YEqn.H" + + // --- PISO loop + for (int corr=1; corr<=nCorr; corr++) + { + #include "hEqn.H" + #include "pEqn.H" + } + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; + } + + turbulence->correct(); + + rho = thermo->rho(); + + if (runTime.write()) + { + #include "additionalOutput.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/readChemistryProperties.H b/applications/solvers/Lagrangian/reactingParcelFoam/readChemistryProperties.H new file mode 100644 index 0000000000..1a60e6fb34 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/readChemistryProperties.H @@ -0,0 +1,22 @@ +Info<< "Reading chemistry properties\n" << endl; + +IOdictionary chemistryProperties +( + IOobject + ( + "chemistryProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) +); + +Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction")); + +dimensionedScalar Cmix("Cmix", dimless, 1.0); + +if (turbulentReaction) +{ + chemistryProperties.lookup("Cmix") >> Cmix; +} diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/rhoEqn.H b/applications/solvers/Lagrangian/reactingParcelFoam/rhoEqn.H new file mode 100644 index 0000000000..e30e721004 --- /dev/null +++ b/applications/solvers/Lagrangian/reactingParcelFoam/rhoEqn.H @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + +Global + rhoEqn + +Description + Solve the continuity for density. + +\*---------------------------------------------------------------------------*/ + +{ + solve + ( + fvm::ddt(rho) + + fvc::div(phi) + == + parcels.Srho() + ); +} + +// ************************************************************************* // diff --git a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/files b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/files new file mode 100644 index 0000000000..387367f169 --- /dev/null +++ b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/files @@ -0,0 +1,3 @@ +uncoupledKinematicParcelFoam.C + +EXE = $(FOAM_APPBIN)/uncoupledKinematicParcelFoam diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/options b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options similarity index 89% rename from applications/solvers/Lagrangian/kinematicParcelFoam/Make/options rename to applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options index c9727abd52..818e371778 100644 --- a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/options +++ b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -6,7 +6,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ EXE_LIBS = \ -llagrangian \ diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/createFields.H similarity index 91% rename from applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H rename to applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/createFields.H index 3854911dd9..c76a81ca46 100644 --- a/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H +++ b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/createFields.H @@ -47,11 +47,7 @@ ); word kinematicCloudName("kinematicCloud"); - - if (args.options().found("cloudName")) - { - kinematicCloudName = args.options()["cloudName"]; - } + args.optionReadIfPresent("cloudName", kinematicCloudName); Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; basicKinematicCloud kinematicCloud diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C b/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C similarity index 100% rename from applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C rename to applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index 9d2073bf2e..49188fcf00 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) U.write(); phi.write(); - if (args.options().found("writep")) + if (args.optionFound("writep")) { p.write(); } diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/files b/applications/solvers/combustion/coalChemistryFoam/Make/files new file mode 100644 index 0000000000..6a1392f01c --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/Make/files @@ -0,0 +1,3 @@ +coalChemistryFoam.C + +EXE = $(FOAM_USER_APPBIN)/coalChemistryFoam diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/options b/applications/solvers/combustion/coalChemistryFoam/Make/options new file mode 100644 index 0000000000..21575a94ae --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/Make/options @@ -0,0 +1,40 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I${LIB_SRC}/meshTools/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude + +EXE_LIBS = \ + -L$(FOAM_USER_LIBBIN) \ + -lfiniteVolume \ + -lmeshTools \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -llagrangian \ + -llagrangianIntermediate \ + -lcoalCombustion\ + -lspecie \ + -lbasicThermophysicalModels \ + -lliquids \ + -lliquidMixture \ + -lsolids \ + -lsolidMixture \ + -lthermophysicalFunctions \ + -lcombustionThermophysicalModels \ + -lchemistryModel \ + -lradiation \ + -lODE diff --git a/applications/solvers/combustion/coalChemistryFoam/UEqn.H b/applications/solvers/combustion/coalChemistryFoam/UEqn.H new file mode 100644 index 0000000000..b02a7c61e8 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/UEqn.H @@ -0,0 +1,17 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + rho.dimensionedInternalField()*g + + coalParcels.SU() + + limestoneParcels.SU() + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/combustion/coalChemistryFoam/YEqn.H b/applications/solvers/combustion/coalChemistryFoam/YEqn.H new file mode 100644 index 0000000000..5c84cfdb3f --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/YEqn.H @@ -0,0 +1,43 @@ +tmp > mvConvection +( + fv::convectionScheme::New + ( + mesh, + fields, + phi, + mesh.divScheme("div(phi,Yi_h)") + ) +); + + +{ + label inertIndex = -1; + volScalarField Yt = 0.0*Y[0]; + + for (label i=0; ifvmDiv(phi, Yi) + - fvm::laplacian(turbulence->muEff(), Yi) + == + coalParcels.Srho(i) + + kappa*chemistry.RR(i)().dimensionedInternalField() + ); + + Yi.max(0.0); + Yt += Yi; + } + else + { + inertIndex = i; + } + } + + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); +} diff --git a/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H b/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H new file mode 100644 index 0000000000..9edd35eb7c --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H @@ -0,0 +1,48 @@ +{ + tmp tdQ + ( + new volScalarField + ( + IOobject + ( + "dQ", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar + ( + "zero", + dimensionSet(1, -3, -1, 0, 0, 0, 0), + 0.0 + ) + ) + ); + + scalarField& dQ = tdQ(); + + scalarField cp(dQ.size(), 0.0); + + forAll(Y, i) + { + volScalarField RRi = chemistry.RR(i); + + forAll(h, celli) + { + scalar Ti = T[celli]; + cp[celli] += Y[i][celli]*chemistry.specieThermo()[i].Cp(Ti); + scalar hi = chemistry.specieThermo()[i].h(Ti); + scalar RR = RRi[celli]; + dQ[celli] -= hi*RR; + } + } + + forAll(dQ, celli) + { + dQ[celli] /= cp[celli]; + } + + tdQ().write(); +} diff --git a/applications/solvers/combustion/coalChemistryFoam/chemistry.H b/applications/solvers/combustion/coalChemistryFoam/chemistry.H new file mode 100644 index 0000000000..07b1e9953b --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/chemistry.H @@ -0,0 +1,25 @@ +{ + Info << "Solving chemistry" << endl; + + chemistry.solve + ( + runTime.value() - runTime.deltaT().value(), + runTime.deltaT().value() + ); + + // turbulent time scale + if (turbulentReaction) + { + DimensionedField tk = + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); + DimensionedField tc = + chemistry.tc()().dimensionedInternalField(); + + // Chalmers PaSR model + kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); + } + else + { + kappa = 1.0; + } +} diff --git a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C new file mode 100644 index 0000000000..3bccc682d3 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Application + coalChemistryFoam + +Description + Transient solver for compressible, turbulent flow with coal and + limestone parcel injections, and combustion. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "hCombustionThermo.H" +#include "turbulenceModel.H" +#include "basicThermoCloud.H" +#include "coalCloud.H" +#include "chemistryModel.H" +#include "chemistrySolver.H" +#include "ReactingCloudThermoTypes.H" +#include "timeActivatedExplicitSource.H" +#include "radiationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "readChemistryProperties.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "createClouds.H" + #include "createRadiationModel.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + rhoEffLagrangian = coalParcels.rhoEff() + limestoneParcels.rhoEff(); + pDyn = 0.5*rho*magSqr(U); + + coalParcels.evolve(); + + coalParcels.info(); + + Info<< endl; + + limestoneParcels.evolve(); + + limestoneParcels.info(); + + Info<< endl; + + #include "chemistry.H" + #include "rhoEqn.H" + + // --- PIMPLE loop + for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) + { + #include "UEqn.H" + #include "YEqn.H" + #include "hEqn.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(); + + enthalpySource.update(); + + rho = thermo->rho(); + + if (runTime.write()) + { + #include "additionalOutput.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/combustion/coalChemistryFoam/createClouds.H b/applications/solvers/combustion/coalChemistryFoam/createClouds.H new file mode 100644 index 0000000000..34398f6b82 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/createClouds.H @@ -0,0 +1,52 @@ +Info<< "\nConstructing interpolation" << endl; + +Info << "\nConstructing gas properties" << endl; +/* +PtrList gasProperties(Y.size()); +forAll(gasProperties, i) +{ + gasProperties.set + ( + i, + new specieConstProperties + ( + dynamic_cast > > >&> + (thermo()).speciesData()[i] + ) + ); +} +*/ +PtrList gasProperties(Y.size()); +forAll(gasProperties, i) +{ + gasProperties.set + ( + i, + new specieReactingProperties + ( + dynamic_cast(thermo()).speciesData()[i] + ) + ); +} + +Info<< "\nConstructing coal cloud" << endl; +coalCloud coalParcels +( + "coalCloud1", + rho, + U, + g, + thermo(), + gasProperties +); + +Info<< "\nConstructing limestone cloud" << endl; +basicThermoCloud limestoneParcels +( + "limestoneCloud1", + rho, + U, + g, + thermo() +); diff --git a/applications/solvers/combustion/coalChemistryFoam/createFields.H b/applications/solvers/combustion/coalChemistryFoam/createFields.H new file mode 100644 index 0000000000..ebd8a44ab6 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/createFields.H @@ -0,0 +1,129 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr thermo + ( + hCombustionThermo::New(mesh) + ); + + combustionMixture& composition = thermo->composition(); + PtrList& Y = composition.Y(); + + word inertSpecie(thermo->lookup("inertSpecie")); + + volScalarField& p = thermo->p(); + volScalarField& h = thermo->h(); + const volScalarField& T = thermo->T(); + const volScalarField& psi = thermo->psi(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + thermo->rho() + ); + + // lagrangian effective density field - used externally (optional) + volScalarField rhoEffLagrangian + ( + IOobject + ( + "rhoEffLagrangian", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimDensity, 0.0) + ); + + // dynamic pressure field - used externally (optional) + volScalarField pDyn + ( + IOobject + ( + "pDyn", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimPressure, 0.0) + ); + + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "compressibleCreatePhi.H" + + DimensionedField kappa + ( + IOobject + ( + "kappa", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimless, 0.0) + ); + + Info<< "Creating turbulence model\n" << endl; + autoPtr turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo() + ) + ); + + Info<< "Creating field DpDt\n" << endl; + volScalarField DpDt = + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + + Info<< "\nConstructing explicit enthalpy source" << endl; + timeActivatedExplicitSource enthalpySource + ( + "enthalpySource", + mesh, + h.dimensions()*phi.dimensions()/mesh.V().dimensions() + ); + + Info << "Constructing chemical mechanism" << endl; + chemistryModel chemistry + ( + thermo(), + rho + ); + + multivariateSurfaceInterpolationScheme::fieldTable fields; + + forAll (Y, i) + { + fields.add(Y[i]); + } + fields.add(h); diff --git a/applications/solvers/combustion/coalChemistryFoam/hEqn.H b/applications/solvers/combustion/coalChemistryFoam/hEqn.H new file mode 100644 index 0000000000..6f0d532437 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/hEqn.H @@ -0,0 +1,22 @@ +{ + fvScalarMatrix hEqn + ( + fvm::ddt(rho, h) + + fvm::div(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/combustion/coalChemistryFoam/pEqn.H b/applications/solvers/combustion/coalChemistryFoam/pEqn.H new file mode 100644 index 0000000000..4a94c725bc --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/pEqn.H @@ -0,0 +1,72 @@ +rho = thermo->rho(); + +volScalarField rUA = 1.0/UEqn.A(); +U = rUA*UEqn.H(); + +if (transonic) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(thermo->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) + == + coalParcels.Srho() + ); + + 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) + == + coalParcels.Srho() + ); + + 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/coalChemistryFoam/readChemistryProperties.H b/applications/solvers/combustion/coalChemistryFoam/readChemistryProperties.H new file mode 100644 index 0000000000..1a60e6fb34 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/readChemistryProperties.H @@ -0,0 +1,22 @@ +Info<< "Reading chemistry properties\n" << endl; + +IOdictionary chemistryProperties +( + IOobject + ( + "chemistryProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) +); + +Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction")); + +dimensionedScalar Cmix("Cmix", dimless, 1.0); + +if (turbulentReaction) +{ + chemistryProperties.lookup("Cmix") >> Cmix; +} diff --git a/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H b/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H new file mode 100644 index 0000000000..fdc338a959 --- /dev/null +++ b/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + +Global + rhoEqn + +Description + Solve the continuity for density. + +\*---------------------------------------------------------------------------*/ + +{ + solve + ( + fvm::ddt(rho) + + fvc::div(phi) + == + coalParcels.Srho() + ); +} + +// ************************************************************************* // diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index bcc60b7b5e..844cc33352 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/interDyMFoam/Make/options b/applications/solvers/multiphase/interDyMFoam/Make/options index 74498326a9..b9aa770576 100644 --- a/applications/solvers/multiphase/interDyMFoam/Make/options +++ b/applications/solvers/multiphase/interDyMFoam/Make/options @@ -7,8 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/dynamicFvMesh/lnInclude EXE_LIBS = \ -linterfaceProperties \ @@ -18,5 +17,4 @@ EXE_LIBS = \ -lfiniteVolume \ -ldynamicMesh \ -lmeshTools \ - -ldynamicFvMesh \ - -lsampling + -ldynamicFvMesh diff --git a/applications/solvers/multiphase/interDyMFoam/createFields.H b/applications/solvers/multiphase/interDyMFoam/createFields.H index 0f1efe717f..bcceb9d748 100644 --- a/applications/solvers/multiphase/interDyMFoam/createFields.H +++ b/applications/solvers/multiphase/interDyMFoam/createFields.H @@ -116,34 +116,23 @@ pd + rho*(g & mesh.C()) ); - autoPtr pRefProbe; label pdRefCell = 0; scalar pdRefValue = 0.0; + setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); + scalar pRefValue = 0.0; if (pd.needReference()) { - pRefProbe.set - ( - new probes - ( - "pRefProbe", - mesh, - mesh.solutionDict().subDict("PISO").subDict("pRefProbe") - ) - ); - pRefValue = readScalar ( mesh.solutionDict().subDict("PISO").lookup("pRefValue") ); - pdRefCell = pRefProbe->cells()[0]; - p += dimensionedScalar ( "p", p.dimensions(), - pRefValue - pRefProbe->sample("p")()[0] + pRefValue - getRefCellValue(p, pdRefCell) ); } diff --git a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C index 0386e6625c..046503a8c4 100644 --- a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C @@ -40,7 +40,6 @@ Description #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" -#include "probes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -123,7 +122,7 @@ int main(int argc, char *argv[]) ( "p", p.dimensions(), - pRefValue - pRefProbe->sample("p")()[0] + pRefValue - getRefCellValue(p, pdRefCell) ); } diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index 53dd01672a..7063774752 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -106,6 +106,23 @@ scalar pdRefValue = 0.0; setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); + scalar pRefValue = 0.0; + + if (pd.needReference()) + { + pRefValue = readScalar + ( + mesh.solutionDict().subDict("PISO").lookup("pRefValue") + ); + + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pdRefCell) + ); + } + // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties); diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 7d2048037a..4dd86bd8f7 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -91,6 +91,16 @@ int main(int argc, char *argv[]) p = pd + rho*gh; + if (pd.needReference()) + { + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pdRefCell) + ); + } + turbulence->correct(); runTime.write(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H index 9119631d0c..07650fd4dd 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H @@ -68,6 +68,23 @@ scalar pdRefValue = 0.0; setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); + scalar pRefValue = 0.0; + + if (pd.needReference()) + { + pRefValue = readScalar + ( + mesh.solutionDict().subDict("PISO").lookup("pRefValue") + ); + + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pdRefCell) + ); + } + // Construct incompressible turbulence model autoPtr turbulence diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C index d0626cbf05..c5fdb5f3c2 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C @@ -83,6 +83,16 @@ int main(int argc, char *argv[]) p = pd + rho*gh; + if (pd.needReference()) + { + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pdRefCell) + ); + } + turbulence->correct(); runTime.write(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index bd7c3e2c9f..a38135dc19 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -95,6 +95,23 @@ scalar pdRefValue = 0.0; setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); + scalar pRefValue = 0.0; + + if (pd.needReference()) + { + pRefValue = readScalar + ( + mesh.solutionDict().subDict("PISO").lookup("pRefValue") + ); + + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pdRefCell) + ); + } + // Construct incompressible turbulence model autoPtr turbulence diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index be8eea9061..1caf455708 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -75,6 +75,16 @@ int main(int argc, char *argv[]) p = pd + rho*gh; + if (pd.needReference()) + { + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pdRefCell) + ); + } + turbulence->correct(); runTime.write(); diff --git a/applications/test/DynamicList/DynamicListTest.C b/applications/test/DynamicList/DynamicListTest.C index 324c5361bb..355c65605f 100644 --- a/applications/test/DynamicList/DynamicListTest.C +++ b/applications/test/DynamicList/DynamicListTest.C @@ -160,18 +160,33 @@ int main(int argc, char *argv[]) << " " << lstB.size() << endl; Info<< "" << dlD << "" << nl << "sizes: " << " " << dlD.size() << "/" << dlD.capacity() << endl; - + DynamicList dlE1(10); - DynamicList