diff --git a/.gitignore b/.gitignore index 575d88cbe8..b124c8d887 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.orig *.bak \#*\# +.directory # CVS recovered versions - anywhere .#* @@ -48,7 +49,9 @@ doc/[Dd]oxygen/man # source packages - anywhere *.tar.bz2 *.tar.gz +*.tar *.tgz +*.gtgz # ignore the persistent .build tag in the main directory /.build diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index ca4e0dcb58..891befab21 100644 --- a/applications/solvers/DNS/dnsFoam/dnsFoam.C +++ b/applications/solvers/DNS/dnsFoam/dnsFoam.C @@ -41,17 +41,16 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMeshNoClear.H" + #include "readTransportProperties.H" + #include "createFields.H" + #include "readTurbulenceProperties.H" + #include "initContinuityErrs.H" -# include "createTime.H" -# include "createMeshNoClear.H" -# include "readTransportProperties.H" -# include "createFields.H" -# include "readTurbulenceProperties.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< nl << "Starting time loop" << endl; @@ -59,7 +58,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readPISOControls.H" + #include "readPISOControls.H" force.internalField() = ReImSum ( @@ -69,12 +68,12 @@ int main(int argc, char *argv[]) ) ); -# include "globalProperties.H" + #include "globalProperties.H" fvVectorMatrix UEqn ( - fvm::ddt(U) - + fvm::div(phi, U) + fvm::ddt(U) + + fvm::div(phi, U) - fvm::laplacian(nu, U) == force @@ -90,7 +89,7 @@ int main(int argc, char *argv[]) volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); - phi = (fvc::interpolate(U) & mesh.Sf()) + phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, U, phi); fvScalarMatrix pEqn @@ -102,7 +101,7 @@ int main(int argc, char *argv[]) phi -= pEqn.flux(); -# include "continuityErrs.H" + #include "continuityErrs.H" U -= rUA*fvc::grad(p); U.correctBoundaryConditions(); 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/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index e765e61574..4e5b8fb9a0 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -8,7 +8,7 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ @@ -23,7 +23,7 @@ EXE_LIBS = \ -lmeshTools \ -lcompressibleRASModels \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ -lfiniteVolume \ diff --git a/applications/solvers/combustion/PDRFoam/PDRFoam.C b/applications/solvers/combustion/PDRFoam/PDRFoam.C index 89a7b7f956..58bea3ed99 100644 --- a/applications/solvers/combustion/PDRFoam/PDRFoam.C +++ b/applications/solvers/combustion/PDRFoam/PDRFoam.C @@ -36,7 +36,7 @@ Description to be appropriate by comparison with the results from the spectral model. - Strain effects are encorporated directly into the Xi equation + Strain effects are incorporated directly into the Xi equation but not in the algebraic approximation. Further work need to be done on this issue, particularly regarding the enhanced removal rate caused by flame compression. Analysis using results of the spectral @@ -70,53 +70,52 @@ Description int main(int argc, char *argv[]) { -# include "setRootCase.H" + #include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readCombustionProperties.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "readPISOControls.H" -# include "initContinuityErrs.H" -# include "readTimeControls.H" -# include "CourantNo.H" -# include "setInitialDeltaT.H" + #include "createTime.H" + #include "createMesh.H" + #include "readCombustionProperties.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" -scalar StCoNum = 0.0; + scalar StCoNum = 0.0; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { -# include "readTimeControls.H" -# include "readPISOControls.H" -# include "CourantNo.H" -# include "setDeltaT.H" + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" runTime++; Info<< "\n\nTime = " << runTime.timeName() << endl; -# include "rhoEqn.H" -# include "UEqn.H" + #include "rhoEqn.H" + #include "UEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { -# include "bEqn.H" -# include "ftEqn.H" -# include "huEqn.H" -# include "hEqn.H" + #include "bEqn.H" + #include "ftEqn.H" + #include "huEqn.H" + #include "hEqn.H" if (!ign.ignited()) { hu == h; } -# include "pEqn.H" + #include "pEqn.H" } turbulence->correct(); diff --git a/applications/solvers/combustion/PDRFoam/StCourantNo.H b/applications/solvers/combustion/PDRFoam/StCourantNo.H index e529409475..18d6e86a94 100644 --- a/applications/solvers/combustion/PDRFoam/StCourantNo.H +++ b/applications/solvers/combustion/PDRFoam/StCourantNo.H @@ -31,23 +31,25 @@ Description \*---------------------------------------------------------------------------*/ { -scalar meanStCoNum = 0.0; + scalar meanStCoNum = 0.0; -if (mesh.nInternalFaces()) -{ - surfaceScalarField SfUfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs() - *mag(phiSt/fvc::interpolate(rho)); + if (mesh.nInternalFaces()) + { + surfaceScalarField SfUfbyDelta = + mesh.surfaceInterpolation::deltaCoeffs() + *mag(phiSt/fvc::interpolate(rho)); - StCoNum = max(SfUfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + StCoNum = + max(SfUfbyDelta/mesh.magSf()).value() + *runTime.deltaT().value(); - meanStCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); -} + meanStCoNum = + (sum(SfUfbyDelta)/sum(mesh.magSf())).value() + *runTime.deltaT().value(); + } -Info<< "St courant Number mean: " << meanStCoNum - << " max: " << StCoNum << endl; + Info<< "St courant Number mean: " << meanStCoNum + << " max: " << StCoNum << endl; } // ************************************************************************* // diff --git a/applications/solvers/combustion/PDRFoam/bEqn.H b/applications/solvers/combustion/PDRFoam/bEqn.H index 3fd99b65ea..cb44931540 100644 --- a/applications/solvers/combustion/PDRFoam/bEqn.H +++ b/applications/solvers/combustion/PDRFoam/bEqn.H @@ -1,7 +1,7 @@ tmp > mvConvection ( fv::convectionScheme::New - ( + ( mesh, fields, phi, @@ -25,7 +25,7 @@ if (ign.ignited()) // Unburnt gas density // ~~~~~~~~~~~~~~~~~~~ - volScalarField rhou = thermo->rhou(); + volScalarField rhou = thermo.rhou(); // Calculate flame normal etc. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/applications/solvers/combustion/PDRFoam/createFields.H b/applications/solvers/combustion/PDRFoam/createFields.H index ba07a6dd46..74a18ab6f5 100644 --- a/applications/solvers/combustion/PDRFoam/createFields.H +++ b/applications/solvers/combustion/PDRFoam/createFields.H @@ -1,10 +1,11 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr thermo + autoPtr pThermo ( hhuCombustionThermo::New(mesh) ); - combustionMixture& composition = thermo->composition(); + hhuCombustionThermo& thermo = pThermo(); + basicMultiComponentMixture& composition = thermo.composition(); volScalarField rho ( @@ -16,13 +17,13 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - const volScalarField& psi = thermo->psi(); - volScalarField& h = thermo->h(); - volScalarField& hu = thermo->hu(); + volScalarField& p = thermo.p(); + const volScalarField& psi = thermo.psi(); + volScalarField& h = thermo.h(); + volScalarField& hu = thermo.hu(); volScalarField& b = composition.Y("b"); Info<< "min(b) = " << min(b).value() << endl; @@ -54,7 +55,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/combustion/PDRFoam/hEqn.H b/applications/solvers/combustion/PDRFoam/hEqn.H index 8077929487..7f5292d01a 100644 --- a/applications/solvers/combustion/PDRFoam/hEqn.H +++ b/applications/solvers/combustion/PDRFoam/hEqn.H @@ -8,5 +8,5 @@ betav*DpDt ); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/combustion/PDRFoam/huEqn.H b/applications/solvers/combustion/PDRFoam/huEqn.H index 462f271f4b..3467bc6b75 100644 --- a/applications/solvers/combustion/PDRFoam/huEqn.H +++ b/applications/solvers/combustion/PDRFoam/huEqn.H @@ -13,6 +13,6 @@ if (ign.ignited()) //+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hu) == - betav*DpDt*rho/thermo->rhou() + betav*DpDt*rho/thermo.rhou() ); } diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H index 1ff6f981bb..1931dbbb35 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.H @@ -196,8 +196,7 @@ public: // Destructor - - ~SCOPE(); + ~SCOPE(); // Member functions diff --git a/applications/solvers/combustion/PDRFoam/pEqn.H b/applications/solvers/combustion/PDRFoam/pEqn.H index 312de8301a..524c8eac74 100644 --- a/applications/solvers/combustion/PDRFoam/pEqn.H +++ b/applications/solvers/combustion/PDRFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField rUA = 1.0/UEqn.A(); U = invA & UEqn.H(); @@ -8,7 +8,7 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi()) + fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) @@ -34,7 +34,7 @@ if (transonic) } else { - phi = + phi = fvc::interpolate(rho)* ( (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options index bc89c0a716..c328b2c1b3 100644 --- a/applications/solvers/combustion/XiFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -13,7 +13,7 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ -lfiniteVolume \ diff --git a/applications/solvers/combustion/XiFoam/XiFoam.C b/applications/solvers/combustion/XiFoam/XiFoam.C index d18ef0d2f4..13a464a755 100644 --- a/applications/solvers/combustion/XiFoam/XiFoam.C +++ b/applications/solvers/combustion/XiFoam/XiFoam.C @@ -61,55 +61,54 @@ Description int main(int argc, char *argv[]) { -# include "setRootCase.H" + #include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readCombustionProperties.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "readPISOControls.H" -# include "initContinuityErrs.H" -# include "readTimeControls.H" -# include "compressibleCourantNo.H" -# include "setInitialDeltaT.H" + #include "createTime.H" + #include "createMesh.H" + #include "readCombustionProperties.H" + #include "readEnvironmentalProperties.H" + #include "createFields.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" + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; -# include "rhoEqn.H" -# include "UEqn.H" + #include "rhoEqn.H" + #include "UEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { -# include "ftEqn.H" -# include "bEqn.H" -# include "huEqn.H" -# include "hEqn.H" + #include "ftEqn.H" + #include "bEqn.H" + #include "huEqn.H" + #include "hEqn.H" if (!ign.ignited()) { hu == h; } -# include "pEqn.H" + #include "pEqn.H" } turbulence->correct(); - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index 739d6987e8..33ef24bfe6 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -6,7 +6,7 @@ if (ign.ignited()) // Unburnt gas density // ~~~~~~~~~~~~~~~~~~~ - volScalarField rhou = thermo->rhou(); + volScalarField rhou = thermo.rhou(); // Calculate flame normal etc. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -76,7 +76,7 @@ if (ign.ignited()) volScalarField epsilon = pow(uPrimeCoef, 3)*turbulence->epsilon(); - volScalarField tauEta = sqrt(thermo->muu()/(rhou*epsilon)); + volScalarField tauEta = sqrt(thermo.muu()/(rhou*epsilon)); volScalarField Reta = up/ ( @@ -180,7 +180,7 @@ if (ign.ignited()) // with a linear correction function to give a plausible profile for Xi // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField XiEqStar = + volScalarField XiEqStar = scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta; volScalarField XiEq = diff --git a/applications/solvers/combustion/XiFoam/createFields.H b/applications/solvers/combustion/XiFoam/createFields.H index 8121886402..ef16bd615c 100644 --- a/applications/solvers/combustion/XiFoam/createFields.H +++ b/applications/solvers/combustion/XiFoam/createFields.H @@ -1,10 +1,11 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr thermo + autoPtr pThermo ( hhuCombustionThermo::New(mesh) ); - combustionMixture& composition = thermo->composition(); + hhuCombustionThermo& thermo = pThermo(); + basicMultiComponentMixture& composition = thermo.composition(); volScalarField rho ( @@ -16,18 +17,18 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - const volScalarField& psi = thermo->psi(); - volScalarField& h = thermo->h(); - volScalarField& hu = thermo->hu(); + volScalarField& p = thermo.p(); + const volScalarField& psi = thermo.psi(); + volScalarField& h = thermo.h(); + volScalarField& hu = thermo.hu(); volScalarField& b = composition.Y("b"); Info<< "min(b) = " << min(b).value() << endl; - const volScalarField& T = thermo->T(); + const volScalarField& T = thermo.T(); Info<< "\nReading field U\n" << endl; @@ -55,7 +56,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/combustion/XiFoam/hEqn.H b/applications/solvers/combustion/XiFoam/hEqn.H index 2a5204aa8d..ebce30e24e 100644 --- a/applications/solvers/combustion/XiFoam/hEqn.H +++ b/applications/solvers/combustion/XiFoam/hEqn.H @@ -8,5 +8,5 @@ DpDt ); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/combustion/XiFoam/huEqn.H b/applications/solvers/combustion/XiFoam/huEqn.H index 2f001b0032..0b4068344b 100644 --- a/applications/solvers/combustion/XiFoam/huEqn.H +++ b/applications/solvers/combustion/XiFoam/huEqn.H @@ -13,6 +13,6 @@ if (ign.ignited()) //+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hu) == - DpDt*rho/thermo->rhou() + DpDt*rho/thermo.rhou() ); } diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 05db89627d..9443f909a3 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); @@ -8,7 +8,7 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi()) + fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) @@ -34,9 +34,9 @@ if (transonic) } else { - phi = - fvc::interpolate(rho)* - ( + phi = + fvc::interpolate(rho) + *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) ); diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options index 028498cc63..53aa22b25a 100644 --- a/applications/solvers/combustion/coldEngineFoam/Make/options +++ b/applications/solvers/combustion/coldEngineFoam/Make/options @@ -4,7 +4,7 @@ EXE_INC = \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude diff --git a/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C b/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C index ddb4c35530..67def3fb59 100644 --- a/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C +++ b/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C @@ -33,7 +33,7 @@ Description #include "fvCFD.H" #include "engineTime.H" #include "engineMesh.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" #include "OFstream.H" @@ -41,27 +41,27 @@ Description int main(int argc, char *argv[]) { -# include "setRootCase.H" + #include "setRootCase.H" -# include "createEngineTime.H" -# include "createEngineMesh.H" -# include "createFields.H" -# include "initContinuityErrs.H" -# include "readEngineTimeControls.H" -# include "compressibleCourantNo.H" -# include "setInitialDeltaT.H" -# include "startSummary.H" + #include "createEngineTime.H" + #include "createEngineMesh.H" + #include "createFields.H" + #include "initContinuityErrs.H" + #include "readEngineTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" + #include "startSummary.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { -# include "readPISOControls.H" -# include "readEngineTimeControls.H" -# include "compressibleCourantNo.H" -# include "setDeltaT.H" + #include "readPISOControls.H" + #include "readEngineTimeControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" runTime++; @@ -70,22 +70,22 @@ int main(int argc, char *argv[]) mesh.move(); -# include "rhoEqn.H" + #include "rhoEqn.H" -# include "UEqn.H" + #include "UEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { -# include "hEqn.H" -# include "pEqn.H" + #include "hEqn.H" + #include "pEqn.H" } turbulence->correct(); runTime.write(); -# include "logSummary.H" + #include "logSummary.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/combustion/coldEngineFoam/createFields.H b/applications/solvers/combustion/coldEngineFoam/createFields.H index 7a369df472..6bc3139ce6 100644 --- a/applications/solvers/combustion/coldEngineFoam/createFields.H +++ b/applications/solvers/combustion/coldEngineFoam/createFields.H @@ -1,9 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr thermo + autoPtr pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); volScalarField rho ( @@ -15,13 +16,13 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - const volScalarField& psi = thermo->psi(); - volScalarField& h = thermo->h(); - const volScalarField& T = thermo->T(); + volScalarField& p = thermo.p(); + const volScalarField& psi = thermo.psi(); + volScalarField& h = thermo.h(); + const volScalarField& T = thermo.T(); Info<< "\nReading field U\n" << endl; @@ -38,7 +39,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" Info<< "Creating turbulence model\n" << endl; @@ -49,7 +50,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/combustion/coldEngineFoam/hEqn.H b/applications/solvers/combustion/coldEngineFoam/hEqn.H index f72ef0c89c..ae60d3316e 100644 --- a/applications/solvers/combustion/coldEngineFoam/hEqn.H +++ b/applications/solvers/combustion/coldEngineFoam/hEqn.H @@ -8,5 +8,5 @@ DpDt ); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/combustion/dieselEngineFoam/Make/options index 20f008d331..60558513fe 100644 --- a/applications/solvers/combustion/dieselEngineFoam/Make/options +++ b/applications/solvers/combustion/dieselEngineFoam/Make/options @@ -7,10 +7,10 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/../applications/solvers/combustion/XiFoam \ + -I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/engine/lnInclude \ @@ -20,7 +20,7 @@ EXE_LIBS = \ -lengine \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lfiniteVolume \ -llagrangian \ -ldieselSpray \ diff --git a/applications/solvers/combustion/dieselEngineFoam/YEqn.H b/applications/solvers/combustion/dieselEngineFoam/YEqn.H index 2f74884bbd..9d46c0d611 100644 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for(label i=0; i > mvConvection inertIndex = i; } } - + Y[inertIndex] = scalar(1) - Yt; Y[inertIndex].max(0.0); - } diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H index cf0532b0f3..9d9229cc3c 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H @@ -1,13 +1,17 @@ Info<< nl << "Reading thermophysicalProperties" << endl; -autoPtr thermo -( - hCombustionThermo::New(mesh) -); -combustionMixture& composition = thermo->composition(); +autoPtr pChemistry +( + psiChemistryModel::New(mesh) +); +psiChemistryModel& chemistry = pChemistry(); + +hCombustionThermo& thermo = chemistry.thermo(); + +basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); -word inertSpecie(thermo->lookup("inertSpecie")); +word inertSpecie(thermo.lookup("inertSpecie")); volScalarField rho ( @@ -17,7 +21,7 @@ volScalarField rho runTime.timeName(), mesh ), - thermo->rho() + thermo.rho() ); Info<< "Reading field U\n" << endl; @@ -35,10 +39,10 @@ volVectorField U ); -volScalarField& p = thermo->p(); -const volScalarField& psi = thermo->psi(); -const volScalarField& T = thermo->T(); -volScalarField& h = thermo->h(); +volScalarField& p = thermo.p(); +const volScalarField& psi = thermo.psi(); +const volScalarField& T = thermo.T(); +volScalarField& h = thermo.h(); #include "compressibleCreatePhi.H" @@ -65,7 +69,7 @@ autoPtr turbulence rho, U, phi, - thermo() + thermo ) ); @@ -73,31 +77,11 @@ 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; -for(label i=0; i gasProperties(Y.size()); +PtrList gasProperties(Y.size()); forAll(gasProperties, i) { gasProperties.set ( i, - new specieProperties + new gasThermoPhysics ( - dynamic_cast(thermo()).speciesData()[i] + dynamic_cast&> + (thermo).speciesData()[i] ) ); } diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 927afe9bc2..ba910bcf56 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -36,40 +36,41 @@ Description #include "hCombustionThermo.H" #include "turbulenceModel.H" #include "spray.H" -#include "chemistryModel.H" +#include "psiChemistryModel.H" #include "chemistrySolver.H" #include "multivariateScheme.H" #include "Switch.H" #include "OFstream.H" #include "volPointInterpolation.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { -# include "setRootCase.H" -# include "createEngineTime.H" -# include "createEngineMesh.H" -# include "createFields.H" -# include "readEnvironmentalProperties.H" -# include "readCombustionProperties.H" -# include "createSpray.H" -# include "initContinuityErrs.H" -# include "readEngineTimeControls.H" -# include "compressibleCourantNo.H" -# include "setInitialDeltaT.H" -# include "startSummary.H" + #include "setRootCase.H" + #include "createEngineTime.H" + #include "createEngineMesh.H" + #include "createFields.H" + #include "readEnvironmentalProperties.H" + #include "readCombustionProperties.H" + #include "createSpray.H" + #include "initContinuityErrs.H" + #include "readEngineTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" + #include "startSummary.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info << "\nStarting time loop\n" << endl; while (runTime.run()) { -# include "readPISOControls.H" -# include "readEngineTimeControls.H" -# include "compressibleCourantNo.H" -# include "setDeltaT.H" + #include "readPISOControls.H" + #include "readEngineTimeControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" runTime++; @@ -101,27 +102,27 @@ int main(int argc, char *argv[]) kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); } -# include "rhoEqn.H" -# include "UEqn.H" + #include "rhoEqn.H" + #include "UEqn.H" for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) { -# include "YEqn.H" -# include "hEqn.H" + #include "YEqn.H" + #include "hEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" } } turbulence->correct(); -# include "logSummary.H" -# include "spraySummary.H" + #include "logSummary.H" + #include "spraySummary.H" - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/combustion/dieselEngineFoam/hEqn.H b/applications/solvers/combustion/dieselEngineFoam/hEqn.H index 347fef1a9c..0406f7fbd4 100644 --- a/applications/solvers/combustion/dieselEngineFoam/hEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/hEqn.H @@ -9,32 +9,5 @@ + dieselSpray.heatTransferSource() ); - thermo->correct(); - - forAll(dQ, i) - { - dQ[i] = 0.0; - } - - 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]; - } + thermo.correct(); } diff --git a/applications/solvers/combustion/dieselEngineFoam/pEqn.H b/applications/solvers/combustion/dieselEngineFoam/pEqn.H index 0324a47ce0..b68ae73296 100644 --- a/applications/solvers/combustion/dieselEngineFoam/pEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField A = UEqn.A(); U = UEqn.H()/A; @@ -8,7 +8,7 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi()) + fvc::interpolate(psi) *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) ); diff --git a/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H b/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H index 396bf33f30..dd396486d3 100644 --- a/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H @@ -44,7 +44,7 @@ volScalarField Sevap dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0) ); -for(label i=0; i()); + label Nparcels = dieselSpray.size(); + reduce(Nparcels, sumOp