diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index e765e61574002156fb224af7f32bcf8d4aef23cf..4e5b8fb9a077888bdd3802f41232ddfb6d7e4618 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 89a7b7f956d2d4b5c03e06f28bb4b0ef4dd33cbc..daeed4ebf086e874af5251c7101bcba8e20de81b 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,53 @@ 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 "readPISOControls.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 e529409475414941805f21949257eaac574a0f99..18d6e86a941045877155f7d01b3c844984c76965 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 3fd99b65eaeaed0e25ce2c7e90f19fde9ff7ccf1..cb4493154030fc42af097a77dfd9258930ac62ec 100644 --- a/applications/solvers/combustion/PDRFoam/bEqn.H +++ b/applications/solvers/combustion/PDRFoam/bEqn.H @@ -1,7 +1,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection ( fv::convectionScheme<scalar>::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 ba07a6dd4659b3c5e127efa8b96abd634611d42a..74a18ab6f5affe39d56ff90d41f084cd6e09e4f3 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<hhuCombustionThermo> thermo + autoPtr<hhuCombustionThermo> 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 807792948793710b37dea4320ffcfb34ec933db2..7f5292d01a903f7931aa0015e81cb26c9250253a 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 462f271f4b75dd60c6efc390b87b9ffc959e32e6..3467bc6b751177800f70b927250e2b61926ff04b 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 1ff6f981bbae09ec27284867cec07f78c0292a97..1931dbbb3554e8b9747fd107b799c6e9f0e4ce4c 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 312de8301a25a9f843956a817d4f1beb5c27c475..524c8eac74935856805699ace15ed3bc019fb29b 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 bc89c0a716e3ef4bcfa3866e2284df73608389d6..c328b2c1b3417b0f8df438317fbf4e0376cdbe0b 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 d18ef0d2f4b91086fcd6bcdd93ad12a5942eb523..cb7f7d2f959a4542ea5462e3943b05c52bbe37bc 100644 --- a/applications/solvers/combustion/XiFoam/XiFoam.C +++ b/applications/solvers/combustion/XiFoam/XiFoam.C @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) 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 739d6987e833f64c06880d7b31d85351a1c77933..33ef24bfe655b2d587b7e403fbd8ee1f5d25b736 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 812188640279377c734494a62d05365bf982f28c..ef16bd615c9bef3cfd86788e8fbd5a8a2bb879f3 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<hhuCombustionThermo> thermo + autoPtr<hhuCombustionThermo> 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 2a5204aa8d21bbc24d91eb0f6d9c29d1f43149a0..ebce30e24e50dee92824de875abfa138f0abf3b1 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 2f001b003265fca1aeeb2be7dd223546bf845bb3..0b4068344bc8b74a46691ba7ed205c6cd4efc9ba 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 05db89627dabf5400a98c2e6a37784dcb9cc53cd..9443f909a356699185bfbc8497cf46e26fd1ed3b 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/coalChemistryFoam/additionalOutput.H b/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H deleted file mode 100644 index 9edd35eb7cab9acd294ba6a9e73b6ee8087b1c0d..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/coalChemistryFoam/additionalOutput.H +++ /dev/null @@ -1,48 +0,0 @@ -{ - tmp<volScalarField> 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/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options index 028498cc6304a59ec1903c7aa206eaac2c4f5cc3..53aa22b25a476812ba4e06f10cf17291d7b031f2 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 ddb4c3553009eb6acb7284c01e7c1f6517dfb89e..67def3fb5901fc279f6e51754b2c7070d658b185 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 7a369df4721e96dd98cf3d86d3d581d86ba59ef2..6bc3139ce6f070445cc5e55ba3b3df839522ab50 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<basicThermo> thermo + autoPtr<basicPsiThermo> 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 f72ef0c89cb973b0150b3ec889b51c5be403b872..ae60d3316ec77061804e629360ed13f6cd891f68 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 20f008d331ae504b3059652a3e2e9908a373665a..60558513fe28ea936712ecf14e78588ea4a4e1fe 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 2f74884bbdec649240d2a0c7c4c93ec43f245d53..9d46c0d6111aa2e759816f385277f8371c3ab538 100644 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/YEqn.H @@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for(label i=0; i<Y.size(); i++) + for (label i=0; i<Y.size(); i++) { if (Y[i].name() != inertSpecie) { @@ -39,8 +39,7 @@ tmp<fv::convectionScheme<scalar> > 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 cf0532b0f3a9079454779e4cb04a1054277129b3..9d9229cc3c1dbed27219d4e53ff49af24f78767d 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<hCombustionThermo> thermo + +autoPtr<psiChemistryModel> pChemistry ( - hCombustionThermo::New(mesh) + psiChemistryModel::New(mesh) ); +psiChemistryModel& chemistry = pChemistry(); + +hCombustionThermo& thermo = chemistry.thermo(); -combustionMixture& composition = thermo->composition(); +basicMultiComponentMixture& composition = thermo.composition(); PtrList<volScalarField>& 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<compressible::turbulenceModel> 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<scalar>::fieldTable fields; -for(label i=0; i<Y.size(); i++) +forAll (Y, i) { fields.add(Y[i]); } fields.add(h); - -volScalarField dQ -( - IOobject - ( - "dQ", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("zero", dimensionSet(1,-3,-1,0,0,0,0), 0.0) -); diff --git a/applications/solvers/combustion/dieselEngineFoam/createSpray.H b/applications/solvers/combustion/dieselEngineFoam/createSpray.H index ac473957e5d1e86395509f79c2175c4f8039bc4d..4bc1a32f11becdd7e88f040685a97ae98be7e4e3 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createSpray.H +++ b/applications/solvers/combustion/dieselEngineFoam/createSpray.H @@ -1,14 +1,15 @@ Info << "Constructing Spray" << endl; -PtrList<specieProperties> gasProperties(Y.size()); +PtrList<gasThermoPhysics> gasProperties(Y.size()); forAll(gasProperties, i) { gasProperties.set ( i, - new specieProperties + new gasThermoPhysics ( - dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i] + dynamic_cast<const reactingMixture<gasThermoPhysics>&> + (thermo).speciesData()[i] ) ); } diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 927afe9bc28e486ad50704f7b9ad2daecbe88ba8..ba910bcf56e2bd70d03251deb46429622fb3a0af 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 347fef1a9c33231900aeecc5703f7e120f26fc4c..0406f7fbd492100a3814d0531ef25487636df4c1 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 0324a47ce01ecdc7496cdacc24b3a137b01fb703..b68ae732962c2e1f26c46876b69efae206eaaa45 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 396bf33f300d9549874fafa6aa92ae9b28d3a895..dd396486d35d57a7b96baeb69c944e461ab7c11f 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<Y.size(); i++) +for (label i=0; i<Y.size(); i++) { if (dieselSpray.isLiquidFuel()[i]) { diff --git a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H index 5b251e22902437f4b4bf964ee25c3d9c3169e90e..31337d0a77ee0dea6b686bd8f1c2b551d317329a 100644 --- a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H +++ b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H @@ -1,30 +1,30 @@ - label Nparcels = dieselSpray.size(); - reduce(Nparcels, sumOp<label>()); + label Nparcels = dieselSpray.size(); + reduce(Nparcels, sumOp<label>()); - Info<< "\nNumber of parcels in system.... | " - << Nparcels << endl - << "Injected liquid mass........... | " - << 1e6*dieselSpray.injectedMass(runTime.value()) << " mg" << endl - << "Liquid Mass in system.......... | " - << 1e6*dieselSpray.liquidMass() << " mg" << endl - << "SMD, Dmax...................... | " - << dieselSpray.smd()*1e6 << " mu, " - << dieselSpray.maxD()*1e6 << " mu" - << endl; + Info<< "\nNumber of parcels in system.... | " + << Nparcels << endl + << "Injected liquid mass........... | " + << 1e6*dieselSpray.injectedMass(runTime.value()) << " mg" << endl + << "Liquid Mass in system.......... | " + << 1e6*dieselSpray.liquidMass() << " mg" << endl + << "SMD, Dmax...................... | " + << dieselSpray.smd()*1e6 << " mu, " + << dieselSpray.maxD()*1e6 << " mu" + << endl; - scalar evapMass = - dieselSpray.injectedMass(runTime.value()) - - dieselSpray.liquidMass(); + scalar evapMass = + dieselSpray.injectedMass(runTime.value()) + - dieselSpray.liquidMass(); - scalar gasMass = fvc::domainIntegrate(rho).value(); + scalar gasMass = fvc::domainIntegrate(rho).value(); - if (dieselSpray.twoD()) - { - gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge(); - } + if (dieselSpray.twoD()) + { + gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge(); + } - scalar addedMass = gasMass - gasMass0; + scalar addedMass = gasMass - gasMass0; - Info<< "Added gas mass................. | " << 1e6*addedMass << " mg" - << nl << "Evaporation Continuity Error... | " - << 1e6*(addedMass - evapMass) << " mg" << endl; + Info<< "Added gas mass................. | " << 1e6*addedMass << " mg" + << nl << "Evaporation Continuity Error... | " + << 1e6*(addedMass - evapMass) << " mg" << endl; diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options index 44d527b0628afd5941de71c0cb41ae0b094be99b..28605eb830357a8aedb735b6d9b13a7a0c721897 100644 --- a/applications/solvers/combustion/dieselFoam/Make/options +++ b/applications/solvers/combustion/dieselFoam/Make/options @@ -8,17 +8,17 @@ 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 EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -llagrangian \ -ldieselSpray \ -lliquids \ diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 31d034bc5734e6807843059dff8eea02e17474a8..11cd91a488e349464b1b7eb8f9dce31c26e3a919 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -34,7 +34,7 @@ Description #include "hCombustionThermo.H" #include "turbulenceModel.H" #include "spray.H" -#include "chemistryModel.H" +#include "psiChemistryModel.H" #include "chemistrySolver.H" #include "multivariateScheme.H" @@ -46,28 +46,27 @@ Description int main(int argc, char *argv[]) { - -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "readEnvironmentalProperties.H" -# include "readCombustionProperties.H" -# include "createSpray.H" -# include "initContinuityErrs.H" -# include "readTimeControls.H" -# include "compressibleCourantNo.H" -# include "setInitialDeltaT.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readEnvironmentalProperties.H" + #include "readCombustionProperties.H" + #include "createSpray.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info << "\nStarting time loop\n" << endl; while (runTime.run()) { -# include "readPISOControls.H" -# include "compressibleCourantNo.H" -# include "setDeltaT.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; @@ -94,26 +93,26 @@ 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 "spraySummary.H" + #include "spraySummary.H" - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/combustion/dieselFoam/pEqn.H b/applications/solvers/combustion/dieselFoam/pEqn.H index 37e63e8635cfa1bdef7ec2021711add2c9b7b464..d74947fe5305882c8958f9237c17709ce530dbb6 100644 --- a/applications/solvers/combustion/dieselFoam/pEqn.H +++ b/applications/solvers/combustion/dieselFoam/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) @@ -36,9 +36,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/engineFoam/Make/options b/applications/solvers/combustion/engineFoam/Make/options index 3ee7cc666f34f1c9356ad4ff1178d1cb7b80be8d..31775e03d63670129e67b82980e8aae38737f19a 100644 --- a/applications/solvers/combustion/engineFoam/Make/options +++ b/applications/solvers/combustion/engineFoam/Make/options @@ -3,7 +3,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)/finiteVolume/lnInclude @@ -13,7 +13,7 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -llaminarFlameSpeedModels \ -lfiniteVolume diff --git a/applications/solvers/combustion/engineFoam/engineFoam.C b/applications/solvers/combustion/engineFoam/engineFoam.C index a835e8ea4295fc3d04efc3665c751c3ec504020c..33a8ea6f5d64deeca30d0c2805a81341e35175fa 100644 --- a/applications/solvers/combustion/engineFoam/engineFoam.C +++ b/applications/solvers/combustion/engineFoam/engineFoam.C @@ -63,29 +63,29 @@ Description int main(int argc, char *argv[]) { -# include "setRootCase.H" - -# include "createEngineTime.H" -# include "createEngineMesh.H" -# include "readPISOControls.H" -# include "readCombustionProperties.H" -# include "createFields.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 "readPISOControls.H" + #include "readCombustionProperties.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++; @@ -93,31 +93,31 @@ 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 "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(); -# include "logSummary.H" + #include "logSummary.H" - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 638d952f1753a9ea38a5dd317c23ea543f7cc4d1..39b4967312055a320025d3ca3ba70b809fafe762 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); @@ -8,8 +8,8 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi()) - *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) + fvc::interpolate(psi) + *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) diff --git a/applications/solvers/combustion/engineFoam/readEngineTimeControls.H b/applications/solvers/combustion/engineFoam/readEngineTimeControls.H index 2aea3445eb2705ed41469074bcae777250a7f378..8d6d5f28b3b50a9d5fd54f33fd5c0a565e187b84 100644 --- a/applications/solvers/combustion/engineFoam/readEngineTimeControls.H +++ b/applications/solvers/combustion/engineFoam/readEngineTimeControls.H @@ -1,3 +1,3 @@ -#include "readTimeControls.H" + #include "readTimeControls.H" maxDeltaT = runTime.userTimeToTime(maxDeltaT); diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options index 908472524a0d648dde43022a8e37bcb31941d483..e982f635a14fefba2fa2a03153961be4e1bf8fca 100644 --- a/applications/solvers/combustion/reactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I../XiFoam \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ @@ -11,7 +11,7 @@ EXE_INC = \ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -lbasicThermophysicalModels \ -lchemistryModel \ diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index 873351ac9b4d4c03c6da75e907ab1eea09fdaac6..cda24ec2f72efc49c797a83bbcbb4ba2be6007b5 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -13,7 +13,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for(label i=0; i<Y.size(); i++) + for (label i=0; i<Y.size(); i++) { if (Y[i].name() != inertSpecie) { @@ -37,7 +37,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection inertIndex = i; } } - + Y[inertIndex] = scalar(1) - Yt; Y[inertIndex].max(0.0); } diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 510f7d4236631404dea74eecb2886c3600d2cb4c..d92766db5498508a45847a41101c7a54f5960701 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -1,13 +1,16 @@ Info<< nl << "Reading thermophysicalProperties" << endl; -autoPtr<hCombustionThermo> thermo +autoPtr<psiChemistryModel> pChemistry ( - hCombustionThermo::New(mesh) + psiChemistryModel::New(mesh) ); +psiChemistryModel& chemistry = pChemistry(); -combustionMixture& composition = thermo->composition(); +hCombustionThermo& thermo = chemistry.thermo(); + +basicMultiComponentMixture& composition = thermo.composition(); PtrList<volScalarField>& Y = composition.Y(); -word inertSpecie(thermo->lookup("inertSpecie")); +word inertSpecie(thermo.lookup("inertSpecie")); volScalarField rho ( @@ -17,7 +20,7 @@ volScalarField rho runTime.timeName(), mesh ), - thermo->rho() + thermo.rho() ); Info<< "Reading field U\n" << endl; @@ -35,9 +38,9 @@ volVectorField U ); -volScalarField& p = thermo->p(); -const volScalarField& psi = thermo->psi(); -volScalarField& h = thermo->h(); +volScalarField& p = thermo.p(); +const volScalarField& psi = thermo.psi(); +volScalarField& h = thermo.h(); #include "compressibleCreatePhi.H" @@ -64,7 +67,7 @@ autoPtr<compressible::turbulenceModel> turbulence rho, U, phi, - thermo() + thermo ) ); @@ -72,31 +75,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<scalar>::fieldTable fields; -for(label i=0; i<Y.size(); i++) +forAll (Y, i) { fields.add(Y[i]); } fields.add(h); -volScalarField dQ -( - IOobject - ( - "dQ", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0, 0, 0), 0.0) -); diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index e915818bdc14525026340f04a7e5339bcd08e740..2a9e34e577395d117645f4f88dd19c90f9add5c2 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -33,7 +33,7 @@ Description #include "fvCFD.H" #include "hCombustionThermo.H" #include "turbulenceModel.H" -#include "chemistryModel.H" +#include "psiChemistryModel.H" #include "chemistrySolver.H" #include "multivariateScheme.H" @@ -41,52 +41,52 @@ Description 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 "initContinuityErrs.H" -# include "readTimeControls.H" -# include "compressibleCourantNo.H" -# include "setInitialDeltaT.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readChemistryProperties.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 "chemistry.H" -# include "rhoEqn.H" -# include "UEqn.H" + #include "chemistry.H" + #include "rhoEqn.H" + #include "UEqn.H" for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) { -# include "YEqn.H" + #include "YEqn.H" -# define Db turbulence->alphaEff() -# include "hEqn.H" + #define Db turbulence->alphaEff() + #include "hEqn.H" // --- PISO loop for (int corr=1; corr<=nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" } } turbulence->correct(); - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/combustion/reactingFoam/readChemistryProperties.H b/applications/solvers/combustion/reactingFoam/readChemistryProperties.H index 1a60e6fb34645a004fd39321f7a54d3bd5b45381..ab51afe28361cdf65bc74af68961a6732535d6b3 100644 --- a/applications/solvers/combustion/reactingFoam/readChemistryProperties.H +++ b/applications/solvers/combustion/reactingFoam/readChemistryProperties.H @@ -8,7 +8,8 @@ IOdictionary chemistryProperties runTime.constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) ); diff --git a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H index ebec931a54fcda48dd8777c8fc77fac5a42400f8..33b4edc8a7d31da894068a3c7016dc38bf21137e 100644 --- a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H +++ b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H @@ -38,11 +38,11 @@ if (mesh.nInternalFaces()) surfaceScalarField amaxSfbyDelta = mesh.surfaceInterpolation::deltaCoeffs()*amaxSf; - CoNum = max(amaxSfbyDelta/mesh.magSf()) - .value()*runTime.deltaT().value(); + CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaT().value(); - meanCoNum = (sum(amaxSfbyDelta)/sum(mesh.magSf())) - .value()*runTime.deltaT().value(); + meanCoNum = + (sum(amaxSfbyDelta)/sum(mesh.magSf())).value() + *runTime.deltaT().value(); } Info<< "Mean and max Courant Numbers = " diff --git a/applications/solvers/compressible/rhoCentralFoam/createFields.H b/applications/solvers/compressible/rhoCentralFoam/createFields.H index 3b273bb3dda1ed515b346870e932faa9a73c3123..daf3a88435cc8b9bfbae14ab33085c9dcd72d55e 100644 --- a/applications/solvers/compressible/rhoCentralFoam/createFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/createFields.H @@ -1,15 +1,16 @@ Info<< "Reading thermophysical properties\n" << endl; -autoPtr<basicThermo> thermo +autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); +basicPsiThermo& thermo = pThermo(); -volScalarField& p = thermo->p(); -volScalarField& h = thermo->h(); -const volScalarField& T = thermo->T(); -const volScalarField& psi = thermo->psi(); -const volScalarField& mu = thermo->mu(); +volScalarField& p = thermo.p(); +volScalarField& h = thermo.h(); +const volScalarField& T = thermo.T(); +const volScalarField& psi = thermo.psi(); +const volScalarField& mu = thermo.mu(); bool inviscid(true); if (max(mu.internalField()) > 0.0) @@ -42,7 +43,7 @@ volScalarField rho IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho(), + thermo.rho(), rhoBoundaryTypes ); diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoBoundaryTypes.H b/applications/solvers/compressible/rhoCentralFoam/rhoBoundaryTypes.H index c85f49198529d7ae1c3e400a5c1ae93afef47f1a..7118d24fc9247c5ed8f0301d9a7bb837ba278b0b 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoBoundaryTypes.H +++ b/applications/solvers/compressible/rhoCentralFoam/rhoBoundaryTypes.H @@ -3,10 +3,7 @@ wordList rhoBoundaryTypes = pbf.types(); forAll(rhoBoundaryTypes, patchi) { - if - ( - rhoBoundaryTypes[patchi] == "waveTransmissive" - ) + if (rhoBoundaryTypes[patchi] == "waveTransmissive") { rhoBoundaryTypes[patchi] = zeroGradientFvPatchScalarField::typeName; } diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 502406d1322f64edbdd77550ffa90b1f040e1ce1..f418f176374b384112da5f8cd760be97d61efc02 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "zeroGradientFvPatchFields.H" #include "fixedRhoFvPatchScalarField.H" @@ -40,18 +40,17 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readThermophysicalProperties.H" + #include "readTimeControls.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "readThermophysicalProperties.H" -# include "readTimeControls.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -# include "readFluxScheme.H" + #include "readFluxScheme.H" dimensionedScalar v_zero("v_zero",dimVolume/dimTime, 0.0); @@ -91,7 +90,7 @@ int main(int argc, char *argv[]) surfaceScalarField phiv_pos = U_pos & mesh.Sf(); surfaceScalarField phiv_neg = U_neg & mesh.Sf(); - volScalarField c = sqrt(thermo->Cp()/thermo->Cv()*rPsi); + volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); surfaceScalarField cSf_pos = fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); surfaceScalarField cSf_neg = fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); @@ -102,9 +101,9 @@ int main(int argc, char *argv[]) surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); -# include "compressibleCourantNo.H" -# include "readTimeControls.H" -# include "setDeltaT.H" + #include "compressibleCourantNo.H" + #include "readTimeControls.H" + #include "setDeltaT.H" runTime++; @@ -183,7 +182,7 @@ int main(int argc, char *argv[]) h = (rhoE + p)/rho - 0.5*magSqr(U); h.correctBoundaryConditions(); - thermo->correct(); + thermo.correct(); rhoE.boundaryField() = rho.boundaryField()* ( @@ -193,15 +192,15 @@ int main(int argc, char *argv[]) if (!inviscid) { - volScalarField k("k", thermo->Cp()*mu/Pr); + volScalarField k("k", thermo.Cp()*mu/Pr); solve ( fvm::ddt(rho, h) - fvc::ddt(rho, h) - - fvm::laplacian(thermo->alpha(), h) - + fvc::laplacian(thermo->alpha(), h) + - fvm::laplacian(thermo.alpha(), h) + + fvc::laplacian(thermo.alpha(), h) - fvc::laplacian(k, T) ); - thermo->correct(); + thermo.correct(); rhoE = rho*(h + 0.5*magSqr(U)) - p; } diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H index e836704cb1fd79e93dd0dffec96d15d0001830e0..1433ea5cc3d7180c4310f7b0710b913025030977 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H @@ -1,13 +1,14 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); volScalarField rho ( @@ -19,7 +20,7 @@ IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); Info<< "Reading field U\n" << endl; @@ -51,7 +52,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/compressible/rhoPimpleFoam/hEqn.H b/applications/solvers/compressible/rhoPimpleFoam/hEqn.H index dbc76740f51da87673524ba4bda189998d837864..e66b99442b87bd6e3a4fdeb4025e94f5f88e09c3 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/hEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/hEqn.H @@ -19,5 +19,5 @@ hEqn.solve(); } - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 7918618404a9653761dff2f60d6b67ce73b91bfb..9c4e9658cc703bb0234c79a797fdfee4d2c8b22d 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField rUA = 1.0/UEqn().A(); U = rUA*UEqn().H(); @@ -13,7 +13,7 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi()) + fvc::interpolate(psi) *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) @@ -99,7 +99,7 @@ else // Explicitly relax pressure for momentum corrector p.relax(); - rho = thermo->rho(); + rho = thermo.rho(); rho.relax(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; @@ -117,7 +117,7 @@ bound(p, pMin); /* if (closedVolume) { - p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) - /fvc::domainIntegrate(thermo->psi()); + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); } */ diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 8b916b308ef081bc5c90d7695a5bc52df53d4fad..19a26875db50c7d5f224371c229db652adc42ca3 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -35,7 +35,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" #include "bound.H" diff --git a/applications/solvers/compressible/rhoPisoFoam/createFields.H b/applications/solvers/compressible/rhoPisoFoam/createFields.H index 614f01702df40cf576ae7b94f5a82cd1405ded64..fdb706a14ce0651bf3722244ea51dae8c0df2d6b 100644 --- a/applications/solvers/compressible/rhoPisoFoam/createFields.H +++ b/applications/solvers/compressible/rhoPisoFoam/createFields.H @@ -1,13 +1,14 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); volScalarField rho ( @@ -19,7 +20,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); Info<< "\nReading field U\n" << endl; @@ -47,7 +48,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/compressible/rhoPisoFoam/hEqn.H b/applications/solvers/compressible/rhoPisoFoam/hEqn.H index f72ef0c89cb973b0150b3ec889b51c5be403b872..ae60d3316ec77061804e629360ed13f6cd891f68 100644 --- a/applications/solvers/compressible/rhoPisoFoam/hEqn.H +++ b/applications/solvers/compressible/rhoPisoFoam/hEqn.H @@ -8,5 +8,5 @@ DpDt ); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/compressible/rhoPisoFoam/pEqn.H b/applications/solvers/compressible/rhoPisoFoam/pEqn.H index 05db89627dabf5400a98c2e6a37784dcb9cc53cd..280842ecc3874e9ba634fd997b194fd940635a57 100644 --- a/applications/solvers/compressible/rhoPisoFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPisoFoam/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,7 +34,7 @@ if (transonic) } else { - phi = + phi = fvc::interpolate(rho)* ( (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C b/applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C index c349e7520e6ad34fd55550c77574107a6ff9fd13..2d9cccd29e6515482f043586d98217c606a8830c 100644 --- a/applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C +++ b/applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) turbulence->correct(); - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H index eee3959a4e0850702aa4ef1a47052aece69971fb..1177cba2a4b86adcdc0081e5305b9095214976a9 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H @@ -1,9 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); volScalarField rho ( @@ -15,11 +16,12 @@ IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); Info<< "Reading field U\n" << endl; @@ -36,7 +38,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" label pRefCell = 0; @@ -56,7 +58,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H b/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H index 8eb03f95eb46b687a79f9f68c09152bbd269224a..605b8820d1816daeaa6a6b4a2f20965e388a1c8f 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H @@ -14,5 +14,5 @@ eqnResidual = hEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H index ae41da9e36fd7af8dd172b163b16dd8829a93b8b..4d8e010f7e352464dd92558f23342c10774f6575 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H @@ -65,10 +65,10 @@ bound(p, pMin); // to obey overall mass continuity if (closedVolume) { - p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) - /fvc::domainIntegrate(thermo->psi()); + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); } -rho = thermo->rho(); +rho = thermo.rho(); rho.relax(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C index 0cd144fce23508b23d803c7abf25510f67f17f99..fbc27d884603ac2c9c80a702d0c7dc9286bd6211 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C @@ -27,12 +27,12 @@ Application Description Steady-state solver for turbulent flow of compressible fluids with - implicit or explicit porosity treatment + RANS turbulence modelling, and implicit or explicit porosity treatment \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "RASModel.H" #include "porousZones.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/createFields.H index 9c4f446c37ff45885232c1219825f8840fe9cbdb..690b53760d75b22618fc9cd0c1358c015d867854 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoSimpleFoam/createFields.H @@ -1,9 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); volScalarField rho ( @@ -15,12 +16,12 @@ IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); Info<< "Reading field U\n" << endl; volVectorField U @@ -56,7 +57,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/compressible/rhoSimpleFoam/hEqn.H b/applications/solvers/compressible/rhoSimpleFoam/hEqn.H index 6a87bbdf11941f36afe9fb7a43186f92cf554e0f..e299d99f83c9b1e0c0ab95b35d015300f4f18d7b 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/hEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/hEqn.H @@ -14,5 +14,5 @@ eqnResidual = hEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index e4fbe15aa485869258c231d8aef86f4e49a5c096..f6a433fd6164d0f803098051d4a9c44f4fafa38c 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -1,4 +1,4 @@ -rho = thermo->rho(); +rho = thermo.rho(); volScalarField rUA = 1.0/UEqn().A(); U = rUA*UEqn().H(); @@ -11,7 +11,7 @@ if (transonic) surfaceScalarField phid ( "phid", - fvc::interpolate(thermo->psi())*(fvc::interpolate(U) & mesh.Sf()) + fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf()) ); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) @@ -82,7 +82,7 @@ else // Explicitly relax pressure for momentum corrector p.relax(); -rho = thermo->rho(); +rho = thermo.rho(); rho.relax(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; @@ -95,6 +95,6 @@ bound(p, pMin); // to obey overall mass continuity if (closedVolume) { - p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) - /fvc::domainIntegrate(thermo->psi()); + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); } diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C index bf6a9f24f3386c7c1f93237fc244c30f85e87951..099257e5ae40a7deec364106327f1a82205a935a 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C @@ -26,13 +26,13 @@ Application rhoSimpleFoam Description - Steady-state SIMPLE solver for laminar or turbulent flow of + Steady-state SIMPLE solver for laminar or turbulent RANS flow of compressible fluids. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "RASModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/sonicDyMFoam/compressibleContinuityErrs.H b/applications/solvers/compressible/sonicDyMFoam/compressibleContinuityErrs.H index eec8485329cfcb0956c0b49b9a6108ead3cc797e..1d869cc58dae738d345b2448f7dfdcf7a63c36cb 100644 --- a/applications/solvers/compressible/sonicDyMFoam/compressibleContinuityErrs.H +++ b/applications/solvers/compressible/sonicDyMFoam/compressibleContinuityErrs.H @@ -1,5 +1,5 @@ { -# include "rhoEqn.H" + #include "rhoEqn.H" } { scalar sumLocalContErr = diff --git a/applications/solvers/compressible/sonicDyMFoam/createFields.H b/applications/solvers/compressible/sonicDyMFoam/createFields.H index eb45a7c23af7826cd0843adead9e5a3ea74ccfbf..bbb5d105269512474d7753bb93ef97affda1e8cc 100644 --- a/applications/solvers/compressible/sonicDyMFoam/createFields.H +++ b/applications/solvers/compressible/sonicDyMFoam/createFields.H @@ -1,13 +1,14 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); volScalarField rho ( @@ -17,7 +18,7 @@ runTime.timeName(), mesh ), - thermo->rho() + thermo.rho() ); Info<< "Reading field U\n" << endl; @@ -45,7 +46,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C index 57b15a0f9ba4e546d59ad17eb9a7129989ca4ad1..d86e41913e94044061c9084c219c934c2df3c63a 100644 --- a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C +++ b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" #include "motionSolver.H" @@ -84,8 +84,8 @@ int main(int argc, char *argv[]) surfaceScalarField phid ( "phid", - fvc::interpolate(psi)* - ( + fvc::interpolate(psi) + *( (fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U) ) ); diff --git a/applications/solvers/compressible/sonicFoam/UEqn.H b/applications/solvers/compressible/sonicFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..25506783aee86c36049d916b0bc349469a6510d4 --- /dev/null +++ b/applications/solvers/compressible/sonicFoam/UEqn.H @@ -0,0 +1,8 @@ +fvVectorMatrix UEqn +( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) +); + +solve(UEqn == -fvc::grad(p)); diff --git a/applications/solvers/compressible/sonicFoam/compressibleContinuityErrs.H b/applications/solvers/compressible/sonicFoam/compressibleContinuityErrs.H deleted file mode 100644 index 128d99c94611b88f8c01b3bb683dedcf0f237dc1..0000000000000000000000000000000000000000 --- a/applications/solvers/compressible/sonicFoam/compressibleContinuityErrs.H +++ /dev/null @@ -1,12 +0,0 @@ -{ -# include "rhoEqn.H" -} -{ - scalar sumLocalContErr = (sum(mag(rho - psi*p))/sum(rho)).value(); - scalar globalContErr = (sum(rho - psi*p)/sum(rho)).value(); - cumulativeContErr += globalContErr; - - Info<< "time step continuity errors : sum local = " << sumLocalContErr - << ", global = " << globalContErr - << ", cumulative = " << cumulativeContErr << endl; -} diff --git a/applications/solvers/compressible/sonicFoam/createFields.H b/applications/solvers/compressible/sonicFoam/createFields.H index eb45a7c23af7826cd0843adead9e5a3ea74ccfbf..5d03dd2bb7ccd83fb9f8900e2e2a08f2b3774ba4 100644 --- a/applications/solvers/compressible/sonicFoam/createFields.H +++ b/applications/solvers/compressible/sonicFoam/createFields.H @@ -1,13 +1,14 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& e = thermo.e(); + const volScalarField& psi = thermo.psi(); volScalarField rho ( @@ -17,7 +18,7 @@ runTime.timeName(), mesh ), - thermo->rho() + thermo.rho() ); Info<< "Reading field U\n" << endl; @@ -34,7 +35,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" Info<< "Creating turbulence model\n" << endl; @@ -45,10 +46,6 @@ rho, U, phi, - thermo() + thermo ) ); - - Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/compressible/sonicFoam/eEqn.H b/applications/solvers/compressible/sonicFoam/eEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..1d1d6aef0b2d53efa849347af2a0c4d6f9cbf912 --- /dev/null +++ b/applications/solvers/compressible/sonicFoam/eEqn.H @@ -0,0 +1,12 @@ +{ + solve + ( + fvm::ddt(rho, e) + + fvm::div(phi, e) + - fvm::laplacian(turbulence->alphaEff(), e) + == + - p*fvc::div(phi/fvc::interpolate(rho)) + ); + + thermo.correct(); +} diff --git a/applications/solvers/compressible/sonicFoam/hEqn.H b/applications/solvers/compressible/sonicFoam/hEqn.H deleted file mode 100644 index 5cb4c48c0883e6fce99b9e9a2e76b277e9cbfef7..0000000000000000000000000000000000000000 --- a/applications/solvers/compressible/sonicFoam/hEqn.H +++ /dev/null @@ -1,12 +0,0 @@ -{ - solve - ( - fvm::ddt(rho, h) - + fvm::div(phi, h) - - fvm::laplacian(turbulence->alphaEff(), h) - == - DpDt - ); - - thermo->correct(); -} diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..96a500d4c2644a1af8220d012f1888f67a297b2c --- /dev/null +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -0,0 +1,37 @@ +rho = thermo.rho(); + +volScalarField rUA = 1.0/UEqn.A(); +U = rUA*UEqn.H(); + +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(); + } +} + +#include "rhoEqn.H" +#include "compressibleContinuityErrs.H" + +U -= rUA*fvc::grad(p); +U.correctBoundaryConditions(); diff --git a/applications/solvers/compressible/sonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/sonicFoam/readThermodynamicProperties.H deleted file mode 100644 index 1fc57fc5fdc6ef0a6d8d232922fa06f124314a3a..0000000000000000000000000000000000000000 --- a/applications/solvers/compressible/sonicFoam/readThermodynamicProperties.H +++ /dev/null @@ -1,23 +0,0 @@ - Info<< "Reading thermodynamicProperties\n" << endl; - - IOdictionary thermodynamicProperties - ( - IOobject - ( - "thermodynamicProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar R - ( - thermodynamicProperties.lookup("R") - ); - - dimensionedScalar Cv - ( - thermodynamicProperties.lookup("Cv") - ); diff --git a/applications/solvers/compressible/sonicFoam/readTransportProperties.H b/applications/solvers/compressible/sonicFoam/readTransportProperties.H deleted file mode 100644 index 1502e2033a05c54d882dd06ea42731938527d1a8..0000000000000000000000000000000000000000 --- a/applications/solvers/compressible/sonicFoam/readTransportProperties.H +++ /dev/null @@ -1,18 +0,0 @@ - Info<< "Reading transportProperties\n" << endl; - - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar mu - ( - transportProperties.lookup("mu") - ); diff --git a/applications/solvers/compressible/sonicFoam/sonicFoam.C b/applications/solvers/compressible/sonicFoam/sonicFoam.C index 6ff79607986802a024e450042be2ad286d6d5b12..df100262efbc93a9127978cd0b472c380a7e8a17 100644 --- a/applications/solvers/compressible/sonicFoam/sonicFoam.C +++ b/applications/solvers/compressible/sonicFoam/sonicFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,64 +58,21 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" - fvVectorMatrix UEqn - ( - fvm::ddt(rho, U) - + fvm::div(phi, U) - + turbulence->divDevRhoReff(U) - ); + #include "UEqn.H" - solve(UEqn == -fvc::grad(p)); - - #include "hEqn.H" + #include "eEqn.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { - volScalarField rUA = 1.0/UEqn.A(); - U = rUA*UEqn.H(); - - 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) - ); - - pEqn.solve(); - - if (nonOrth == nNonOrthCorr) - { - phi = pEqn.flux(); - } - } - - #include "compressibleContinuityErrs.H" - - U -= rUA*fvc::grad(p); - U.correctBoundaryConditions(); + #include "pEqn.H" } - DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); - turbulence->correct(); - rho = psi*p; + rho = thermo.rho(); runTime.write(); diff --git a/applications/solvers/compressible/sonicLiquidFoam/createFields.H b/applications/solvers/compressible/sonicLiquidFoam/createFields.H index f419234c7dbf28ee9231ce36837df22d996912ae..1268cbb7b0657b70f8ffa4131204ad516b2e1b79 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/createFields.H +++ b/applications/solvers/compressible/sonicLiquidFoam/createFields.H @@ -41,4 +41,4 @@ ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" diff --git a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C index 0324da8299896476159dca790e388716a8ca8ac3..763e03a4b9759e3210379affa4bc44341e7ea848 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C +++ b/applications/solvers/compressible/sonicLiquidFoam/sonicLiquidFoam.C @@ -37,16 +37,15 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readThermodynamicProperties.H" + #include "readTransportProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readThermodynamicProperties.H" -# include "readTransportProperties.H" -# include "createFields.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -54,10 +53,10 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readPISOControls.H" -# include "compressibleCourantNo.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" -# include "rhoEqn.H" + #include "rhoEqn.H" fvVectorMatrix UEqn ( @@ -79,8 +78,8 @@ int main(int argc, char *argv[]) surfaceScalarField phid ( "phid", - psi* - ( + psi + *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) ) @@ -100,7 +99,7 @@ int main(int argc, char *argv[]) phi += pEqn.flux(); -# include "compressibleContinuityErrs.H" + #include "compressibleContinuityErrs.H" U -= rUA*fvc::grad(p); U.correctBoundaryConditions(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options index a53061a93cc503d9368d9d3a900ac6ef801015ba..041d2e0605468bb86b7eee749a4be8de8076f910 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I../buoyantBoussinesqSimpleFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \ diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H index e2a89d1441582292fcb5a33ec7e092eac455a5a5..ece4b8ffe5c70d80f68e7093baffe960d5e76433 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/TEqn.H @@ -2,7 +2,7 @@ volScalarField kappaEff ( "kappaEff", - turbulence->nu() + turbulence->nut()/Prt + turbulence->nu()/Pr + turbulence->nut()/Prt ); fvScalarMatrix TEqn @@ -15,4 +15,6 @@ TEqn.relax(); TEqn.solve(); + + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H index 3b5b5be24923c1b410d47c34fd14da319e117026..35387f4ff40468426b6ebc31a6fb517553759fe4 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/UEqn.H @@ -1,23 +1,26 @@ // Solve the momentum equation - tmp<fvVectorMatrix> UEqn + fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) ); - UEqn().relax(); + UEqn.relax(); - solve - ( - UEqn() - == - -fvc::reconstruct + if (momentumPredictor) + { + solve ( + UEqn + == + fvc::reconstruct ( - fvc::snGrad(pd) - - betaghf*fvc::snGrad(T) - ) * mesh.magSf() - ) - ); + ( + fvc::interpolate(rhok)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() + ) + ) + ); + } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C index e3cece5b91f321694941d087e194fb3b07dec430..3f0ece93cb37bc787f8c6a5cfd39ac8fe83598e2 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C @@ -54,18 +54,17 @@ Description int main(int argc, char *argv[]) { - -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "initContinuityErrs.H" -# include "readTimeControls.H" -# include "CourantNo.H" -# include "setInitialDeltaT.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -73,26 +72,23 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readTimeControls.H" -# include "readPISOControls.H" -# include "CourantNo.H" -# include "setDeltaT.H" + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" -# include "UEqn.H" + #include "UEqn.H" + #include "TEqn.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { -# include "TEqn.H" -# include "pdEqn.H" + #include "pEqn.H" } turbulence->correct(); - if (runTime.write()) - { -# include "writeAdditionalFields.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H index 5f3f13626db0a860d7058e76ce5a90f397558c95..dde0e38b339348ac1693d4bfdf3da9889610a354 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/createFields.H @@ -14,13 +14,12 @@ mesh ); - // kinematic pd - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -53,15 +52,25 @@ incompressible::RASModel::New(U, phi, laminarTransport) ); - Info<< "Calculating field beta*(g.h)\n" << endl; - surfaceScalarField betaghf("betagh", beta*(g & mesh.Cf())); - - label pdRefCell = 0; - scalar pdRefValue = 0.0; + label pRefCell = 0; + scalar pRefValue = 0.0; setRefCell ( - pd, - mesh.solutionDict().subDict("SIMPLE"), - pdRefCell, - pdRefValue + p, + mesh.solutionDict().subDict("PISO"), + pRefCell, + pRefValue + ); + + + // Kinematic density for buoyancy force + volScalarField rhok + ( + IOobject + ( + "rhok", + runTime.timeName(), + mesh + ), + 1.0 - beta*(T - TRef) ); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H similarity index 55% rename from applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H index 25e2a9817fbe680f3b52b91b5a7fc187d52a3643..ff0c26f05893f6e625e7a8a5193c2f6a08882bc5 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pdEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H @@ -1,9 +1,8 @@ { - volScalarField rUA("rUA", 1.0/UEqn().A()); + volScalarField rUA("rUA", 1.0/UEqn.A()); surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA)); - U = rUA*UEqn().H(); - UEqn.clear(); + U = rUA*UEqn.H(); surfaceScalarField phiU ( @@ -11,31 +10,31 @@ + fvc::ddtPhiCorr(rUA, U, phi) ); - phi = phiU + betaghf*fvc::snGrad(T)*rUAf*mesh.magSf(); + phi = phiU + rUAf*fvc::interpolate(rhok)*(g & mesh.Sf()); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi += pdEqn.flux(); + phi -= pEqn.flux(); } } - U -= rUA*fvc::reconstruct((phi - phiU)/rUAf); + U += rUA*fvc::reconstruct((phi - phiU)/rUAf); U.correctBoundaryConditions(); #include "continuityErrs.H" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H deleted file mode 100644 index 585128dfdeb7d5e5212f9412d9b415c05c15b752..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/readTransportProperties.H +++ /dev/null @@ -1,13 +0,0 @@ - singlePhaseTransportModel laminarTransport(U, phi); - - // thermal expansion coefficient [1/K] - dimensionedScalar beta(laminarTransport.lookup("beta")); - - // reference temperature [K] - dimensionedScalar TRef(laminarTransport.lookup("TRef")); - - // reference kinematic pressure [m2/s2] - dimensionedScalar pRef(laminarTransport.lookup("pRef")); - - // turbulent Prandtl number - dimensionedScalar Prt(laminarTransport.lookup("Prt")); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H deleted file mode 100644 index 20f7c6ae1dcff80630dc2ca21253b1e824ea5d77..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/writeAdditionalFields.H +++ /dev/null @@ -1,29 +0,0 @@ -{ - volScalarField rhoEff - ( - IOobject - ( - "rhoEff", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - 1.0 - beta*(T - TRef) - ); - rhoEff.write(); - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rhoEff*(g & mesh.C()) + pRef - ); - p.write(); -} diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H index d00f0877eaf592058b956d3c9f78979d91d6dbc1..7452a0495adf2207ffb0f66e9e4484e1e7c9bad2 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H @@ -2,7 +2,7 @@ volScalarField kappaEff ( "kappaEff", - turbulence->nu() + turbulence->nut()/Prt + turbulence->nu()/Pr + turbulence->nut()/Prt ); fvScalarMatrix TEqn @@ -16,4 +16,6 @@ eqnResidual = TEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); + + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H index cf5c4a197893afff99ffec01847b2ce9bbd57b3e..a813a2d8b7aab17f8a45dfc9295e9ee6f161a683 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H @@ -13,12 +13,12 @@ ( UEqn() == - -fvc::reconstruct + fvc::reconstruct ( ( - fvc::snGrad(pd) - - betaghf*fvc::snGrad(T) - ) * mesh.magSf() + fvc::interpolate(rhok)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() + ) ) ).initialResidual(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index fafb49d84846c8ab4505a3770bfd9fc55d90dd89..63b938fa3625c2a15475b5ab5eb2157ce4cd9416 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -54,15 +54,14 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -70,30 +69,27 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" -# include "initConvergenceCheck.H" + #include "readSIMPLEControls.H" + #include "initConvergenceCheck.H" - pd.storePrevIter(); + p.storePrevIter(); // Pressure-velocity SIMPLE corrector { -# include "UEqn.H" -# include "TEqn.H" -# include "pdEqn.H" + #include "UEqn.H" + #include "TEqn.H" + #include "pEqn.H" } turbulence->correct(); - if (runTime.write()) - { -# include "writeAdditionalFields.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; -# include "convergenceCheck.H" + #include "convergenceCheck.H" } Info<< "End\n" << endl; diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H index 5f3f13626db0a860d7058e76ce5a90f397558c95..0e668e9d987c132605e1aa28daee9e9aa0bf9a94 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H @@ -14,13 +14,12 @@ mesh ); - // kinematic pd - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -56,12 +55,25 @@ Info<< "Calculating field beta*(g.h)\n" << endl; surfaceScalarField betaghf("betagh", beta*(g & mesh.Cf())); - label pdRefCell = 0; - scalar pdRefValue = 0.0; + label pRefCell = 0; + scalar pRefValue = 0.0; setRefCell ( - pd, + p, mesh.solutionDict().subDict("SIMPLE"), - pdRefCell, - pdRefValue + pRefCell, + pRefValue + ); + + + // Kinematic density for buoyancy force + volScalarField rhok + ( + IOobject + ( + "rhok", + runTime.timeName(), + mesh + ), + 1.0 - beta*(T - TRef) ); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pdEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H similarity index 64% rename from applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pdEqn.H rename to applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H index e782d26c8dc5ad4374d1b5a76ab7dfd72f6b9601..e1d42d738e8deff2eda578436baca131809f352f 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pdEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H @@ -6,41 +6,42 @@ UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); - adjustPhi(phi, U, pd); - surfaceScalarField buoyancyPhi = -betaghf*fvc::snGrad(T)*rUAf*mesh.magSf(); - phi -= buoyancyPhi; + adjustPhi(phi, U, p); + surfaceScalarField buoyancyPhi = + rUAf*fvc::interpolate(rhok)*(g & mesh.Sf()); + phi += buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, pRefValue); // retain the residual from the first iteration if (nonOrth == 0) { - eqnResidual = pdEqn.solve().initialResidual(); + eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); } else { - pdEqn.solve(); + pEqn.solve(); } if (nonOrth == nNonOrthCorr) { // Calculate the conservative fluxes - phi -= pdEqn.flux(); + phi -= pEqn.flux(); // Explicitly relax pressure for momentum corrector - pd.relax(); + p.relax(); // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure - U -= rUA*fvc::reconstruct((buoyancyPhi + pdEqn.flux())/rUAf); + U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf); U.correctBoundaryConditions(); } } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H index 585128dfdeb7d5e5212f9412d9b415c05c15b752..82d101d8c1b18d88c41af9ffd0f7e4d10fa89cd2 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H @@ -1,13 +1,13 @@ singlePhaseTransportModel laminarTransport(U, phi); - // thermal expansion coefficient [1/K] + // Thermal expansion coefficient [1/K] dimensionedScalar beta(laminarTransport.lookup("beta")); - // reference temperature [K] + // Reference temperature [K] dimensionedScalar TRef(laminarTransport.lookup("TRef")); - // reference kinematic pressure [m2/s2] - dimensionedScalar pRef(laminarTransport.lookup("pRef")); + // Laminar Prandtl number + dimensionedScalar Pr(laminarTransport.lookup("Pr")); - // turbulent Prandtl number + // Turbulent Prandtl number dimensionedScalar Prt(laminarTransport.lookup("Prt")); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/writeAdditionalFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/writeAdditionalFields.H deleted file mode 100644 index 20f7c6ae1dcff80630dc2ca21253b1e824ea5d77..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/writeAdditionalFields.H +++ /dev/null @@ -1,29 +0,0 @@ -{ - volScalarField rhoEff - ( - IOobject - ( - "rhoEff", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - 1.0 - beta*(T - TRef) - ); - rhoEff.write(); - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rhoEff*(g & mesh.C()) + pRef - ); - p.write(); -} diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C b/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C index 83527f8215130271882402bac0f6d5769ba4f860..b5055812c40e362d420c08ab862c9db91e2469c5 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C @@ -27,13 +27,13 @@ Application Description Transient Solver for buoyant, turbulent flow of compressible fluids for - ventilation and heat-transfer. Turbulence is modelled using a run-time - selectable compressible RAS model. + ventilation and heat-transfer. Turbulence is modelled using a run-time + selectable compressible RAS or LES model. \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicRhoThermo.H" #include "turbulenceModel.H" #include "fixedGradientFvPatchFields.H" @@ -81,6 +81,8 @@ int main(int argc, char *argv[]) turbulence->correct(); + rho = thermo.rho(); + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H index f199713cf877086d8202d88a0b66d5e763d728d6..b8ac5595e47cec77aa257c54a1710f91b08f20f7 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H @@ -1,9 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicRhoThermo> pThermo ( - basicThermo::New(mesh) + basicRhoThermo::New(mesh) ); + basicRhoThermo& thermo = pThermo(); volScalarField rho ( @@ -15,12 +16,12 @@ IOobject::NO_READ, IOobject::NO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); Info<< "Reading field U\n" << endl; @@ -37,7 +38,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" Info<< "Creating turbulence model\n" << endl; @@ -48,7 +49,7 @@ rho, U, phi, - thermo() + thermo ) ); @@ -59,6 +60,8 @@ fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) ); - thermo->correct(); + thermo.correct(); dimensionedScalar initialMass = fvc::domainIntegrate(rho); + + dimensionedScalar totalVolume = sum(mesh.V()); diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/hEqn.H index f1a87c6a798229100ff3493a194d73ccfdd601b9..3125cc3ffa86ce120e7dbbf774c9b46941105418 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/hEqn.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/hEqn.H @@ -11,5 +11,5 @@ hEqn.relax(); hEqn.solve(); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H index 7e48167d67a938b8fb52993be324d2cc01185f72..c954c0ecb193a86033981bc7123725bc9335a9cc 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H @@ -1,7 +1,11 @@ { bool closedVolume = p.needReference(); - rho = thermo->rho(); + rho = thermo.rho(); + + // Thermodynamic density needs to be updated by psi*d(p) after the + // pressure solution - done in 2 parts. Part 1: + thermo.rho() -= psi*p; volScalarField rUA = 1.0/UEqn.A(); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); @@ -23,7 +27,7 @@ { fvScalarMatrix pEqn ( - fvm::ddt(psi, p) + fvc::ddt(rho) + psi*correction(fvm::ddt(p)) + fvc::div(phi) - fvm::laplacian(rhorUAf, p) ); @@ -43,6 +47,9 @@ } } + // Second part of thermodynamic density update + thermo.rho() += psi*p; + U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf); U.correctBoundaryConditions(); @@ -55,8 +62,10 @@ // to obey overall mass continuity if (closedVolume) { - p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) - /fvc::domainIntegrate(thermo->psi()); - rho = thermo->rho(); + p += + (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); + thermo.rho() = psi*p; + rho += (initialMass - fvc::domainIntegrate(rho))/totalVolume; } } diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index b2a8c5c374211719be84f7e03b6340f55a29e2e9..52f915bd7abe4b59a89aa7b30f1e40de0279e07c 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "RASModel.H" #include "fixedGradientFvPatchFields.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index 0d9d9d5ec7fc667216c1af6937a24f50d7905986..b304ace1046bbb82fff0318762b17848835cce1d 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -1,9 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); volScalarField rho ( @@ -15,11 +16,12 @@ IOobject::NO_READ, IOobject::NO_WRITE ), - thermo->rho() + thermo.rho() ); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); Info<< "Reading field U\n" << endl; @@ -36,7 +38,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" Info<< "Creating turbulence model\n" << endl; @@ -47,11 +49,11 @@ rho, U, phi, - thermo() + thermo ) ); - thermo->correct(); + thermo.correct(); label pRefCell = 0; scalar pRefValue = 0.0; diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/hEqn.H index dad078c2193a6797d2f08ed9751cdac4ca4ff157..0c507ce3d18bff29619626d62d5570c67e415cc2 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/hEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/hEqn.H @@ -14,5 +14,5 @@ eqnResidual = hEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/initConvergenceCheck.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/initConvergenceCheck.H index b56197f22a50cfd07b04fc14d40b9a5454da8c5b..c920b6708d044d177227d79973ed61bc7f2658fc 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/initConvergenceCheck.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/initConvergenceCheck.H @@ -1,4 +1,4 @@ -// initialize values for convergence checks + // initialize values for convergence checks scalar eqnResidual = 1, maxResidual = 0; scalar convergenceCriterion = 0; diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index d592bc3c43eb47f568b79f123f27dd95654fe6ff..e680e9421aee62a3dac1d09b8174005925399050 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -1,5 +1,5 @@ { - rho = thermo->rho(); + rho = thermo.rho(); volScalarField rUA = 1.0/UEqn().A(); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); @@ -39,8 +39,8 @@ // to obey overall mass continuity if (closedVolume) { - p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) - /fvc::domainIntegrate(thermo->psi()); + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); } // Calculate the conservative fluxes @@ -58,7 +58,7 @@ #include "continuityErrs.H" - rho = thermo->rho(); + rho = thermo.rho(); rho.relax(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C index 5996e6be23b5fe4d1845f46ea34965ada35422dd..c869eff89956a1b4e581fcdf6e1adf4643ecbfe4 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "RASModel.H" #include "fixedGradientFvPatchFields.H" #include "radiationModel.H" @@ -41,16 +41,15 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "createRadiationModel.H" + #include "initContinuityErrs.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "createRadiationModel.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -58,17 +57,17 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" -# include "initConvergenceCheck.H" + #include "readSIMPLEControls.H" + #include "initConvergenceCheck.H" - pd.storePrevIter(); + p.storePrevIter(); rho.storePrevIter(); // Pressure-velocity SIMPLE corrector { -# include "UEqn.H" -# include "hEqn.H" -# include "pEqn.H" + #include "UEqn.H" + #include "hEqn.H" + #include "pEqn.H" } turbulence->correct(); @@ -79,7 +78,7 @@ int main(int argc, char *argv[]) << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; -# include "convergenceCheck.H" + #include "convergenceCheck.H" } Info<< "End\n" << endl; diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/hEqn.H index 31462927b94bdd60bba71db3718e6d98a7e9defb..24b17645d2c3f62b38cdca9a4c7b908a8e08931f 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/hEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/hEqn.H @@ -7,7 +7,7 @@ == fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)) - p*fvc::div(phi/fvc::interpolate(rho)) - + radiation->Sh(thermo()) + + radiation->Sh(thermo) ); hEqn.relax(); @@ -15,7 +15,7 @@ eqnResidual = hEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); - thermo->correct(); + thermo.correct(); radiation->correct(); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 7ad940bcff1bf5910c2c78253d5068b78a80f768..54e1c8cb1840d4719b1f2f360a7ab3d4ba81b052 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" #include "fixedGradientFvPatchFields.H" #include "regionProperties.H" @@ -42,37 +42,36 @@ Description int main(int argc, char *argv[]) { - -# include "setRootCase.H" -# include "createTime.H" + #include "setRootCase.H" + #include "createTime.H" regionProperties rp(runTime); -# include "createFluidMeshes.H" -# include "createSolidMeshes.H" + #include "createFluidMeshes.H" + #include "createSolidMeshes.H" -# include "createFluidFields.H" -# include "createSolidFields.H" + #include "createFluidFields.H" + #include "createSolidFields.H" -# include "initContinuityErrs.H" + #include "initContinuityErrs.H" -# include "readTimeControls.H" + #include "readTimeControls.H" if (fluidRegions.size()) { -# include "compressibleMultiRegionCourantNo.H" -# include "setInitialDeltaT.H" + #include "compressibleMultiRegionCourantNo.H" + #include "setInitialDeltaT.H" } while (runTime.run()) { -# include "readTimeControls.H" -# include "readPIMPLEControls.H" + #include "readTimeControls.H" + #include "readPIMPLEControls.H" if (fluidRegions.size()) { -# include "compressibleMultiRegionCourantNo.H" -# include "setDeltaT.H" + #include "compressibleMultiRegionCourantNo.H" + #include "setDeltaT.H" } runTime++; @@ -83,8 +82,8 @@ int main(int argc, char *argv[]) { forAll(fluidRegions, i) { -# include "setRegionFluidFields.H" -# include "storeOldFluidFields.H" + #include "setRegionFluidFields.H" + #include "storeOldFluidFields.H" } } @@ -96,18 +95,18 @@ int main(int argc, char *argv[]) { Info<< "\nSolving for fluid region " << fluidRegions[i].name() << endl; -# include "setRegionFluidFields.H" -# include "readFluidMultiRegionPIMPLEControls.H" -# include "solveFluid.H" + #include "setRegionFluidFields.H" + #include "readFluidMultiRegionPIMPLEControls.H" + #include "solveFluid.H" } forAll(solidRegions, i) { Info<< "\nSolving for solid region " << solidRegions[i].name() << endl; -# include "setRegionSolidFields.H" -# include "readSolidMultiRegionPIMPLEControls.H" -# include "solveSolid.H" + #include "setRegionSolidFields.H" + #include "readSolidMultiRegionPIMPLEControls.H" + #include "solveSolid.H" } } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H index fd9624685f8fcc07cc4f82d014676fb469bbd064..7aa01dee7939de0bf5ce3595f0cefc73a5d7653f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H @@ -1,5 +1,5 @@ // Initialise fluid field pointer lists - PtrList<basicThermo> thermoFluid(fluidRegions.size()); + PtrList<basicPsiThermo> thermoFluid(fluidRegions.size()); PtrList<volScalarField> rhoFluid(fluidRegions.size()); PtrList<volScalarField> KFluid(fluidRegions.size()); PtrList<volVectorField> UFluid(fluidRegions.size()); @@ -19,7 +19,7 @@ thermoFluid.set ( i, - basicThermo::New(fluidRegions[i]).ptr() + basicPsiThermo::New(fluidRegions[i]).ptr() ); Info<< " Adding to rhoFluid\n" << endl; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H index 72c9bbc4faf7e81c0fd759466c210a536929ff2c..29aea044664c8a7c2045525c5e94d94e0c0b1e48 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H @@ -1,6 +1,6 @@ const fvMesh& mesh = fluidRegions[i]; - basicThermo& thermo = thermoFluid[i]; + basicPsiThermo& thermo = thermoFluid[i]; volScalarField& rho = rhoFluid[i]; volScalarField& K = KFluid[i]; volVectorField& U = UFluid[i]; diff --git a/applications/solvers/incompressible/channelFoam/readTransportProperties.H b/applications/solvers/incompressible/channelFoam/readTransportProperties.H index c99d0ae4b5b97f4ed18765efe9a69103ba08e2c3..87c93c9195880f243c7ac035020345c283fd2450 100644 --- a/applications/solvers/incompressible/channelFoam/readTransportProperties.H +++ b/applications/solvers/incompressible/channelFoam/readTransportProperties.H @@ -7,7 +7,8 @@ runTime.constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) ); diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/files b/applications/solvers/lagrangian/coalChemistryFoam/Make/files similarity index 100% rename from applications/solvers/combustion/coalChemistryFoam/Make/files rename to applications/solvers/lagrangian/coalChemistryFoam/Make/files diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options similarity index 92% rename from applications/solvers/combustion/coalChemistryFoam/Make/options rename to applications/solvers/lagrangian/coalChemistryFoam/Make/options index d1dd07691bb4999db85d94725ccac1ee912e6173..b7abd77a175372229b37f37bd8151117e904f3c2 100644 --- a/applications/solvers/combustion/coalChemistryFoam/Make/options +++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options @@ -13,7 +13,7 @@ EXE_INC = \ -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/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude @@ -33,7 +33,7 @@ EXE_LIBS = \ -lsolids \ -lsolidMixture \ -lthermophysicalFunctions \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ -lODE diff --git a/applications/solvers/combustion/coalChemistryFoam/UEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H similarity index 100% rename from applications/solvers/combustion/coalChemistryFoam/UEqn.H rename to applications/solvers/lagrangian/coalChemistryFoam/UEqn.H diff --git a/applications/solvers/combustion/coalChemistryFoam/YEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H similarity index 100% rename from applications/solvers/combustion/coalChemistryFoam/YEqn.H rename to applications/solvers/lagrangian/coalChemistryFoam/YEqn.H diff --git a/applications/solvers/combustion/coalChemistryFoam/chemistry.H b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H similarity index 100% rename from applications/solvers/combustion/coalChemistryFoam/chemistry.H rename to applications/solvers/lagrangian/coalChemistryFoam/chemistry.H diff --git a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C similarity index 95% rename from applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C rename to applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index f5fc4faea60a3445be00566bfcad67f9904cfbbc..9abc94a829723b9e1db1d27fe30fd34569e9a5b3 100644 --- a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -36,9 +36,9 @@ Description #include "turbulenceModel.H" #include "basicThermoCloud.H" #include "CoalCloud.H" -#include "chemistryModel.H" +#include "psiChemistryModel.H" #include "chemistrySolver.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "timeActivatedExplicitCellSource.H" #include "radiationModel.H" @@ -113,12 +113,9 @@ int main(int argc, char *argv[]) turbulence->correct(); - rho = thermo->rho(); + rho = thermo.rho(); - if (runTime.write()) - { - #include "additionalOutput.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/combustion/coalChemistryFoam/createClouds.H b/applications/solvers/lagrangian/coalChemistryFoam/createClouds.H similarity index 75% rename from applications/solvers/combustion/coalChemistryFoam/createClouds.H rename to applications/solvers/lagrangian/coalChemistryFoam/createClouds.H index 4ed459b1507d7064f1a996c6aad3e0dcac95331b..0a5fd91b756b58ec1b2bbadae9b72751a1ce2813 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createClouds.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createClouds.H @@ -1,11 +1,11 @@ Info<< "\nConstructing coal cloud" << endl; -CoalCloud<specieReactingProperties> coalParcels +CoalCloud<gasThermoPhysics> coalParcels ( "coalCloud1", rho, U, g, - thermo() + thermo ); Info<< "\nConstructing limestone cloud" << endl; @@ -15,5 +15,5 @@ basicThermoCloud limestoneParcels rho, U, g, - thermo() + thermo ); diff --git a/applications/solvers/combustion/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H similarity index 79% rename from applications/solvers/combustion/coalChemistryFoam/createFields.H rename to applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 7232cc424478db7ab9195ca6fef16e61fdf98110..bba39fe8627d330b08eab8f586835fbe37449e39 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -1,19 +1,30 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<hCombustionThermo> thermo + autoPtr<psiChemistryModel> pChemistry ( - hCombustionThermo::New(mesh) + psiChemistryModel::New(mesh) ); + psiChemistryModel& chemistry = pChemistry(); - combustionMixture& composition = thermo->composition(); + hCombustionThermo& thermo = chemistry.thermo(); + + basicMultiComponentMixture& composition = thermo.composition(); PtrList<volScalarField>& Y = composition.Y(); - word inertSpecie(thermo->lookup("inertSpecie")); + word inertSpecie(thermo.lookup("inertSpecie")); + + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& T = thermo.T(); + const volScalarField& psi = thermo.psi(); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& T = thermo->T(); - const volScalarField& psi = thermo->psi(); + multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; + + forAll (Y, i) + { + fields.add(Y[i]); + } + fields.add(h); volScalarField rho ( @@ -25,7 +36,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); // lagrangian effective density field - used externally (optional) @@ -73,7 +84,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" DimensionedField<scalar, volMesh> kappa ( @@ -97,13 +108,16 @@ rho, U, phi, - thermo() + thermo ) ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + "DpDt", + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); Info<< "\nConstructing explicit enthalpy cell source" << endl; timeActivatedExplicitCellSource enthalpySource @@ -112,18 +126,3 @@ mesh, h.dimensions()*phi.dimensions()/mesh.V().dimensions() ); - - Info << "Constructing chemical mechanism" << endl; - chemistryModel chemistry - ( - thermo(), - rho - ); - - multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; - - forAll (Y, i) - { - fields.add(Y[i]); - } - fields.add(h); diff --git a/applications/solvers/combustion/coalChemistryFoam/hEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/hEqn.H similarity index 76% rename from applications/solvers/combustion/coalChemistryFoam/hEqn.H rename to applications/solvers/lagrangian/coalChemistryFoam/hEqn.H index 6f0d5324379d84066f24c78911b6c0e6d32ab766..2eaf6315cfb9fabe9f4f2ae6e1149fbd111c9739 100644 --- a/applications/solvers/combustion/coalChemistryFoam/hEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/hEqn.H @@ -2,21 +2,21 @@ fvScalarMatrix hEqn ( fvm::ddt(rho, h) - + fvm::div(phi, h) + + mvConvection->fvmDiv(phi, h) - fvm::laplacian(turbulence->alphaEff(), h) == DpDt + coalParcels.Sh() + limestoneParcels.Sh() + enthalpySource.Su() - + radiation->Sh(thermo()) + + radiation->Sh(thermo) ); hEqn.relax(); hEqn.solve(); - thermo->correct(); + thermo.correct(); radiation->correct(); } diff --git a/applications/solvers/combustion/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H similarity index 95% rename from applications/solvers/combustion/coalChemistryFoam/pEqn.H rename to applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 4a94c725bc13905bc9f015c54ed8741f7f7c8da4..b31ad45ed4529b30d6d0dbc6c32c1b1e7f5ca6f0 100644 --- a/applications/solvers/combustion/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/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) diff --git a/applications/solvers/combustion/coalChemistryFoam/readChemistryProperties.H b/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H similarity index 90% rename from applications/solvers/combustion/coalChemistryFoam/readChemistryProperties.H rename to applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H index 1a60e6fb34645a004fd39321f7a54d3bd5b45381..ab51afe28361cdf65bc74af68961a6732535d6b3 100644 --- a/applications/solvers/combustion/coalChemistryFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H @@ -8,7 +8,8 @@ IOdictionary chemistryProperties runTime.constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) ); diff --git a/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H similarity index 100% rename from applications/solvers/combustion/coalChemistryFoam/rhoEqn.H rename to applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/files b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..dfee7d7d19ff7f3015c4ea903a462dec1200e73a --- /dev/null +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/files @@ -0,0 +1,3 @@ +porousExplicitSourceReactingParcelFoam.C + +EXE = $(FOAM_APPBIN)/porousExplicitSourceReactingParcelFoam diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/options b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options similarity index 92% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/Make/options rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options index 54d7b744d4c7a23d0992ee5c6b127cc63cbc6c93..76bc8b084f460664af2e459e21f691c45be205e4 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options @@ -13,7 +13,7 @@ EXE_INC = \ -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/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude @@ -32,7 +32,7 @@ EXE_LIBS = \ -lsolids \ -lsolidMixture \ -lthermophysicalFunctions \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ -lODE diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H similarity index 86% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/UEqn.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H index c82307305b8cba5e0877a7f0a13784ab2f66978b..3fbe9f63b5dccde3146aa0a98f151bb68f61bdd0 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H @@ -1,11 +1,12 @@ fvVectorMatrix UEqn ( - fvm::ddt(rho, U) +// fvm::ddt(rho, U) + pZones.ddt(rho, U) + fvm::div(phi, U) + turbulence->divDevRhoReff(U) == rho.dimensionedInternalField()*g - + reactingParcels.SU() + + parcels.SU() ); UEqn.relax(); @@ -32,16 +33,11 @@ { pZones.addResistance(UEqn); + trAU = 1.0/UEqn.A(); + trAU().rename("rAU"); + solve ( UEqn == -fvc::grad(p) ); - - trAU = 1.0/UEqn.A(); - trAU().rename("rAU"); - } - - if (momentumPredictor) - { - solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H similarity index 88% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/YEqn.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index 8f77f23bc2f3f3799ed84830c75eab4bbd5b438b..1623b746649eea235a3cdb5a8e45094a26940cd6 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -26,9 +26,10 @@ tmp<fv::convectionScheme<scalar> > mvConvection + mvConvection->fvmDiv(phi, Yi) - fvm::laplacian(turbulence->muEff(), Yi) == - reactingParcels.Srho(i) + parcels.Srho(i) + kappa*chemistry.RR(i)().dimensionedInternalField() - + pointMassSources.Su(i) + + pointMassSources.Su(i), + mesh.solver("Yi") ); Yi.max(0.0); diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H similarity index 100% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/chemistry.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/createClouds.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H similarity index 54% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/createClouds.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H index aaf91c81cc6ce8c5ba6248863458b17d98b4fd79..728e605e572d043b2b0158ebe8a57f5741e3fe09 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/createClouds.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createClouds.H @@ -1,9 +1,9 @@ Info<< "\nConstructing reacting cloud" << endl; -BasicTrackedReactingCloud<specieReactingProperties> reactingParcels +BasicReactingCloud<icoPoly8ThermoPhysics> parcels ( "reactingCloud1", rho, U, g, - thermo() + thermo ); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..da3cca5a5b935f9b7a0d76d66f03c785fdff8ecd --- /dev/null +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -0,0 +1,89 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<rhoChemistryModel> pChemistry + ( + rhoChemistryModel::New(mesh) + ); + rhoChemistryModel& chemistry = pChemistry(); + + hReactionThermo& thermo = chemistry.thermo(); + + basicMultiComponentMixture& composition = thermo.composition(); + PtrList<volScalarField>& 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<scalar, volMesh> 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<compressible::turbulenceModel> turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + Info<< "Creating field DpDt\n" << endl; + volScalarField DpDt + ( + "DpDt", + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); + + multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; + + forAll (Y, i) + { + fields.add(Y[i]); + } + fields.add(h); diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/createMulticomponentPointSources.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createMulticomponentPointSources.H similarity index 100% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/createMulticomponentPointSources.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createMulticomponentPointSources.H diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H new file mode 100644 index 0000000000000000000000000000000000000000..caed85ecba899c76d9f3dcce50d474ef1114e1bf --- /dev/null +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createPorousZones.H @@ -0,0 +1,21 @@ + Info<< "Creating porous zones" << nl << endl; + + porousZones pZones(mesh); + Switch pressureImplicitPorosity(false); + + label nUCorr = 0; + if (pZones.size()) + { + // nUCorrectors for pressureImplicitPorosity + if (mesh.solutionDict().subDict("PISO").found("nUCorrectors")) + { + mesh.solutionDict().subDict("PISO").lookup("nUCorrectors") + >> nUCorr; + } + + if (nUCorr > 0) + { + pressureImplicitPorosity = true; + } + } + diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H similarity index 64% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/hEqn.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H index 32e71555369290be7d019af0f4d6ad15473ee064..d686e452f46f053c7b52f7b19872f964d9c054ef 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/hEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hEqn.H @@ -2,19 +2,19 @@ fvScalarMatrix hEqn ( fvm::ddt(rho, h) - + fvm::div(phi, h) + + mvConvection->fvmDiv(phi, h) - fvm::laplacian(turbulence->alphaEff(), h) == DpDt - + reactingParcels.Sh() - + radiation->Sh(thermo()) + + parcels.Sh() + + radiation->Sh(thermo) ); hEqn.relax(); hEqn.solve(); - thermo->correct(); + thermo.correct(); radiation->correct(); } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..be4c14c8e5e01ffb045a749b5451e00e59f75ac0 --- /dev/null +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -0,0 +1,138 @@ +{ + rho = thermo.rho(); + + // Thermodynamic density needs to be updated by psi*d(p) after the + // pressure solution - done in 2 parts. Part 1: + thermo.rho() -= psi*p; + + if (pressureImplicitPorosity) + { + U = trTU()&UEqn.H(); + } + else + { + U = trAU()*UEqn.H(); + } + + if (transonic) + { + surfaceScalarField phiv = fvc::interpolate(U) & mesh.Sf(); + + phi = fvc::interpolate(rho)*phiv; + + surfaceScalarField phid("phid", fvc::interpolate(psi)*phiv); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + tmp<fvScalarMatrix> lapTerm; + + if (pressureImplicitPorosity) + { + lapTerm = fvm::laplacian(rho*trTU(), p); + } + else + { + lapTerm = fvm::laplacian(rho*trAU(), p); + } + + fvScalarMatrix pEqn + ( + fvc::ddt(rho) + fvc::div(phi) + + correction(psi*fvm::ddt(p) + fvm::div(phid, p)) + - lapTerm() + == + parcels.Srho() + + pointMassSources.Su() + ); + + if + ( + oCorr == nOuterCorr-1 + && corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + { + pEqn.solve(mesh.solver("pFinal")); + } + else + { + pEqn.solve(); + } + + if (nonOrth == nNonOrthCorr) + { + phi == pEqn.flux(); + } + } + } + else + { + phi = + fvc::interpolate(rho) + *( + (fvc::interpolate(U) & mesh.Sf()) +// + fvc::ddtPhiCorr(trAU(), rho, U, phi) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + tmp<fvScalarMatrix> lapTerm; + + if (pressureImplicitPorosity) + { + lapTerm = fvm::laplacian(rho*trTU(), p); + } + else + { + lapTerm = fvm::laplacian(rho*trAU(), p); + } + + fvScalarMatrix pEqn + ( + fvc::ddt(rho) + psi*correction(fvm::ddt(p)) + + fvc::div(phi) + - lapTerm() + == + parcels.Srho() + + pointMassSources.Su() + ); + + if + ( + oCorr == nOuterCorr-1 + && corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + { + pEqn.solve(mesh.solver("pFinal")); + } + else + { + pEqn.solve(); + } + + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); + } + } + } + + // Second part of thermodynamic density update + thermo.rho() += psi*p; + + #include "rhoEqn.H" + #include "compressibleContinuityErrs.H" + + if (pressureImplicitPorosity) + { + U -= trTU()&fvc::grad(p); + } + else + { + U -= trAU()*fvc::grad(p); + } + U.correctBoundaryConditions(); + + DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +} diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/trackedReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C similarity index 83% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/trackedReactingParcelFoam.C rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index 62af964eba7dad29b1c2517c025d02af76df1c38..3db0d3827dc6bcd9ecbcac2541de7e97d576ef81 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/trackedReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -23,18 +23,25 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application + trackedReactingParcelFoam Description + - reacting parcel cloud tracking + - porous media + - point mass sources + - polynomial based, incompressible thermodynamics (f(T)) + + Note: ddtPhiCorr not used here - not well defined for porous calcs \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "hCombustionThermo.H" +#include "hReactionThermo.H" #include "turbulenceModel.H" -#include "BasicTrackedReactingCloud.H" -#include "chemistryModel.H" +#include "BasicReactingCloud.H" +#include "rhoChemistryModel.H" #include "chemistrySolver.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "radiationModel.H" #include "porousZones.H" #include "timeActivatedExplicitMulticomponentPointSource.H" @@ -53,6 +60,7 @@ int main(int argc, char *argv[]) #include "createRadiationModel.H" #include "createClouds.H" #include "createMulticomponentPointSources.H" + #include "createPorousZones.H" #include "readPISOControls.H" #include "initContinuityErrs.H" #include "readTimeControls.H" @@ -74,23 +82,23 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - reactingParcels.evolve(); + parcels.evolve(); - reactingParcels.info(); + parcels.info(); #include "chemistry.H" #include "rhoEqn.H" + #include "UEqn.H" // --- PIMPLE loop - for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) + 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 "hEqn.H" #include "pEqn.H" } @@ -100,12 +108,9 @@ int main(int argc, char *argv[]) turbulence->correct(); - rho = thermo->rho(); + rho = thermo.rho(); - if (runTime.write()) - { - #include "additionalOutput.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H similarity index 90% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/readChemistryProperties.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H index 1a60e6fb34645a004fd39321f7a54d3bd5b45381..ab51afe28361cdf65bc74af68961a6732535d6b3 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H @@ -8,7 +8,8 @@ IOdictionary chemistryProperties runTime.constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) ); diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H similarity index 90% rename from applications/solvers/lagrangian/trackedReactingParcelFoam/rhoEqn.H rename to applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H index faadc1ecfbb1c8347bc8e6b1b6102f1a0ab911c4..5bc5e120a01dee5c2ac7434c3700503b66fe4e8e 100644 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,14 +31,18 @@ Description \*---------------------------------------------------------------------------*/ { - solve + fvScalarMatrix rhoEqn ( fvm::ddt(rho) + fvc::div(phi) == - reactingParcels.Srho() + parcels.Srho() + pointMassSources.Su() ); + + rhoEqn.relax(); + + rhoEqn.solve(); } // ************************************************************************* // diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index 7d9fba61432e98b3f2cf2b390e4dcc547d488f8a..d10253a8fa3615ecf3f0d435390af869fb16a743 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -12,7 +12,7 @@ EXE_INC = \ -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/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude @@ -31,7 +31,7 @@ EXE_LIBS = \ -lsolids \ -lsolidMixture \ -lthermophysicalFunctions \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lchemistryModel \ -lradiation \ -lODE diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index c7ade57fbeaf33effb8d4fef4abd4bda4b0e0551..5cf44cb09fef5500b0813c099abc57c433cee9cc 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -26,7 +26,8 @@ tmp<fv::convectionScheme<scalar> > mvConvection - fvm::laplacian(turbulence->muEff(), Yi) == parcels.Srho(i) - + kappa*chemistry.RR(i)().dimensionedInternalField() + + kappa*chemistry.RR(i)().dimensionedInternalField(), + mesh.solver("Yi") ); Yi.max(0.0); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/additionalOutput.H b/applications/solvers/lagrangian/reactingParcelFoam/additionalOutput.H deleted file mode 100644 index 9edd35eb7cab9acd294ba6a9e73b6ee8087b1c0d..0000000000000000000000000000000000000000 --- a/applications/solvers/lagrangian/reactingParcelFoam/additionalOutput.H +++ /dev/null @@ -1,48 +0,0 @@ -{ - tmp<volScalarField> 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/createClouds.H b/applications/solvers/lagrangian/reactingParcelFoam/createClouds.H index fcab29c923c274b45ec86647cb3b5eb3a54ecc7b..4ae0633ab7bc74f993286571c10f3c52f645e7e4 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createClouds.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createClouds.H @@ -1,9 +1,9 @@ Info<< "\nConstructing reacting cloud" << endl; -BasicReactingCloud<specieReactingProperties> parcels +BasicReactingCloud<gasThermoPhysics> parcels ( "reactingCloud1", rho, U, g, - thermo() + thermo ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index 8f0d59e77d4d2e88e6080b7b029dcb1facefa450..ec820fa5e364dcc3a56781d08bf9ac2dc7925ad0 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -1,19 +1,22 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<hCombustionThermo> thermo + autoPtr<psiChemistryModel> pChemistry ( - hCombustionThermo::New(mesh) + psiChemistryModel::New(mesh) ); + psiChemistryModel& chemistry = pChemistry(); - combustionMixture& composition = thermo->composition(); + hCombustionThermo& thermo = chemistry.thermo(); + + basicMultiComponentMixture& composition = thermo.composition(); PtrList<volScalarField>& Y = composition.Y(); - word inertSpecie(thermo->lookup("inertSpecie")); + word inertSpecie(thermo.lookup("inertSpecie")); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& T = thermo->T(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& T = thermo.T(); + const volScalarField& psi = thermo.psi(); volScalarField rho ( @@ -25,7 +28,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); Info<< "\nReading field U\n" << endl; @@ -42,7 +45,7 @@ mesh ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" DimensionedField<scalar, volMesh> kappa ( @@ -66,19 +69,15 @@ rho, U, phi, - thermo() + 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 + volScalarField DpDt ( - thermo(), - rho + "DpDt", + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) ); multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H index 7909d8c67d2b3962b6da9a75da8637ccd4673ed0..d686e452f46f053c7b52f7b19872f964d9c054ef 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H @@ -2,19 +2,19 @@ fvScalarMatrix hEqn ( fvm::ddt(rho, h) - + fvm::div(phi, h) + + mvConvection->fvmDiv(phi, h) - fvm::laplacian(turbulence->alphaEff(), h) == DpDt + parcels.Sh() - + radiation->Sh(thermo()) + + radiation->Sh(thermo) ); hEqn.relax(); hEqn.solve(); - thermo->correct(); + thermo.correct(); radiation->correct(); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 63370f0cd41ea582ddaa646e9861f7d362293f00..d27afcce8ac2464b63b09e05645bcb5de6aa1282 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/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) @@ -37,8 +37,8 @@ if (transonic) else { phi = - fvc::interpolate(rho)* - ( + fvc::interpolate(rho) + *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index 3c2182d2bc36156e3b02a2e195e4d94be92ac425..f60de4a3690648beffdbd72e14e1077c1902180b 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -35,9 +35,9 @@ Description #include "hCombustionThermo.H" #include "turbulenceModel.H" #include "BasicReactingCloud.H" -#include "chemistryModel.H" +#include "psiChemistryModel.H" #include "chemistrySolver.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -100,12 +100,9 @@ int main(int argc, char *argv[]) turbulence->correct(); - rho = thermo->rho(); + rho = thermo.rho(); - if (runTime.write()) - { - #include "additionalOutput.H" - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H index 1a60e6fb34645a004fd39321f7a54d3bd5b45381..ab51afe28361cdf65bc74af68961a6732535d6b3 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H @@ -8,7 +8,8 @@ IOdictionary chemistryProperties runTime.constant(), mesh, IOobject::MUST_READ, - IOobject::NO_WRITE + IOobject::NO_WRITE, + false ) ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H index 1b2882a2b7b7e6bd09521babeb2cda56feb5f0aa..131c144114eb2b6f04bfd0798ec2facac0516ef0 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/files b/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/files deleted file mode 100644 index 90e8aa5b4bbda928a7b5c9c7993b24ffdcbf0bab..0000000000000000000000000000000000000000 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -trackedReactingParcelFoam.C - -EXE = $(FOAM_APPBIN)/trackedReactingParcelFoam diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/additionalOutput.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/additionalOutput.H deleted file mode 100644 index 9edd35eb7cab9acd294ba6a9e73b6ee8087b1c0d..0000000000000000000000000000000000000000 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/additionalOutput.H +++ /dev/null @@ -1,48 +0,0 @@ -{ - tmp<volScalarField> 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/trackedReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/createFields.H deleted file mode 100644 index b9cea162f4a863babc5ef3536cf68e2451c84297..0000000000000000000000000000000000000000 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/createFields.H +++ /dev/null @@ -1,111 +0,0 @@ - Info<< "Reading thermophysical properties" << nl << endl; - - autoPtr<hCombustionThermo> thermo - ( - hCombustionThermo::New(mesh) - ); - - combustionMixture& composition = thermo->composition(); - PtrList<volScalarField>& 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<< "Reading field U" << nl << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - -# include "compressibleCreatePhi.H" - - DimensionedField<scalar, volMesh> kappa - ( - IOobject - ( - "kappa", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("zero", dimless, 0.0) - ); - - Info<< "Creating turbulence model" << nl << endl; - autoPtr<compressible::turbulenceModel> turbulence - ( - compressible::turbulenceModel::New - ( - rho, - U, - phi, - thermo() - ) - ); - - Info<< "Creating field DpDt" << nl << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); - - Info << "Constructing chemical mechanism" << nl << endl; - chemistryModel chemistry - ( - thermo(), - rho - ); - - multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; - - forAll (Y, i) - { - fields.add(Y[i]); - } - fields.add(h); - - Info<< "Creating porous zones" << nl << endl; - porousZones pZones(mesh); - Switch pressureImplicitPorosity(false); - - label nUCorr = 0; - if (pZones.size()) - { - // nUCorrectors for pressureImplicitPorosity - if (mesh.solutionDict().subDict("PISO").found("nUCorrectors")) - { - mesh.solutionDict().subDict("PISO").lookup("nUCorrectors") - >> nUCorr; - } - - if (nUCorr > 0) - { - pressureImplicitPorosity = true; - } - } - diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H deleted file mode 100644 index b6207ce0c4df93ff1272e297b0eb5c7553976c1c..0000000000000000000000000000000000000000 --- a/applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H +++ /dev/null @@ -1,110 +0,0 @@ -rho = thermo->rho(); - -if (pressureImplicitPorosity) -{ - U = trTU()&UEqn.H(); -} -else -{ - U = trAU()*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++) - { - tmp<fvScalarMatrix> lapTerm; - - if (pressureImplicitPorosity) - { - lapTerm = fvm::laplacian(rho*trTU(), p); - } - else - { - lapTerm = fvm::laplacian(rho*trAU(), p); - } - - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvm::div(phid, p) - - lapTerm() - == - reactingParcels.Srho() - + pointMassSources.Su() - ); - - pEqn.solve(); - - if (nonOrth == nNonOrthCorr) - { - phi == pEqn.flux(); - } - } -} -else -{ - phi = - fvc::interpolate(rho) - *( - (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(trAU(), rho, U, phi) - ); - - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) - { - tmp<fvScalarMatrix> lapTerm; - - if (pressureImplicitPorosity) - { - lapTerm = fvm::laplacian(rho*trTU(), p); - } - else - { - lapTerm = fvm::laplacian(rho*trAU(), p); - } - - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvc::div(phi) - - lapTerm() - == - reactingParcels.Srho() - + pointMassSources.Su() - ); - - pEqn.solve(); - - if (nonOrth == nNonOrthCorr) - { - phi += pEqn.flux(); - } - } -} - -#include "rhoEqn.H" -#include "compressibleContinuityErrs.H" - -if (pressureImplicitPorosity) -{ - U -= trTU()&fvc::grad(p); -} -else -{ - U -= trAU()*fvc::grad(p); -} -U.correctBoundaryConditions(); - -DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); - diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options index 818e3717788426a0b9fac4956d1fd343500bec1f..83ef9251c59430f44264fc1a6733d120a19135a5 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/intermediate/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)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H index c76a81ca4666d882442b8c8f09663be378a134d0..78b0e8b552f8a9b63fce0a2bf52b545200d944f4 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H @@ -1,9 +1,10 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); volScalarField rho ( @@ -15,7 +16,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); Info<< "\nReading field U\n" << endl; @@ -42,7 +43,7 @@ rho, U, phi, - thermo() + thermo ) ); @@ -55,6 +56,6 @@ kinematicCloudName, rho, U, - thermo().mu(), + thermo.mu(), g ); diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index e4c2b396652630423cc6ed925e55a61b0203ce03..2039346411b21b7ac84a633416040c4e1ecc71d0 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" #include "basicKinematicCloud.H" diff --git a/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C b/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C index 66df8cfb9f260d31d788d24f20819ee5ed208629..af6de6def0bb1d6561b24052aee46724b67a2f54 100644 --- a/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C +++ b/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C @@ -26,7 +26,7 @@ Application bubbleFoam Description - Solver for a system of 2 incompressible fluid phases with one phase + Solver for a system of 2 incompressible fluid phases with one phase dispersed, e.g. gas bubbles in a liquid. \*---------------------------------------------------------------------------*/ @@ -40,16 +40,15 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "initContinuityErrs.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -57,30 +56,30 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readBubbleFoamControls.H" -# include "CourantNo.H" + #include "readBubbleFoamControls.H" + #include "CourantNo.H" -# include "alphaEqn.H" -# include "liftDragCoeffs.H" -# include "UEqns.H" + #include "alphaEqn.H" + #include "liftDragCoeffs.H" + #include "UEqns.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" if (correctAlpha) { -# include "alphaEqn.H" + #include "alphaEqn.H" } } -# include "DDtU.H" + #include "DDtU.H" -# include "kEpsilon.H" + #include "kEpsilon.H" -# include "write.H" + #include "write.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/multiphase/bubbleFoam/createFields.H b/applications/solvers/multiphase/bubbleFoam/createFields.H index 875a4f1be13550588c393b2d52e17a19e3990a4a..9aca6933fc300f754f064f3b2ad95c05168e7fdd 100644 --- a/applications/solvers/multiphase/bubbleFoam/createFields.H +++ b/applications/solvers/multiphase/bubbleFoam/createFields.H @@ -141,8 +141,8 @@ transportProperties.lookup("Ct") ); -# include "createPhia.H" -# include "createPhib.H" + #include "createPhia.H" + #include "createPhib.H" surfaceScalarField phi ( @@ -157,7 +157,7 @@ ); -# include "createRASTurbulence.H" + #include "createRASTurbulence.H" Info<< "Calculating field DDtUa and DDtUb\n" << endl; diff --git a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H index 016d1f4488c43c53bb22e11802bff96667712220..b1c8951b04ab389de71cbdf1a5efbc9193c734fb 100644 --- a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H +++ b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H @@ -9,7 +9,7 @@ if(turbulence) volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb()))); tgradUb.clear(); -# include "wallFunctions.H" + #include "wallFunctions.H" // Dissipation equation fvScalarMatrix epsEqn @@ -22,7 +22,7 @@ if(turbulence) - fvm::Sp(C2*beta*epsilon/k, epsilon) ); -# include "wallDissipation.H" + #include "wallDissipation.H" epsEqn.relax(); epsEqn.solve(); @@ -48,8 +48,7 @@ if(turbulence) //- Re-calculate turbulence viscosity nutb = Cmu*sqr(k)/epsilon; -# include "wallViscosity.H" - + #include "wallViscosity.H" } nuEffa = sqr(Ct)*nutb + nua; diff --git a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 12a8f4d49991b3e8f280bcef7f3274f05498a921..62aa7a076fbff1fb215ce1cda8f04cfd88119c13 100644 --- a/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C +++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C @@ -41,40 +41,39 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readThermodynamicProperties.H" + #include "readControls.H" + #include "createFields.H" + #include "initContinuityErrs.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" -# include "createTime.H" -# include "createMesh.H" -# include "readThermodynamicProperties.H" -# include "readControls.H" -# include "createFields.H" -# include "initContinuityErrs.H" -# include "compressibleCourantNo.H" -# include "setInitialDeltaT.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { -# include "readControls.H" -# include "CourantNo.H" -# include "setDeltaT.H" + #include "readControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; for (int outerCorr=0; outerCorr<nOuterCorr; outerCorr++) { -# include "rhoEqn.H" -# include "gammaPsi.H" -# include "UEqn.H" + #include "rhoEqn.H" + #include "gammaPsi.H" + #include "UEqn.H" for (int corr=0; corr<nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" } } diff --git a/applications/solvers/multiphase/cavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H index dc2f5e696129edaac8b20e59effedc957c975a24..49c7de1473355e69429cf309091dc81aaea5a563 100644 --- a/applications/solvers/multiphase/cavitatingFoam/createFields.H +++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H @@ -71,8 +71,8 @@ mesh ); -# include "createPhiv.H" -# include "compressibleCreatePhi.H" + #include "createPhiv.H" + #include "compressibleCreatePhi.H" Info<< "Reading transportProperties\n" << endl; diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index c22aa76479a0d503d22bc60af591a82a7733d850..979834717be78414443c08afdf542d4355eb5b64 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -24,7 +24,7 @@ phiv -= phiGradp/rhof; -# include "resetPhivPatches.H" + #include "resetPhivPatches.H" for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { @@ -82,6 +82,5 @@ Info<< "max-min rho: " << max(rho).value() << " " << min(rho).value() << endl; -# include "gammaPsi.H" - + #include "gammaPsi.H" } diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 7c8445a71d4465bae5514c86afbf83f6611ce057..916acde39ed5264a9f7bc765d3ec445b83519637 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -128,7 +128,7 @@ alpha.boundaryField().types() ); -# include "compressibleCreatePhi.H" + #include "compressibleCreatePhi.H" label pRefCell = 0; diff --git a/applications/solvers/multiphase/settlingFoam/settlingFoam.C b/applications/solvers/multiphase/settlingFoam/settlingFoam.C index ad8dbe3646cf2deb96e6affbdf75d155f2c90d37..e68ddbb0f0710ab911cc6855763e624c818c9883 100644 --- a/applications/solvers/multiphase/settlingFoam/settlingFoam.C +++ b/applications/solvers/multiphase/settlingFoam/settlingFoam.C @@ -43,17 +43,15 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "initContinuityErrs.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -61,27 +59,27 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readPISOControls.H" -# include "compressibleCourantNo.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" -# include "rhoEqn.H" + #include "rhoEqn.H" -# include "calcVdj.H" + #include "calcVdj.H" -# include "UEqn.H" + #include "UEqn.H" -# include "alphaEqn.H" + #include "alphaEqn.H" -# include "correctViscosity.H" + #include "correctViscosity.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" } -# include "kEpsilon.H" + #include "kEpsilon.H" runTime.write(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index b61566d924db04be243167e57d2250845b3c0b3c..b94bf6c23e65cb80f5557f2bccd1ecd8e4c23946 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -40,7 +40,7 @@ mesh ); -# include "createPhi.H" + #include "createPhi.H" Info<< "Reading transportProperties\n" << endl; twoPhaseMixture twoPhaseProperties(U, phi); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C index ce3fb2aa551eeb45011a373277d6d8e169c01b7e..a28d929578081eb03bee4d6599b6575dc40341b7 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C @@ -47,59 +47,58 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "readPPProperties.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "readPPProperties.H" -# include "initContinuityErrs.H" -# include "readTimeControls.H" -# include "CourantNo.H" -# include "setInitialDeltaT.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { -# include "readTwoPhaseEulerFoamControls.H" -# include "CourantNos.H" -# include "setDeltaT.H" + #include "readTwoPhaseEulerFoamControls.H" + #include "CourantNos.H" + #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; -# include "alphaEqn.H" + #include "alphaEqn.H" -# include "liftDragCoeffs.H" + #include "liftDragCoeffs.H" -# include "UEqns.H" + #include "UEqns.H" // --- PISO loop for (int corr=0; corr<nCorr; corr++) { -# include "pEqn.H" + #include "pEqn.H" if (correctAlpha && corr<nCorr-1) { -# include "alphaEqn.H" + #include "alphaEqn.H" } } -# include "DDtU.H" + #include "DDtU.H" -# include "kEpsilon.H" + #include "kEpsilon.H" if (kineticTheory.on()) { kineticTheory.solve(); nuEffa += kineticTheory.mua()/rhoa; } -# include "write.H" + #include "write.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/test/DynamicField/DynamicFieldTest.C b/applications/test/DynamicField/DynamicFieldTest.C new file mode 100644 index 0000000000000000000000000000000000000000..19ba78109d84db17ccdd443ac409db03bc5e30c2 --- /dev/null +++ b/applications/test/DynamicField/DynamicFieldTest.C @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Description + +\*---------------------------------------------------------------------------*/ + +#include "DynamicField.H" +#include "IOstreams.H" +#include "labelField.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + { + DynamicField<label> dl(10); + Pout<< "null construct dl:" << dl << endl; + dl.append(3); + dl.append(2); + dl.append(1); + Pout<< "appending : dl:" << dl << endl; + } + + { + DynamicField<label> dl(IStringStream("(1 2 3)")()); + Pout<< "reading : dl:" << dl << endl; + } + + { + labelField lf(3); + lf[0] = 1; + lf[1] = 2; + lf[2] = 3; + DynamicField<label> dl; + dl = lf; + Pout<< "assigning from labelField : dl:" << dl << endl; + } + + { + labelField lf(3); + lf[0] = 1; + lf[1] = 2; + lf[2] = 3; + DynamicField<label> dl(lf); + Pout<< "constructing from labelField dl:" << dl << endl; + } + + + Info<< "\nEnd\n"; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/DynamicField/Make/files b/applications/test/DynamicField/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..bcf6af7eceec7845507b794f6183bc83694839b6 --- /dev/null +++ b/applications/test/DynamicField/Make/files @@ -0,0 +1,3 @@ +DynamicFieldTest.C + +EXE = $(FOAM_USER_APPBIN)/DynamicFieldTest diff --git a/applications/test/DynamicField/Make/options b/applications/test/DynamicField/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..6a9e9810b3d5ce6684bdaf03143933480ff45e42 --- /dev/null +++ b/applications/test/DynamicField/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/readCHEMKINIII/Make/options b/applications/test/readCHEMKINIII/Make/options index dcc48758d3cc8768ef85a9c2e542f6503dcc63b6..233d9fa2ef5a1b20403b69c5470f3a5db127765a 100644 --- a/applications/test/readCHEMKINIII/Make/options +++ b/applications/test/readCHEMKINIII/Make/options @@ -1,8 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude EXE_LIBS = \ -lspecie \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels + -lreactionThermophysicalModels diff --git a/applications/test/speed/Make/files b/applications/test/speed/Make/files deleted file mode 100644 index 84a6d2fa6202cc1e7fb7482bfc9e23dc718b406d..0000000000000000000000000000000000000000 --- a/applications/test/speed/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -speedTest.C - -EXE = $(FOAM_USER_APPBIN)/speedTest diff --git a/applications/test/speed/Make/options b/applications/test/speed/Make/options deleted file mode 100644 index e68056198750cebb50fea02c6fffbf8db9220261..0000000000000000000000000000000000000000 --- a/applications/test/speed/Make/options +++ /dev/null @@ -1 +0,0 @@ -EXE_INC = /* -ffast-math -mtune=core2 */ diff --git a/applications/test/speed/scalarSpeedTest/Make/files b/applications/test/speed/scalarSpeedTest/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..dae64db89f8cb8366067016721994cf8b3d09b82 --- /dev/null +++ b/applications/test/speed/scalarSpeedTest/Make/files @@ -0,0 +1,3 @@ +scalarSpeedTest.C + +EXE = $(FOAM_USER_APPBIN)/scalarSpeedTest diff --git a/applications/test/speed/scalarSpeedTest/Make/options b/applications/test/speed/scalarSpeedTest/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/applications/test/speed/scalarSpeedTest/scalarSpeedTest.C b/applications/test/speed/scalarSpeedTest/scalarSpeedTest.C new file mode 100644 index 0000000000000000000000000000000000000000..e1858e2d42bf578d54a747c469019fedbd1a3bdd --- /dev/null +++ b/applications/test/speed/scalarSpeedTest/scalarSpeedTest.C @@ -0,0 +1,192 @@ +#include "primitiveFields.H" +#include "Random.H" +#include "cpuTime.H" +#include "IOstreams.H" +#include "OFstream.H" + +using namespace Foam; + +int main() +{ + Info<< "Initialising fields" << endl; + + const label nIter = 100; + const label size = 10000000; + const label rndAddrSkip = 40; + const label redFac = 6; + const label redSize = size/redFac; + Random genAddr(100); + + double* f1 = new double[size]; + double* f2 = new double[size]; + double* f3 = new double[size]; + double* f4 = new double[size]; + double* fr = new double[redSize]; + label* addr = new label[size]; + label* redAddr = new label[size]; + label* redAddr2 = new label[size]; + + for (register label i=0; i<size; i++) + { + f1[i] = 1.0; + f2[i] = 1.0; + f3[i] = 1.0; + addr[i] = i; + redAddr[i] = i/redFac; + redAddr2[i] = (size - i - 1)/redFac; + } + + for (register label i=0; i<size; i+=rndAddrSkip) + { + addr[i] = genAddr.integer(0, size-1); + } + + for (register label i=0; i<redSize; i++) + { + fr[i] = 1.0; + } + + Info<< "Done\n" <<endl; + + { + Info<< "Single loop combined operation (expression templates)" + << endl; + + cpuTime executionTime; + + for (int j=0; j<nIter; j++) + { + for (register label i=0; i<size; i++) + { + f4[i] = f1[i] + f2[i] - f3[i]; + } + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< f4[1] << endl << endl; + } + + { + Info<< "Single loop combined operation with indirect addressing" + << endl; + + cpuTime executionTime; + + for (int j=0; j<nIter; j++) + { + for (register label i=0; i<size; i++) + { + f4[addr[i]] = f1[addr[i]] + f2[addr[i]] - f3[addr[i]]; + } + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< f4[1] << endl << endl; + } + + { + Info<< "Single loop reduction operation" + << endl; + + cpuTime executionTime; + label redOffset = (size - 1)/redFac; + + for (int j=0; j<nIter; j++) + { + for (register label i=0; i<size; i++) + { + label j = i/redFac; + fr[j] += f1[i]; + fr[redOffset - j] -= f2[i]; + } + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< fr[1] << endl << endl; + } + + { + Info<< "Single loop reduction operation with indirect addressing" + << endl; + + cpuTime executionTime; + + for (int j=0; j<nIter; j++) + { + for (register label i=0; i<size; i++) + { + fr[redAddr[i]] += f1[i]; + fr[redAddr2[i]] -= f2[i]; + } + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< fr[1] << endl << endl; + } + + { + Info<< "Separate loops ?= operations" << endl; + + cpuTime executionTime; + + for (int j=0; j<nIter; j++) + { + for (register label i=0; i<size; i++) + { + f4[i] = f1[i]; + } + for (register label i=0; i<size; i++) + { + f4[i] += f2[i]; + } + for (register label i=0; i<size; i++) + { + f4[i] -= f3[i]; + } + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< f4[1] << endl << endl; + } + + { + Info<< "OpenFOAM field algebra" << endl; + + scalarField + sf1(size, 1.0), + sf2(size, 1.0), + sf3(size, 1.0), + sf4(size); + + cpuTime executionTime; + + for (int j=0; j<nIter; j++) + { + //sf4 = sf1 + sf2 - sf3; + sf4 = sf1; + sf4 += sf2; + sf4 -= sf3; + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< sf4[1] << endl << endl; + } +} diff --git a/applications/test/speed/speedTest.C b/applications/test/speed/speedTest.C deleted file mode 100644 index 052514359190204cbf8d9cab1fab1470461f9f2d..0000000000000000000000000000000000000000 --- a/applications/test/speed/speedTest.C +++ /dev/null @@ -1,99 +0,0 @@ -#include "primitiveFields.H" -#include "cpuTime.H" -#include "IOstreams.H" - -using namespace Foam; - -int main() -{ - const label nIter = 10; - const label size = 10000000; - - double* f1 = new double[size]; - double* f2 = new double[size]; - double* f3 = new double[size]; - double* f4 = new double[size]; - - for (register label i=0; i<size; i++) - { - f1[i] = 1.0; - f2[i] = 1.0; - f3[i] = 1.0; - } - - cpuTime executionTime1; - - for (int j=0; j<nIter; j++) - { - for (register label i=0; i<size; i++) - { - f4[i] = f1[i] + f2[i] - f3[i]; - } - } - - Info<< "ExecutionTime = " - << executionTime1.elapsedCpuTime() - << " s\n" << endl; - - Info << f4[1] << endl << endl; - - - scalarField sf1(size, 1.0), sf2(size, 1.0), sf3(size, 1.0), sf4(size); - - cpuTime executionTime2; - - for (register int j=0; j<nIter; j++) - { - sf4 = sf1 + sf2 - sf3; - //sf4 = sf1; - //sf4 += sf2; - //sf4 -= sf3; - } - - Info<< "ExecutionTime = " - << executionTime2.elapsedCpuTime() - << " s\n" << endl; - - Info << sf4[1] << endl << endl; - - - vectorField - vf1(size, vector::one), - vf2(size, vector::one), - vf3(size, vector::one), - vf4(size); - - cpuTime executionTime3; - - for (register int j=0; j<nIter; j++) - { - vf4 = vf1 + vf2 - vf3; - } - - Info<< "ExecutionTime = " - << executionTime3.elapsedCpuTime() - << " s\n" << endl; - - Info << vf4[1] << endl << endl; - - cpuTime executionTime4; - - scalarField sf11(size, 1.0), sf12(size, 1.0), sf13(size, 1.0), sf14(size); - scalarField sf21(size, 1.0), sf22(size, 1.0), sf23(size, 1.0), sf24(size); - scalarField sf31(size, 1.0), sf32(size, 1.0), sf33(size, 1.0), sf34(size); - - for (register int j=0; j<nIter; j++) - { - sf14 = sf11 + sf12 - sf13; - sf24 = sf21 + sf22 - sf23; - sf34 = sf31 + sf32 - sf33; - } - - Info<< "ExecutionTime = " - << executionTime4.elapsedCpuTime() - << " s\n" << endl; - - Info << sf14[1] << sf24[1] << sf34[1] << endl << endl; - - -} diff --git a/applications/test/speed/vectorSpeedTest/Make/files b/applications/test/speed/vectorSpeedTest/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..ccb0187615ed49e981498b9ad532c2f7b7b55326 --- /dev/null +++ b/applications/test/speed/vectorSpeedTest/Make/files @@ -0,0 +1,3 @@ +vectorSpeedTest.C + +EXE = $(FOAM_USER_APPBIN)/vectorSpeedTest diff --git a/applications/test/speed/vectorSpeedTest/Make/options b/applications/test/speed/vectorSpeedTest/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/applications/test/speed/vectorSpeedTest/vectorSpeedTest.C b/applications/test/speed/vectorSpeedTest/vectorSpeedTest.C new file mode 100644 index 0000000000000000000000000000000000000000..da802bab20e7c39767f97318d484536f127f5a40 --- /dev/null +++ b/applications/test/speed/vectorSpeedTest/vectorSpeedTest.C @@ -0,0 +1,39 @@ +#include "primitiveFields.H" +#include "cpuTime.H" +#include "IOstreams.H" +#include "OFstream.H" + +using namespace Foam; + +int main() +{ + const label nIter = 100; + const label size = 1000000; + + Info<< "Initialising fields" << endl; + + vectorField + vf1(size, vector::one), + vf2(size, vector::one), + vf3(size, vector::one), + vf4(size); + + Info<< "Done\n" << endl; + + { + cpuTime executionTime; + + Info<< "vectorField algebra" << endl; + + for (register int j=0; j<nIter; j++) + { + vf4 = vf1 + vf2 - vf3; + } + + Info<< "ExecutionTime = " + << executionTime.elapsedCpuTime() + << " s\n" << endl; + + Snull<< vf4[1] << endl << endl; + } +} diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 68eb9c46cfc2cb6b3d22b26e1d4c960382cee03e..23aec54cd871425b943c4efbd233a7e5c0e51022 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -657,6 +657,16 @@ void readCells << " tet :" << nTet << endl << endl; + if (cells.size() == 0) + { + FatalErrorIn("readCells(..)") + << "No cells read from file " << inFile.name() << nl + << "Does your file specify any 3D elements (hex=" << MSHHEX + << ", prism=" << MSHPRISM << ", pyramid=" << MSHPYR + << ", tet=" << MSHTET << ")?" << nl + << "Perhaps you have not exported the 3D elements?" + << exit(FatalError); + } Info<< "CellZones:" << nl << "Zone\tSize" << endl; diff --git a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H index 3347db180bbe769eefeb5a41762550409e5b16e2..aeb3137adfe091daaabbda9490016527a066afe9 100644 --- a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H +++ b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H @@ -1,7 +1,7 @@ - Info<< "Creating merge patch pairs" << nl << endl; - if (mergePatchPairs.size()) { + Info<< "Creating merge patch pairs" << nl << endl; + // Create and add point and face zones and mesh modifiers List<pointZone*> pz(mergePatchPairs.size()); List<faceZone*> fz(3*mergePatchPairs.size()); diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSetDict b/applications/utilities/mesh/manipulation/cellSet/cellSetDict index 95465d8f5421d2316b2a74f0404ea79e10700010..fd11ab871d9b66a0bb4b3c89feb0d7d8015b40c4 100644 --- a/applications/utilities/mesh/manipulation/cellSet/cellSetDict +++ b/applications/utilities/mesh/manipulation/cellSet/cellSetDict @@ -26,12 +26,31 @@ action new; topoSetSources ( + // Select by explicitly providing cell labels + labelToCell + { + value (12 13 56); // labels of cells + } + // Copy elements from cellSet cellToCell { set c1; } + // Cells in cell zone + zoneToCell + { + name ".*Zone"; // Name of cellZone, regular expressions allowed + } + + // Cells on master or slave side of faceZone + faceZoneToCell + { + name ".*Zone"; // Name of faceZone, regular expressions allowed + option master; // master/slave + } + // Select based on faceSet faceToCell { @@ -51,12 +70,6 @@ topoSetSources //option all; // cell with all points in pointSet } - // Select by explicitly providing cell labels - labelToCell - { - value (12 13 56); // labels of cells - } - // Select based on cellShape shapeToCell { @@ -87,7 +100,6 @@ topoSetSources radius 5.0; } - // Cells with centre within sphere sphereToCell { @@ -95,20 +107,6 @@ topoSetSources radius 5.0; } - // Cells in cell zone - zoneToCell - { - name ".*Zone"; // Name of cellZone, regular expressions allowed - } - - // values of field within certain range - fieldToCell - { - fieldName U; // Note: uses mag(U) since volVectorField - min 0.1; - max 0.5; - } - // Cells with cellCentre nearest to coordinates nearestToCell { @@ -129,6 +127,22 @@ topoSetSources // and near surf curvature // (set to -100 if not used) } + + // values of field within certain range + fieldToCell + { + fieldName U; // Note: uses mag(U) since volVectorField + min 0.1; + max 0.5; + } + + // Mesh region (non-face connected part of (subset of)mesh) + regionToCell + { + set c0; // name of cellSet giving mesh subset + insidePoint (1 2 3); // point inside region to select + } + ); diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSetDict b/applications/utilities/mesh/manipulation/pointSet/pointSetDict index 1c704a1868fe88c46be3e5d7f53a7eb184eae708..895dcd7f0aec3d01e875c335962a85ae0c6211f7 100644 --- a/applications/utilities/mesh/manipulation/pointSet/pointSetDict +++ b/applications/utilities/mesh/manipulation/pointSet/pointSetDict @@ -51,18 +51,24 @@ topoSetSources value (12 13 56); // labels of points } - // Points with coordinate within box - boxToPoint - { - box (0 0 0) (1 1 1); - } - // All points in pointzone zoneToPoint { name ".*Zone"; // name of pointZone, regular expressions allowed } + // Points nearest to coordinates + nearestToPoint + { + points ((0 0 0) (1 1 1)); + } + + // Points with coordinate within box + boxToPoint + { + box (0 0 0) (1 1 1); + } + // Select based on surface surfaceToPoint { diff --git a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C index dfd7262fd17ba65a287bd041289dbcc95475c7df..dcb744e801cb896101cfaf5a17ffaf8983f21f0a 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C +++ b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C @@ -28,8 +28,8 @@ Description There is one catch: for faceZones you also need to specify a flip condition which basically denotes the side of the face. In this app - it reads a cellSet (xxxCells if 'xxx' is the name of the faceSet) and - any face whose neighbour is in the cellSet gets a flip=true. + it reads a cellSet (xxxCells if 'xxx' is the name of the faceSet) which + is the masterCells of the zone. There are lots of situations in which this will go wrong but it is the best I can think of for now. @@ -201,13 +201,10 @@ int main(int argc, char *argv[]) if (!noFlipMap) { - word setName(set.name() + "Cells"); + word setName(set.name() + "SlaveCells"); Pout<< "Trying to load cellSet " << setName - << " to find out the flipMap." << nl - << "If the neighbour side of the face is in the cellSet" - << " the flipMap becomes true," << nl - << "in all other cases it stays false." + << " to find out the slave side of the zone." << nl << " If you do not care about the flipMap" << " (i.e. do not use the sideness)" << nl << "use the -noFlipMap command line option." @@ -230,7 +227,7 @@ int main(int argc, char *argv[]) && !cells.found(mesh.faceNeighbour()[faceI]) ) { - flip = false; + flip = true; } else if ( @@ -238,7 +235,7 @@ int main(int argc, char *argv[]) && cells.found(mesh.faceNeighbour()[faceI]) ) { - flip = true; + flip = false; } else { @@ -260,11 +257,11 @@ int main(int argc, char *argv[]) { if (cells.found(mesh.faceOwner()[faceI])) { - flip = false; + flip = true; } else { - flip = true; + flip = false; } } diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index de8242a89ffbb56259d8dec06155de72e98cb29e..ed65d154376ca5fb02e4738b07af1e0541e0d749 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -1,7 +1,7 @@ EXE_LIBS = \ -lbasicThermophysicalModels \ -lchemistryModel \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lcompressibleLESModels \ -ldecompositionMethods \ -ldieselSpray \ diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C index 0555309348f58078907baaa15c99b606ae7e8861..596c9e4f880dc8c415791596cab74a23a3d58be5 100644 --- a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C @@ -46,14 +46,20 @@ using namespace Foam; int main(int argc, char *argv[]) { -# include "setRootCase.H" + timeSelector::addOptions(); + #include "addRegionOption.H" -# include "createTime.H" + #include "setRootCase.H" + + #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMesh.H" -# include "createFields.H" + #include "createNamedMesh.H" + #include "createFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + fileName vtkPath(runTime.path()/"VTK"); + mkDir(vtkPath); Info<< "Scanning times to determine track data" << nl << endl; @@ -63,29 +69,28 @@ int main(int argc, char *argv[]) runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; - IOobject origProcHeader - ( - "origProc", - runTime.timeName(), - cloud::prefix/cloudName, - mesh, - IOobject::MUST_READ - ); - IOobject idHeader + IOobject positionsHeader ( - "id", + "positions", runTime.timeName(), cloud::prefix/cloudName, mesh, - IOobject::MUST_READ + IOobject::MUST_READ, + IOobject::NO_WRITE, + false ); - if (idHeader.headerOk() && origProcHeader.headerOk()) + + if (positionsHeader.headerOk()) { - IOField<label> origProc(origProcHeader); - IOField<label> id(idHeader); - forAll(id, i) + Info<< " Reading particle positions" << endl; + Cloud<passiveParticle> myCloud(mesh, cloudName, false); + + forAllConstIter(Cloud<passiveParticle>, myCloud, iter) { - maxIds[origProc[i]] = max(maxIds[origProc[i]], id[i]); + label origId = iter().origId(); + label origProc = iter().origProc(); + + maxIds[origProc] = max(maxIds[origProc], origId); } } } @@ -124,60 +129,35 @@ int main(int argc, char *argv[]) false ); - IOobject origProcHeader - ( - "origProc", - runTime.timeName(), - cloud::prefix/cloudName, - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ); - - IOobject idHeader - ( - "id", - runTime.timeName(), - cloud::prefix/cloudName, - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ); - - if - ( - positionsHeader.headerOk() - && origProcHeader.headerOk() - && idHeader.headerOk() - ) + if (positionsHeader.headerOk()) { Info<< " Reading particle positions" << endl; Cloud<passiveParticle> myCloud(mesh, cloudName, false); - Info<< " Reading particle id" << endl; - IOField<label> id(idHeader); + // collect the track data on the master processor + List<pointField> allPositions(Pstream::nProcs()); + allPositions[Pstream::myProcNo()].setSize + ( + myCloud.size(), + point::zero + ); - Info<< " Reading particle origProc" << endl; - IOField<label> origProc(origProcHeader); + List<labelField> allOrigIds(Pstream::nProcs()); + allOrigIds[Pstream::myProcNo()].setSize(myCloud.size(), 0); + + List<labelField> allOrigProcs(Pstream::nProcs()); + allOrigProcs[Pstream::myProcNo()].setSize(myCloud.size(), 0); - // collect the track data on the master processor label i = 0; - List<pointField> allPositions(Pstream::nProcs()); - allPositions[Pstream::myProcNo()].setSize(myCloud.size()); forAllConstIter(Cloud<passiveParticle>, myCloud, iter) { - allPositions[Pstream::myProcNo()][i++] = iter().position(); + allPositions[Pstream::myProcNo()][i] = iter().position(); + allOrigIds[Pstream::myProcNo()][i] = iter().origId(); + allOrigProcs[Pstream::myProcNo()][i] = iter().origProc(); + i++; } Pstream::gatherList(allPositions); - - List<labelList> allIds(Pstream::nProcs()); - allIds[Pstream::myProcNo()] = id; - Pstream::gatherList(allIds); - - List<labelList> allOrigProcs(Pstream::nProcs()); - allOrigProcs[Pstream::myProcNo()] = origProc; + Pstream::gatherList(allOrigIds); Pstream::gatherList(allOrigProcs); Info<< " Constructing tracks" << nl << endl; @@ -189,7 +169,7 @@ int main(int argc, char *argv[]) { label globalId = startIds[allOrigProcs[procI][i]] - + allIds[procI][i]; + + allOrigIds[procI][i]; if (globalId % sampleFrequency == 0) { @@ -216,7 +196,7 @@ int main(int argc, char *argv[]) { Info<< "\nWriting particle tracks" << nl << endl; - OFstream vtkTracks("particleTracks.vtk"); + OFstream vtkTracks(vtkPath/"particleTracks.vtk"); // Total number of points in tracks + 1 per track label nPoints = 0; diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C index 0843f3acf3b72ea161cfb5958493373792787fac..b9310ffc92c5a51be55475d778465399da550a32 100644 --- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C +++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C @@ -42,7 +42,7 @@ Description #include "incompressible/RAS/RASModel/RASModel.H" #include "incompressible/LES/LESModel/LESModel.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "compressible/RAS/RASModel/RASModel.H" #include "compressible/LES/LESModel/LESModel.H" @@ -194,7 +194,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) } else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0)) { - autoPtr<basicThermo> thermo(basicThermo::New(mesh)); + autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh)); volScalarField rho ( diff --git a/applications/utilities/postProcessing/velocityField/Mach/Mach.C b/applications/utilities/postProcessing/velocityField/Mach/Mach.C index daa4aa2ccf3d7aef33eef506761f46cb7c168a1c..2e7c517e9d0358f7bbdb37ea0e121384b755f356 100644 --- a/applications/utilities/postProcessing/velocityField/Mach/Mach.C +++ b/applications/utilities/postProcessing/velocityField/Mach/Mach.C @@ -33,7 +33,7 @@ Description \*---------------------------------------------------------------------------*/ #include "calc.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) @@ -66,9 +66,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) if (isFile(runTime.constantPath()/"thermophysicalProperties")) { // thermophysical Mach - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> thermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); volScalarField Cp = thermo->Cp(); diff --git a/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H b/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H index 4e4ea81b3d87463b4c8d91fb115e0ea465e4b41b..7283802f7790a6c0cf209195a9273e51697fc017 100644 --- a/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H +++ b/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H @@ -18,9 +18,9 @@ { volVectorField U(Uheader, mesh); - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> thermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); volScalarField Cp = thermo->Cp(); diff --git a/applications/utilities/postProcessing/velocityField/Pe/Pe.C b/applications/utilities/postProcessing/velocityField/Pe/Pe.C index 905074131d9f32b2d3d199dc8f12aae410343cb1..05c9ca1a0d2488dcd717df604e96f230f9cb9c7b 100644 --- a/applications/utilities/postProcessing/velocityField/Pe/Pe.C +++ b/applications/utilities/postProcessing/velocityField/Pe/Pe.C @@ -39,7 +39,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "incompressible/RAS/RASModel/RASModel.H" #include "incompressible/LES/LESModel/LESModel.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "compressible/RAS/RASModel/RASModel.H" #include "compressible/LES/LESModel/LESModel.H" @@ -204,7 +204,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { IOdictionary RASProperties(RASPropertiesHeader); - autoPtr<basicThermo> thermo(basicThermo::New(mesh)); + autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh)); volScalarField rho ( @@ -252,7 +252,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { IOdictionary LESProperties(LESPropertiesHeader); - autoPtr<basicThermo> thermo(basicThermo::New(mesh)); + autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh)); volScalarField rho ( diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options index 64ac8299174fe95e6954bf6c3f74967bbdd80004..8cdfe23fd1daf63d9c8e782f084eb202d891dd6e 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options @@ -2,13 +2,13 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -lcompressibleRASModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lfiniteVolume \ -lspecie \ -lbasicThermophysicalModels diff --git a/applications/utilities/thermophysical/chemkinToFoam/Make/options b/applications/utilities/thermophysical/chemkinToFoam/Make/options index d4d6f35e08864dde6a1a43d84ed4c5869ff005b6..7fe5ba4077fe6c57b2daafcc873b929c962665a2 100644 --- a/applications/utilities/thermophysical/chemkinToFoam/Make/options +++ b/applications/utilities/thermophysical/chemkinToFoam/Make/options @@ -1,8 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude EXE_LIBS = \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lbasicThermophysicalModels \ -lspecie diff --git a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H index fa32697e0a82449b8b9c7642ac06a3d6100db9b5..76bdd558601d023c9eaa24c9a2cbd128eb4421a1 100644 --- a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H +++ b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H @@ -129,16 +129,10 @@ public: // IOstream Operators - friend Istream& operator>> - #ifndef __CINT__ - <TemplateArgument> - #endif + friend Istream& operator>> <TemplateArgument> (Istream&, ClassName<TemplateArgument>&); - friend Ostream& operator<< - #ifndef __CINT__ - <TemplateArgument> - #endif + friend Ostream& operator<< <TemplateArgument> (Ostream&, const ClassName<TemplateArgument>&); }; diff --git a/etc/apps/cint/bashrc b/etc/apps/cint/bashrc deleted file mode 100644 index dbbd89631e2487e11803e1dea7cb95a720e0aafc..0000000000000000000000000000000000000000 --- a/etc/apps/cint/bashrc +++ /dev/null @@ -1,51 +0,0 @@ -#----------------------------------*-sh-*-------------------------------------- -# ========= | -# \\ / 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 -# -# Script -# cint/bashrc -# -# Description -# Setup file for cint -# Sourced from OpenFOAM-*/etc/bashrc -# -#------------------------------------------------------------------------------ - -for CINTSYSDIR in \ - $HOME/pub/CINT/cint7 \ - $WM_THIRD_PARTY_DIR/cint-svn/platforms/$WM_OPTIONS \ - ; -do - if [ -r $CINTSYSDIR ] - then - export CINTSYSDIR - export PATH=$PATH:$CINTSYSDIR/bin - export MANPATH=$MANPATH:$CINTSYSDIR/doc - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CINTSYSDIR/lib - break - fi -done - -[ -r "$CINTSYSDIR" ] || unset CINTSYSDIR - -# ----------------------------------------------------------------------------- diff --git a/etc/apps/cint/cshrc b/etc/apps/cint/cshrc deleted file mode 100644 index f2c38c481a3ebca703415c4e094137bb8efc43db..0000000000000000000000000000000000000000 --- a/etc/apps/cint/cshrc +++ /dev/null @@ -1,34 +0,0 @@ -#----------------------------------*-sh-*-------------------------------------- -# ========= | -# \\ / 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 -# -# Script -# cint/cshrc -# -# Description -# Setup file for cint -# Sourced from OpenFOAM-*/etc/cshrc -# -#------------------------------------------------------------------------------ - -# ----------------------------------------------------------------------------- diff --git a/etc/bashrc b/etc/bashrc index edd0265b63d079bec3730a3be43a72878b692d6c..aae664f98a2986dd3fe6dbc2ec5de65470c9ea14 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -244,7 +244,6 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.sh # _foamSource $WM_PROJECT_DIR/etc/apps/paraview/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/bashrc _foamSource $WM_PROJECT_DIR/etc/apps/ensight/bashrc -_foamSource $WM_PROJECT_DIR/etc/apps/cint/bashrc # Clean environment paths again. Only remove duplicates diff --git a/etc/cshrc b/etc/cshrc index 17e75ba888df4e149d0d9bd52650d7e88a3bc482..3e6af0cd44890b8a4202babc1485ceaa981c274f 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -241,7 +241,6 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.csh # _foamSource $WM_PROJECT_DIR/etc/apps/paraview/cshrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc # _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc -# _foamSource $WM_PROJECT_DIR/etc/apps/cint/cshrc # Clean environment paths again. Only remove duplicates diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index c3902bc9c5ea2215ee7d4d58d3f7a3870d35a573..24208bfcd5fcd7b65fd0e9ac717da1f635113233 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -63,7 +63,7 @@ primitives/random/Random.C containers/HashTables/HashTable/HashTableName.C containers/HashTables/StaticHashTable/StaticHashTableName.C containers/Lists/SortableList/ParSortableListName.C -containers/Lists/PackedList/PackedListCore.C +containers/Lists/PackedList/PackedListName.C containers/Lists/ListOps/ListOps.C containers/LinkedLists/linkTypes/SLListBase/SLListBase.C containers/LinkedLists/linkTypes/DLListBase/DLListBase.C diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H index 8ae3697f1dd95a402c56b2ca69616084be84fd74..78cb735e17066245c211c932bbd20ac486777b3b 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H @@ -122,19 +122,13 @@ public: // IOstream Operators - friend Istream& operator>> - #ifndef __CINT__ - <T, Key, Hash> - #endif + friend Istream& operator>> <T, Key, Hash> ( Istream&, HashPtrTable<T, Key, Hash>& ); - friend Ostream& operator<< - #ifndef __CINT__ - <T, Key, Hash> - #endif + friend Ostream& operator<< <T, Key, Hash> ( Ostream&, const HashPtrTable<T, Key, Hash>& diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 0e13b7c9a1d82016ff51b5915f09db97b6a42a64..3871db3a50e486370485979b9974290a74526ea9 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -417,19 +417,13 @@ public: // IOstream Operator - friend Istream& operator>> - #ifndef __CINT__ - <T, Key, Hash> - #endif + friend Istream& operator>> <T, Key, Hash> ( Istream&, HashTable<T, Key, Hash>& ); - friend Ostream& operator<< - #ifndef __CINT__ - <T, Key, Hash> - #endif + friend Ostream& operator<< <T, Key, Hash> ( Ostream&, const HashTable<T, Key, Hash>& diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H index e2655da4334ea4878513b757d56d1133156b35b5..5212d57f5168d289e5fcdc6b9fdedef1e9569632 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H @@ -428,20 +428,19 @@ inline bool Foam::HashTable<T, Key, Hash>::const_iterator::operator!= template<class T, class Key, class Hash> -inline const T& +inline const T& Foam::HashTable<T, Key, Hash>::const_iterator::operator*() const { return elmtPtr_->obj_; } -#ifndef __CINT__ template<class T, class Key, class Hash> inline const T& Foam::HashTable<T, Key, Hash>::const_iterator::operator()() const { return elmtPtr_->obj_; } -#endif + template<class T, class Key, class Hash> inline diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H index 2e0823fe3d69c8344123ad156b1eea395063a153..20635fa53f944bedcaa4f240d05657a09782f2df 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/ILList/ILList.H @@ -152,10 +152,7 @@ public: // Istream operator //- Read List from Istream, discarding contents of existing List. - friend Istream& operator>> - #ifndef __CINT__ - <LListBase, T> - #endif + friend Istream& operator>> <LListBase, T> ( Istream&, ILList<LListBase, T>& diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H index 9c8a22945ac8934cd75f880d6e4204742b95125e..0905f5543cbd7f272845f62d5d7d8afa0633b9ae 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LList/LList.H @@ -327,19 +327,13 @@ public: // IOstream operators - friend Istream& operator>> - #ifndef __CINT__ - <LListBase, T> - #endif + friend Istream& operator>> <LListBase, T> ( Istream&, LList<LListBase, T>& ); - friend Ostream& operator<< - #ifndef __CINT__ - <LListBase, T> - #endif + friend Ostream& operator<< <LListBase, T> ( Ostream&, const LList<LListBase, T>& diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H index ed98956ad5bd168b51b791b92ef7f24352b93465..333d916a65a4bbb84a0b75532cfcfaca28a0d463 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/LPtrList/LPtrList.H @@ -260,19 +260,13 @@ public: // IOstream operators - friend Istream& operator>> - #ifndef __CINT__ - <LListBase, T> - #endif + friend Istream& operator>> <LListBase, T> ( Istream&, LPtrList<LListBase, T>& ); - friend Ostream& operator<< - #ifndef __CINT__ - <LListBase, T> - #endif + friend Ostream& operator<< <LListBase, T> ( Ostream&, const LPtrList<LListBase, T>& diff --git a/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H b/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H index feefd60c7c8460aac8574299e6ff3d8b86b4248d..61585d6ac8c25afb931dd08f689a84b5fee7de3b 100644 --- a/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H +++ b/src/OpenFOAM/containers/LinkedLists/accessTypes/UILList/UILList.H @@ -277,10 +277,7 @@ public: // Ostream operator - friend Ostream& operator<< - #ifndef __CINT__ - <LListBase, T> - #endif + friend Ostream& operator<< <LListBase, T> ( Ostream&, const UILList<LListBase, T>& diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H index 460d325006d133cfa3be15018539bf76c3806bd5..daccd7af3d11c1f358ff7aeb3397018cd9d545c9 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H @@ -210,20 +210,14 @@ public: // IOstream operators // Write DynamicList to Ostream. - friend Ostream& operator<< - #ifndef __CINT__ - <T, SizeInc, SizeMult, SizeDiv> - #endif + friend Ostream& operator<< <T, SizeInc, SizeMult, SizeDiv> ( Ostream&, const DynamicList<T, SizeInc, SizeMult, SizeDiv>& ); //- Read from Istream, discarding contents of existing DynamicList. - friend Istream& operator>> - #ifndef __CINT__ - <T, SizeInc, SizeMult, SizeDiv> - #endif + friend Istream& operator>> <T, SizeInc, SizeMult, SizeDiv> ( Istream&, DynamicList<T, SizeInc, SizeMult, SizeDiv>& diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H index 6c64a92d03f3a0400a33ff3cf0cd7e40cceff75a..76f9527701d4eec378553f1f4767572be282055a 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H @@ -331,17 +331,11 @@ public: // IOstream operators //- Read List from Istream, discarding contents of existing List. - friend Istream& operator>> - #ifndef __CINT__ - <T, Size> - #endif + friend Istream& operator>> <T, Size> (Istream&, FixedList<T, Size>&); // Write FixedList to Ostream. - friend Ostream& operator<< - #ifndef __CINT__ - <T, Size> - #endif + friend Ostream& operator<< <T, Size> ( Ostream&, const FixedList<T, Size>& diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H index 055f785471b909e9ee65c324d2d62bfb23b1777c..1c3fe7131e6f179ad801a0151da2dd93d746c83e 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H @@ -398,7 +398,6 @@ inline bool Foam::FixedList<T, Size>::empty() const } -#ifndef __CINT__ template<class T, unsigned Size> template<class HashT> inline unsigned Foam::FixedList<T, Size>::Hash<HashT>::operator() @@ -426,6 +425,5 @@ inline unsigned Foam::FixedList<T, Size>::Hash<HashT>::operator() } } -#endif // __CINT__ // ************************************************************************* // diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C index 3fa3dcc8748bb8a3fbb8e775a4510baa705ab189..08422fd9ba23333451a1123d5ebf7217b4f9bfd6 100644 --- a/src/OpenFOAM/containers/Lists/List/List.C +++ b/src/OpenFOAM/containers/Lists/List/List.C @@ -35,8 +35,6 @@ License #include "BiIndirectList.H" #include "contiguous.H" -#include <algorithm> - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // @@ -442,34 +440,6 @@ void Foam::List<T>::transfer(SortableList<T>& a) } -template<class T> -void Foam::sort(List<T>& a) -{ - std::sort(a.begin(), a.end()); -} - - -template<class T, class Cmp> -void Foam::sort(List<T>& a, const Cmp& cmp) -{ - std::sort(a.begin(), a.end(), cmp); -} - - -template<class T> -void Foam::stableSort(List<T>& a) -{ - std::stable_sort(a.begin(), a.end()); -} - - -template<class T, class Cmp> -void Foam::stableSort(List<T>& a, const Cmp& cmp) -{ - std::stable_sort(a.begin(), a.end(), cmp); -} - - // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // Assignment to UList operator. Takes linear time. diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H index 434320cf5b21b980bbbbf286a57df2186e4e98fe..b89f6c95a9f15c2bfe07eddfb3aa537a30c1d9b1 100644 --- a/src/OpenFOAM/containers/Lists/List/List.H +++ b/src/OpenFOAM/containers/Lists/List/List.H @@ -233,10 +233,7 @@ public: // Istream operator //- Read List from Istream, discarding contents of existing List. - friend Istream& operator>> - #ifndef __CINT__ - <T> - #endif + friend Istream& operator>> <T> (Istream&, List<T>&); }; @@ -251,18 +248,6 @@ public: template<class T> List<T> readList(Istream&); -template<class T> -void sort(List<T>&); - -template<class T, class Cmp> -void sort(List<T>&, const Cmp&); - -template<class T> -void stableSort(List<T>&); - -template<class T, class Cmp> -void stableSort(List<T>&, const Cmp&); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/containers/Lists/List/ListLoopM.H b/src/OpenFOAM/containers/Lists/List/ListLoopM.H index da90147c64c08f5e5ef03cab1b57900eb79cb319..48b8c5d17e5336268f6fcd6ae7798c662d4b5233 100644 --- a/src/OpenFOAM/containers/Lists/List/ListLoopM.H +++ b/src/OpenFOAM/containers/Lists/List/ListLoopM.H @@ -31,8 +31,6 @@ Description #ifndef ListLoop_H #define ListLoop_H -#include "undefListLoopM.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef vectorMachine @@ -48,8 +46,11 @@ Description #define List_ELEM(f, fp, i) (fp[i]) -#define List_ACCESS(type, f, fp) type* __restrict__ fp = (f).begin() -#define List_CONST_ACCESS(type, f, fp) const type* __restrict__ fp = (f).begin() +#define List_ACCESS(type, f, fp) \ + type* const __restrict__ fp = (f).begin() + +#define List_CONST_ACCESS(type, f, fp) \ + const type* const __restrict__ fp = (f).begin() #else @@ -64,8 +65,11 @@ Description #define List_ELEM(f, fp, i) (*fp++) -#define List_ACCESS(type, f, fp) register type* __restrict__ fp = (f).begin() -#define List_CONST_ACCESS(type, f, fp) register const type* __restrict__ fp = (f).begin() +#define List_ACCESS(type, f, fp) \ + register type* __restrict__ fp = (f).begin() + +#define List_CONST_ACCESS(type, f, fp) \ + register const type* __restrict__ fp = (f).begin() #endif diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListCore.C b/src/OpenFOAM/containers/Lists/PackedList/PackedListName.C similarity index 99% rename from src/OpenFOAM/containers/Lists/PackedList/PackedListCore.C rename to src/OpenFOAM/containers/Lists/PackedList/PackedListName.C index 270d1c30eb8138da1d492d92218bdf94325700ab..5973d3021e011a682921cabac851ee87f6d5082a 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedListCore.C +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListName.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "PackedList.H" diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C index 6418537b02089d50eb8e1905cda5f556f2fa33ae..11d997dd3f2fe6047b0ad9734c0de207404a302d 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C @@ -27,7 +27,6 @@ License #include "error.H" #include "PtrList.H" -#include "PtrListLoopM.H" #include "SLPtrList.H" // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H index ec6a1b9fd6f330f6d5feb3c5e7bd4d78a8b411af..0219e02af72861fb2c92b001b498f6ff1fb68b18 100644 --- a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H +++ b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectList.H @@ -97,16 +97,16 @@ public: //- Assignment of all entries to the given value inline void operator=(const T&); + // Ostream operator //- Write UIndirectList to Ostream // Binary output is currently still a bit of a problem - friend Ostream& operator<< - #ifndef __CINT__ - <T> - #endif - (Ostream&, const UIndirectList<T>&); - + friend Ostream& operator<< <T> + ( + Ostream&, + const UIndirectList<T>& + ); }; diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C index 255a91ecfecc83484da0f0f6873795e82dbf586d..42d00bc41e7ede72f47b9e4dcf9490e0891c2f33 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.C +++ b/src/OpenFOAM/containers/Lists/UList/UList.C @@ -30,6 +30,8 @@ License #include "ListLoopM.H" #include "contiguous.H" +#include <algorithm> + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class T> @@ -116,6 +118,34 @@ Foam::label Foam::UList<T>::byteSize() const } +template<class T> +void Foam::sort(UList<T>& a) +{ + std::sort(a.begin(), a.end()); +} + + +template<class T, class Cmp> +void Foam::sort(UList<T>& a, const Cmp& cmp) +{ + std::sort(a.begin(), a.end(), cmp); +} + + +template<class T> +void Foam::stableSort(UList<T>& a) +{ + std::stable_sort(a.begin(), a.end()); +} + + +template<class T, class Cmp> +void Foam::stableSort(UList<T>& a, const Cmp& cmp) +{ + std::stable_sort(a.begin(), a.end(), cmp); +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template<class T> diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index 6370f8e749fe4025bb66c5e255bf6d13fa5848d7..087f685ff6cf182cee3be9fe3a4c24370d3f25fa 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -313,13 +313,25 @@ public: // Ostream operator // Write UList to Ostream. - friend Ostream& operator<< - #ifndef __CINT__ - <T> - #endif - (Ostream&, const UList<T>&); + friend Ostream& operator<< <T> + ( + Ostream&, + const UList<T>& + ); }; +template<class T> +void sort(UList<T>&); + +template<class T, class Cmp> +void sort(UList<T>&, const Cmp&); + +template<class T> +void stableSort(UList<T>&); + +template<class T, class Cmp> +void stableSort(UList<T>&, const Cmp&); + // Reverse the first n elements of the list template<class T> inline void reverse(UList<T>&, const label n); diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C index 02015efb9b663ec6dbd13a36398bce94def3a9ee..bed0214749efe46fecb7de60e3e063c612fbf7d7 100644 --- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C +++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C @@ -27,7 +27,6 @@ License #include "error.H" #include "UPtrList.H" -#include "PtrListLoopM.H" // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H index 5fc5a839b13d8d86a06828551200584335ca9f4c..063af46c66118b07ab87b42faf9bb834d83a5d76 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.H +++ b/src/OpenFOAM/db/IOobject/IOobject.H @@ -83,8 +83,6 @@ class objectRegistry; Class IOobject Declaration \*---------------------------------------------------------------------------*/ -#include "CintDefs.H" - class IOobject { @@ -395,7 +393,6 @@ public: void operator=(const IOobject&); }; -#include "CintUndefs.H" #if defined (__GNUC__) template<> diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H index 29079d33f8c740b69222e63c77ad8cd0b0b8752d..7ad2ebd88a17bd08dd93305d2771171da6b3c982 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H +++ b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H @@ -148,9 +148,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Global predefined null output stream -#ifndef __CINT__ extern OFstream Snull; -#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H index f2846f47f5735db3206b15613676a4bfda02b690..a9c50741e932333e10c53b8163ab704533918126 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H @@ -74,8 +74,6 @@ namespace Foam Class IOstream Declaration \*---------------------------------------------------------------------------*/ -#include "CintDefs.H" - class IOstream { @@ -193,9 +191,7 @@ public: //- Ostream operator - #ifndef __MAKECINT__ friend Ostream& operator<<(Ostream& os, const versionNumber& vn); - #endif }; @@ -421,7 +417,7 @@ public: } //- Return compression of given compression name - static compressionType compressionEnum(const word&); + static compressionType compressionEnum(const word&); //- Return the stream compression compressionType compression() const @@ -545,7 +541,6 @@ public: } }; -#include "CintUndefs.H" Ostream& operator<<(Ostream& os, const IOstream::streamFormat& sf); Ostream& operator<<(Ostream& os, const IOstream::versionNumber& vn); @@ -554,7 +549,6 @@ Ostream& operator<<(Ostream& os, const IOstream::versionNumber& vn); // -------------------------------------------------------------------- // ------ Manipulators (not taking arguments) // -------------------------------------------------------------------- -#ifndef __CINT__ typedef IOstream& (*IOstreamManip)(IOstream&); @@ -595,8 +589,6 @@ inline IOstream& scientific(IOstream& io) return io; } -#endif - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/InfoProxy.H b/src/OpenFOAM/db/IOstreams/IOstreams/InfoProxy.H index b4f48ab18f8268b3f2579a64b535fa015d9eb8c7..ff2c1e8a3e7e384e2677594f2eb5f6b81a12cc80 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/InfoProxy.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/InfoProxy.H @@ -52,19 +52,14 @@ class InfoProxy { public: - #ifndef __MAKECINT__ const T& t_; - #endif InfoProxy(const T& t) : t_(t) {} - - friend Ostream& operator<< - #ifndef __CINT__ - <T> - #endif + + friend Ostream& operator<< <T> (Ostream&, const InfoProxy<T>&); }; diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Istream.H b/src/OpenFOAM/db/IOstreams/IOstreams/Istream.H index f446f2938f270e2af1205f0ea956ba0afb7be812..701c674b14f5a6df33da9c6f4ce86e40663e6d62 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Istream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Istream.H @@ -152,7 +152,6 @@ public: // -------------------------------------------------------------------- // ------ Manipulators (not taking arguments) // -------------------------------------------------------------------- -#ifndef __CINT__ typedef Istream& (*IstreamManip)(Istream&); @@ -169,8 +168,6 @@ inline Istream& operator>>(Istream& is, IOstreamManip f) return is; } -#endif - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H index f82c7962225dc04df0b1930e19d0157720b27a65..6ea3380777f252c4bc76faaed0309f1d20311f60 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H @@ -70,6 +70,7 @@ protected: //- Current indent level unsigned short indentLevel_; + public: // Constructors @@ -87,10 +88,9 @@ public: {} - // Destructor - - virtual ~Ostream() - {} + //- Destructor + virtual ~Ostream() + {} // Member functions @@ -199,7 +199,6 @@ public: // -------------------------------------------------------------------- // ------ Manipulators (not taking arguments) // -------------------------------------------------------------------- -#ifndef __CINT__ typedef Ostream& (*OstreamManip)(Ostream&); @@ -254,8 +253,6 @@ inline Ostream& endl(Ostream& os) return os; } -#endif - // Useful aliases for tab and newline characters static const char tab = '\t'; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H index ba7904639c001e024c44ee1e7be9e140c07a9102..dff94c259f78ee2cbe7811d244432f43576a7c7f 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H @@ -151,9 +151,7 @@ public: // Ostream Operator - #ifndef __CINT__ friend Ostream& operator<<(Ostream&, const commsStruct&); - #endif }; diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.H b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.H index 45dc5a607ce67b94804d0a698c8af96d61af8521..fe778fa01031cccb4d0602d913ba61da3ebb6889 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.H +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.H @@ -58,9 +58,7 @@ class ISstream // Private data fileName name_; - #ifndef __CINT__ istream& is_; - #endif // Private member functions diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H index 75d18ef793779d2051fd0d6139031b3bb8018a8f..5c862afd9311328093b843440feb846e1baf2d09 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H @@ -58,9 +58,7 @@ class OSstream // Private data fileName name_; - #ifndef __CINT__ ostream& os_; - #endif // Private Member Functions diff --git a/src/OpenFOAM/db/IOstreams/Tstreams/ITstream.H b/src/OpenFOAM/db/IOstreams/Tstreams/ITstream.H index 3a34761db789bc27ddfdc0ac27b698d5a10299d6..891c8f0dab8472b7d13aca6e0e881619e7e3501b 100644 --- a/src/OpenFOAM/db/IOstreams/Tstreams/ITstream.H +++ b/src/OpenFOAM/db/IOstreams/Tstreams/ITstream.H @@ -98,6 +98,12 @@ public: } + // Destructor + + virtual ~ITstream() + {} + + // Member functions // Inquiry @@ -142,31 +148,31 @@ public: // Read functions //- Return next token from stream - Istream& read(token&); + virtual Istream& read(token&); //- Read a character - Istream& read(char&); + virtual Istream& read(char&); //- Read a word - Istream& read(word&); + virtual Istream& read(word&); // Read a string (including enclosing double-quotes) - Istream& read(string&); + virtual Istream& read(string&); //- Read a label - Istream& read(label&); + virtual Istream& read(label&); //- Read a floatScalar - Istream& read(floatScalar&); + virtual Istream& read(floatScalar&); //- Read a doubleScalar - Istream& read(doubleScalar&); + virtual Istream& read(doubleScalar&); //- Read binary block - Istream& read(char*, std::streamsize); + virtual Istream& read(char*, std::streamsize); //- Rewind and return the stream so that it may be read again - Istream& rewind(); + virtual Istream& rewind(); // Edit diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 2defc09d73b7ff615fad2a6622d5820c2a575cb0..0880b13d13262ef949a75b7de29932fcb87b6f82 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -66,8 +66,6 @@ Ostream& operator<<(Ostream&, const token&); Class token Declaration \*---------------------------------------------------------------------------*/ -#include "CintDefs.H" - class token { @@ -206,9 +204,7 @@ public: // IOstream Operators - #ifndef __MAKECINT__ friend Ostream& operator<<(Ostream&, const compound&); - #endif }; @@ -431,7 +427,6 @@ public: friend ostream& operator<<(ostream&, const InfoProxy<token>&); }; -#include "CintUndefs.H" Ostream& operator<<(Ostream&, const token::punctuationToken&); ostream& operator<<(ostream&, const token::punctuationToken&); diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H index e4255827bf60572cdf5d43f8b0cf5da577d79fe8..6fc94aa1ad6ca8255832a3981d1bd5a42bab1d10 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H @@ -80,7 +80,7 @@ class includeEntry public: //- Runtime type information - TypeName("include"); + ClassName("include"); // Member Functions diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H index da3bd7a0676ae53a969fdaa7f09e0a696916e363..4aace67dfaff2c01f98bfe7e31aeca78bc800be4 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H @@ -96,7 +96,7 @@ class inputModeEntry public: //- Runtime type information - TypeName("inputMode"); + ClassName("inputMode"); // Member Functions @@ -118,7 +118,6 @@ public: //- Return true if the inputMode is %error static bool error(); - }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H index 1ed2d99639228540938aba2c4d993a3a749a6185..b98da86e67de68f421d4865389a8c74e812fddd7 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H @@ -74,7 +74,7 @@ class removeEntry public: //- Runtime type information - TypeName("remove"); + ClassName("remove"); // Member Functions diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H index c5189c1520d6c2ddb955f300d27c9d9c7eb1edf0..afc391248380ea12f90f3fd14cf9fa5b5db8bd5c 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H @@ -66,9 +66,6 @@ class primitiveEntry public entry, public ITstream { - -public: - // Private member functions //- Append the given token to this entry @@ -93,9 +90,6 @@ public: Istream& ); - //- Read tokens from the given stream - bool read(const dictionary&, Istream&); - //- Read the complete entry from the given stream void readEntry(const dictionary&, Istream&); @@ -169,6 +163,9 @@ public: // calling this function generates a FatalError dictionary& dict(); + //- Read tokens from the given stream + bool read(const dictionary&, Istream&); + // Write void write(Ostream&) const; diff --git a/src/OpenFOAM/db/error/error.H b/src/OpenFOAM/db/error/error.H index 1cd9574e6dcb5c56d0fdd55dae072edebc0a6dee..639bd933c6e75b2af398044d75b402b337c43428 100644 --- a/src/OpenFOAM/db/error/error.H +++ b/src/OpenFOAM/db/error/error.H @@ -150,12 +150,9 @@ public: //- Convert to Ostream // Prints basic message and then returns Ostream for further info. - #ifndef __CINT__ operator OSstream&(); - #endif //- Explicitly convert to Ostream for << operations - // needed in cint OSstream& operator()() { return operator OSstream&(); @@ -311,9 +308,7 @@ extern IOerror FatalIOError; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifndef __CINT__ #include "errorManip.H" -#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/error/messageStream.H b/src/OpenFOAM/db/error/messageStream.H index 20b04363276ef44c38d5314e644175bdca0a1668..d37f6a010c7c2f23accf7a329e01ad54a5a25640 100644 --- a/src/OpenFOAM/db/error/messageStream.H +++ b/src/OpenFOAM/db/error/messageStream.H @@ -182,12 +182,9 @@ public: ); //- Convert to Ostream for << operations - #ifndef __CINT__ operator OSstream&(); - #endif //- Explicitly convert to Ostream for << operations - // needed in cint OSstream& operator()() { return operator OSstream&(); diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 0f27c101f1b9fdaee9182429abc7f30091129300..6e2682e19902ce4bcc2beb16f6cbaa7aab357eea 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -134,14 +134,26 @@ bool Foam::regIOobject::checkIn() // any mapping registered_ = db().checkIn(*this); - // checkin on defaultRegion is allowed to fail, since subsetted meshes + // check-in on defaultRegion is allowed to fail, since subsetted meshes // are created with the same name as their originating mesh if (!registered_ && debug && name() != polyMesh::defaultRegion) { - WarningIn("regIOobject::checkIn()") - << "failed to register object " << objectPath() - << " the name already exists in the objectRegistry" - << endl; + if (debug == 2) + { + // for ease of finding where attempted duplicate check-in + // originated + FatalErrorIn("regIOobject::checkIn()") + << "failed to register object " << objectPath() + << " the name already exists in the objectRegistry" + << abort(FatalError); + } + else + { + WarningIn("regIOobject::checkIn()") + << "failed to register object " << objectPath() + << " the name already exists in the objectRegistry" + << endl; + } } } diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H index 1ad252955a3e7430c78c7b0ff84c5f78beeffa9c..6817098a6cbb8ffd0960ce9f7f65c3421b8f04ce 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H @@ -174,16 +174,10 @@ public: // IOstream operators - friend Istream& operator>> - #ifndef __CINT__ - <Type> - #endif + friend Istream& operator>> <Type> (Istream&, dimensioned<Type>&); - friend Ostream& operator<< - #ifndef __CINT__ - <Type> - #endif + friend Ostream& operator<< <Type> (Ostream&, const dimensioned<Type>&); }; diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H index 79c9cd4bae2f48d2273199ce81afc4a7aa2e06c2..1b9915d5730da34d75fca1c2680911217c1fd1cb 100644 --- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H @@ -62,12 +62,10 @@ Istream& operator>>(Istream&, DynamicField<Type>&); Class DynamicField Declaration \*---------------------------------------------------------------------------*/ -#include "CintDefs.H" - template<class Type> class DynamicField : - public Field<Type> //private Field<Type> + public Field<Type> { // Private data @@ -185,26 +183,16 @@ public: // IOstream operators - friend Ostream& operator<< - #ifndef __CINT__ - <Type> - #endif + friend Ostream& operator<< <Type> (Ostream&, const DynamicField<Type>&); - friend Ostream& operator<< - #ifndef __CINT__ - <Type> - #endif + friend Ostream& operator<< <Type> (Ostream&, const tmp<DynamicField<Type> >&); - friend Istream& operator>> - #ifndef __CINT__ - <Type> - #endif + friend Istream& operator>> <Type> (Istream&, DynamicField<Type>&); }; -#include "CintUndefs.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H index e56e4633713df00768e640c2db83283368f87e73..98e664ec8d5a503fb0ea98802fe0ab54dc8414f4 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.H +++ b/src/OpenFOAM/fields/Fields/Field/Field.H @@ -75,8 +75,6 @@ class dictionary; Class Field Declaration \*---------------------------------------------------------------------------*/ -#include "CintDefs.H" - template<class Type> class Field : @@ -198,13 +196,11 @@ public: //- Return a pointer to a new calculatedFvPatchFieldField created on // freestore without setting patchField values - #ifndef __CINT__ template<class Type2> static tmp<Field<Type> > NewCalculatedType(const Field<Type2>& f) { return tmp<Field<Type> >(new Field<Type>(f.size())); } - #endif // Member Functions @@ -343,20 +339,13 @@ public: // IOstream operators - friend Ostream& operator<< - #ifndef __CINT__ - <Type> - #endif + friend Ostream& operator<< <Type> (Ostream&, const Field<Type>&); - friend Ostream& operator<< - #ifndef __CINT__ - <Type> - #endif + friend Ostream& operator<< <Type> (Ostream&, const tmp<Field<Type> >&); }; -#include "CintUndefs.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/Fields/symmTransformField/symmTransformField.C b/src/OpenFOAM/fields/Fields/symmTransformField/symmTransformField.C index 67cb86e1935460040eb44360e4d0fabb38769ccb..db24d88042d79969d4d7bbf2032387b2145dae16 100644 --- a/src/OpenFOAM/fields/Fields/symmTransformField/symmTransformField.C +++ b/src/OpenFOAM/fields/Fields/symmTransformField/symmTransformField.C @@ -50,7 +50,7 @@ void transform { TFOR_ALL_F_OP_FUNC_F_F ( - Type, rtf, =, transform, tensor, trf, Type, tf + Type, rtf, =, transform, symmTensor, trf, Type, tf ) } } diff --git a/src/OpenFOAM/fields/cloud/cloud.H b/src/OpenFOAM/fields/cloud/cloud.H index 0c0915464edfb6f92a00958fb473f0d9c7620e00..d48e5dffbb579ead329d8a069a951f3dfc6ac438 100644 --- a/src/OpenFOAM/fields/cloud/cloud.H +++ b/src/OpenFOAM/fields/cloud/cloud.H @@ -75,15 +75,15 @@ public: //- The default cloud name: %defaultCloud static word defaultName; + // Constructors //- Construct for the given objectRegistry and named cloud instance cloud(const objectRegistry&, const word& cloudName = ""); - // Destructor - - virtual ~cloud(); + //- Destructor + virtual ~cloud(); // Member Functions diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index df698693940e49279bbc3078941af1090a0c232c..707d68b88f49a87f9a378c73228b2d8d9b429513 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -298,6 +298,7 @@ Foam::argList::argList jobInfo.add("startTime", timeString); jobInfo.add("userName", userName()); jobInfo.add("foamVersion", word(FOAMversion)); + jobInfo.add("foamBuild", Foam::FOAMbuild); jobInfo.add("code", executable_); jobInfo.add("argList", argListString); jobInfo.add("currentDir", cwd()); diff --git a/src/OpenFOAM/include/CintDefs.H b/src/OpenFOAM/include/CintDefs.H deleted file mode 100644 index 90e1f62a2f1a2cd098a4b8ecac448273cbae4635..0000000000000000000000000000000000000000 --- a/src/OpenFOAM/include/CintDefs.H +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __CINT__ -# define tmp Foam::tmp -# define UList Foam::UList -# define List Foam::List -# define InfoProxy Foam::InfoProxy -#endif diff --git a/src/OpenFOAM/include/CintUndefs.H b/src/OpenFOAM/include/CintUndefs.H deleted file mode 100644 index 6b0b69e99ceba4cca1744c51d733c6b685329344..0000000000000000000000000000000000000000 --- a/src/OpenFOAM/include/CintUndefs.H +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __CINT__ -# undef tmp -# undef UList -# undef List -# undef InfoProxy -#endif diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixATmul.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixATmul.C index 05958edf68ad060e63c51e8f078656fbbb82a5e6..cb376fde10c28ba807da0541cac76140a3043e8e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixATmul.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixATmul.C @@ -67,38 +67,15 @@ void Foam::lduMatrix::Amul register const label nCells = diag().size(); for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&psiPtr[cell+96],0,1); - __builtin_prefetch (&diagPtr[cell+96],0,1); - __builtin_prefetch (&ApsiPtr[cell+96],1,1); - #endif - ApsiPtr[cell] = diagPtr[cell]*psiPtr[cell]; } register const label nFaces = upper().size(); - #ifdef ICC_IA64_PREFETCH - #pragma swp - #endif + for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+32],0,0); - __builtin_prefetch (&lPtr[face+32],0,0); - __builtin_prefetch (&lowerPtr[face+32],0,1); - __builtin_prefetch (&psiPtr[lPtr[face+32]],0,1); - __builtin_prefetch (&ApsiPtr[uPtr[face+32]],0,1); - #endif - ApsiPtr[uPtr[face]] += lowerPtr[face]*psiPtr[lPtr[face]]; - - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&upperPtr[face+32],0,1); - __builtin_prefetch (&psiPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&ApsiPtr[lPtr[face+32]],0,1); - #endif - ApsiPtr[lPtr[face]] += upperPtr[face]*psiPtr[uPtr[face]]; } @@ -151,34 +128,13 @@ void Foam::lduMatrix::Tmul register const label nCells = diag().size(); for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&psiPtr[cell+96],0,1); - __builtin_prefetch (&diagPtr[cell+96],0,1); - __builtin_prefetch (&TpsiPtr[cell+96],1,1); - #endif - TpsiPtr[cell] = diagPtr[cell]*psiPtr[cell]; } register const label nFaces = upper().size(); for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+32],0,0); - __builtin_prefetch (&lPtr[face+32],0,0); - __builtin_prefetch (&upperPtr[face+32],0,1); - __builtin_prefetch (&psiPtr[lPtr[face+32]],0,1); - __builtin_prefetch (&TpsiPtr[uPtr[face+32]],0,1); - #endif - TpsiPtr[uPtr[face]] += upperPtr[face]*psiPtr[lPtr[face]]; - - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&lowerPtr[face+32],0,1); - __builtin_prefetch (&psiPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&TpsiPtr[lPtr[face+32]],0,1); - #endif - TpsiPtr[lPtr[face]] += lowerPtr[face]*psiPtr[uPtr[face]]; } @@ -218,34 +174,12 @@ void Foam::lduMatrix::sumA for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&diagPtr[cell+96],0,1); - __builtin_prefetch (&sumAPtr[cell+96],1,1); - #endif - sumAPtr[cell] = diagPtr[cell]; } - #ifdef ICC_IA64_PREFETCH - #pragma swp - #endif - for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+32],0,0); - __builtin_prefetch (&lPtr[face+32],0,0); - __builtin_prefetch (&lowerPtr[face+32],0,1); - __builtin_prefetch (&sumAPtr[uPtr[face+32]],0,1); - #endif - sumAPtr[uPtr[face]] += lowerPtr[face]; - - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&upperPtr[face+32],0,1); - __builtin_prefetch (&sumAPtr[lPtr[face+32]],0,1); - #endif - sumAPtr[lPtr[face]] += upperPtr[face]; } @@ -323,39 +257,15 @@ void Foam::lduMatrix::residual register const label nCells = diag().size(); for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&psiPtr[cell+96],0,1); - __builtin_prefetch (&diagPtr[cell+96],0,1); - __builtin_prefetch (&sourcePtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],1,1); - #endif - rAPtr[cell] = sourcePtr[cell] - diagPtr[cell]*psiPtr[cell]; } register const label nFaces = upper().size(); - #ifdef ICC_IA64_PREFETCH - #pragma swp - #endif + for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+32],0,0); - __builtin_prefetch (&lPtr[face+32],0,0); - __builtin_prefetch (&lowerPtr[face+32],0,1); - __builtin_prefetch (&psiPtr[lPtr[face+32]],0,1); - __builtin_prefetch (&rAPtr[uPtr[face+32]],0,1); - #endif - rAPtr[uPtr[face]] -= lowerPtr[face]*psiPtr[lPtr[face]]; - - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&upperPtr[face+32],0,1); - __builtin_prefetch (&psiPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&rAPtr[lPtr[face+32]],0,1); - #endif - rAPtr[lPtr[face]] -= upperPtr[face]*psiPtr[uPtr[face]]; } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C index 6766e0ec803c065050bff3149c59f5c085a76fc6..9c898f2d9ea008666028023b17147a2aaaee3892 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixOperations.C @@ -353,20 +353,7 @@ Foam::tmp<Foam::scalarField > Foam::lduMatrix::H1() const for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+32],0,0); - __builtin_prefetch (&lPtr[face+32],0,0); - __builtin_prefetch (&lowerPtr[face+32],0,1); - __builtin_prefetch (&H1Ptr[uPtr[face+32]],0,1); - #endif - H1Ptr[uPtr[face]] -= lowerPtr[face]; - - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&upperPtr[face+32],0,1); - __builtin_prefetch (&H1Ptr[lPtr[face+32]],0,1); - #endif - H1Ptr[lPtr[face]] -= upperPtr[face]; } } diff --git a/src/OpenFOAM/matrices/lduMatrix/preconditioners/DICPreconditioner/DICPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/preconditioners/DICPreconditioner/DICPreconditioner.C index dbf5b31f2a7ec91cdcea2ff1741d994584fda43b..f6fc7ab87f1f086ddd1f8e4997b5f238d3fc4605 100644 --- a/src/OpenFOAM/matrices/lduMatrix/preconditioners/DICPreconditioner/DICPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/preconditioners/DICPreconditioner/DICPreconditioner.C @@ -71,29 +71,15 @@ void Foam::DICPreconditioner::calcReciprocalD register const label nFaces = matrix.upper().size(); for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&upperPtr[face+96],0,1); - __builtin_prefetch (&rDPtr[lPtr[face+24]],0,1); - __builtin_prefetch (&rDPtr[uPtr[face+24]],1,1); - #endif - rDPtr[uPtr[face]] -= upperPtr[face]*upperPtr[face]/rDPtr[lPtr[face]]; } // Calculate the reciprocal of the preconditioned diagonal register const label nCells = rD.size(); - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif + for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&rDPtr[cell+96],0,1); - #endif - rDPtr[cell] = 1.0/rDPtr[cell]; } } @@ -120,61 +106,18 @@ void Foam::DICPreconditioner::precondition register label nFaces = solver_.matrix().upper().size(); register label nFacesM1 = nFaces - 1; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&rDPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - #endif - wAPtr[cell] = rDPtr[cell]*rAPtr[cell]; } - #ifdef ICC_IA64_PREFETCH - #pragma noprefetch uPtr,lPtr,upperPtr,rDPtr,wAPtr - #pragma nounroll - #endif - for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&upperPtr[face+96],0,0); - __builtin_prefetch (&rDPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face+32]],0,1); - #endif - wAPtr[uPtr[face]] -= rDPtr[uPtr[face]]*upperPtr[face]*wAPtr[lPtr[face]]; } - #ifdef ICC_IA64_PREFETCH - #pragma noprefetch uPtr,lPtr,rDPtr,wAPtr - #pragma nounroll - #endif - for (register label face=nFacesM1; face>=0; face--) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face-95],0,0); - __builtin_prefetch (&lPtr[face-95],0,0); - __builtin_prefetch (&rDPtr[lPtr[face-16]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-16]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-16]],0,1); - __builtin_prefetch (&rDPtr[lPtr[face-24]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-24]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-24]],0,1); - __builtin_prefetch (&rDPtr[lPtr[face-32]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-32]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-32]],0,1); - #endif - wAPtr[lPtr[face]] -= rDPtr[lPtr[face]]*upperPtr[face]*wAPtr[uPtr[face]]; } } diff --git a/src/OpenFOAM/matrices/lduMatrix/preconditioners/DILUPreconditioner/DILUPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/preconditioners/DILUPreconditioner/DILUPreconditioner.C index 5193acb5eb192f21b0f78f848ead3846fa6a2e3f..4fdebcd9c58a6c68402645a8e413577e9ad10c86 100644 --- a/src/OpenFOAM/matrices/lduMatrix/preconditioners/DILUPreconditioner/DILUPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/preconditioners/DILUPreconditioner/DILUPreconditioner.C @@ -72,30 +72,15 @@ void Foam::DILUPreconditioner::calcReciprocalD register label nFaces = matrix.upper().size(); for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&upperPtr[face+96],0,1); - __builtin_prefetch (&lowerPtr[face+96],0,1); - __builtin_prefetch (&rDPtr[lPtr[face+24]],0,1); - __builtin_prefetch (&rDPtr[uPtr[face+24]],1,1); - #endif - rDPtr[uPtr[face]] -= upperPtr[face]*lowerPtr[face]/rDPtr[lPtr[face]]; } // Calculate the reciprocal of the preconditioned diagonal register label nCells = rD.size(); - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif + for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&rDPtr[cell+96],0,1); - #endif - rDPtr[cell] = 1.0/rDPtr[cell]; } } @@ -128,26 +113,14 @@ void Foam::DILUPreconditioner::precondition register label nFaces = solver_.matrix().upper().size(); register label nFacesM1 = nFaces - 1; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&rDPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - #endif - wAPtr[cell] = rDPtr[cell]*rAPtr[cell]; } register label sface; - #ifdef ICC_IA64_PREFETCH - #pragma nounroll - #endif + for (register label face=0; face<nFaces; face++) { sface = losortPtr[face]; @@ -155,28 +128,8 @@ void Foam::DILUPreconditioner::precondition rDPtr[uPtr[sface]]*lowerPtr[sface]*wAPtr[lPtr[sface]]; } - #ifdef ICC_IA64_PREFETCH - #pragma noprefetch uPtr,lPtr,rDPtr,wAPtr - #pragma nounroll - #endif - for (register label face=nFacesM1; face>=0; face--) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face-95],0,0); - __builtin_prefetch (&lPtr[face-95],0,0); - __builtin_prefetch (&upperPtr[face-95],0,1); - __builtin_prefetch (&rDPtr[lPtr[face-16]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-16]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-16]],0,1); - __builtin_prefetch (&rDPtr[lPtr[face-24]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-24]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-24]],0,1); - __builtin_prefetch (&rDPtr[lPtr[face-32]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-32]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-32]],0,1); - #endif - wAPtr[lPtr[face]] -= rDPtr[lPtr[face]]*upperPtr[face]*wAPtr[uPtr[face]]; } @@ -210,46 +163,20 @@ void Foam::DILUPreconditioner::preconditionT register label nFaces = solver_.matrix().upper().size(); register label nFacesM1 = nFaces - 1; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&wTPtr[cell+96],0,1); - __builtin_prefetch (&rDPtr[cell+96],0,1); - __builtin_prefetch (&rTPtr[cell+96],0,1); - #endif - wTPtr[cell] = rDPtr[cell]*rTPtr[cell]; } - #ifdef ICC_IA64_PREFETCH - #pragma noprefetch uPtr,lPtr,upperPtr,rDPtr,wTPtr - #pragma nounroll - #endif - for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&upperPtr[face+96],0,1); - __builtin_prefetch (&rDPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&wTPtr[lPtr[face+32]],0,1); - __builtin_prefetch (&wTPtr[uPtr[face+32]],0,1); - #endif - wTPtr[uPtr[face]] -= rDPtr[uPtr[face]]*upperPtr[face]*wTPtr[lPtr[face]]; } register label sface; - #ifdef ICC_IA64_PREFETCH - #pragma nounroll - #endif + for (register label face=nFacesM1; face>=0; face--) { sface = losortPtr[face]; diff --git a/src/OpenFOAM/matrices/lduMatrix/preconditioners/FDICPreconditioner/FDICPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/preconditioners/FDICPreconditioner/FDICPreconditioner.C index 9b17ef902d1cd7cd31ac6637bc70470112253361..db4a51c4b7f6a204b75545b0eb1ab6c845513396 100644 --- a/src/OpenFOAM/matrices/lduMatrix/preconditioners/FDICPreconditioner/FDICPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/preconditioners/FDICPreconditioner/FDICPreconditioner.C @@ -66,47 +66,17 @@ Foam::FDICPreconditioner::FDICPreconditioner for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&upperPtr[face+96],0,1); - __builtin_prefetch (&rDPtr[lPtr[face+24]],0,1); - __builtin_prefetch (&rDPtr[uPtr[face+24]],1,1); - #endif - rDPtr[uPtr[face]] -= sqr(upperPtr[face])/rDPtr[lPtr[face]]; } - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - // Generate reciprocal FDIC for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&rDPtr[cell+96],0,1); - #endif - rDPtr[cell] = 1.0/rDPtr[cell]; } - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&upperPtr[face+96],0,0); - __builtin_prefetch (&rDuUpperPtr[face+96],0,0); - __builtin_prefetch (&rDlUpperPtr[face+96],0,0); - __builtin_prefetch (&rDPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&rDPtr[lPtr[face+32]],0,1); - #endif - rDuUpperPtr[face] = rDPtr[uPtr[face]]*upperPtr[face]; rDlUpperPtr[face] = rDPtr[lPtr[face]]*upperPtr[face]; } @@ -138,58 +108,18 @@ void Foam::FDICPreconditioner::precondition register label nFaces = solver_.matrix().upper().size(); register label nFacesM1 = nFaces - 1; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&rDPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - #endif - wAPtr[cell] = rDPtr[cell]*rAPtr[cell]; } - #ifdef ICC_IA64_PREFETCH - #pragma noprefetch uPtr,lPtr,rDuUpperPtr,wAPtr - #pragma nounroll - #endif - for (register label face=0; face<nFaces; face++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face+96],0,0); - __builtin_prefetch (&lPtr[face+96],0,0); - __builtin_prefetch (&rDuUpperPtr[face+96],0,0); - __builtin_prefetch (&wAPtr[uPtr[face+32]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face+32]],0,1); - #endif - wAPtr[uPtr[face]] -= rDuUpperPtr[face]*wAPtr[lPtr[face]]; } - #ifdef ICC_IA64_PREFETCH - #pragma noprefetch uPtr,lPtr,rDlUpperPtr,wAPtr - #pragma nounroll - #endif - for (register label face=nFacesM1; face>=0; face--) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&uPtr[face-95],0,0); - __builtin_prefetch (&lPtr[face-95],0,0); - __builtin_prefetch (&rDlUpperPtr[face-95],0,0); - __builtin_prefetch (&wAPtr[lPtr[face-16]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-16]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-24]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-24]],0,1); - __builtin_prefetch (&wAPtr[lPtr[face-32]],0,1); - __builtin_prefetch (&wAPtr[uPtr[face-32]],0,1); - #endif - wAPtr[lPtr[face]] -= rDlUpperPtr[face]*wAPtr[uPtr[face]]; } } diff --git a/src/OpenFOAM/matrices/lduMatrix/preconditioners/diagonalPreconditioner/diagonalPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/preconditioners/diagonalPreconditioner/diagonalPreconditioner.C index e5a32fa1689220f3e558e1e866cc8184c1b65b1e..04ccc2add03118dc662013e3925be372cff2b97a 100644 --- a/src/OpenFOAM/matrices/lduMatrix/preconditioners/diagonalPreconditioner/diagonalPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/preconditioners/diagonalPreconditioner/diagonalPreconditioner.C @@ -58,18 +58,9 @@ Foam::diagonalPreconditioner::diagonalPreconditioner register label nCells = rD.size(); - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - // Generate reciprocal diagonal for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&rDPtr[cell+96],0,1); - __builtin_prefetch (&DPtr[cell+96],0,1); - #endif - rDPtr[cell] = 1.0/DPtr[cell]; } } @@ -90,18 +81,8 @@ void Foam::diagonalPreconditioner::precondition register label nCells = wA.size(); - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&rDPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - #endif - wAPtr[cell] = rDPtr[cell]*rAPtr[cell]; } } diff --git a/src/OpenFOAM/matrices/lduMatrix/preconditioners/noPreconditioner/noPreconditioner.C b/src/OpenFOAM/matrices/lduMatrix/preconditioners/noPreconditioner/noPreconditioner.C index d1df531040c6fceea43d259a4a9e3553cc7b25fe..54302bea66223a2d4cfa7bb014bec2fb431e80cb 100644 --- a/src/OpenFOAM/matrices/lduMatrix/preconditioners/noPreconditioner/noPreconditioner.C +++ b/src/OpenFOAM/matrices/lduMatrix/preconditioners/noPreconditioner/noPreconditioner.C @@ -68,17 +68,8 @@ void Foam::noPreconditioner::precondition register label nCells = wA.size(); - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - #endif - wAPtr[cell] = rAPtr[cell]; } } diff --git a/src/OpenFOAM/matrices/lduMatrix/smoothers/GaussSeidel/GaussSeidelSmoother.C b/src/OpenFOAM/matrices/lduMatrix/smoothers/GaussSeidel/GaussSeidelSmoother.C index ff206e2e5fcbc31eb2184c600dd7b84c74dd8cfc..4c04d67b361d32368ad29a8b90df7d58e88cd6f2 100644 --- a/src/OpenFOAM/matrices/lduMatrix/smoothers/GaussSeidel/GaussSeidelSmoother.C +++ b/src/OpenFOAM/matrices/lduMatrix/smoothers/GaussSeidel/GaussSeidelSmoother.C @@ -146,19 +146,6 @@ void Foam::GaussSeidelSmoother::smooth for (register label cellI=0; cellI<nCells; cellI++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&psiPtr[cellI+64],0,1); - __builtin_prefetch (&bPrimePtr[cellI+64],0,1); - __builtin_prefetch (&ownStartPtr[cellI+64],0,1); - __builtin_prefetch (&diagPtr[cellI+64],0,1); - __builtin_prefetch (&uPtr[ownStartPtr[cellI+24]],0,1); - __builtin_prefetch (&uPtr[ownStartPtr[cellI+25]],0,1); - __builtin_prefetch (&uPtr[ownStartPtr[cellI+26]],0,1); - __builtin_prefetch (&uPtr[ownStartPtr[cellI+27]],0,1); - __builtin_prefetch (&upperPtr[ownStartPtr[cellI+24]],0,1); - __builtin_prefetch (&lowerPtr[ownStartPtr[cellI+24]],0,1); - #endif - // Start and end of this row fStart = fEnd; fEnd = ownStartPtr[cellI + 1]; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C index 0a5f1036749844421ecb7e7518aeadfb056e04a9..c514276c84e9d5341d8d5bb99d241600303393a8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PBiCG/PBiCG.C @@ -144,19 +144,8 @@ Foam::lduMatrix::solverPerformance Foam::PBiCG::solve if (solverPerf.nIterations() == 0) { - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&pAPtr[cell+96],0,1); - __builtin_prefetch (&pTPtr[cell+96],0,1); - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&wTPtr[cell+96],0,1); - #endif - pAPtr[cell] = wAPtr[cell]; pTPtr[cell] = wTPtr[cell]; } @@ -165,19 +154,8 @@ Foam::lduMatrix::solverPerformance Foam::PBiCG::solve { scalar beta = wArT/wArTold; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&pAPtr[cell+96],0,1); - __builtin_prefetch (&pTPtr[cell+96],0,1); - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&wTPtr[cell+96],0,1); - #endif - pAPtr[cell] = wAPtr[cell] + beta*pAPtr[cell]; pTPtr[cell] = wTPtr[cell] + beta*pTPtr[cell]; } @@ -199,21 +177,8 @@ Foam::lduMatrix::solverPerformance Foam::PBiCG::solve scalar alpha = wArT/wApT; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&pAPtr[cell+96],0,1); - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&wTPtr[cell+96],0,1); - __builtin_prefetch (&psiPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - __builtin_prefetch (&rTPtr[cell+96],0,1); - #endif - psiPtr[cell] += alpha*pAPtr[cell]; rAPtr[cell] -= alpha*wAPtr[cell]; rTPtr[cell] -= alpha*wTPtr[cell]; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C b/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C index 03b9419db20c7f266bbb1ddb2565380952c4f201..ea7581903cc5fd8c8b24ff29b67607dde9f1e66b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/PCG/PCG.C @@ -134,17 +134,8 @@ Foam::lduMatrix::solverPerformance Foam::PCG::solve if (solverPerf.nIterations() == 0) { - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&pAPtr[cell+96],0,1); - __builtin_prefetch (&wAPtr[cell+96],0,1); - #endif - pAPtr[cell] = wAPtr[cell]; } } @@ -152,17 +143,8 @@ Foam::lduMatrix::solverPerformance Foam::PCG::solve { scalar beta = wArA/wArAold; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&pAPtr[cell+96],0,1); - __builtin_prefetch (&wAPtr[cell+96],0,1); - #endif - pAPtr[cell] = wAPtr[cell] + beta*pAPtr[cell]; } } @@ -182,19 +164,8 @@ Foam::lduMatrix::solverPerformance Foam::PCG::solve scalar alpha = wArA/wApA; - #ifdef ICC_IA64_PREFETCH - #pragma ivdep - #endif - for (register label cell=0; cell<nCells; cell++) { - #ifdef ICC_IA64_PREFETCH - __builtin_prefetch (&pAPtr[cell+96],0,1); - __builtin_prefetch (&wAPtr[cell+96],0,1); - __builtin_prefetch (&psiPtr[cell+96],0,1); - __builtin_prefetch (&rAPtr[cell+96],0,1); - #endif - psiPtr[cell] += alpha*pAPtr[cell]; rAPtr[cell] -= alpha*wAPtr[cell]; } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H index c74d82b182d556b080368ee1e920579041f1871b..e394f679d042dd0c425f6fa7a869ebafeb5f2a4a 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H @@ -81,30 +81,49 @@ public: // Member Functions - //- Start of procI+1 data - inline const labelList& offsets() const; + ////- Start of procI+1 data + //inline const labelList& offsets() const; - //- my local size - inline label localSize() const; - //- Global sum of localSizes - inline label size() const; + // Queries relating to my processor - //- From local to global - inline label toGlobal(const label i) const; + //- my local size + inline label localSize() const; - //- Is on local processor - inline bool isLocal(const label i) const; + //- From local to global + inline label toGlobal(const label i) const; - //- From global to local on procI - inline label toLocal(const label procI, const label i) const; + //- Is on local processor + inline bool isLocal(const label i) const; - //- From global to local on current processor. - // FatalError if not on local processor. - inline label toLocal(const label i) const; + //- From global to local on current processor. + // FatalError if not on local processor. + inline label toLocal(const label i) const; + + + // Global queries + + //- Global sum of localSizes + inline label size() const; + + //- Size of procI data + inline label localSize(const label procI) const; + + //- From local to global on procI + inline label toGlobal(const label procI, const label i) const; + + //- Is on processor procI + inline bool isLocal(const label procI, const label i) const; + + //- From global to local on procI + inline label toLocal(const label procI, const label i) const; + + //- Which processor does global come from? Binary search. + inline label whichProcID(const label i) const; + + //- Start of procI data + inline label offset(const label procI) const; - //- Which processor does global come from? - inline label whichProcID(const label i) const; // IOstream Operators diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H index 65f5d2d9d06f4c50e49a0232184f0dd1aedeca92..d7c44107c665e29d0fd38900b2767e116b5e1b57 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H @@ -28,50 +28,74 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::labelList& Foam::globalIndex::offsets() const +//inline const Foam::labelList& Foam::globalIndex::offsets() const +//{ +// return offsets_; +//} + + +inline Foam::label Foam::globalIndex::offset(const label procI) const { - return offsets_; + return (procI == 0 ? 0 : offsets_[procI-1]); } -inline Foam::label Foam::globalIndex::localSize() const +inline Foam::label Foam::globalIndex::localSize(const label procI) const { return ( - Pstream::myProcNo() == 0 - ? offsets_[Pstream::myProcNo()] - : offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1] + procI == 0 + ? offsets_[procI] + : offsets_[procI] - offsets_[procI-1] ); } +inline Foam::label Foam::globalIndex::localSize() const +{ + return localSize(Pstream::myProcNo()); +} + + inline Foam::label Foam::globalIndex::size() const { return offsets_[Pstream::nProcs()-1]; } +inline Foam::label Foam::globalIndex::toGlobal +( + const label procI, + const label i +) const +{ + return(procI == 0 ? i : i + offsets_[procI-1]); +} + + inline Foam::label Foam::globalIndex::toGlobal(const label i) const { - return - ( - Pstream::myProcNo() == 0 - ? i - : i + offsets_[Pstream::myProcNo()-1] - ); + return toGlobal(Pstream::myProcNo(), i); } + //- Is on local processor -inline bool Foam::globalIndex::isLocal(const label i) const +inline bool Foam::globalIndex::isLocal(const label procI, const label i) const { return - (i < offsets_[Pstream::myProcNo()]) - && (i >= (Pstream::myProcNo() == 0 ? 0 : offsets_[Pstream::myProcNo()-1])); + (i < offsets_[procI]) + && (i >= (procI == 0 ? 0 : offsets_[procI-1])); +} + + +inline bool Foam::globalIndex::isLocal(const label i) const +{ + return isLocal(Pstream::myProcNo(), i); } inline Foam::label Foam::globalIndex::toLocal(const label procI, const label i) - const +const { label localI = (procI == 0 ? i : i - offsets_[procI-1]); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H index 690fb1083b4a4fce2f27c84df711fe8e5d33ea10..de1d9cc9f98c4fe60502606c3842c1057e7c8c9c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H @@ -32,7 +32,6 @@ Description SourceFiles coupledPolyPatch.C - coupledPolyPatchMorph.C \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/primitiveShapes/line/line.H b/src/OpenFOAM/meshes/primitiveShapes/line/line.H index 8af00d5bf9a70f1f2d081f00f288fac019d7abf6..e9f7c0296f81327d41a868ebe73eed644150b83b 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/line/line.H +++ b/src/OpenFOAM/meshes/primitiveShapes/line/line.H @@ -124,19 +124,13 @@ public: // Ostream operator - friend Istream& operator>> - #ifndef __CINT__ - <Point, PointRef> - #endif + friend Istream& operator>> <Point, PointRef> ( Istream&, line& ); - friend Ostream& operator<< - #ifndef __CINT__ - <Point, PointRef> - #endif + friend Ostream& operator<< <Point, PointRef> ( Ostream&, const line& diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H index 8ae9afc7f24b19abddca4140c4059619634872a6..375978a0b22e293cac8c772ecfc4a08880a8a8d1 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H +++ b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H @@ -184,10 +184,7 @@ public: // Ostream operator - friend Ostream& operator<< - #ifndef __CINT__ - <Point> - #endif + friend Ostream& operator<< <Point> ( Ostream& os, const PointHit<Point>& b @@ -202,7 +199,7 @@ inline Ostream& operator<<(Ostream& os, const PointHit<Point>& b) << b.rawPoint() << token::SPACE << b.distance() << token::SPACE << b.eligibleMiss(); - + return os; } diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index 33b3cab15e67775129d8997818a299add2d687f9..e43d4b9d2948219c3c4f11d2b1eb653200609992 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -607,6 +607,18 @@ inline bool triangle<Point, PointRef>::classify // system E0, E1 // + //Pout<< "alpha:" << alpha << endl; + //Pout<< "beta:" << beta << endl; + //Pout<< "hit:" << hit << endl; + //Pout<< "tol:" << tol << endl; + + if (hit) + { + // alpha,beta might get negative due to precision errors + alpha = max(0.0, min(1.0, alpha)); + beta = max(0.0, min(1.0, beta)); + } + nearType = NONE; nearLabel = -1; diff --git a/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H b/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H index 28b7b8b9d3050737cf197100c22cd3b69204025f..0459aedecf2f2f192ece94d9154031d266fcf87d 100644 --- a/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H +++ b/src/OpenFOAM/primitives/SphericalTensor/SphericalTensorI.H @@ -181,7 +181,7 @@ inline Cmpt det(const SphericalTensor<Cmpt>& st) template <class Cmpt> inline SphericalTensor<Cmpt> inv(const SphericalTensor<Cmpt>& st) { - return SphericalTensor<Cmpt>(1.0/st.ii()); + return SphericalTensor<Cmpt>(1.0/st.ii()); } @@ -202,7 +202,6 @@ public: }; -#ifndef __CINT__ template<class Cmpt> class innerProduct<SphericalTensor<Cmpt>, SphericalTensor<Cmpt> > { @@ -227,7 +226,6 @@ public: typedef Vector<Cmpt> type; }; -#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H index 5a2de5dbbda00df13548802a55f409fc4ffe20ec..3078f941e6ada25d9d3b29f4f70b6fe57277a0ea 100644 --- a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H +++ b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H @@ -520,7 +520,6 @@ public: typedef SymmTensor<Cmpt> type; }; -#ifndef __CINT__ template<class Cmpt> class innerProduct<SymmTensor<Cmpt>, SymmTensor<Cmpt> > { @@ -529,7 +528,6 @@ public: typedef SymmTensor<Cmpt> type; }; - template<class Cmpt> class innerProduct<SymmTensor<Cmpt>, Vector<Cmpt> > { @@ -578,7 +576,7 @@ public: typedef SymmTensor<Cmpt> type; }; -#endif + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Tensor/TensorI.H b/src/OpenFOAM/primitives/Tensor/TensorI.H index 7ca9958aa1800237f79a2d7766d62680732c28e6..71e7c0c76732a91728311840f2a0233d811bf80a 100644 --- a/src/OpenFOAM/primitives/Tensor/TensorI.H +++ b/src/OpenFOAM/primitives/Tensor/TensorI.H @@ -647,7 +647,6 @@ operator&&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2) return(t1.xx()*st2.ii() + t1.yy()*st2.ii() + t1.zz()*st2.ii()); } -#ifndef __CINT__ template<class Cmpt> class typeOfSum<SphericalTensor<Cmpt>, Tensor<Cmpt> > { @@ -679,7 +678,7 @@ public: typedef Tensor<Cmpt> type; }; -#endif + // * * * * * * * * * * Mixed Tensor SymmTensor Operators * * * * * * * * * * // @@ -806,7 +805,6 @@ operator&&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2) ); } -#ifndef __CINT__ template<class Cmpt> class typeOfSum<SymmTensor<Cmpt>, Tensor<Cmpt> > { @@ -839,7 +837,6 @@ public: typedef Tensor<Cmpt> type; }; -#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Tuple2/Tuple2.H b/src/OpenFOAM/primitives/Tuple2/Tuple2.H index 9a850e623666a1813acb77609206a0246355a19a..cac459587279012ae41af4cea6a53c9ddedb1c3b 100644 --- a/src/OpenFOAM/primitives/Tuple2/Tuple2.H +++ b/src/OpenFOAM/primitives/Tuple2/Tuple2.H @@ -139,19 +139,13 @@ public: // Friend Operators - friend bool operator== - #ifndef __CINT__ - <Type1, Type2> - #endif + friend bool operator== <Type1, Type2> ( const Tuple2<Type1, Type2>& a, const Tuple2<Type1, Type2>& b ); - friend bool operator!= - #ifndef __CINT__ - <Type1, Type2> - #endif + friend bool operator!= <Type1, Type2> ( const Tuple2<Type1, Type2>& a, const Tuple2<Type1, Type2>& b @@ -161,20 +155,14 @@ public: // IOstream operators //- Read Tuple2 from Istream, discarding contents of existing Tuple2. - friend Istream& operator>> - #ifndef __CINT__ - <Type1, Type2> - #endif + friend Istream& operator>> <Type1, Type2> ( Istream& is, Tuple2<Type1, Type2>& t2 ); // Write Tuple2 to Ostream. - friend Ostream& operator<< - #ifndef __CINT__ - <Type1, Type2> - #endif + friend Ostream& operator<< <Type1, Type2> ( Ostream& os, const Tuple2<Type1, Type2>& t2 diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H index dda9bd280428ed77f170f21c0b244653b5aea170..31e5b84f4aab19d6e507dcddf174501325937898 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H @@ -136,19 +136,13 @@ public: // IOstream Operators - friend Istream& operator>> - #ifndef __CINT__ - <Form, Cmpt, nCmpt> - #endif + friend Istream& operator>> <Form, Cmpt, nCmpt> ( Istream&, VectorSpace<Form, Cmpt, nCmpt>& ); - friend Ostream& operator<< - #ifndef __CINT__ - <Form, Cmpt, nCmpt> - #endif + friend Ostream& operator<< <Form, Cmpt, nCmpt> ( Ostream&, const VectorSpace<Form, Cmpt, nCmpt>& diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H index f368c6b8aef52b1023f3ea64afdbaba3cba7a955..eeea5f6bffe8fb4488e72f626beae526725adf02 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H @@ -263,7 +263,6 @@ inline const Cmpt& component // Powers of a Form // Equivalent to outer-products between the Form and itself -#ifndef __CINT__ // Form^0 = 1.0 template<class Form, class Cmpt, int nCmpt> inline typename powProduct<Form, 0>::type pow @@ -300,7 +299,7 @@ inline typename powProduct<Form, 2>::type pow { return sqr(static_cast<const Form&>(v)); } -#endif + template<class Form, class Cmpt, int nCmpt> inline scalar magSqr @@ -515,7 +514,6 @@ inline Form operator+ return v; } - template<class Form, class Cmpt, int nCmpt> inline Form operator- ( diff --git a/src/OpenFOAM/primitives/VectorSpace/products.H b/src/OpenFOAM/primitives/VectorSpace/products.H index d91790f02c1b138942d669212b7778ed8f9297e5..64647f71462c0a2c35b6932a7dfc9e359f488648 100644 --- a/src/OpenFOAM/primitives/VectorSpace/products.H +++ b/src/OpenFOAM/primitives/VectorSpace/products.H @@ -61,8 +61,6 @@ public: }; -#ifndef __CINT__ - template<class arg1, class arg2> class outerProduct { @@ -121,52 +119,6 @@ public: >::type type; }; -#else - -template<class arg1, class arg2> -class outerProduct -{ -public: - - typedef arg1 type; -}; - - -template<class arg1, class arg2> -class crossProduct -{ -public: - - typedef arg1 type; -}; - -template<class arg1, class arg2> -class innerProduct -{ -public: - - typedef arg1 type; -}; - -template<class arg1, class arg2> -class scalarProduct -{ -public: - - typedef typename pTraits<arg1>::cmptType type; -}; - - -template<class arg1, int arg2> -class powProduct -{ -public: - - typedef arg1 type; -}; - -#endif - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C new file mode 100644 index 0000000000000000000000000000000000000000..8f3381ea45a634a60de6614e33b6f9eadd13f709 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -0,0 +1,196 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "Polynomial.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<int PolySize> +Foam::Polynomial<PolySize>::Polynomial() +: + VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), + name_("unknownPolynomialName"), + logActive_(false), + logCoeff_(0.0) +{} + + +template<int PolySize> +Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) +: + VectorSpace<Polynomial<PolySize>, scalar, PolySize>(), + name_(is), + logActive_(false), + logCoeff_(0.0) +{ + if (name_ != name) + { + FatalErrorIn + ( + "Polynomial<PolySize>::Polynomial(const word&, Istream&)" + ) << "Expected polynomial name " << name << " but read " << name_ + << nl << exit(FatalError); + } + + VectorSpace<Polynomial<PolySize>, scalar, PolySize>:: + operator=(VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is)); + + if (this->size() == 0) + { + FatalErrorIn + ( + "Polynomial<PolySize>::Polynomial(const word&, Istream&)" + ) << "Polynomial coefficients for entry " << name_ + << " are invalid (empty)" << nl << exit(FatalError); + } +} + + +template<int PolySize> +Foam::Polynomial<PolySize>::Polynomial +( + const word& name, + const Polynomial<PolySize>& poly +) +: + VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly), + name_(name), + logActive_(poly.logActive_), + logCoeff_(poly.logCoeff_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<int PolySize> +const Foam::word& Foam::Polynomial<PolySize>::name() const +{ + return name_; +} + + +template<int PolySize> +bool& Foam::Polynomial<PolySize>::logActive() +{ + return logActive_; +} + + +template<int PolySize> +Foam::scalar& Foam::Polynomial<PolySize>::logCoeff() +{ + return logCoeff_; +} + + +template<int PolySize> +Foam::scalar Foam::Polynomial<PolySize>::evaluate(const scalar x) const +{ + scalar y = this->v_[0]; + + for (label i=1; i<PolySize; i++) + { + y += this->v_[i]*pow(x, i); + } + + if (logActive_) + { + y += logCoeff_*log(x); + } + + return y; +} + + +template<int PolySize> +Foam::scalar Foam::Polynomial<PolySize>::integrateLimits +( + const scalar x1, + const scalar x2 +) const +{ + if (logActive_) + { + FatalErrorIn + ( + "scalar Polynomial<PolySize>::integrateLimits" + "(" + "const scalar, " + "const scalar" + ") const" + ) << "Cannot integrate polynomial with logarithmic coefficients" + << nl << abort(FatalError); + } + + intPolyType poly = this->integrate(); + + return poly.evaluate(x2) - poly.evaluate(x1); +} + + +template<int PolySize> +typename Foam::Polynomial<PolySize>::intPolyType +Foam::Polynomial<PolySize>::integrate(const scalar intConstant) +{ + intPolyType newCoeffs; + + newCoeffs[0] = intConstant; + forAll(*this, i) + { + newCoeffs[i + 1] = this->v_[i]/(i + 1); + } + + return newCoeffs; +} + + +template<int PolySize> +typename Foam::Polynomial<PolySize>::polyType +Foam::Polynomial<PolySize>::integrateMinus1(const scalar intConstant) +{ + polyType newCoeffs; + + if (this->v_[0] > VSMALL) + { + newCoeffs.logActive() = true; + newCoeffs.logCoeff() = this->v_[0]; + } + + newCoeffs[0] = intConstant; + + if (PolySize > 0) + { + for (label i=1; i<PolySize; i++) + { + newCoeffs[i] = this->v_[i]/i; + } + } + + return newCoeffs; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H new file mode 100644 index 0000000000000000000000000000000000000000..c1e2b580090235841c2f83260c04a1bf5543c72b --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +Class + Foam::Polynomial + +Description + Polynomial templated on size (order): + + poly = logCoeff*log(x) + sum(coeff_[i]*x^i) + + where 0 <= i <= n + + - integer powers, starting at zero + - evaluate(x) to evaluate the poly for a given value + - integrate(x1, x2) between two scalar values + - integrate() to return a new, intergated coeff polynomial + - increases the size (order) + - integrateMinus1() to return a new, integrated coeff polynomial where + the base poly starts at order -1 + +SourceFiles + Polynomial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Polynomial_H +#define Polynomial_H + +#include "word.H" +#include "scalar.H" +#include "Ostream.H" +#include "VectorSpace.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template<int PolySize> +class Polynomial; + +// Forward declaration of friend functions +template<int PolySize> +Ostream& operator<< +( + Ostream&, + const Polynomial<PolySize>& +); + + +/*---------------------------------------------------------------------------*\ + Class Polynomial Declaration +\*---------------------------------------------------------------------------*/ + +template<int PolySize> +class Polynomial +: + public VectorSpace<Polynomial<PolySize>, scalar, PolySize> +{ + // Private data + + //- Polynomial name + word name_; + + //- Include the log term? - only activated using integrateMinus1() + bool logActive_; + + //- Log coefficient - only activated using integrateMinus1() + scalar logCoeff_; + + +public: + + typedef Polynomial<PolySize> polyType; + + typedef Polynomial<PolySize+1> intPolyType; + + + // Constructors + + //- Construct null + Polynomial(); + + //- Construct from name and Istream + Polynomial(const word& name, Istream& is); + + //- Copy constructor with name + Polynomial(const word& name, const Polynomial& poly); + + + // Member Functions + + // Access + + //- Return const access to the polynomial name + const word& name() const; + + //- Return access to the log term active flag + bool& logActive(); + + //- Return access to the log coefficient + scalar& logCoeff(); + + + // Evaluation + + //- Return polynomial value + scalar evaluate(const scalar x) const; + + //- Return integrated polynomial coefficients + // argument becomes zeroth element (constant of integration) + intPolyType integrate(const scalar intConstant = 0.0); + + //- Return integrated polynomial coefficients when lowest order + // is -1. Argument added to zeroth element + polyType integrateMinus1(const scalar intConstant = 0.0); + + //- Integrate between two values + scalar integrateLimits(const scalar x1, const scalar x2) const; + + + //- Ostream Operator + friend Ostream& operator<< <PolySize> + ( + Ostream&, + const Polynomial& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "Polynomial.C" +# include "PolynomialIO.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C similarity index 73% rename from src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C rename to src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C index b41cb31df9454bcd2e03ccb799cf146b26fd5a32..2a0d2187aa79c1df3d7051527598263216d4c76e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C @@ -24,24 +24,29 @@ License \*---------------------------------------------------------------------------*/ -#include "TrackedReactingParcel.H" +#include "Polynomial.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // -template <class ParcelType> -Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel +template<int PolySize> +Foam::Ostream& Foam::operator<< ( - const TrackedReactingParcel<ParcelType>& p + Ostream& os, + const Polynomial<PolySize>& poly ) -: - ReactingParcel<ParcelType>(p), - ParticleTrackingData<ParcelType>(p) -{} +{ + os << poly.name_ << token::SPACE + << static_cast + <VectorSpace<Polynomial<PolySize>, scalar, PolySize> >(poly); + // Check state of Ostream + os.check + ( + "Ostream& operator<<(Ostream&, const Polynomial<PolySize>&)" + ); -// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // + return os; +} -#include "TrackedReactingParcelIO.C" // ************************************************************************* // - diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 313110bd43ad9541a65a0d4199803aa3420141c3..37b59c523a3e541665964c469a5fbe75bee38012 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -109,7 +109,6 @@ $(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFiel $(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C -$(derivedFvPatchFields)/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C @@ -148,6 +147,7 @@ $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C $(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C +$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C fvsPatchFields = fields/fvsPatchFields $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C diff --git a/src/finiteVolume/cfdTools/compressible/compressibleContinuityErrs.H b/src/finiteVolume/cfdTools/compressible/compressibleContinuityErrs.H index b846a36cde00196ab2210bc8d0ad705887ebc4f3..9500b6d6713d3f17b48f5a242680d34155f28b33 100644 --- a/src/finiteVolume/cfdTools/compressible/compressibleContinuityErrs.H +++ b/src/finiteVolume/cfdTools/compressible/compressibleContinuityErrs.H @@ -33,15 +33,11 @@ Description { dimensionedScalar totalMass = fvc::domainIntegrate(rho); - scalar sumLocalContErr = - ( - fvc::domainIntegrate(mag(rho - thermo->rho()))/totalMass - ).value(); - - scalar globalContErr = - ( - fvc::domainIntegrate(rho - thermo->rho())/totalMass - ).value(); + scalar sumLocalContErr = + (fvc::domainIntegrate(mag(rho - thermo.rho()))/totalMass).value(); + + scalar globalContErr = + (fvc::domainIntegrate(rho - thermo.rho())/totalMass).value(); cumulativeContErr += globalContErr; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C deleted file mode 100644 index 9a75eed1688a05b8c3f308220f2033a7bb6f05d8..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C +++ /dev/null @@ -1,149 +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 "fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField:: -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(p, iF) -{} - - -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField:: -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField -( - const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper) -{} - - -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField:: -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& -) -: - fixedGradientFvPatchScalarField(p, iF) -{ - fvPatchField<scalar>::operator=(patchInternalField()); - gradient() = 0.0; -} - - -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField:: -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField -( - const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& wbppsf -) -: - fixedGradientFvPatchScalarField(wbppsf) -{} - - -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField:: -fixedFluxBoussinesqBuoyantPressureFvPatchScalarField -( - const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& wbppsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(wbppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const dictionary& environmentalProperties - = db().lookupObject<IOdictionary>("environmentalProperties"); - - dimensionedVector g(environmentalProperties.lookup("g")); - - const dictionary& transportProperties - = db().lookupObject<IOdictionary>("transportProperties"); - - dimensionedScalar beta(transportProperties.lookup("beta")); - - const fvPatchField<scalar>& T = - patch().lookupPatchField<volScalarField, scalar>("T"); - - gradient() = beta.value()*T.snGrad()*(g.value() & patch().Cf()); - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::write -( - Ostream& os -) const -{ - fixedGradientFvPatchScalarField::write(os); - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C index b6f48ff6ada8e214e41f83c848bafabdb32de46e..279918b47af95cdb9d91b7344ff5844af91888bd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C @@ -43,56 +43,61 @@ fixedFluxBuoyantPressureFvPatchScalarField const DimensionedField<scalar, volMesh>& iF ) : - fixedGradientFvPatchScalarField(p, iF) + fixedGradientFvPatchScalarField(p, iF), + rhoName_("rho") {} fixedFluxBuoyantPressureFvPatchScalarField:: fixedFluxBuoyantPressureFvPatchScalarField ( - const fixedFluxBuoyantPressureFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper + const dictionary& dict ) : - fixedGradientFvPatchScalarField(ptf, p, iF, mapper) -{} + fixedGradientFvPatchScalarField(p, iF), + rhoName_(dict.lookupOrDefault<word>("rho", "rho")) +{ + fvPatchField<scalar>::operator=(patchInternalField()); + gradient() = 0.0; +} fixedFluxBuoyantPressureFvPatchScalarField:: fixedFluxBuoyantPressureFvPatchScalarField ( + const fixedFluxBuoyantPressureFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, - const dictionary& + const fvPatchFieldMapper& mapper ) : - fixedGradientFvPatchScalarField(p, iF) -{ - fvPatchField<scalar>::operator=(patchInternalField()); - gradient() = 0.0; -} + fixedGradientFvPatchScalarField(ptf, p, iF, mapper), + rhoName_(ptf.rhoName_) +{} fixedFluxBuoyantPressureFvPatchScalarField:: fixedFluxBuoyantPressureFvPatchScalarField ( - const fixedFluxBuoyantPressureFvPatchScalarField& wbppsf + const fixedFluxBuoyantPressureFvPatchScalarField& ptf ) : - fixedGradientFvPatchScalarField(wbppsf) + fixedGradientFvPatchScalarField(ptf), + rhoName_(ptf.rhoName_) {} fixedFluxBuoyantPressureFvPatchScalarField:: fixedFluxBuoyantPressureFvPatchScalarField ( - const fixedFluxBuoyantPressureFvPatchScalarField& wbppsf, + const fixedFluxBuoyantPressureFvPatchScalarField& ptf, const DimensionedField<scalar, volMesh>& iF ) : - fixedGradientFvPatchScalarField(wbppsf, iF) + fixedGradientFvPatchScalarField(ptf, iF), + rhoName_(ptf.rhoName_) {} @@ -111,7 +116,7 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs() dimensionedVector g(environmentalProperties.lookup("g")); const fvPatchField<scalar>& rho = - patch().lookupPatchField<volScalarField, scalar>("rho"); + patch().lookupPatchField<volScalarField, scalar>(rhoName_); // If the variable name is "pd" assume it is p - rho*g.h // and set the gradient appropriately. @@ -132,6 +137,7 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs() void fixedFluxBuoyantPressureFvPatchScalarField::write(Ostream& os) const { fixedGradientFvPatchScalarField::write(os); + os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H index 8e433cb8f167f0304ec840bb270c4521c9230e5b..ec5dc7dd990d69170621c253ca5b73b5d9e91b74 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H @@ -55,6 +55,11 @@ class fixedFluxBuoyantPressureFvPatchScalarField : public fixedGradientFvPatchScalarField { + // Private data + + //- Name of the density field used to calculate the buoyancy force + word rhoName_; + public: diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index 76267d4fa6a86f2083f6720b2eb58fe255610d4d..56ee8a0753d38e9eef05c766677ca1d4eccfa64d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -30,7 +30,6 @@ License #include "volFields.H" #include "surfaceFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..dfda8caf521d7e6f3733d3e4bf640fbfd58ee22f --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C @@ -0,0 +1,168 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "uniformDensityHydrostaticPressureFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "surfaceFields.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformDensityHydrostaticPressureFvPatchScalarField:: +uniformDensityHydrostaticPressureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + rho_(0.0), + pRefValue_(0.0), + pRefPoint_(vector::zero) +{} + + +Foam::uniformDensityHydrostaticPressureFvPatchScalarField:: +uniformDensityHydrostaticPressureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF), + rho_(readScalar(dict.lookup("rho"))), + pRefValue_(readScalar(dict.lookup("pRefValue"))), + pRefPoint_(dict.lookup("pRefPoint")) +{ + if (dict.found("value")) + { + fvPatchField<scalar>::operator= + ( + scalarField("value", dict, p.size()) + ); + } + else + { + evaluate(); + } +} + + +Foam::uniformDensityHydrostaticPressureFvPatchScalarField:: +uniformDensityHydrostaticPressureFvPatchScalarField +( + const uniformDensityHydrostaticPressureFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + rho_(ptf.rho_), + pRefValue_(ptf.pRefValue_), + pRefPoint_(ptf.pRefPoint_) +{} + + +Foam::uniformDensityHydrostaticPressureFvPatchScalarField:: +uniformDensityHydrostaticPressureFvPatchScalarField +( + const uniformDensityHydrostaticPressureFvPatchScalarField& ptf +) +: + fixedValueFvPatchScalarField(ptf), + rho_(ptf.rho_), + pRefValue_(ptf.pRefValue_), + pRefPoint_(ptf.pRefPoint_) +{} + + +Foam::uniformDensityHydrostaticPressureFvPatchScalarField:: +uniformDensityHydrostaticPressureFvPatchScalarField +( + const uniformDensityHydrostaticPressureFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(ptf, iF), + rho_(ptf.rho_), + pRefValue_(ptf.pRefValue_), + pRefPoint_(ptf.pRefPoint_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const dictionary& environmentalProperties + = db().lookupObject<IOdictionary>("environmentalProperties"); + + dimensionedVector g(environmentalProperties.lookup("g")); + + operator== + ( + pRefValue_ + + rho_*((g.value() & patch().Cf()) - (g.value() & pRefPoint_)) + ); + + fixedValueFvPatchScalarField::updateCoeffs(); +} + + +void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("rho") << rho_ << token::END_STATEMENT << nl; + os.writeKeyword("pRefValue") << pRefValue_ << token::END_STATEMENT << nl; + os.writeKeyword("pRefPoint") << pRefPoint_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + uniformDensityHydrostaticPressureFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H similarity index 53% rename from src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.H rename to src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H index 094f8805606650a1f2b087d1404dcad78fd1c680..8b129fe3ab3ac5e9bc834f38f9124ffd53742454 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.H @@ -23,23 +23,24 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + Foam::uniformDensityHydrostaticPressureFvPatchScalarField Description - Boundary condition on pressure for use with buoyant solvers employing the - Boussinesq approximation to balance the flux generated by the temperature - gradient. + Hydrostatic pressure boundary condition calculated as + + pRefValue + rho*g.(x - pRefPoint) + + where rho is provided and assumed uniform. SourceFiles - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C + uniformDensityHydrostaticPressureFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef fixedFluxBoussinesqBuoyantPressureFvPatchScalarFields_H -#define fixedFluxBoussinesqBuoyantPressureFvPatchScalarFields_H +#ifndef uniformDensityHydrostaticPressureFvPatchScalarField_H +#define uniformDensityHydrostaticPressureFvPatchScalarField_H -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" +#include "fixedValueFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,30 +48,42 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class fixedFluxBoussinesqBuoyantPressureFvPatchScalarField Declaration + Class uniformDensityHydrostaticPressureFvPatch Declaration \*---------------------------------------------------------------------------*/ -class fixedFluxBoussinesqBuoyantPressureFvPatchScalarField +class uniformDensityHydrostaticPressureFvPatchScalarField : - public fixedGradientFvPatchScalarField + public fixedValueFvPatchScalarField { + // Private data + + //- Constant density in the far-field + scalar rho_; + + //- Reference pressure + scalar pRefValue_; + + //- Reference pressure location + vector pRefPoint_; + + public: //- Runtime type information - TypeName("fixedFluxBoussinesqBuoyantPressure"); + TypeName("uniformDensityHydrostaticPressure"); // Constructors //- Construct from patch and internal field - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + uniformDensityHydrostaticPressureFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>& ); //- Construct from patch, internal field and dictionary - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + uniformDensityHydrostaticPressureFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>&, @@ -78,20 +91,19 @@ public: ); //- Construct by mapping given - // fixedFluxBoussinesqBuoyantPressureFvPatchScalarField onto a new - // patch - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + // uniformDensityHydrostaticPressureFvPatchScalarField onto a new patch + uniformDensityHydrostaticPressureFvPatchScalarField ( - const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField&, + const uniformDensityHydrostaticPressureFvPatchScalarField&, const fvPatch&, const DimensionedField<scalar, volMesh>&, const fvPatchFieldMapper& ); //- Construct as copy - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + uniformDensityHydrostaticPressureFvPatchScalarField ( - const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& + const uniformDensityHydrostaticPressureFvPatchScalarField& ); //- Construct and return a clone @@ -99,14 +111,14 @@ public: { return tmp<fvPatchScalarField> ( - new fixedFluxBoussinesqBuoyantPressureFvPatchScalarField(*this) + new uniformDensityHydrostaticPressureFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + uniformDensityHydrostaticPressureFvPatchScalarField ( - const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField&, + const uniformDensityHydrostaticPressureFvPatchScalarField&, const DimensionedField<scalar, volMesh>& ); @@ -118,7 +130,7 @@ public: { return tmp<fvPatchScalarField> ( - new fixedFluxBoussinesqBuoyantPressureFvPatchScalarField + new uniformDensityHydrostaticPressureFvPatchScalarField ( *this, iF @@ -129,8 +141,52 @@ public: // Member functions - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); + // Access + + //- Return the constant density in the far-field + scalar rho() const + { + return rho_; + } + + //- Return reference to the constant density in the far-field + // to allow adjustment + scalar& rho() + { + return rho_; + } + + //- Return the reference pressure + scalar pRefValue() const + { + return pRefValue_; + } + + //- Return reference to the reference pressure to allow adjustment + scalar& pRefValue() + { + return pRefValue_; + } + + //- Return the pressure reference location + const vector& pRefPoint() const + { + return pRefPoint_; + } + + //- Return reference to the pressure reference location + // to allow adjustment + vector& pRefPoint() + { + return pRefPoint_; + } + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + //- Write virtual void write(Ostream&) const; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 5eae3a9f80a1ce3f9401f07fd8759a5d67789a68..1e49de46837ff1613623633bc791033d46e02595 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -1301,7 +1301,11 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::correction { tmp<Foam::fvMatrix<Type> > tAcorr = A - (A & A.psi()); - if ((A.hasUpper() || A.hasLower()) && A.mesh().fluxRequired(A.psi().name())) + if + ( + (A.hasUpper() || A.hasLower()) + && A.psi().mesh().fluxRequired(A.psi().name()) + ) { tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr(); } @@ -1321,7 +1325,11 @@ Foam::tmp<Foam::fvMatrix<Type> > Foam::correction // Note the matrix coefficients are still that of matrix A const fvMatrix<Type>& A = tAcorr(); - if ((A.hasUpper() || A.hasLower()) && A.mesh().fluxRequired(A.psi().name())) + if + ( + (A.hasUpper() || A.hasLower()) + && A.psi().mesh().fluxRequired(A.psi().name()) + ) { tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr(); } diff --git a/src/fvMotionSolver/Make/files b/src/fvMotionSolver/Make/files index 41f31c0ecc79dd3972e667e08041002a0e9099ae..f229ae322ef04b4bf61dd4bb0eb336fed3764e48 100644 --- a/src/fvMotionSolver/Make/files +++ b/src/fvMotionSolver/Make/files @@ -30,5 +30,6 @@ pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPo pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C +pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C LIB = $(FOAM_LIBBIN)/libfvMotionSolvers diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C new file mode 100644 index 0000000000000000000000000000000000000000..bbafb189faa97eba4faea0aa5e69ad1d163e70fd --- /dev/null +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C @@ -0,0 +1,514 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +\*---------------------------------------------------------------------------*/ + +#include "surfaceDisplacementPointPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "Time.H" +#include "transformField.H" +#include "fvMesh.H" +#include "displacementLaplacianFvMotionSolver.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<> +const char* +NamedEnum<surfaceDisplacementPointPatchVectorField::projectMode, 3>:: +names[] = +{ + "nearest", + "pointNormal", + "fixedNormal" +}; + +const NamedEnum<surfaceDisplacementPointPatchVectorField::projectMode, 3> + surfaceDisplacementPointPatchVectorField::projectModeNames_; + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void surfaceDisplacementPointPatchVectorField::calcProjection +( + vectorField& displacement +) const +{ + const polyMesh& mesh = patch().boundaryMesh().mesh()(); + const pointField& localPoints = patch().localPoints(); + const labelList& meshPoints = patch().meshPoints(); + + //const scalar deltaT = mesh.time().deltaT().value(); + + // Construct large enough vector in direction of projectDir so + // we're guaranteed to hit something. + + //- Per point projection vector: + const scalar projectLen = mag(mesh.bounds().max()-mesh.bounds().min()); + + // For case of fixed projection vector: + vector projectVec; + if (projectMode_ == FIXEDNORMAL) + { + vector n = projectDir_/mag(projectDir_); + projectVec = projectLen*n; + } + + + // Get fixed points (bit of a hack) + const pointZone* zonePtr = NULL; + + if (frozenPointsZone_.size() > 0) + { + const pointZoneMesh& pZones = mesh.pointZones(); + + zonePtr = &pZones[pZones.findZoneID(frozenPointsZone_)]; + + Pout<< "surfaceDisplacementPointPatchVectorField : Fixing all " + << zonePtr->size() << " points in pointZone " << zonePtr->name() + << endl; + } + + // Get the starting locations from the motionSolver + const pointField& points0 = mesh.lookupObject<displacementFvMotionSolver> + ( + "dynamicMeshDict" + ).points0(); + + + pointField start(meshPoints.size()); + forAll(start, i) + { + start[i] = points0[meshPoints[i]] + displacement[i]; + } + + label nNotProjected = 0; + + if (projectMode_ == NEAREST) + { + List<pointIndexHit> nearest; + labelList hitSurfaces; + surfaces().findNearest + ( + start, + scalarField(start.size(), sqr(projectLen)), + hitSurfaces, + nearest + ); + + forAll(nearest, i) + { + if (zonePtr && (zonePtr->whichPoint(meshPoints[i]) >= 0)) + { + // Fixed point. Reset to point0 location. + displacement[i] = points0[meshPoints[i]] - localPoints[i]; + } + else if (nearest[i].hit()) + { + displacement[i] = + nearest[i].hitPoint() + - points0[meshPoints[i]]; + } + else + { + nNotProjected++; + + if (debug) + { + Pout<< " point:" << meshPoints[i] + << " coord:" << localPoints[i] + << " did not find any surface within " << projectLen + << endl; + } + } + } + } + else + { + // Do tests on all points. Combine later on. + + // 1. Check if already on surface + List<pointIndexHit> nearest; + { + labelList nearestSurface; + surfaces().findNearest + ( + start, + scalarField(start.size(), sqr(SMALL)), + nearestSurface, + nearest + ); + } + + // 2. intersection. (combined later on with information from nearest + // above) + vectorField projectVecs(start.size(), projectVec); + + if (projectMode_ == POINTNORMAL) + { + projectVecs = projectLen*patch().pointNormals(); + } + + // Knock out any wedge component + scalarField offset(start.size(), 0.0); + if (wedgePlane_ >= 0 && wedgePlane_ <= vector::nComponents) + { + forAll(offset, i) + { + offset[i] = start[i][wedgePlane_]; + start[i][wedgePlane_] = 0; + projectVecs[i][wedgePlane_] = 0; + } + } + + List<pointIndexHit> rightHit; + { + labelList rightSurf; + surfaces().findAnyIntersection + ( + start, + start+projectVecs, + rightSurf, + rightHit + ); + } + + List<pointIndexHit> leftHit; + { + labelList leftSurf; + surfaces().findAnyIntersection + ( + start, + start-projectVecs, + leftSurf, + leftHit + ); + } + + // 3. Choose either -fixed, nearest, right, left. + forAll(displacement, i) + { + if (zonePtr && (zonePtr->whichPoint(meshPoints[i]) >= 0)) + { + // Fixed point. Reset to point0 location. + displacement[i] = points0[meshPoints[i]] - localPoints[i]; + } + else if (nearest[i].hit()) + { + // Found nearest. + displacement[i] = + nearest[i].hitPoint() + - points0[meshPoints[i]]; + } + else + { + pointIndexHit interPt; + + if (rightHit[i].hit()) + { + if (leftHit[i].hit()) + { + if + ( + magSqr(rightHit[i].hitPoint()-start[i]) + < magSqr(leftHit[i].hitPoint()-start[i]) + ) + { + interPt = rightHit[i]; + } + else + { + interPt = leftHit[i]; + } + } + else + { + interPt = rightHit[i]; + } + } + else + { + if (leftHit[i].hit()) + { + interPt = leftHit[i]; + } + } + + + if (interPt.hit()) + { + if (wedgePlane_ >= 0 && wedgePlane_ <= vector::nComponents) + { + interPt.rawPoint()[wedgePlane_] += offset[i]; + } + displacement[i] = interPt.rawPoint()-points0[meshPoints[i]]; + } + else + { + nNotProjected++; + + if (debug) + { + Pout<< " point:" << meshPoints[i] + << " coord:" << localPoints[i] + << " did not find any intersection between" + << " ray from " << start[i]-projectVecs[i] + << " to " << start[i]+projectVecs[i] << endl; + } + } + } + } + } + + reduce(nNotProjected, sumOp<label>()); + + if (nNotProjected > 0) + { + Info<< "surfaceDisplacement :" + << " on patch " << patch().name() + << " did not project " << nNotProjected + << " out of " << returnReduce(localPoints.size(), sumOp<label>()) + << " points." << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +surfaceDisplacementPointPatchVectorField:: +surfaceDisplacementPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchVectorField(p, iF), + velocity_(vector::zero), + projectMode_(NEAREST), + projectDir_(vector::zero), + wedgePlane_(-1) +{} + + +surfaceDisplacementPointPatchVectorField:: +surfaceDisplacementPointPatchVectorField +( + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const dictionary& dict +) +: + fixedValuePointPatchVectorField(p, iF, dict), + velocity_(dict.lookup("velocity")), + surfacesDict_(dict.subDict("geometry")), + projectMode_(projectModeNames_.read(dict.lookup("projectMode"))), + projectDir_(dict.lookup("projectDirection")), + wedgePlane_(readLabel(dict.lookup("wedgePlane"))), + frozenPointsZone_(dict.lookupOrDefault("frozenPointsZone", word::null)) +{ + if (velocity_.x() < 0 || velocity_.y() < 0 || velocity_.z() < 0) + { + FatalErrorIn + ( + "surfaceDisplacementPointPatchVectorField::\n" + "surfaceDisplacementPointPatchVectorField\n" + "(\n" + " const pointPatch& p,\n" + " const DimensionedField<vector, pointMesh>& iF,\n" + " const dictionary& dict\n" + ")\n" + ) << "All components of velocity have to be positive : " + << velocity_ << nl + << "Set velocity components to a great value if no clipping" + << " necessary." << exit(FatalError); + } +} + + +surfaceDisplacementPointPatchVectorField:: +surfaceDisplacementPointPatchVectorField +( + const surfaceDisplacementPointPatchVectorField& ppf, + const pointPatch& p, + const DimensionedField<vector, pointMesh>& iF, + const pointPatchFieldMapper& mapper +) +: + fixedValuePointPatchVectorField(ppf, p, iF, mapper), + velocity_(ppf.velocity_), + surfacesDict_(ppf.surfacesDict_), + projectMode_(ppf.projectMode_), + projectDir_(ppf.projectDir_), + wedgePlane_(ppf.wedgePlane_), + frozenPointsZone_(ppf.frozenPointsZone_) +{} + + +surfaceDisplacementPointPatchVectorField:: +surfaceDisplacementPointPatchVectorField +( + const surfaceDisplacementPointPatchVectorField& ppf +) +: + fixedValuePointPatchVectorField(ppf), + velocity_(ppf.velocity_), + surfacesDict_(ppf.surfacesDict_), + projectMode_(ppf.projectMode_), + projectDir_(ppf.projectDir_), + wedgePlane_(ppf.wedgePlane_), + frozenPointsZone_(ppf.frozenPointsZone_) +{} + + +surfaceDisplacementPointPatchVectorField:: +surfaceDisplacementPointPatchVectorField +( + const surfaceDisplacementPointPatchVectorField& ppf, + const DimensionedField<vector, pointMesh>& iF +) +: + fixedValuePointPatchVectorField(ppf, iF), + velocity_(ppf.velocity_), + surfacesDict_(ppf.surfacesDict_), + projectMode_(ppf.projectMode_), + projectDir_(ppf.projectDir_), + wedgePlane_(ppf.wedgePlane_), + frozenPointsZone_(ppf.frozenPointsZone_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const searchableSurfaces& +surfaceDisplacementPointPatchVectorField::surfaces() const +{ + if (surfacesPtr_.empty()) + { + surfacesPtr_.reset + ( + new searchableSurfaces + ( + IOobject + ( + "abc", // dummy name + db().time().constant(), // directory + "triSurface", // instance + db().time(), // registry + IOobject::MUST_READ, + IOobject::NO_WRITE + ), + surfacesDict_ + ) + ); + } + return surfacesPtr_(); +} + + +void surfaceDisplacementPointPatchVectorField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + const polyMesh& mesh = patch().boundaryMesh().mesh()(); + + vectorField currentDisplacement = this->patchInternalField(); + + // Calculate intersections with surface w.r.t points0. + vectorField displacement(currentDisplacement); + calcProjection(displacement); + + // offset wrt current displacement + vectorField offset = displacement-currentDisplacement; + + // Clip offset to maximum displacement possible: velocity*timestep + + const scalar deltaT = mesh.time().deltaT().value(); + const vector clipVelocity = velocity_*deltaT; + + forAll(displacement, i) + { + vector& d = offset[i]; + + for (direction cmpt = 0; cmpt < vector::nComponents; cmpt++) + { + if (d[cmpt] < 0) + { + d[cmpt] = max(d[cmpt], -clipVelocity[cmpt]); + } + else + { + d[cmpt] = min(d[cmpt], clipVelocity[cmpt]); + } + } + } + + this->operator==(currentDisplacement+offset); + + fixedValuePointPatchVectorField::updateCoeffs(); +} + + +void surfaceDisplacementPointPatchVectorField::write(Ostream& os) const +{ + fixedValuePointPatchVectorField::write(os); + os.writeKeyword("velocity") << velocity_ + << token::END_STATEMENT << nl; + os.writeKeyword("geometry") << surfacesDict_ + << token::END_STATEMENT << nl; + os.writeKeyword("projectMode") << projectModeNames_[projectMode_] + << token::END_STATEMENT << nl; + os.writeKeyword("projectDirection") << projectDir_ + << token::END_STATEMENT << nl; + os.writeKeyword("wedgePlane") << wedgePlane_ + << token::END_STATEMENT << nl; + if (frozenPointsZone_ != word::null) + { + os.writeKeyword("frozenPointsZone") << frozenPointsZone_ + << token::END_STATEMENT << nl; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePointPatchTypeField +( + fixedValuePointPatchVectorField, + surfaceDisplacementPointPatchVectorField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H new file mode 100644 index 0000000000000000000000000000000000000000..7b3ecd7c2ff4437b825b1b17238ce0ba2cc6c10f --- /dev/null +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.H @@ -0,0 +1,223 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Class + surfaceDisplacementPointPatchVectorField + +Description + Displacement fixed by projection onto triSurface. + Use in a displacement fvMotionSolver + as a bc on the pointDisplacement field. + + Calculates the projection onto the surface according + to the projectMode + - NEAREST : nearest + - POINTNORMAL : intersection with point normal + - FIXEDNORMAL : intersection with fixed vector + + This displacement is then clipped with the specified velocity * deltaT. + + Optionally (intersection only) removes a component ("wedgePlane") to + stay in 2D. + + Needs: + - geometry : dictionary with searchableSurfaces. (usually + triSurfaceMeshes in constant/triSurface) + - projectMode : see above + - projectDirection : if projectMode = fixedNormal + - wedgePlane : -1 or component to knock out of intersection normal + - frozenPointsZone : empty or name of pointZone containing points + that do not move + +SourceFiles + surfaceDisplacementPointPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef surfaceDisplacementPointPatchVectorField_H +#define surfaceDisplacementPointPatchVectorField_H + +#include "pointPatchFields.H" +#include "fixedValuePointPatchFields.H" +#include "searchableSurfaces.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class surfaceDisplacementPointPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class surfaceDisplacementPointPatchVectorField +: + public fixedValuePointPatchVectorField +{ + +public: + + // Public data types + + enum projectMode + { + NEAREST, + POINTNORMAL, + FIXEDNORMAL + }; + +private: + + // Private data + + //- project mode names + static const NamedEnum<projectMode, 3> projectModeNames_; + + //- Maximum velocity + const vector velocity_; + + //- names of surfaces + const dictionary surfacesDict_; + + //- How to project/project onto surface + const projectMode projectMode_; + + //- direction to project + const vector projectDir_; + + //- plane for 2D wedge case or -1. + const label wedgePlane_; + + //- pointZone with frozen points + const word frozenPointsZone_; + + //- Demand driven: surface to project + mutable autoPtr<searchableSurfaces> surfacesPtr_; + + + // Private Member Functions + + //- Calculate displacement (w.r.t. points0()) to project onto surface + void calcProjection(vectorField& displacement) const; + + + //- Disallow default bitwise assignment + void operator=(const surfaceDisplacementPointPatchVectorField&); + +public: + + //- Runtime type information + TypeName("surfaceDisplacement"); + + + // Constructors + + //- Construct from patch and internal field + surfaceDisplacementPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct from patch, internal field and dictionary + surfaceDisplacementPointPatchVectorField + ( + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const dictionary& + ); + + //- Construct by mapping given patchField<vector> onto a new patch + surfaceDisplacementPointPatchVectorField + ( + const surfaceDisplacementPointPatchVectorField&, + const pointPatch&, + const DimensionedField<vector, pointMesh>&, + const pointPatchFieldMapper& + ); + + //- Construct as copy + surfaceDisplacementPointPatchVectorField + ( + const surfaceDisplacementPointPatchVectorField& + ); + + //- Construct and return a clone + virtual autoPtr<pointPatchVectorField> clone() const + { + return autoPtr<pointPatchVectorField> + ( + new surfaceDisplacementPointPatchVectorField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + surfaceDisplacementPointPatchVectorField + ( + const surfaceDisplacementPointPatchVectorField&, + const DimensionedField<vector, pointMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual autoPtr<pointPatchVectorField> clone + ( + const DimensionedField<vector, pointMesh>& iF + ) const + { + return autoPtr<pointPatchVectorField> + ( + new surfaceDisplacementPointPatchVectorField + ( + *this, + iF + ) + ); + } + + // Member Functions + + //- Surface to follow. Demand loads surfaceNames. + const searchableSurfaces& surfaces() const; + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C index 8c310481d7c5ae20dfda44ff7e402437cf2f4b7a..8f37cd91abadbe0bc26a3f7a49985a961902721c 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C @@ -40,7 +40,7 @@ namespace Foam template<> const char* -NamedEnum<surfaceSlipDisplacementPointPatchVectorField::followMode, 3>:: +NamedEnum<surfaceSlipDisplacementPointPatchVectorField::projectMode, 3>:: names[] = { "nearest", @@ -48,8 +48,8 @@ names[] = "fixedNormal" }; -const NamedEnum<surfaceSlipDisplacementPointPatchVectorField::followMode, 3> - surfaceSlipDisplacementPointPatchVectorField::followModeNames_; +const NamedEnum<surfaceSlipDisplacementPointPatchVectorField::projectMode, 3> + surfaceSlipDisplacementPointPatchVectorField::projectModeNames_; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -95,12 +95,10 @@ void surfaceSlipDisplacementPointPatchVectorField::calcProjection } // Get the starting locations from the motionSolver - const displacementFvMotionSolver& motionSolver = - mesh.lookupObject<displacementFvMotionSolver> - ( - "dynamicMeshDict" - ); - const pointField& points0 = motionSolver.points0(); + const pointField& points0 = mesh.lookupObject<displacementFvMotionSolver> + ( + "dynamicMeshDict" + ).points0(); pointField start(meshPoints.size()); @@ -326,7 +324,7 @@ surfaceSlipDisplacementPointPatchVectorField : pointPatchVectorField(p, iF, dict), surfacesDict_(dict.subDict("geometry")), - projectMode_(followModeNames_.read(dict.lookup("followMode"))), + projectMode_(projectModeNames_.read(dict.lookup("projectMode"))), projectDir_(dict.lookup("projectDirection")), wedgePlane_(readLabel(dict.lookup("wedgePlane"))), frozenPointsZone_(dict.lookupOrDefault("frozenPointsZone", word::null)) @@ -343,11 +341,11 @@ surfaceSlipDisplacementPointPatchVectorField ) : pointPatchVectorField(p, iF), - surfacesDict_(ppf.surfacesDict()), - projectMode_(ppf.projectMode()), - projectDir_(ppf.projectDir()), - wedgePlane_(ppf.wedgePlane()), - frozenPointsZone_(ppf.frozenPointsZone()) + surfacesDict_(ppf.surfacesDict_), + projectMode_(ppf.projectMode_), + projectDir_(ppf.projectDir_), + wedgePlane_(ppf.wedgePlane_), + frozenPointsZone_(ppf.frozenPointsZone_) {} @@ -358,11 +356,11 @@ surfaceSlipDisplacementPointPatchVectorField ) : pointPatchVectorField(ppf), - surfacesDict_(ppf.surfacesDict()), - projectMode_(ppf.projectMode()), - projectDir_(ppf.projectDir()), - wedgePlane_(ppf.wedgePlane()), - frozenPointsZone_(ppf.frozenPointsZone()) + surfacesDict_(ppf.surfacesDict_), + projectMode_(ppf.projectMode_), + projectDir_(ppf.projectDir_), + wedgePlane_(ppf.wedgePlane_), + frozenPointsZone_(ppf.frozenPointsZone_) {} @@ -374,11 +372,11 @@ surfaceSlipDisplacementPointPatchVectorField ) : pointPatchVectorField(ppf, iF), - surfacesDict_(ppf.surfacesDict()), - projectMode_(ppf.projectMode()), - projectDir_(ppf.projectDir()), - wedgePlane_(ppf.wedgePlane()), - frozenPointsZone_(ppf.frozenPointsZone()) + surfacesDict_(ppf.surfacesDict_), + projectMode_(ppf.projectMode_), + projectDir_(ppf.projectDir_), + wedgePlane_(ppf.wedgePlane_), + frozenPointsZone_(ppf.frozenPointsZone_) {} @@ -435,7 +433,7 @@ void surfaceSlipDisplacementPointPatchVectorField::write(Ostream& os) const pointPatchVectorField::write(os); os.writeKeyword("geometry") << surfacesDict_ << token::END_STATEMENT << nl; - os.writeKeyword("followMode") << followModeNames_[projectMode_] + os.writeKeyword("projectMode") << projectModeNames_[projectMode_] << token::END_STATEMENT << nl; os.writeKeyword("projectDirection") << projectDir_ << token::END_STATEMENT << nl; diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H index 9edb42ac0d8764334c014267bbdbb327bb808596..2b2b89819fd98faeefb5ad658c75813273fa59e2 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H @@ -26,8 +26,10 @@ Class Foam::surfaceSlipDisplacementPointPatchVectorField Description - Displacement follows a triSurface. Use in a displacement fvMotionSolver. - Following is either + Displacement follows a triSurface. Use in a displacement fvMotionSolver + as a bc on the pointDisplacement field. + Following is done by calculating the projection onto the surface according + to the projectMode - NEAREST : nearest - POINTNORMAL : intersection with point normal - FIXEDNORMAL : intersection with fixed vector @@ -36,9 +38,10 @@ Description stay in 2D. Needs: - - projectSurfaces : names of triSurfaceMeshes (in constant/triSurface) - - followMode : see above - - projectDirection : if followMode = fixedNormal + - geometry : dictionary with searchableSurfaces. (usually + triSurfaceMeshes in constant/triSurface) + - projectMode : see above + - projectDirection : if projectMode = fixedNormal - wedgePlane : -1 or component to knock out of intersection normal - frozenPointsZone : empty or name of pointZone containing points that do not move @@ -72,7 +75,7 @@ public: // Public data types - enum followMode + enum projectMode { NEAREST, POINTNORMAL, @@ -83,14 +86,14 @@ private: // Private data - //- follow mode names - static const NamedEnum<followMode, 3> followModeNames_; + //- project mode names + static const NamedEnum<projectMode, 3> projectModeNames_; //- names of surfaces const dictionary surfacesDict_; - //- How to follow/project onto surface - const followMode projectMode_; + //- How to project/project onto surface + const projectMode projectMode_; //- direction to project const vector projectDir_; @@ -101,13 +104,13 @@ private: //- pointZone with frozen points const word frozenPointsZone_; - //- Demand driven: surface to follow + //- Demand driven: surface to project mutable autoPtr<searchableSurfaces> surfacesPtr_; // Private Member Functions - //- Calculate displacement to project onto surface + //- Calculate displacement (w.r.t. points0()) to project onto surface void calcProjection(vectorField& displacement) const; //- Disallow default bitwise assignment @@ -189,40 +192,9 @@ public: // Member Functions - //- Surfaces to follow - const dictionary& surfacesDict() const - { - return surfacesDict_; - } - //- Surface to follow. Demand loads surfaceNames. const searchableSurfaces& surfaces() const; - //- Mode of projection/following - followMode projectMode() const - { - return projectMode_; - } - - //- Direction to project back onto surface - const vector& projectDir() const - { - return projectDir_; - } - - //- Normal of wedgeplane (0, 1, 2) or -1. Note: should be obtained - // from twoDPointCorrector. - label wedgePlane() const - { - return wedgePlane_; - } - - //- Zone containing frozen points - const word& frozenPointsZone() const - { - return frozenPointsZone_; - } - //- Update the patch field virtual void evaluate ( diff --git a/src/lagrangian/basic/IOPosition/IOPosition.C b/src/lagrangian/basic/IOPosition/IOPosition.C index 7865a12105f0bd3923a2b3fa85fdb6f139b4c041..810a9fbcf55f463efb7a07abb3eb879630ada3f2 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.C +++ b/src/lagrangian/basic/IOPosition/IOPosition.C @@ -22,12 +22,77 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "IOPosition.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class ParticleType> +Foam::word Foam::IOPosition<ParticleType>::particlePropertiesName +( + "particleProperties" +); + +// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // + +template<class ParticleType> +void Foam::IOPosition<ParticleType>::readParticleProperties() +{ + IOobject propsDictHeader + ( + particlePropertiesName, + cloud_.db().time().timeName(), + "uniform"/cloud::prefix/cloud_.name(), + cloud_.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (propsDictHeader.headerOk()) + { + const IOdictionary propsDict(propsDictHeader); + + word procName("processor" + Foam::name(Pstream::myProcNo())); + if (propsDict.found(procName)) + { + propsDict.subDict(procName).lookup("particleCount") + >> Particle<ParticleType>::particleCount; + } + } +} + + +template<class ParticleType> +void Foam::IOPosition<ParticleType>::writeParticleProperties() const +{ + IOdictionary propsDict + ( + IOobject + ( + particlePropertiesName, + cloud_.db().time().timeName(), + "uniform"/cloud::prefix/cloud_.name(), + cloud_.db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ) + ); + + word procName("processor" + Foam::name(Pstream::myProcNo())); + propsDict.add(procName, dictionary()); + propsDict.subDict(procName).add + ( + "particleCount", + Particle<ParticleType>::particleCount + ); + + propsDict.regIOobject::write(); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParticleType> @@ -70,6 +135,8 @@ bool Foam::IOPosition<ParticleType>::write() const template<class ParticleType> bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const { + writeParticleProperties(); + os<< cloud_.size() << nl << token::BEGIN_LIST << nl; forAllConstIter(typename Cloud<ParticleType>, cloud_, iter) @@ -90,6 +157,8 @@ void Foam::IOPosition<ParticleType>::readData bool checkClass ) { + readParticleProperties(); + Istream& is = readStream(checkClass ? typeName : ""); token firstToken(is); diff --git a/src/lagrangian/basic/IOPosition/IOPosition.H b/src/lagrangian/basic/IOPosition/IOPosition.H index 5123644385f28bb942c01c5a2de8f30d43f41116..069dc0135df4339dbc0cb4ee1c5063865a40ef4e 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.H +++ b/src/lagrangian/basic/IOPosition/IOPosition.H @@ -59,30 +59,38 @@ class IOPosition const Cloud<ParticleType>& cloud_; + // Private member functions + + //- Read particle properties dictionary + void readParticleProperties(); + + //- Write particle properties dictionary + void writeParticleProperties() const; + + public: - //- Runtime type name information - virtual const word& type() const - { - return cloud_.type(); - } + // Static data + + //- Runtime type name information + virtual const word& type() const + { + return cloud_.type(); + } + + //- Name of particle properties dictionary + static word particlePropertiesName; + // Constructors //- Construct from cloud - IOPosition - ( - const Cloud<ParticleType>& - ); + IOPosition(const Cloud<ParticleType>&); // Member functions - void readData - ( - Cloud<ParticleType>& c, - bool checkClass - ); + void readData(Cloud<ParticleType>& c, bool checkClass); bool write() const; diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index ee85abda689f5a1110a9b7c6b9a7ff90ced46d12..4b51b88a4514d97d5d21b8c6b648a880ab3624be 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -33,6 +33,12 @@ License #include "wallPolyPatch.H" #include "transform.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class ParticleType> +Foam::label Foam::Particle<ParticleType>::particleCount = 0; + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class ParticleType> @@ -69,7 +75,7 @@ void Foam::Particle<ParticleType>::findFaces DynamicList<label>& faceList ) const { - const polyMesh& mesh = cloud_.polyMesh_; + const polyMesh& mesh = cloud_.mesh(); const labelList& faces = mesh.cells()[celli]; const vector& C = mesh.cellCentres()[celli]; @@ -176,7 +182,9 @@ Foam::Particle<ParticleType>::Particle position_(position), celli_(celli), facei_(-1), - stepFraction_(0.0) + stepFraction_(0.0), + origProc_(Pstream::myProcNo()), + origId_(particleCount++) {} @@ -187,7 +195,9 @@ Foam::Particle<ParticleType>::Particle(const Particle<ParticleType>& p) position_(p.position_), celli_(p.celli_), facei_(p.facei_), - stepFraction_(p.stepFraction_) + stepFraction_(p.stepFraction_), + origProc_(p.origProc_), + origId_(p.origId_) {} diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H index f061c06b68b96fedb4963264187faed12d614d5e..71011d72a460ce3a9490d2e284b233a0bd868040 100644 --- a/src/lagrangian/basic/Particle/Particle.H +++ b/src/lagrangian/basic/Particle/Particle.H @@ -127,6 +127,12 @@ protected: //- Fraction of time-step completed scalar stepFraction_; + //- Originating processor id + label origProc_; + + //- Local particle id on originating processor + label origId_; + // Private member functions @@ -267,11 +273,14 @@ public: // Static data members + //- Runtime type information + TypeName("Particle"); + //- String representation of properties static string propHeader; - //- Runtime type information - TypeName("Particle"); + //- Cumulative particle count used for particle id + static label particleCount; // Constructors @@ -396,6 +405,12 @@ public: //- Return the fraction of time-step completed inline scalar stepFraction() const; + //- Return the originating processor id + inline label origProc() const; + + //- Return the particle id on originating processor + inline label origId() const; + // Track diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H index 0eb891271730376021b36f0e743f7de08986e84b..65ac64e5251c25a460e79eb70ae5aeadc3d523bb 100644 --- a/src/lagrangian/basic/Particle/ParticleI.H +++ b/src/lagrangian/basic/Particle/ParticleI.H @@ -26,15 +26,10 @@ License #include "polyMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class ParticleType> -inline scalar Particle<ParticleType>::lambda +inline Foam::scalar Foam::Particle<ParticleType>::lambda ( const vector& from, const vector& to, @@ -182,7 +177,7 @@ inline scalar Particle<ParticleType>::lambda template<class ParticleType> -inline scalar Particle<ParticleType>::lambda +inline Foam::scalar Foam::Particle<ParticleType>::lambda ( const vector& from, const vector& to, @@ -234,7 +229,7 @@ inline scalar Particle<ParticleType>::lambda template<class ParticleType> -inline bool Particle<ParticleType>::inCell() const +inline bool Foam::Particle<ParticleType>::inCell() const { DynamicList<label>& faces = cloud_.labels_; findFaces(position_, faces); @@ -244,7 +239,7 @@ inline bool Particle<ParticleType>::inCell() const template<class ParticleType> -inline bool Particle<ParticleType>::inCell +inline bool Foam::Particle<ParticleType>::inCell ( const vector& position, const label celli, @@ -261,7 +256,7 @@ inline bool Particle<ParticleType>::inCell // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ParticleType> -inline Particle<ParticleType>::trackData::trackData +inline Foam::Particle<ParticleType>::trackData::trackData ( Cloud<ParticleType>& cloud ) @@ -269,8 +264,10 @@ inline Particle<ParticleType>::trackData::trackData cloud_(cloud) {} + template<class ParticleType> -inline Cloud<ParticleType>& Particle<ParticleType>::trackData::cloud() +inline Foam::Cloud<ParticleType>& +Foam::Particle<ParticleType>::trackData::cloud() { return cloud_; } @@ -279,76 +276,92 @@ inline Cloud<ParticleType>& Particle<ParticleType>::trackData::cloud() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ParticleType> -inline const Cloud<ParticleType>& Particle<ParticleType>::cloud() const +inline const Foam::Cloud<ParticleType>& +Foam::Particle<ParticleType>::cloud() const { return cloud_; } template<class ParticleType> -inline const vector& Particle<ParticleType>::position() const +inline const Foam::vector& Foam::Particle<ParticleType>::position() const { return position_; } template<class ParticleType> -inline vector& Particle<ParticleType>::position() +inline Foam::vector& Foam::Particle<ParticleType>::position() { return position_; } template<class ParticleType> -inline label Particle<ParticleType>::cell() const +inline Foam::label Foam::Particle<ParticleType>::cell() const { return celli_; } + template<class ParticleType> -inline label& Particle<ParticleType>::cell() +inline Foam::label& Foam::Particle<ParticleType>::cell() { return celli_; } template<class ParticleType> -inline label Particle<ParticleType>::face() const +inline Foam::label Foam::Particle<ParticleType>::face() const { return facei_; } template<class ParticleType> -inline bool Particle<ParticleType>::onBoundary() const +inline bool Foam::Particle<ParticleType>::onBoundary() const { return facei_ != -1 && facei_ >= cloud_.pMesh().nInternalFaces(); } template<class ParticleType> -inline scalar& Particle<ParticleType>::stepFraction() +inline Foam::scalar& Foam::Particle<ParticleType>::stepFraction() { return stepFraction_; } template<class ParticleType> -inline scalar Particle<ParticleType>::stepFraction() const +inline Foam::scalar Foam::Particle<ParticleType>::stepFraction() const { return stepFraction_; } template<class ParticleType> -inline bool Particle<ParticleType>::softImpact() const +inline Foam::label Foam::Particle<ParticleType>::origProc() const +{ + return origProc_; +} + + +template<class ParticleType> +inline Foam::label Foam::Particle<ParticleType>::origId() const +{ + return origId_; +} + + +template<class ParticleType> +inline bool Foam::Particle<ParticleType>::softImpact() const { return false; } template<class ParticleType> -inline scalar Particle<ParticleType>::currentTime() const +inline Foam::scalar Foam::Particle<ParticleType>::currentTime() const { return cloud_.pMesh().time().value() @@ -357,14 +370,14 @@ inline scalar Particle<ParticleType>::currentTime() const template<class ParticleType> -inline label Particle<ParticleType>::patch(const label facei) const +inline Foam::label Foam::Particle<ParticleType>::patch(const label facei) const { return cloud_.facePatch(facei); } template<class ParticleType> -inline label Particle<ParticleType>::patchFace +inline Foam::label Foam::Particle<ParticleType>::patchFace ( const label patchi, const label facei @@ -375,21 +388,18 @@ inline label Particle<ParticleType>::patchFace template<class ParticleType> -inline scalar Particle<ParticleType>::wallImpactDistance(const vector&) const +inline Foam::scalar +Foam::Particle<ParticleType>::wallImpactDistance(const vector&) const { return 0.0; } template<class ParticleType> -inline label Particle<ParticleType>::faceInterpolation() const +inline Foam::label Foam::Particle<ParticleType>::faceInterpolation() const { return facei_; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/lagrangian/basic/Particle/ParticleIO.C b/src/lagrangian/basic/Particle/ParticleIO.C index 70e635dc94765e8e3b321fbf98d45b3a8259b91c..5865cf5098a81180d64c2c30b0a1f03d9e725b27 100644 --- a/src/lagrangian/basic/Particle/ParticleIO.C +++ b/src/lagrangian/basic/Particle/ParticleIO.C @@ -31,12 +31,11 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template<class ParticleType> -Foam::string Foam::Particle<ParticleType>::propHeader = "(Px Py Pz) cellI"; - +Foam::string Foam::Particle<ParticleType>::propHeader = + "(Px Py Pz) cellI origProc origId"; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from Istream template<class ParticleType> Foam::Particle<ParticleType>::Particle ( @@ -47,20 +46,26 @@ Foam::Particle<ParticleType>::Particle : cloud_(cloud), facei_(-1), - stepFraction_(0.0) + stepFraction_(0.0), + origProc_(Pstream::myProcNo()), + origId_(-1) { if (is.format() == IOstream::ASCII) { - is >> position_ >> celli_; + is >> position_ >> celli_ >> origProc_ >> origId_; } else { - // In binary read both celli_ and facei_, needed for parallel transfer + // In binary read all particle data - needed for parallel transfer is.read ( reinterpret_cast<char*>(&position_), - sizeof(position_) + sizeof(celli_) - + sizeof(facei_) + sizeof(stepFraction_) + sizeof(position_) + + sizeof(celli_) + + sizeof(facei_) + + sizeof(stepFraction_) + + sizeof(origProc_) + + sizeof(origId_) ); } @@ -92,7 +97,9 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p) if (os.format() == IOstream::ASCII) { os << p.position_ - << token::SPACE << p.celli_; + << token::SPACE << p.celli_ + << token::SPACE << p.origProc_ + << token::SPACE << p.origId_; } else { @@ -100,8 +107,12 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p) os.write ( reinterpret_cast<const char*>(&p.position_), - sizeof(p.position_) + sizeof(p.celli_) - + sizeof(p.facei_) + sizeof(p.stepFraction_) + sizeof(p.position_) + + sizeof(p.celli_) + + sizeof(p.facei_) + + sizeof(p.stepFraction_) + + sizeof(p.origProc_) + + sizeof(p.origId_) ); } diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H deleted file mode 100644 index c752c2ec366ab52dad64f49b6081f01d93e2c2e6..0000000000000000000000000000000000000000 --- a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H +++ /dev/null @@ -1,166 +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 - -Class - Foam::ParticleTrackingData - -Description - Class to provide additional properties to allow construction of - particle tracks - -SourceFiles - ParticleTrackingData.C - ParticleTrackingDataIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef ParticleTrackingData_H -#define ParticleTrackingData_H - -#include "Cloud.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes and friend functions -template<class ParcelType> -class ParticleTrackingData; - - -template<class ParcelType> -Ostream& operator<< -( - Ostream&, - const ParticleTrackingData<ParcelType>& -); - - -/*---------------------------------------------------------------------------*\ - Class ParticleTrackingData Declaration -\*---------------------------------------------------------------------------*/ - -template<class ParcelType> -class ParticleTrackingData -{ - // Private data - - //- Reference to the cloud - const Cloud<ParcelType>& cloud_; - - //- Originating processor id - label origProc_; - - //- Local particle id - label id_; - - //- Cumulative particle count used for particle id - static label PARTICLE_COUNT; - - - // Private member functions - - //- Write properties - particle count - static void writeProperties(const Cloud<ParcelType>& cloud); - - //- Read properties - particle count - static void readProperties(const Cloud<ParcelType>& cloud); - - -public: - - // Constructors - - //- Construct from cloud - ParticleTrackingData(const Cloud<ParcelType>& cloud); - - //- Construct copy - ParticleTrackingData(const ParticleTrackingData& ptd); - - //- Construct from Istream and mesh - ParticleTrackingData - ( - const Cloud<ParcelType>& cloud, - Istream& is, - bool readFields - ); - - - //- Destructor - ~ParticleTrackingData(); - - - // Member functions - - // Access - - //- Return const access to the cloud - inline const Cloud<ParcelType>& cloud() const; - - //- Return const access to the originating processor id - inline label origProc() const; - - //- Return const access to the local particle id - inline label id() const; - - - // I-O - - //- Read fields - static void readFields(Cloud<ParcelType>& c); - - //- Write fields - static void writeFields(const Cloud<ParcelType>& c); - - - // Ostream Operator - - friend Ostream& operator<< <ParcelType> - ( - Ostream&, - const ParticleTrackingData<ParcelType>& - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "ParticleTrackingDataI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "ParticleTrackingData.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H deleted file mode 100644 index da195d56274e4ac02cd87bd051539c1f1de517eb..0000000000000000000000000000000000000000 --- a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H +++ /dev/null @@ -1,49 +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 - -\*---------------------------------------------------------------------------*/ - -template<class ParcelType> -inline const Foam::Cloud<ParcelType>& -Foam::ParticleTrackingData<ParcelType>::cloud() const -{ - return cloud_; -} - - -template<class ParcelType> -inline Foam::label Foam::ParticleTrackingData<ParcelType>::origProc() const -{ - return origProc_; -} - - -template<class ParcelType> -inline Foam::label Foam::ParticleTrackingData<ParcelType>::id() const -{ - return id_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataIO.C b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataIO.C deleted file mode 100644 index e575426eea793be664dea0c84b216c8d5252e2e3..0000000000000000000000000000000000000000 --- a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataIO.C +++ /dev/null @@ -1,233 +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 "ParticleTrackingData.H" - -// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // - -template<class ParcelType> -void Foam::ParticleTrackingData<ParcelType>::readProperties -( - const Cloud<ParcelType>& cloud -) -{ - IOobject propsDictHeader - ( - "particleTrackingProperties", - cloud.db().time().timeName(), - "uniform/Lagrangian"/cloud.name(), - cloud.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ); - - if (propsDictHeader.headerOk()) - { - const IOdictionary propsDict(propsDictHeader); - - word procName("processor" + name(Pstream::myProcNo())); - if (propsDict.found(procName)) - { - propsDict.subDict(procName).lookup("particleCount") >> - PARTICLE_COUNT; - } - } -} - - -template<class ParcelType> -void Foam::ParticleTrackingData<ParcelType>::writeProperties -( - const Cloud<ParcelType>& cloud -) -{ - if (cloud.db().time().outputTime()) - { - IOdictionary propsDict - ( - IOobject - ( - "particleTrackingProperties", - cloud.db().time().timeName(), - "uniform/Lagrangian"/cloud.name(), - cloud.db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ) - ); - - word procName("processor" + name(Pstream::myProcNo())); - propsDict.add(procName, dictionary()); - propsDict.subDict(procName).add("particleCount", PARTICLE_COUNT); - - propsDict.regIOobject::write(); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class ParcelType> -Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData -( - const Cloud<ParcelType>& cloud, - Istream& is, - bool readFields -) -: - cloud_(cloud), - origProc_(-1), - id_(-1) -{ - if (readFields) - { - if (is.format() == IOstream::ASCII) - { - is >> origProc_ >> id_; - } - else - { - is.read - ( - reinterpret_cast<char*>(&origProc_), - sizeof(origProc_) + sizeof(id_) - ); - } - } - - // Check state of Istream - is.check - ( - "ParticleTrackingData<ParcelType>::ParticleTrackingData" - "(" - "Istream&, " - "bool" - ")" - ); -} - - -template<class ParcelType> -void Foam::ParticleTrackingData<ParcelType>::readFields -( - Cloud<ParcelType>& c -) -{ - if (!c.size()) - { - return; - } - - readProperties(c); - - IOField<label> origProc(c.fieldIOobject("origProc", IOobject::MUST_READ)); - c.checkFieldIOobject(c, origProc); - - IOField<label> id(c.fieldIOobject("id", IOobject::MUST_READ)); - c.checkFieldIOobject(c, id); - - label i = 0; - forAllIter(typename Cloud<ParcelType>, c, iter) - { - ParcelType& p = iter(); - p.origProc_ = origProc[i]; - p.id_ = id[i]; - i++; - } -} - - -template<class ParcelType> -void Foam::ParticleTrackingData<ParcelType>::writeFields -( - const Cloud<ParcelType>& c -) -{ - writeProperties(c); - - const label np = c.size(); - - IOField<label> origProc - ( - c.fieldIOobject("origProc", IOobject::NO_READ), - np - ); - IOField<label> id(c.fieldIOobject("id", IOobject::NO_READ), np); - - label i = 0; - forAllConstIter(typename Cloud<ParcelType>, c, iter) - { - const ParcelType& p = iter(); - - origProc[i] = p.origProc(); - id[i] = p.id(); - i++; - } - - origProc.write(); - id.write(); -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<class ParcelType> -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const ParticleTrackingData<ParcelType>& p -) -{ - if (os.format() == IOstream::ASCII) - { - os << p.origProc_ << token::SPACE << p.id_ << token::SPACE; - } - else - { - os.write - ( - reinterpret_cast<const char*>(&p.origProc_), - sizeof(p.origProc_) + sizeof(p.id_) - ); - } - - // Check state of Ostream - os.check - ( - "Ostream& operator<<" - "(" - "Ostream&, " - "const ParticleTrackingData<ParcelType>&" - ")" - ); - - return os; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C index 873b82d170ba37b1d33beb485a46533b3266a9f2..a4d249d265fe3f5fff3b62957e0a69eec4bd910c 100644 --- a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C @@ -35,7 +35,7 @@ Foam::CoalCloud<ThermoType>::CoalCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ) : ReactingMultiphaseCloud<CoalParcel<ThermoType> > diff --git a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H index 91a0289f0ffe3439d1f0900f7da70d073e2c96e1..36e3b4e03ee7e5d4e4875604c254c8fbf1b22416 100644 --- a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H @@ -76,7 +76,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ); diff --git a/src/lagrangian/coalCombustion/Make/options b/src/lagrangian/coalCombustion/Make/options index 21dc5327f121a8c8b4fb4f85df2feff75b232bce..965409487a3c83e2651e6cd1facbc8f479f68228 100755 --- a/src/lagrangian/coalCombustion/Make/options +++ b/src/lagrangian/coalCombustion/Make/options @@ -10,7 +10,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ @@ -30,6 +30,6 @@ LIB_LIBS = \ -lliquidMixture \ -lsolids \ -lsolidMixture \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lcompressibleRASModels \ -lcompressibleLESModels diff --git a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H index 4c0668668379a0cbbf744e9dfa3867669d34b5f2..7d7f95da36a1d0f7a0db56b22d6ac36e53d70aa1 100644 --- a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H +++ b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H @@ -28,7 +28,7 @@ License #define createCoalParcelTypes_H #include "makeParcelIOList.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "CoalCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -38,12 +38,17 @@ License createCoalParcelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ createCoalParcelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + createCoalParcelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H index 1f60f47d9d5b48d0594eae236f89eb11bda0416a..0a8e17481aa2b0ff4599ef411157dd734ee89ba2 100644 --- a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H +++ b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingMultiphaseCloud.H" #include "NoSurfaceReaction.H" @@ -44,12 +44,17 @@ License makeCoalSurfaceReactionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeCoalSurfaceReactionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeCoalSurfaceReactionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C index 6c44dc9da86e5cbe7ad406dc5799cfa32b07e361..2e252fbf596518b276d552225c0fc55353f48cc1 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C @@ -50,10 +50,10 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); - scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); + WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W(); + scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W(); WC_ = WCO2 - WO2_; - HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc(); + HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc(); if (Sb_ < 0) { @@ -120,8 +120,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate } // Local mass fraction of O2 in the carrier phase - const scalar YO2 = - this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; + const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI]; // Change in C mass [kg] scalar dmC = diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C index d21efd77e8b0b612b8a4c0d8bb22d3ce41a894f9..682bac3ec67c9bd4eb4634daa0e7315ea9d24140 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C @@ -58,10 +58,10 @@ COxidationKineticDiffusionLimitedRate CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); - scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); + WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W(); + scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W(); WC_ = WCO2 - WO2_; - HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc(); + HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc(); if (Sb_ < 0) { @@ -128,8 +128,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate } // Local mass fraction of O2 in the carrier phase - const scalar YO2 = - this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; + const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI]; // Diffusion rate coefficient const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C index c7c8dd795582d9ce079240f1b65bf2bc69740080..e2a1c68700d84c7f2ad2470881d5ee946ee9d127 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C @@ -69,8 +69,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); - scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); + WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W(); + scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W(); WC_ = WCO2 - WO2_; } @@ -125,7 +125,7 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate // Cell carrier phase O2 species density [kg/m^3] const scalar rhoO2 = - rhoc*this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; + rhoc*this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI]; if (rhoO2 < SMALL) { @@ -211,9 +211,9 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate this->owner().composition().solids().properties()[CsLocalId_].Hf() + this->owner().composition().solids().properties()[CsLocalId_].cp()*T; const scalar HCO2 = - this->owner().composition().carrierSpecies()[CO2GlobalId_].H(T); + this->owner().mcCarrierThermo().speciesData()[CO2GlobalId_].H(T); const scalar HO2 = - this->owner().composition().carrierSpecies()[O2GlobalId_].H(T); + this->owner().mcCarrierThermo().speciesData()[O2GlobalId_].H(T); // Heat of reaction return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2); diff --git a/src/lagrangian/dieselSpray/Make/options b/src/lagrangian/dieselSpray/Make/options index d0817503ce4ed16a0798dbe5c0654e91f6df3420..454c4f15bfae582e59a09888022a83a0261b2475 100644 --- a/src/lagrangian/dieselSpray/Make/options +++ b/src/lagrangian/dieselSpray/Make/options @@ -11,7 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude LIB_LIBS = \ diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index 4d19f332fd3aa3901af43bedd62c8bc789a199ee..0dd861683bbf95e89686d661f4c719ab665c0703 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -34,15 +34,14 @@ License #include "wallPolyPatch.H" #include "wedgePolyPatch.H" #include "processorPolyPatch.H" -#include "combustionMixture.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + namespace Foam { -defineParticleTypeNameAndDebug(parcel, 0); -defineTemplateTypeNameAndDebug(Cloud<parcel>, 0); + defineParticleTypeNameAndDebug(parcel, 0); + defineTemplateTypeNameAndDebug(Cloud<parcel>, 0); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C index 058ae4252e91ccdb091ed40eddb1dc665adeb3f6..131e9f885f9877a9ba771d4650ffec322aaed6e5 100644 --- a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C +++ b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C @@ -30,7 +30,7 @@ License #include "dragModel.H" #include "evaporationModel.H" #include "heatTransferModel.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,7 +93,7 @@ void parcel::setRelaxationTimes for(label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; - scalar Y = sDB.composition().Y()[j][celli]; + scalar Y = sDB.composition().Y()[j][celli]; scalar Wi = sDB.gasProperties()[j].W(); Yf[i] = Y; Xf[i] = Y*W/Wi; @@ -139,14 +139,14 @@ void parcel::setRelaxationTimes scalar Prandtl = Pr(cpMixture, muf, kMixture); // calculate the characteritic times - + if(liquidCore_> 0.5) { // no drag for parcels in the liquid core.. tauMomentum = GREAT; } else - { + { tauMomentum = sDB.drag().relaxationTime ( Urel(Up), @@ -218,10 +218,10 @@ void parcel::setRelaxationTimes { scalar Nusselt = sDB.heatTransfer().Nu(Reynolds, Prandtl); - + // calculating the boiling temperature of the liquid at ambient pressure scalar tBoilingSurface = Td; - + label Niter = 0; scalar deltaT = 10.0; scalar dp0 = fuels.properties()[i].pv(pressure, tBoilingSurface) - pressure; @@ -255,16 +255,16 @@ void parcel::setRelaxationTimes } dp0 = dp; } - + scalar vapourSurfaceEnthalpy = 0.0; scalar vapourFarEnthalpy = 0.0; - + for(label k = 0; k < sDB.gasProperties().size(); k++) { vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface); vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature); } - + scalar kLiquid = fuels.properties()[i].K(pressure, 0.5*(tBoilingSurface+T())); tauBoiling[i] = sDB.evaporation().boilingTime diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C index 1f4b1a242fc28027105b480f34d914f88886b12f..07dbcdbe7ef3665a01201daf4eb7cf31bb0bb405 100644 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ b/src/lagrangian/dieselSpray/spray/spray.C @@ -36,7 +36,7 @@ License #include "injectorModel.H" #include "wallModel.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" @@ -56,8 +56,8 @@ Foam::spray::spray const volScalarField& rho, const volScalarField& p, const volScalarField& T, - const combustionMixture& composition, - const PtrList<specieProperties>& gasProperties, + const basicMultiComponentMixture& composition, + const PtrList<gasThermoPhysics>& gasProperties, const dictionary&, const dictionary& environmentalProperties ) @@ -264,7 +264,7 @@ Foam::spray::spray "spray::spray(const volVectorField& U, " "const volScalarField& rho, const volScalarField& p, " "const volScalarField& T, const combustionMixture& composition," - "const PtrList<specieProperties>& gaseousFuelProperties, " + "const PtrList<gasThermoPhsyics>& gaseousFuelProperties, " "const dictionary& thermophysicalProperties, " "const dictionary& environmentalProperties)" ) << "spray::(...) only one wedgePolyPatch found. " diff --git a/src/lagrangian/dieselSpray/spray/spray.H b/src/lagrangian/dieselSpray/spray/spray.H index be9c49e67a437cf3abb729aa3d174a8c1b39e47f..f416e3cf4ea2f175588fa9c95d3633494f996420 100644 --- a/src/lagrangian/dieselSpray/spray/spray.H +++ b/src/lagrangian/dieselSpray/spray/spray.H @@ -38,10 +38,10 @@ Description #include "IOPtrList.H" #include "interpolation.H" #include "liquid.H" -#include "sprayThermoTypes.H" #include "autoPtr.H" #include "liquidMixture.H" #include "Random.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +58,7 @@ class injectorModel; class heatTransferModel; class wallModel; -class combustionMixture; +class basicMultiComponentMixture; /*---------------------------------------------------------------------------*\ Class spray Declaration @@ -127,8 +127,8 @@ class spray // Composition properties - const PtrList<specieProperties>& gasProperties_; - const combustionMixture& composition_; + const PtrList<gasThermoPhysics>& gasProperties_; + const basicMultiComponentMixture& composition_; List<label> liquidToGasIndex_; List<label> gasToLiquidIndex_; @@ -192,8 +192,8 @@ public: const volScalarField& rho, const volScalarField& p, const volScalarField& T, - const combustionMixture& composition, - const PtrList<specieProperties>& gasProperties, + const basicMultiComponentMixture& composition, + const PtrList<gasThermoPhysics>& gasProperties, const dictionary& thermophysicalProperties, const dictionary& environmentalProperties ); @@ -257,8 +257,8 @@ public: inline const vector& g() const; inline const liquidMixture& fuels() const; - inline const PtrList<specieProperties>& gasProperties() const; - inline const combustionMixture& composition() const; + inline const PtrList<gasThermoPhysics>& gasProperties() const; + inline const basicMultiComponentMixture& composition() const; inline const List<label>& liquidToGasIndex() const; inline const List<label>& gasToLiquidIndex() const; diff --git a/src/lagrangian/dieselSpray/spray/sprayI.H b/src/lagrangian/dieselSpray/spray/sprayI.H index 1e38a81668d0d73739cdf1226de4526c756daab4..86c063ca6f7dc5bdae3823837b0ff472918efb10 100644 --- a/src/lagrangian/dieselSpray/spray/sprayI.H +++ b/src/lagrangian/dieselSpray/spray/sprayI.H @@ -36,71 +36,85 @@ inline const Time& spray::runTime() const return runTime_; } + inline const fvMesh& spray::mesh() const { return mesh_; } + inline const volVectorField& spray::U() const { return U_; } + inline const volScalarField& spray::rho() const { return rho_; } + inline const volScalarField& spray::p() const { return p_; } + inline const volScalarField& spray::T() const { return T_; } + inline PtrList<injector>& spray::injectors() { return injectors_; } + inline const PtrList<injector>& spray::injectors() const { return injectors_; } + inline const atomizationModel& spray::atomization() const { return atomization_; } + inline const breakupModel& spray::breakup() const { return breakupModel_; } + inline const collisionModel& spray::collisions() const { return collisionModel_; } + inline const dispersionModel& spray::dispersion() const { return dispersionModel_; } + inline const dragModel& spray::drag() const { return drag_; } + inline const evaporationModel& spray::evaporation() const { return evaporation_; } + inline const heatTransferModel& spray::heatTransfer() const { return heatTransfer_; @@ -112,11 +126,13 @@ inline const injectorModel& spray::injection() const return injectorModel_; } + inline const wallModel& spray::wall() const { return wall_; } + inline tmp<volVectorField> spray::momentumSource() const { tmp<volVectorField> tsource @@ -146,6 +162,7 @@ inline tmp<volVectorField> spray::momentumSource() const return tsource; } + inline tmp<volScalarField> spray::evaporationSource(const label si) const { tmp<volScalarField> tsource @@ -179,6 +196,7 @@ inline tmp<volScalarField> spray::evaporationSource(const label si) const return tsource; } + inline tmp<volScalarField> spray::heatTransferSource() const { tmp<volScalarField> tsource @@ -209,6 +227,7 @@ inline Random& spray::rndGen() return rndGen_; } + inline label spray::subCycles() const { return subCycles_; @@ -226,81 +245,97 @@ inline const liquidMixture& spray::fuels() const return fuels_; } -inline const PtrList<specieProperties>& spray::gasProperties() const + +inline const PtrList<gasThermoPhysics>& spray::gasProperties() const { return gasProperties_; } -inline const combustionMixture& spray::composition() const + +inline const basicMultiComponentMixture& spray::composition() const { return composition_; } + inline const List<label>& spray::liquidToGasIndex() const { return liquidToGasIndex_; } + inline const List<label>& spray::gasToLiquidIndex() const { return gasToLiquidIndex_; } + inline const List<bool>& spray::isLiquidFuel() const { return isLiquidFuel_; } + inline const bool& spray::twoD() const { return twoD_; } + inline const vector& spray::axisOfSymmetry() const { return axisOfSymmetry_; } + inline const vector& spray::axisOfWedge() const { return axisOfWedge_; } + inline const vector& spray::axisOfWedgeNormal() const { return axisOfWedgeNormal_; } + inline const scalar& spray::angleOfWedge() const { return angleOfWedge_; } + inline const interpolation<vector>& spray::UInterpolator() const { return UInterpolator_; } + inline const interpolation<scalar>& spray::rhoInterpolator() const { return rhoInterpolator_; } + inline const interpolation<scalar>& spray::pInterpolator() const { return pInterpolator_; } + inline const interpolation<scalar>& spray::TInterpolator() const { return TInterpolator_; } + inline vectorField& spray::sms() { return sms_; } + inline const vectorField& spray::sms() const { return sms_; @@ -312,6 +347,7 @@ inline scalarField& spray::shs() return shs_; } + inline const scalarField& spray::shs() const { return shs_; @@ -323,16 +359,19 @@ inline PtrList<scalarField>& spray::srhos() return srhos_; } + inline const PtrList<scalarField>& spray::srhos() const { return srhos_; } + inline const scalar& spray::ambientPressure() const { return ambientPressure_; } + inline const scalar& spray::ambientTemperature() const { return ambientTemperature_; diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C index ce7cded04b869b4678527d6e6e108b340eebbfb2..742f1fe1b347be3af257e33e66af7d2b273b7f31 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C @@ -28,7 +28,7 @@ License #include "LISA.H" #include "addToRunTimeSelectionTable.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" #include "RosinRammler.H" @@ -84,7 +84,7 @@ void LISA::atomizeParcel ) const { - + const PtrList<volScalarField>& Y = spray_.composition().Y(); label Ns = Y.size(); @@ -98,7 +98,7 @@ void LISA::atomizeParcel { Winv += Y[i][cellI]/spray_.gasProperties()[i].W(); } - + scalar R = specie::RR*Winv; // ideal gas law to evaluate density @@ -113,31 +113,31 @@ void LISA::atomizeParcel scalar WeberNumber = p.We(vel, rhoAverage, sigma); scalar tau = 0.0; - scalar dL = 0.0; + scalar dL = 0.0; scalar k = 0.0; scalar muFuel = fuels.mu(pressure, p.T(), p.X()); scalar rhoFuel = fuels.rho(1.0e+5, p.T(), p.X()); scalar nuFuel = muFuel/rhoFuel; vector uDir = p.U()/mag(p.U()); - + scalar uGas = mag(vel & uDir); vector Ug = uGas*uDir; -/* +/* TL It might be the relative velocity between Liquid and Gas, but I use the - absolute velocity of the parcel as suggested by the authors + absolute velocity of the parcel as suggested by the authors */ - + // scalar U = mag(p.Urel(vel)); scalar U = mag(p.U()); - + p.ct() += deltaT; scalar Q = rhoAverage/rhoFuel; - const injectorType& it = + const injectorType& it = spray_.injectors()[label(p.injector())].properties(); if (it.nHoles() > 1) @@ -150,38 +150,38 @@ void LISA::atomizeParcel scalar pWalk = mag(p.position() - itPosition); // Updating liquid sheet tickness... that is the droplet diameter - + const vector direction = it.direction(0, spray_.runTime().value()); - + scalar h = (p.position() - itPosition) & direction; scalar d = sqrt(sqr(pWalk)-sqr(h)); - + scalar time = pWalk/mag(p.U()); - + scalar elapsedTime = spray_.runTime().value(); - + scalar massFlow = it.massFlowRate(max(0.0,elapsedTime-time)); - - scalar hSheet = massFlow/(mathematicalConstant::pi*d*rhoFuel*mag(p.U())); - + + scalar hSheet = massFlow/(mathematicalConstant::pi*d*rhoFuel*mag(p.U())); + p.d() = min(hSheet,p.d()); if(WeberNumber > 27.0/16.0) { - + scalar kPos = 0.0; scalar kNeg = Q*pow(U, 2.0)*rhoFuel/sigma; - + scalar derivativePos = sqrt ( Q*pow(U,2.0) - ); - - scalar derivativeNeg = + ); + + scalar derivativeNeg = ( - 8.0*pow(nuFuel, 2.0)*pow(kNeg, 3.0) - + Q*pow(U, 2.0)*kNeg + 8.0*pow(nuFuel, 2.0)*pow(kNeg, 3.0) + + Q*pow(U, 2.0)*kNeg - 3.0*sigma/2.0/rhoFuel*pow(kNeg, 2.0) ) / @@ -189,23 +189,23 @@ void LISA::atomizeParcel ( 4.0*pow(nuFuel, 2.0)*pow(kNeg, 4.0) + Q*pow(U, 2.0)*pow(kNeg, 2.0) - - sigma*pow(kNeg, 3.0)/rhoFuel + - sigma*pow(kNeg, 3.0)/rhoFuel ) - 4.0*nuFuel*kNeg; - scalar kOld = 0.0; + scalar kOld = 0.0; + - for(label i=0; i<40; i++) { k = kPos - (derivativePos/((derivativeNeg-derivativePos)/(kNeg-kPos))); - - scalar derivativek = + + scalar derivativek = ( - 8.0*pow(nuFuel, 2.0)*pow(k, 3.0) - + Q*pow(U, 2.0)*k + 8.0*pow(nuFuel, 2.0)*pow(k, 3.0) + + Q*pow(U, 2.0)*k - 3.0*sigma/2.0/rhoFuel*pow(k, 2.0) ) / @@ -213,10 +213,10 @@ void LISA::atomizeParcel ( 4.0*pow(nuFuel, 2.0)*pow(k, 4.0) + Q*pow(U, 2.0)*pow(k, 2.0) - - sigma*pow(k, 3.0)/rhoFuel + - sigma*pow(k, 3.0)/rhoFuel ) - - 4.0*nuFuel*k; + 4.0*nuFuel*k; if(derivativek > 0) { @@ -228,17 +228,17 @@ void LISA::atomizeParcel derivativeNeg = derivativek; kNeg = k; } - + if(mag(k-kOld)/k < 1e-4) { break; } - + kOld = k; - + } - - scalar omegaS = + + scalar omegaS = - 2.0 * nuFuel * pow(k, 2.0) + sqrt ( @@ -246,22 +246,22 @@ void LISA::atomizeParcel + Q*pow(U, 2.0)*pow(k, 2.0) - sigma*pow(k, 3.0)/rhoFuel ); - - tau = cTau_/omegaS; - + + tau = cTau_/omegaS; + dL = sqrt(8.0*p.d()/k); } else { - - k = + + k = rhoAverage*pow(U, 2.0) / 2.0*sigma; - + scalar J = pWalk*p.d()/2.0; - + tau = pow(3.0*cTau_,2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow(U,4.0)*rhoFuel)); dL = sqrt(4.0*p.d()/k); @@ -269,78 +269,78 @@ void LISA::atomizeParcel - scalar kL = + scalar kL = 1.0 / ( - dL * + dL * pow(0.5 + 1.5 * muFuel/pow((rhoFuel*sigma*dL), 0.5), 0.5) ); - scalar dD = cbrt(3.0*mathematicalConstant::pi*pow(dL, 2.0)/kL); - + scalar dD = cbrt(3.0*mathematicalConstant::pi*pow(dL, 2.0)/kL); + scalar lisaExp = 0.27; scalar ambientPressure = 1.0e+5; - + scalar pRatio = spray_.ambientPressure()/ambientPressure; - + dD = dD*pow(pRatio,lisaExp); // modifications to take account of the flash boiling on primary breakUp scalar pExp = 0.135; - + scalar chi = 0.0; - - label Nf = fuels.components().size(); + + label Nf = fuels.components().size(); scalar Td = p.T(); - + for(label i = 0; i < Nf ; i++) { - + if(fuels.properties()[i].pv(spray_.ambientPressure(), Td) >= 0.999*spray_.ambientPressure()) { // The fuel is boiling..... -// Calculation of the boiling temperature - +// Calculation of the boiling temperature + scalar tBoilingSurface = Td; - + label Niter = 200; - + for(label k=0; k< Niter ; k++) { scalar pBoil = fuels.properties()[i].pv(pressure, tBoilingSurface); - + if(pBoil > pressure) { - tBoilingSurface = tBoilingSurface - (Td-temperature)/Niter; + tBoilingSurface = tBoilingSurface - (Td-temperature)/Niter; } else { break; } } - + scalar hl = fuels.properties()[i].hl(spray_.ambientPressure(), tBoilingSurface); scalar iTp = fuels.properties()[i].h(spray_.ambientPressure(), Td) - spray_.ambientPressure()/fuels.properties()[i].rho(spray_.ambientPressure(), Td); scalar iTb = fuels.properties()[i].h(spray_.ambientPressure(), tBoilingSurface) - spray_.ambientPressure()/fuels.properties()[i].rho(spray_.ambientPressure(), tBoilingSurface); - + chi += p.X()[i]*(iTp-iTb)/hl; - + } - } - + } + // bounding chi - + chi = max(chi, 0.0); chi = min(chi, 1.0); - + // modifing dD to take account of flash boiling - + dD = dD*(1.0 - chi*pow(pRatio, -pExp)); - + scalar lBU = Cl_ * mag(p.U())*tau; if(pWalk > lBU) @@ -349,7 +349,7 @@ void LISA::atomizeParcel p.liquidCore() = 0.0; // calculate the new diameter with a Rosin Rammler distribution - + scalar minValue = min(p.d(),dD/10.0); scalar maxValue = dD; @@ -357,30 +357,30 @@ void LISA::atomizeParcel if(maxValue - minValue < SMALL) { minValue = p.d()/10.0; - } - + } + scalar range = maxValue - minValue; - + scalar y = 0; scalar x = 0; bool success = false; - + while(!success) { - + x = minValue + range*rndGen_.scalar01(); y = rndGen_.scalar01(); scalar p = 0.0; - + scalar nExp = 1; - + scalar xx = pow(x/dD, nExp); p = xx*exp(-xx); - if (y<p) + if (y<p) { success = true; } @@ -388,13 +388,13 @@ void LISA::atomizeParcel } // New droplet diameter - + p.d() = x; p.ct() = 0.0; - - } - - + + } + + } diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C index db1372ca5892b0faecc54c84ff67cfb7e41c5dc2..c6fd3e3056ac912b893ac4e2b46d5b265e69005e 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C @@ -28,7 +28,7 @@ License #include "blobsSheetAtomization.H" #include "addToRunTimeSelectionTable.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" #include "RosinRammler.H" diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C index 0e590604d90de4e7577559f14b2b9945ead69125..65300cb6f20f16fb11d94ff2c30c21f819ea676e 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C +++ b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C @@ -28,7 +28,7 @@ License #include "noAtomization.H" #include "addToRunTimeSelectionTable.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C index 9a77c1c7bae400ce7cfa97018dd54e2cde5b5a7a..bfe3c4045e1b11417b19f23940f3f7c928efdbdd 100644 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C +++ b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C @@ -28,7 +28,7 @@ License #include "reitzDiwakar.H" #include "addToRunTimeSelectionTable.H" -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index c2040070e9b530719a49a8cef3427939d03e24c5..807337d7e01a6c734f5ac040db3a7acefad348ef 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C @@ -162,6 +162,13 @@ void Foam::FreeStream<CloudType>::inflow() scalar mass = cloud.constProps(typeId).mass(); + if (min(boundaryT[patchI]) < SMALL) + { + FatalErrorIn ("Foam::FreeStream<CloudType>::inflow()") + << "Zero boundary temperature detected, check boundaryT condition." << nl + << nl << abort(FatalError); + } + scalarField mostProbableSpeed ( cloud.maxwellianMostProbableSpeed diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index de8bcd332129c0d94f42c8f818b3d6aa0359ea02..c07a3a34fa18d5899c101a5a4d626f54cffafa73 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -23,7 +23,6 @@ $(DERIVEDCLOUDS)/basicKinematicCloud/basicKinematicCloud.C $(DERIVEDCLOUDS)/basicThermoCloud/basicThermoCloud.C $(DERIVEDCLOUDS)/BasicReactingCloud/defineBasicReactingCloud.C $(DERIVEDCLOUDS)/BasicReactingMultiphaseCloud/defineBasicReactingMultiphaseCloud.C -$(DERIVEDCLOUDS)/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C /* kinematic parcel sub-models */ @@ -46,12 +45,6 @@ $(REACTINGPARCEL)/defineBasicReactingParcel.C $(REACTINGPARCEL)/makeBasicReactingParcelSubmodels.C -/* tracked reacting parcel sub-models */ -TRACKEDREACTINGPARCEL=$(DERIVEDPARCELS)/BasicTrackedReactingParcel -$(TRACKEDREACTINGPARCEL)/defineTrackedReactingParcel.C -$(TRACKEDREACTINGPARCEL)/makeBasicTrackedReactingParcelSubmodels.C - - /* reacting multiphase parcel sub-models */ REACTINGMPPARCEL=$(DERIVEDPARCELS)/BasicReactingMultiphaseParcel $(REACTINGMPPARCEL)/defineBasicReactingMultiphaseParcel.C diff --git a/src/lagrangian/intermediate/Make/options b/src/lagrangian/intermediate/Make/options index e9d4852aa052ed16afba328ec783401bef4bf61e..f3525972826a471984552d2ea2df7172861bafd1 100644 --- a/src/lagrangian/intermediate/Make/options +++ b/src/lagrangian/intermediate/Make/options @@ -9,7 +9,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ @@ -28,6 +28,6 @@ LIB_LIBS = \ -lsolidMixture \ -lspecie \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lcompressibleRASModels \ -lcompressibleLESModels diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index 2f96ae1418ee6d1365a2a87e2380cadefc398b70..1a7ba970846633df957532fa649a91b5eebd2043 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -151,18 +151,18 @@ Foam::KinematicCloud<ParcelType>::~KinematicCloud() template<class ParcelType> void Foam::KinematicCloud<ParcelType>::checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { if (!fullyDescribed) { - pPtr->rho() = constProps_.rho0(); + parcel.rho() = constProps_.rho0(); } scalar carrierDt = this->db().time().deltaT().value(); - pPtr->stepFraction() = (carrierDt - lagrangianDt)/carrierDt; + parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt; } diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 2dcd277a1db0e9d4ed53b68e1968c929d17ca130..538975a912e705f1f4f3f029e23c71d213cc8e1f 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -357,7 +357,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index 88d5e8a877222a2f938217a77aca595255e8d5b4..d4f4f10c9abe7823f6c99a8fc6605fa8e17ed07b 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -28,7 +28,6 @@ License #include "CompositionModel.H" #include "PhaseChangeModel.H" -#include "multiComponentMixture.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // @@ -68,14 +67,16 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ) : ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo), reactingCloud(), constProps_(this->particleProperties()), - carrierThermo_(thermo), - carrierSpecies_(thermo.composition().Y().size()), + mcCarrierThermo_ + ( + dynamic_cast<multiComponentMixture<thermoType>&>(thermo) + ), compositionModel_ ( CompositionModel<ReactingCloud<ParcelType> >::New @@ -92,23 +93,9 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud *this ) ), - rhoTrans_(thermo.composition().Y().size()), + rhoTrans_(mcCarrierThermo_.species().size()), dMassPhaseChange_(0.0) { - // Create the carrier species - forAll(carrierSpecies_, specieI) - { - carrierSpecies_.set - ( - specieI, - new thermoType - ( - dynamic_cast<const multiComponentMixture<thermoType>&> - (thermo).speciesData()[specieI] - ) - ); - } - // Set storage for mass source fields and initialise to zero forAll(rhoTrans_, i) { @@ -119,9 +106,7 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud ( IOobject ( - this->name() - + "rhoTrans_" - + thermo.composition().Y()[i].name(), + this->name() + "rhoTrans_" + mcCarrierThermo_.species()[i], this->db().time().timeName(), this->db(), IOobject::NO_READ, @@ -148,34 +133,34 @@ Foam::ReactingCloud<ParcelType>::~ReactingCloud() template<class ParcelType> void Foam::ReactingCloud<ParcelType>::checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { ThermoCloud<ParcelType>::checkParcelProperties ( - pPtr, + parcel, lagrangianDt, fullyDescribed ); if (!fullyDescribed) { - pPtr->Y() = composition().YMixture0(); + parcel.Y() = composition().YMixture0(); } else { checkSuppliedComposition ( - pPtr->Y(), + parcel.Y(), composition().YMixture0(), "YMixture" ); } // derived information - store initial mass - pPtr->mass0() = pPtr->mass(); + parcel.mass0() = parcel.mass(); } @@ -193,9 +178,9 @@ void Foam::ReactingCloud<ParcelType>::resetSourceTerms() template<class ParcelType> void Foam::ReactingCloud<ParcelType>::evolve() { - const volScalarField& T = carrierThermo_.T(); - const volScalarField cp = carrierThermo_.Cp(); - const volScalarField& p = carrierThermo_.p(); + const volScalarField& T = this->carrierThermo().T(); + const volScalarField cp = this->carrierThermo().Cp(); + const volScalarField& p = this->carrierThermo().p(); autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New ( diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index beeee65e6e80fe9a6040a6d7277180be4ec185d5..4a79c03b6f42ca3ec614c5f782bffcff2bd26c44 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -41,11 +41,9 @@ SourceFiles #ifndef ReactingCloud_H #define ReactingCloud_H -#include "autoPtr.H" -#include "hCombustionThermo.H" - #include "ThermoCloud.H" #include "reactingCloud.H" +#include "multiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -94,11 +92,8 @@ protected: //- Parcel constant properties typename ParcelType::constantProperties constProps_; - //- Thermodynamics package (combustion) - hCombustionThermo& carrierThermo_; - - //- Gas phase properties - PtrList<thermoType> carrierSpecies_; + //- Multi-component carrier phase thermo + multiComponentMixture<thermoType>& mcCarrierThermo_; // References to the cloud sub-models @@ -148,7 +143,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ); @@ -168,14 +163,12 @@ public: inline const typename ParcelType::constantProperties& constProps() const; - //- Return const access to carrier phase thermo package - inline const hCombustionThermo& carrierThermo() const; - - //- Return access to carrier phase thermo package - inline hCombustionThermo& carrierThermo(); + //- Return const access to multi-component carrier phase thermo + inline const multiComponentMixture<thermoType>& + mcCarrierThermo() const; - //- Gas phase properties - inline const PtrList<thermoType>& carrierSpecies() const; + //- Return access to multi-component carrier phase thermo + inline multiComponentMixture<thermoType>& mcCarrierThermo(); // Sub-models @@ -224,7 +217,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index 8dbaf52bbcf81675641d903cc1be6b8e171bde5a..b59686482706c47710e3041ad8b4f85e13b693c4 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -35,26 +35,18 @@ Foam::ReactingCloud<ParcelType>::constProps() const template<class ParcelType> -inline const Foam::hCombustionThermo& -Foam::ReactingCloud<ParcelType>::carrierThermo() const +inline const Foam::multiComponentMixture<typename ParcelType::thermoType>& +Foam::ReactingCloud<ParcelType>::mcCarrierThermo() const { - return carrierThermo_; + return mcCarrierThermo_; } template<class ParcelType> -inline Foam::hCombustionThermo& -Foam::ReactingCloud<ParcelType>::carrierThermo() +inline Foam::multiComponentMixture<typename ParcelType::thermoType>& +Foam::ReactingCloud<ParcelType>::mcCarrierThermo() { - return carrierThermo_; -} - - -template<class ParcelType> -inline const Foam::PtrList<typename ParcelType::thermoType>& -Foam::ReactingCloud<ParcelType>::carrierSpecies() const -{ - return carrierSpecies_; + return mcCarrierThermo_; } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index 379f12f341d49efc5109b2298c022b6ce1e0eca7..d07db7ed622a5b6efb51f27c2436da58b6f9e478 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -38,7 +38,7 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ) : ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo), @@ -76,14 +76,14 @@ Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud() template<class ParcelType> void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { ReactingCloud<ParcelType>::checkParcelProperties ( - pPtr, + parcel, lagrangianDt, fullyDescribed ); @@ -94,27 +94,27 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties if (!fullyDescribed) { - pPtr->YGas() = this->composition().Y0(idGas); - pPtr->YLiquid() = this->composition().Y0(idLiquid); - pPtr->YSolid() = this->composition().Y0(idSolid); + parcel.YGas() = this->composition().Y0(idGas); + parcel.YLiquid() = this->composition().Y0(idLiquid); + parcel.YSolid() = this->composition().Y0(idSolid); } else { this->checkSuppliedComposition ( - pPtr->YGas(), + parcel.YGas(), this->composition().Y0(idGas), "YGas" ); this->checkSuppliedComposition ( - pPtr->YLiquid(), + parcel.YLiquid(), this->composition().Y0(idLiquid), "YLiquid" ); this->checkSuppliedComposition ( - pPtr->YSolid(), + parcel.YSolid(), this->composition().Y0(idSolid), "YSolid" ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index 8a90d25ef75f17f08cf359581066866d77ea7672..525b03983cabf044fbd7ec87ceb5d43d4e151005 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -123,7 +123,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ); @@ -178,7 +178,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index bdde1bbdfe49458f4da209d2c138fa0ee55eeec8..19428d38a1936f8ad0fa6d764657ec422f4db4ea 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -113,22 +113,22 @@ Foam::ThermoCloud<ParcelType>::~ThermoCloud() template<class ParcelType> void Foam::ThermoCloud<ParcelType>::checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ) { KinematicCloud<ParcelType>::checkParcelProperties ( - pPtr, + parcel, lagrangianDt, fullyDescribed ); if (!fullyDescribed) { - pPtr->T() = constProps_.T0(); - pPtr->cp() = constProps_.cp0(); + parcel.T() = constProps_.T0(); + parcel.cp() = constProps_.cp0(); } } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 2660060baf293834643a999008081ecbbd7bc0e3..cc8f0fadc8e1d313cf5e1b74fef6eb5ab97ad490 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -40,11 +40,9 @@ SourceFiles #ifndef ThermoCloud_H #define ThermoCloud_H -#include "autoPtr.H" -#include "hCombustionThermo.H" - #include "KinematicCloud.H" #include "thermoCloud.H" +#include "basicThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -220,7 +218,7 @@ public: //- Check parcel properties void checkParcelProperties ( - ParcelType* pPtr, + ParcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C index 1a639b5820b0d008932fe9454bc1df9e62bc0cee..e59ca18ecf7dcf98670722534fc12059f9cd6665 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C @@ -35,7 +35,7 @@ Foam::BasicReactingCloud<ThermoType>::BasicReactingCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ) : ReactingCloud<BasicReactingParcel<ThermoType> > diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H index aa3048e6663f3db16cbad66a4392a13f397ac2a6..49a51a230e11e72d0e413366a0a0759e30ab2a1d 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H @@ -81,7 +81,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo + basicThermo& thermo ); diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C index 07cb83587ecd620b23e26fb2d874afdbf7a66ee2..6f08db20167346b0b1fc41e9c669661c38d39861 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C @@ -35,8 +35,7 @@ Foam::BasicReactingMultiphaseCloud<ThermoType>::BasicReactingMultiphaseCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<ThermoType>& carrierSpecies + basicThermo& thermo ) : ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> > @@ -45,8 +44,7 @@ Foam::BasicReactingMultiphaseCloud<ThermoType>::BasicReactingMultiphaseCloud rho, U, g, - thermo, - carrierSpecies + thermo ) { BasicReactingMultiphaseParcel<ThermoType>::readFields(*this); diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H index 7b093c529c03d7e2c9c8871b493cc93ae46f3293..ac0853823fce7f97dc2ca15c2afa5bd7520b44af 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H @@ -81,8 +81,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<ThermoType>& carrierSpecies + basicThermo& thermo ); diff --git a/src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H b/src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H index cc73ce3ec3aca7987ef438cd3a0956fd41dbc77f..14f439e28524df4fe17cb0269b9409207e003082 100644 --- a/src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H +++ b/src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H @@ -27,14 +27,15 @@ License #ifndef createReactingCloudTypes_H #define createReactingCloudTypes_H -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define createReactingCloudType(CloudType) \ \ - createReactingCloudThermoType(CloudType, specieConstProperties); \ - createReactingCloudThermoType(CloudType, specieReactingProperties); + createReactingCloudThermoType(CloudType, constGasThermoPhysics); \ + createReactingCloudThermoType(CloudType, gasThermoPhysics); \ + createReactingCloudThermoType(CloudType, icoPoly8ThermoPhysics); #define createReactingCloudThermoType(CloudType, ThermoType) \ diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index d0962539e761760a9a693619c2bca2742288dbb8..55c10a0abfa086ac285024f0bf56a37a0328ddba 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -49,7 +49,7 @@ void Foam::KinematicParcel<ParcelType>::setCellValues "const scalar, " "const label" ")" - ) << "Limiting density in cell " << cellI << " to " + ) << "Limiting observed density in cell " << cellI << " to " << td.constProps().rhoMin() << nl << endl; rhoc_ = td.constProps().rhoMin(); @@ -113,9 +113,6 @@ void Foam::KinematicParcel<ParcelType>::calc // Motion // ~~~~~~ - // No additional forces - vector Fx = vector::zero; - // Calculate new particle velocity vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 695ff95a8ef96e42020adfe63d7da93834d4ac93..682cad335ad2c0c9ad36aa89c11f5799adfc47dc 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -168,7 +168,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::cellValueSourceCorrection forAll(td.cloud().rhoTrans(), i) { scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; - cpEff += Y*td.cloud().carrierSpecies()[i].Cp(this->Tc_); + cpEff += + Y*td.cloud().mcCarrierThermo().speciesData()[i].Cp(this->Tc_); } } const scalar cpc = td.cpInterp().psi()[cellI]; @@ -248,7 +249,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc scalarField dMassSRGas(YGas_.size(), 0.0); scalarField dMassSRLiquid(YLiquid_.size(), 0.0); scalarField dMassSRSolid(YSolid_.size(), 0.0); - scalarField dMassSRCarrier(td.cloud().carrierSpecies().size(), 0.0); + scalarField + dMassSRCarrier + ( + td.cloud().mcCarrierThermo().species().size(), + 0.0 + ); // Clac mass and enthalpy transfer due to surface reactions calcSurfaceReactions @@ -340,7 +346,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassGas[i] - *td.cloud().composition().carrierSpecies()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); } forAll(YLiquid_, i) { @@ -349,7 +355,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassLiquid[i] - *td.cloud().composition().carrierSpecies()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); } /* // No mapping between solid components and carrier phase @@ -360,7 +366,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassSolid[i] - *td.cloud().composition().carrierSpecies()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); } */ forAll(dMassSRCarrier, i) @@ -369,7 +375,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassSRCarrier[i] - *td.cloud().composition().carrierSpecies()[i].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[i].H(T0); } // Update momentum transfer diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index b52bfeef29f4c81dc18d8f038fc42a6198b197c3..b1733762e5994e12e9574d6d03c0dc552180fd2f 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -50,7 +50,7 @@ void Foam::ReactingParcel<ParcelType>::setCellValues "const scalar, " "const label" ")" - ) << "Limiting pressure in cell " << cellI << " to " + ) << "Limiting observed pressure in cell " << cellI << " to " << td.constProps().pMin() << nl << endl; pc_ = td.constProps().pMin(); @@ -86,7 +86,8 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection forAll(td.cloud().rhoTrans(), i) { scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; - cpEff += Y*td.cloud().carrierSpecies()[i].Cp(this->Tc_); + cpEff += + Y*td.cloud().mcCarrierThermo().speciesData()[i].Cp(this->Tc_); } } const scalar cpc = td.cpInterp().psi()[cellI]; @@ -190,9 +191,6 @@ void Foam::ReactingParcel<ParcelType>::calc // Motion // ~~~~~~ - // No additional forces - vector Fx = vector::zero; - // Calculate new particle velocity vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); @@ -210,7 +208,7 @@ void Foam::ReactingParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassPC[i] - *td.cloud().composition().carrierSpecies()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); } // Update momentum transfer @@ -317,16 +315,15 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot); // Enthalphy transfer to carrier phase + label id; forAll(YComponents, i) { - label gid; - - gid = td.cloud().composition().localToGlobalCarrierId(idPhase, i); - const scalar hv = td.cloud().composition().carrierSpecies()[gid].H(T); + id = td.cloud().composition().localToGlobalCarrierId(idPhase, i); + const scalar hv = td.cloud().mcCarrierThermo().speciesData()[id].H(T); - gid = td.cloud().composition().globalIds(idPhase)[i]; + id = td.cloud().composition().globalIds(idPhase)[i]; const scalar hl = - td.cloud().composition().liquids().properties()[gid].h(pc_, T); + td.cloud().composition().liquids().properties()[id].h(pc_, T); Sh += dMassPC[i]*(hl - hv)/dt; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 4596a471259111fbd0092bbbea56b88c676f3c55..6449b95dbacdf47a075589230aeb425d026f4bb1 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -53,7 +53,7 @@ void Foam::ThermoParcel<ParcelType>::setCellValues "const scalar, " "const label" ")" - ) << "Limiting temperature in cell " << cellI << " to " + ) << "Limiting observed temperature in cell " << cellI << " to " << td.constProps().TMin() << nl << endl; Tc_ = td.constProps().TMin(); @@ -178,13 +178,13 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer if (mag(htc) < ROOTVSMALL && !td.cloud().radiation()) { - return T + dt*Sh/(this->mass()*cp); + return T + dt*Sh/(this->volume(d)*rho*cp); } scalar ap; scalar bp; - if(td.cloud().radiation()) + if (td.cloud().radiation()) { const scalarField& G = td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G"); diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.H deleted file mode 100644 index 8df58f8d2c8938473289a9c024877d0bad670d08..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.H +++ /dev/null @@ -1,169 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-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 - -Class - Foam::TrackedReactingParcel - -Description - Adds tracking to ReactingParcel - -SourceFiles - TrackedReactingParcelI.H - TrackedReactingParcel.C - TrackedReactingParcelIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef TrackedReactingParcel_H -#define TrackedReactingParcel_H - -#include "ReactingParcel.H" -#include "ParticleTrackingData.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -template<class ParcelType> -class TrackedReactingParcel; - -// Forward declaration of friend functions - -template<class ParcelType> -Ostream& operator<< -( - Ostream&, - const TrackedReactingParcel<ParcelType>& -); - -/*---------------------------------------------------------------------------*\ - Class TrackedReactingParcel Declaration -\*---------------------------------------------------------------------------*/ - -template<class ParcelType> -class TrackedReactingParcel -: - public ReactingParcel<ParcelType>, - public ParticleTrackingData<ParcelType> -{ -public: - - typedef typename ReactingParcel<ParcelType>::constantProperties - constantProperties; - - // Static data - - //- Runtime type information - TypeName("TrackedReactingParcel"); - - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - inline TrackedReactingParcel - ( - ReactingCloud<ParcelType>& owner, - const vector& position, - const label cellI - ); - - //- Construct from components - inline TrackedReactingParcel - ( - ReactingCloud<ParcelType>& owner, - const vector& position, - const label cellI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const vector& U0, - const scalarField& Y0, - const constantProperties& constProps - ); - - //- Construct from Istream - TrackedReactingParcel - ( - const Cloud<ParcelType>& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - TrackedReactingParcel(const TrackedReactingParcel& p); - - //- Construct and return a clone - autoPtr<TrackedReactingParcel> clone() const - { - return - autoPtr<TrackedReactingParcel> - ( - new TrackedReactingParcel(*this) - ); - } - - - // Member Functions - - // I-O - - //- Read - static void readFields(ReactingCloud<ParcelType>& c); - - //- Write - static void writeFields(const ReactingCloud<ParcelType>& c); - - - // Ostream Operator - - friend Ostream& operator<< <ParcelType> - ( - Ostream&, - const TrackedReactingParcel<ParcelType>& - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "TrackedReactingParcelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "TrackedReactingParcel.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // - diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelIO.C deleted file mode 100644 index 8ce5d9b2f2f22a726598366796204702741a40b1..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelIO.C +++ /dev/null @@ -1,105 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-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 "TrackedReactingParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template <class ParcelType> -Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel -( - const Cloud<ParcelType>& cloud, - Istream& is, - bool readFields -) -: - ReactingParcel<ParcelType>(cloud, is, readFields), - ParticleTrackingData<ParcelType>(cloud, is, readFields) -{} - - -template<class ParcelType> -void Foam::TrackedReactingParcel<ParcelType>::readFields -( - ReactingCloud<ParcelType>& c -) -{ - if (!c.size()) - { - return; - } - - ReactingParcel<ParcelType>::readFields(c); - ParticleTrackingData<ParcelType>::readFields(c); -} - - -template<class ParcelType> -void Foam::TrackedReactingParcel<ParcelType>::writeFields -( - const ReactingCloud<ParcelType>& c -) -{ - ReactingParcel<ParcelType>::writeFields(c); - ParticleTrackingData<ParcelType>::writeFields(c); -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<class ParcelType> -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const TrackedReactingParcel<ParcelType>& p -) -{ - if (os.format() == IOstream::ASCII) - { - os << static_cast<const ReactingParcel<ParcelType>&>(p) - << static_cast<const ParticleTrackingData<ParcelType>&>(p); - } - else - { - os << static_cast<const ReactingParcel<ParcelType>&>(p) - << static_cast<const ParticleTrackingData<ParcelType>&>(p); - } - - // Check state of Ostream - os.check - ( - "Ostream& operator<<" - "(" - "Ostream&, " - "const TrackedReactingParcel<ParcelType>&" - ")" - ); - - return os; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.C deleted file mode 100644 index db48ba437f5a0a47f66ba8e14de956729063ed0e..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.C +++ /dev/null @@ -1,113 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-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 "BasicTrackedReactingParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class ThermoType> -Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel -( - ReactingCloud<BasicTrackedReactingParcel<ThermoType> >& owner, - const vector& position, - const label cellI -) -: - TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > - ( - owner, - position, - cellI - ) -{} - - -template<class ThermoType> -Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel -( - ReactingCloud<BasicTrackedReactingParcel<ThermoType> >& owner, - const vector& position, - const label cellI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const vector& U0, - const scalarField& Y0, - const typename - TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> >:: - constantProperties& constProps -) -: - TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > - ( - owner, - position, - cellI, - typeId, - nParticle0, - d0, - U0, - Y0, - constProps - ) -{} - - -template<class ThermoType> -Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel -( - const Cloud<BasicTrackedReactingParcel<ThermoType> >& cloud, - Istream& is, - bool readFields -) -: - TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > - ( - cloud, - is, - readFields - ) -{} - - -template<class ThermoType> -Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel -( - const BasicTrackedReactingParcel<ThermoType>& p -) -: - TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> >(p) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -template<class ThermoType> -Foam::BasicTrackedReactingParcel<ThermoType>::~BasicTrackedReactingParcel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.H b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.H deleted file mode 100644 index 8c30301f9c2d5c88b3f0f105bc670b9bed161240..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.H +++ /dev/null @@ -1,137 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-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 - -Class - Foam::BasicTrackedReactingParcel - -Description - - -SourceFiles - BasicTrackedReactingParcel.C - BasicTrackedReactingParcelIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef BasicTrackedReactingParcel_H -#define BasicTrackedReactingParcel_H - -#include "TrackedReactingParcel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes -template<class ThermoType> -class BasicTrackedReactingParcel; - -/*---------------------------------------------------------------------------*\ - Class BasicTrackedReactingParcel Declaration -\*---------------------------------------------------------------------------*/ - -template<class ThermoType> -class BasicTrackedReactingParcel -: - public TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > -{ - -public: - - //- The type of thermodynamics this parcel was instantiated for - typedef ThermoType thermoType; - - //- Run-time type information - TypeName("BasicTrackedReactingParcel"); - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - BasicTrackedReactingParcel - ( - ReactingCloud<BasicTrackedReactingParcel>& owner, - const vector& position, - const label cellI - ); - - //- Construct from components - BasicTrackedReactingParcel - ( - ReactingCloud<BasicTrackedReactingParcel>& owner, - const vector& position, - const label cellI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const vector& U0, - const scalarField& Y0, - const typename - TrackedReactingParcel<BasicTrackedReactingParcel>:: - constantProperties& constProps - ); - - //- Construct from Istream - BasicTrackedReactingParcel - ( - const Cloud<BasicTrackedReactingParcel>& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - BasicTrackedReactingParcel(const BasicTrackedReactingParcel& p); - - //- Construct and return a clone - autoPtr<BasicTrackedReactingParcel> clone() const - { - return - autoPtr<BasicTrackedReactingParcel> - ( - new BasicTrackedReactingParcel(*this) - ); - } - - - //- Destructor - virtual ~BasicTrackedReactingParcel(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "BasicTrackedReactingParcel.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/makeBasicTrackedReactingParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/makeBasicTrackedReactingParcelSubmodels.C deleted file mode 100644 index 7d94a79bea88df99a17c5c945bacc614518895b4..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/makeBasicTrackedReactingParcelSubmodels.C +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-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 "BasicTrackedReactingParcel.H" - -// Kinematic -#include "makeReactingParcelDispersionModels.H" -#include "makeReactingParcelDragModels.H" -#include "makeReactingParcelInjectionModels.H" -#include "makeReactingParcelPatchInteractionModels.H" -#include "makeReactingParcelPostProcessingModels.H" - -// Thermo -#include "makeReactingParcelHeatTransferModels.H" - -// Reacting -#include "makeReactingParcelCompositionModels.H" -#include "makeReactingParcelPhaseChangeModels.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // Kinematic sub-models - makeReactingDispersionModels(BasicTrackedReactingParcel); - makeReactingDragModels(BasicTrackedReactingParcel); - makeReactingInjectionModels(BasicTrackedReactingParcel); - makeReactingPatchInteractionModels(BasicTrackedReactingParcel); - makeReactingPostProcessingModels(BasicTrackedReactingParcel); - - // Thermo sub-models - makeReactingHeatTransferModels(BasicTrackedReactingParcel); - - // Reacting sub-models - makeReactingCompositionModels(BasicTrackedReactingParcel); - makeReactingPhaseChangeModels(BasicTrackedReactingParcel); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H index 9c1a6baf61e35a2e757f1f321c4dbd2551863788..de8d5a04caa4633e833f33b58f7d564b2043a030 100644 --- a/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H @@ -28,7 +28,7 @@ License #define createReactingMultiphaseParcelTypes_H #include "makeParcelIOList.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -37,12 +37,17 @@ License createReactingMultiphaseParcelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ createReactingMultiphaseParcelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + createReactingMultiphaseParcelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H index 78bdf1aae4de76d7ef1ce00acbae73a5548ba78b..bea3f8a9dcd16fffeab554456c2b94ca27ba9013 100644 --- a/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H @@ -28,14 +28,15 @@ License #define createReactingParcelTypes_H #include "makeParcelIOList.H" -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define createReactingParcelType(ParcelType) \ \ - createReactingParcelThermoType(ParcelType, specieConstProperties); \ - createReactingParcelThermoType(ParcelType, specieReactingProperties); + createReactingParcelThermoType(ParcelType, constGasThermoPhysics); \ + createReactingParcelThermoType(ParcelType, gasThermoPhysics); \ + createReactingParcelThermoType(ParcelType, icoPoly8ThermoPhysics); #define createReactingParcelThermoType(ParcelType, ThermoType) \ diff --git a/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H index fb357cb7c8b61a678e08141edc3e8d02084b2868..95e46e3d6fed33aea291f3b0313ad727b8cff119 100644 --- a/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H @@ -36,12 +36,17 @@ License createTrackedReactingParcelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ createTrackedReactingParcelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + createTrackedReactingParcelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H index 654582e3c1d256a7f9bbb31e3dd8e2f024fad1de..4f703d49676c80b883930a4cdf3286b4bf069715 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingCloud.H" #include "SingleMixtureFraction.H" @@ -41,12 +41,17 @@ License makeReactingMultiphaseCompositionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeReactingMultiphaseCompositionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeReactingMultiphaseCompositionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H index 85e9192a59ca84bcf14cea726c01566b60aa2d05..d293222c5b516b20003677f424f10cbb723603bd 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingMultiphaseCloud.H" #include "ConstantRateDevolatilisation.H" @@ -43,12 +43,17 @@ License makeReactingMultiphaseDevolatilisationModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeReactingMultiphaseDevolatilisationModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeReactingMultiphaseDevolatilisationModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H index fe7a669d7e9f3303dc8098e102c987b66739add1..01a36897600539861ba9604172c3f2a668eb9e41 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "ConeInjection.H" @@ -45,13 +45,19 @@ License makeReactingMultiphaseInjectionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ \ makeReactingMultiphaseInjectionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + \ + makeReactingMultiphaseInjectionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H index d85a073dde6f0c1a53098952abca716addef4ffa..47bbdcefb3d02d4525423438a549de8b2c668969 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingMultiphaseCloud.H" #include "NoSurfaceReaction.H" @@ -41,12 +41,17 @@ License makeReactingMultiphaseSurfaceReactionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeReactingMultiphaseSurfaceReactionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeReactingMultiphaseSurfaceReactionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H index 475095871f85befcfef55dfe451bcba5626e31ab..d20439fccb8d6cc970a06e4a28fd9a180ab1e022 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingCloud.H" #include "SinglePhaseMixture.H" @@ -41,12 +41,17 @@ License makeReactingCompositionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeReactingCompositionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeReactingCompositionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H index 534e85e190dfded6671c5736663f5373ced5dbdb..394cb9c2499dcd6fcd802b995d9ffe5a141c8753 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "NoDispersion.H" @@ -43,13 +43,19 @@ License makeReactingDispersionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ \ makeReactingDispersionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + \ + makeReactingDispersionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H index 545995ec4d86849b73c951f6273750d9b92b9179..a41d440ddce190334336a3e3ec843b80ebbb36be 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "NoDrag.H" @@ -42,12 +42,17 @@ License makeReactingDragModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeReactingDragModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeReactingDragModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H index 02290b68c260f9796f67f58dc13a0e7c0dce0510..0bfe7af9a8a6e3222cead0703e94ae700e5ba107 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ThermoCloud.H" #include "NoHeatTransfer.H" @@ -42,12 +42,17 @@ License makeReactingHeatTransferModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ makeReactingHeatTransferModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + makeReactingHeatTransferModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H index c691fee62c8d12374ba38c341d360213d15bff49..288510c48c32f21a59372c8401dd59ffd2f4f3a2 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "ConeInjection.H" @@ -46,13 +46,19 @@ License makeReactingInjectionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ \ makeReactingInjectionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + \ + makeReactingInjectionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H index 6c64d7d50e2b6e43ab19fd66119622b16ef45032..c25a4202f0c59171e25f57e6c2e5b03ddeee5c4f 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "LocalInteraction.H" @@ -43,13 +43,19 @@ License makeReactingPatchInteractionModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ \ makeReactingPatchInteractionModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + \ + makeReactingPatchInteractionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H index cd2fab217054d63a2dbbecd11a10762d64afcc5c..57a067198eef490da220569e5544684aa4c3abc4 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "ReactingCloud.H" #include "NoPhaseChange.H" @@ -42,13 +42,19 @@ License makeReactingPhaseChangeModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ \ makeReactingPhaseChangeModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + \ + makeReactingPhaseChangeModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H index f316b1c460d5435454e593c6d43ab0675e9c05e0..ae7f226e362e15f7132ff7b02d7954025856bd84 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H @@ -29,7 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "reactingThermoTypes.H" +#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "NoPostProcessing.H" @@ -42,13 +42,19 @@ License makeReactingPostProcessingModelThermoType \ ( \ ParcelType, \ - specieConstProperties \ + constGasThermoPhysics \ ); \ \ makeReactingPostProcessingModelThermoType \ ( \ ParcelType, \ - specieReactingProperties \ + gasThermoPhysics \ + ); \ + \ + makeReactingPostProcessingModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ ); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index abbba2698d004ea46afbc4b8048ce1abe52fa34a..fa48f4c28b3c2cc6f3daf4acfca711511432aedc 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -37,7 +37,7 @@ void Foam::InjectionModel<CloudType>::readProps() ( "injectionProperties", owner_.db().time().timeName(), - "uniform/Lagrangian"/owner_.name(), + "uniform"/cloud::prefix/owner_.name(), owner_.db(), IOobject::MUST_READ, IOobject::NO_WRITE, @@ -67,7 +67,7 @@ void Foam::InjectionModel<CloudType>::writeProps() ( "injectionProperties", owner_.db().time().timeName(), - "uniform/Lagrangian"/owner_.name(), + "uniform"/cloud::prefix/owner_.name(), owner_.db(), IOobject::NO_READ, IOobject::NO_WRITE, @@ -401,7 +401,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) setProperties(parcelI, newParcels, timeInj, *pPtr); // Check new parcel properties - td.cloud().checkParcelProperties(pPtr, dt, fullyDescribed()); + td.cloud().checkParcelProperties(*pPtr, dt, fullyDescribed()); // Apply correction to velocity for 2-D cases meshTools::constrainDirection diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C index 257f2af21a9d9632fdc561fc9f25cdb7f1a46cf0..ffe1f09631471a82d42072887224ffc5d5313dbf 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C @@ -29,17 +29,20 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template <class CloudType> -bool Foam::LocalInteraction<CloudType>::applyToPatch(const polyPatch& pp) const +Foam::label Foam::LocalInteraction<CloudType>::applyToPatch +( + const label globalPatchI +) const { forAll(patchIds_, patchI) { - if (patchIds_[patchI] == pp.index()) + if (patchIds_[patchI] == globalPatchI) { - return true; + return patchI; } } - return false; + return -1; } @@ -75,7 +78,11 @@ Foam::LocalInteraction<CloudType>::LocalInteraction DynamicList<word> badWalls; forAll(bMesh, patchI) { - if (isA<wallPolyPatch>(bMesh[patchI]) && !applyToPatch(bMesh[patchI])) + if + ( + isA<wallPolyPatch>(bMesh[patchI]) + && applyToPatch(bMesh[patchI].index()) < 0 + ) { badWalls.append(bMesh[patchI].name()); } @@ -115,7 +122,9 @@ bool Foam::LocalInteraction<CloudType>::correct vector& U ) const { - if (applyToPatch(pp)) + label patchI = applyToPatch(pp.index()); + + if (patchI >= 0) { vector nw = pp.faceAreas()[pp.whichFace(faceId)]; nw /= mag(nw); @@ -125,10 +134,10 @@ bool Foam::LocalInteraction<CloudType>::correct if (Un > 0) { - U -= (1.0 + patchData_[pp.index()].e())*Un*nw; + U -= (1.0 + patchData_[patchI].e())*Un*nw; } - U -= patchData_[pp.index()].mu()*Ut; + U -= patchData_[patchI].mu()*Ut; return true; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H index a53d6398efb22b488f37cd34c98736061d1a39b9..49d36e9c6d82eab8c15e1aeef2d5b0ed6fa58446 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H @@ -132,8 +132,8 @@ class LocalInteraction // Private member functions - //- Returns true if patch is in patchIds_ list - bool applyToPatch(const polyPatch& pp) const; + //- Returns local patchI if patch is in patchIds_ list + label applyToPatch(const label globalPatchI) const; diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 4154dcf06c40b0eca5212abaa797a095f776b559..6ae3dabb6fd1ab3ac3efac2f5526adee30e0f3d1 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -39,15 +39,14 @@ Foam::CompositionModel<CloudType>::CompositionModel dict_(dict), owner_(owner), coeffDict_(dict.subDict(type + "Coeffs")), - carrierThermo_(owner.carrierThermo()), - carrierSpecies_(owner.carrierSpecies()), + mcCarrierThermo_(owner.mcCarrierThermo()), liquids_ ( liquidMixture::New ( owner.mesh().objectRegistry::lookupObject<dictionary> ( - carrierThermo_.name() + owner.carrierThermo().name() ) ) ), @@ -57,14 +56,14 @@ Foam::CompositionModel<CloudType>::CompositionModel ( owner.mesh().objectRegistry::lookupObject<dictionary> ( - carrierThermo_.name() + owner.carrierThermo().name() ) ) ), phaseProps_ ( coeffDict_.lookup("phases"), - carrierThermo_.composition().species(), + mcCarrierThermo_.species(), liquids_().components(), solids_().components() ) @@ -102,18 +101,10 @@ const Foam::dictionary& Foam::CompositionModel<CloudType>::coeffDict() const template<class CloudType> -const Foam::hCombustionThermo& -Foam::CompositionModel<CloudType>::carrierThermo() const +const Foam::multiComponentMixture<typename CloudType::thermoType>& +Foam::CompositionModel<CloudType>::mcCarrierThermo() const { - return carrierThermo_; -} - - -template<class CloudType> -const Foam::PtrList<typename CloudType::thermoType>& -Foam::CompositionModel<CloudType>::carrierSpecies() const -{ - return carrierSpecies_; + return mcCarrierThermo_; } @@ -184,10 +175,9 @@ Foam::label Foam::CompositionModel<CloudType>::globalCarrierId const word& cmptName ) const { - forAll(carrierThermo_.composition().species(), i) + forAll(mcCarrierThermo_.species(), i) { - word carrierSpecieName = carrierThermo_.composition().species()[i]; - if (cmptName == carrierSpecieName) + if (cmptName == mcCarrierThermo_.species()[i]) { return i; } @@ -323,8 +313,8 @@ Foam::scalarField Foam::CompositionModel<CloudType>::X forAll(Y, i) { label gid = props.globalIds()[i]; - WInv += Y[i]/this->carrierSpecies()[gid].W(); - X[i] = Y[i]/this->carrierSpecies()[gid].W(); + WInv += Y[i]/mcCarrierThermo_.speciesData()[gid].W(); + X[i] = Y[i]/mcCarrierThermo_.speciesData()[gid].W(); } break; } @@ -374,7 +364,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::H forAll(Y, i) { label gid = props.globalIds()[i]; - HMixture += Y[i]*this->carrierSpecies()[gid].H(T); + HMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].H(T); } break; } @@ -438,7 +428,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::cp forAll(Y, i) { label gid = props.globalIds()[i]; - cpMixture += Y[i]*this->carrierSpecies()[gid].Cp(T); + cpMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Cp(T); } break; } diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index 1e0b800b45709680d18fc421aba7f9b5805e02df..b3f0949defcc84b06f7f8c4b4b0a9ff900d1b079 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -44,7 +44,7 @@ SourceFiles #include "runTimeSelectionTables.H" #include "PtrList.H" -#include "hCombustionThermo.H" +#include "multiComponentMixture.H" #include "liquidMixture.H" #include "solidMixture.H" @@ -74,11 +74,8 @@ class CompositionModel //- The coefficients dictionary const dictionary& coeffDict_; - //- Reference to the carrier phase thermo package - hCombustionThermo& carrierThermo_; - - //- Reference to the carrier phase species - const PtrList<typename CloudType::thermoType>& carrierSpecies_; + //- Reference to the multi-component carrier phase thermo + multiComponentMixture<typename CloudType::thermoType>& mcCarrierThermo_; //- Global (additional) liquid properties data autoPtr<liquidMixture> liquids_; @@ -146,15 +143,12 @@ public: const dictionary& coeffDict() const; //- Return the carrier phase thermo package - const hCombustionThermo& carrierThermo() const; + const multiComponentMixture<typename CloudType::thermoType>& + mcCarrierThermo() const; // Composition lists - //- Return the carrier species - const PtrList<typename CloudType::thermoType>& - carrierSpecies() const; - //- Return the global (additional) liquids const liquidMixture& liquids() const; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index b7caef3652d1f71f8b2406c6f4100adb5bd1f905..19429ba6817e94bdaab43a832c7d1494c0a99638 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -35,14 +35,14 @@ Foam::scalarField Foam::LiquidEvaporation<CloudType>::calcXc const label cellI ) const { - scalarField Xc(this->owner().carrierThermo().composition().Y().size()); + scalarField Xc(this->owner().mcCarrierThermo().Y().size()); scalar Winv = 0.0; forAll(Xc, i) { - scalar Y = this->owner().carrierThermo().composition().Y()[i][cellI]; - Winv += Y/this->owner().carrierSpecies()[i].W(); - Xc[i] = Y/this->owner().carrierSpecies()[i].W(); + scalar Y = this->owner().mcCarrierThermo().Y()[i][cellI]; + Winv += Y/this->owner().mcCarrierThermo().speciesData()[i].W(); + Xc[i] = Y/this->owner().mcCarrierThermo().speciesData()[i].W(); } return Xc/Winv; @@ -104,7 +104,7 @@ Foam::LiquidEvaporation<CloudType>::LiquidEvaporation owner.composition().globalCarrierId(activeLiquids_[i]); } - // Determine mapping between local and global liquids + // Determine mapping between model active liquids and global liquids label idLiquid = owner.composition().idLiquid(); forAll(activeLiquids_, i) { @@ -153,8 +153,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate // Reynolds number scalar Re = mag(Ur)*d/(nuc + ROOTVSMALL); - // film temperature evaluated using the particle temperature - scalar Tf = T; + // film temperature evaluated using the 2/3 rule + scalar Tf = (2.0*T + Tc)/3.0; // calculate mass transfer of each specie in liquid forAll(activeLiquids_, i) @@ -162,12 +162,13 @@ void Foam::LiquidEvaporation<CloudType>::calculate label gid = liqToCarrierMap_[i]; label lid = liqToLiqMap_[i]; - // vapour diffusivity [m2/s] + // vapour diffusivity at film temperature and cell pressure [m2/s] scalar Dab = liquids_->properties()[lid].D(pc, Tf); - // saturation pressure for species i [pa] - // - carrier phase pressure assumed equal to the liquid vapour pressure - // close to the surface + // saturation pressure for species i at film temperature and cell + // pressure [pa] - carrier phase pressure assumed equal to the liquid + // vapour pressure close to the surface + // - limited to pc if pSat > pc scalar pSat = min(liquids_->properties()[lid].pv(pc, Tf), pc); // Schmidt number @@ -179,11 +180,11 @@ void Foam::LiquidEvaporation<CloudType>::calculate // mass transfer coefficient [m/s] scalar kc = Sh*Dab/(d + ROOTVSMALL); - // vapour concentration at droplet surface [kmol/m3] + // vapour concentration at droplet surface at film temperature [kmol/m3] scalar Cs = pSat/(specie::RR*Tf); - // vapour concentration in bulk gas [kmol/m3] - scalar Cinf = Xc[gid]*pc/(specie::RR*Tc); + // vapour concentration in bulk gas at film temperature [kmol/m3] + scalar Cinf = Xc[gid]*pc/(specie::RR*Tf); // molar flux of vapour [kmol/m2/s] scalar Ni = max(kc*(Cs - Cinf), 0.0); diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index d5133cb33dad9e45beb50fa4785fdaee749b2d39..a61d00246e04323e182603105061d72d9150acd6 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -90,6 +90,7 @@ $(cellSources)/nbrToCell/nbrToCell.C $(cellSources)/zoneToCell/zoneToCell.C $(cellSources)/sphereToCell/sphereToCell.C $(cellSources)/cylinderToCell/cylinderToCell.C +$(cellSources)/faceZoneToCell/faceZoneToCell.C faceSources = sets/faceSources $(faceSources)/faceToFace/faceToFace.C diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H index 1a476f66a9eb392021ac0d8085bfbe804f82bccf..a3d936757eaa5fc190dfb7890ff2f0194406f9a8 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H @@ -105,6 +105,7 @@ private: // - schedule mutable autoPtr<mapDistribute> mapPtr_; + // Private Member Functions //- Collect single list of samples and originating processor+face. @@ -162,7 +163,7 @@ private: public: //- Runtime type information - ClassName("directMappedPatchBase"); + TypeName("directMappedPatchBase"); // Constructors @@ -177,15 +178,14 @@ public: directMappedPatchBase(const polyPatch&, const directMappedPatchBase&); - // Destructor - - ~directMappedPatchBase(); - - void clearOut(); + //- Destructor + virtual ~directMappedPatchBase(); // Member functions + void clearOut(); + //- What to sample const sampleMode& mode() const { diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H index 522564b33775c89f135092dc1b161875c9a78ed0..fdd4baec85c9547ded1b7911c765d696c0d10946 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H @@ -151,9 +151,8 @@ public: } - // Destructor - - ~directMappedPolyPatch(); + //- Destructor + virtual ~directMappedPolyPatch(); // Member functions diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H index 407d62ddda2c07958a45b0ea642567ceaf4c1078..457552e42140f9a92a49b1ca3fd40ba99d1df1c9 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H @@ -158,9 +158,8 @@ public: } - // Destructor - - ~directMappedWallPolyPatch(); + //- Destructor + virtual ~directMappedWallPolyPatch(); // Member functions diff --git a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H index 4d5f7dfd173edd6ccb3c559221de0564d46edc50..dba72d2abf4b1491be861f6e5dc825533d9b1427 100644 --- a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H +++ b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.H @@ -354,8 +354,7 @@ public: //- Range of global indices that can be returned. virtual label globalSize() const { - const labelList& offsets = globalTris().offsets(); - return offsets[offsets.size()-1]; + return globalTris().size(); } virtual void findNearest diff --git a/src/meshTools/searchableSurface/searchableSurfaceCollection.H b/src/meshTools/searchableSurface/searchableSurfaceCollection.H index 2004bf9400c24c01a7bf2a1c475973f05a1c6562..dd4c5fdce215c5ccf3743a97541f9075114c668e 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceCollection.H +++ b/src/meshTools/searchableSurface/searchableSurfaceCollection.H @@ -26,7 +26,8 @@ Class Foam::searchableSurfaceCollection Description - Union of transformed searchableSurfaces + Set of transformed searchableSurfaces. Does not do boolean operations. + So when meshing might find parts 'inside'. SourceFiles searchableSurfaceCollection.C diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C new file mode 100644 index 0000000000000000000000000000000000000000..526620fe14746be56d0e433274be25edb0b5d8cd --- /dev/null +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -0,0 +1,185 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "faceZoneToCell.H" +#include "polyMesh.H" + +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + +defineTypeNameAndDebug(faceZoneToCell, 0); + +addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word); + +addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream); + +} + + +Foam::topoSetSource::addToUsageTable Foam::faceZoneToCell::usage_ +( + faceZoneToCell::typeName, + "\n Usage: faceZoneToCell zone master|slave\n\n" + " Select master or slave side of the faceZone." + " Note:accepts wildcards for zone.\n\n" +); + + +template<> +const char* Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>::names[] = +{ + "master", + "slave" +}; + + +const Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2> + Foam::faceZoneToCell::faceActionNames_; + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const +{ + bool hasMatched = false; + + forAll(mesh_.faceZones(), i) + { + const faceZone& zone = mesh_.faceZones()[i]; + + if (zoneName_.match(zone.name())) + { + const labelList& cellLabels = + ( + option_ == MASTER + ? zone.masterCells() + : zone.slaveCells() + ); + + Info<< " Found matching zone " << zone.name() + << " with " << cellLabels.size() << " cells on selected side." + << endl; + + hasMatched = true; + + forAll(cellLabels, i) + { + // Only do active cells + if (cellLabels[i] < mesh_.nCells()) + { + addOrDelete(set, cellLabels[i], add); + } + } + } + } + + if (!hasMatched) + { + WarningIn("faceZoneToCell::combine(topoSet&, const bool)") + << "Cannot find any faceZone named " << zoneName_ << endl + << "Valid names are " << mesh_.faceZones().names() << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +// Construct from components +Foam::faceZoneToCell::faceZoneToCell +( + const polyMesh& mesh, + const word& zoneName, + const faceAction option +) +: + topoSetSource(mesh), + zoneName_(zoneName), + option_(option) +{} + + +// Construct from dictionary +Foam::faceZoneToCell::faceZoneToCell +( + const polyMesh& mesh, + const dictionary& dict +) +: + topoSetSource(mesh), + zoneName_(dict.lookup("name")), + option_(faceActionNames_.read(dict.lookup("option"))) +{} + + +// Construct from Istream +Foam::faceZoneToCell::faceZoneToCell +( + const polyMesh& mesh, + Istream& is +) +: + topoSetSource(mesh), + zoneName_(checkIs(is)), + option_(faceActionNames_.read(checkIs(is))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::faceZoneToCell::~faceZoneToCell() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::faceZoneToCell::applyToSet +( + const topoSetSource::setAction action, + topoSet& set +) const +{ + if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + { + Info<< " Adding all " << faceActionNames_[option_] + << " cells of faceZone " << zoneName_ << " ..." << endl; + + combine(set, true); + } + else if (action == topoSetSource::DELETE) + { + Info<< " Removing all " << faceActionNames_[option_] + << " cells of faceZone " << zoneName_ << " ..." << endl; + + combine(set, false); + } +} + + +// ************************************************************************* // diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H new file mode 100644 index 0000000000000000000000000000000000000000..b09c58399fcca136725ec959690542ff25221318 --- /dev/null +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.H @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Class + Foam::faceZoneToCell + +Description + A topoSetSource to select cells based on side of faceZone. + +SourceFiles + faceZoneToCell.C + +\*---------------------------------------------------------------------------*/ + +#ifndef faceZoneToCell_H +#define faceZoneToCell_H + +#include "topoSetSource.H" +#include "wordRe.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class faceZoneToCell Declaration +\*---------------------------------------------------------------------------*/ + +class faceZoneToCell +: + public topoSetSource +{ +public: + //- Enumeration defining the valid options + enum faceAction + { + MASTER, + SLAVE + }; + +private: + + // Private data + + static const NamedEnum<faceAction, 2> faceActionNames_; + + //- Add usage string + static addToUsageTable usage_; + + //- Name/regular expression of faceZone + wordRe zoneName_; + + //- Option + faceAction option_; + + + // Private Member Functions + + void combine(topoSet& set, const bool add) const; + + +public: + + //- Runtime type information + TypeName("faceZoneToCell"); + + // Constructors + + //- Construct from components + faceZoneToCell + ( + const polyMesh& mesh, + const word& zoneName, + const faceAction option + ); + + //- Construct from dictionary + faceZoneToCell + ( + const polyMesh& mesh, + const dictionary& dict + ); + + //- Construct from Istream + faceZoneToCell + ( + const polyMesh& mesh, + Istream& + ); + + + // Destructor + + virtual ~faceZoneToCell(); + + + // Member Functions + + virtual void applyToSet + ( + const topoSetSource::setAction action, + topoSet& + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C index 0dcd1e0ffb8b733911aebf50cdaab88e67a0c0f9..14b6deb7f37771b062c29e8d635f7feae33448aa 100644 --- a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C +++ b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C @@ -47,7 +47,8 @@ Foam::topoSetSource::addToUsageTable Foam::zoneToCell::usage_ ( zoneToCell::typeName, "\n Usage: zoneToCell zone\n\n" - " Select all cells in the cellZone\n\n" + " Select all cells in the cellZone." + " Note:accepts wildcards for zone.\n\n" ); diff --git a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C index 9bcf49690ffc285ae3db1568476ba31edc0e9353..000db639a96180f2e24ada7aa4f08b4a621685e4 100644 --- a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C +++ b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C @@ -49,7 +49,7 @@ Foam::topoSetSource::addToUsageTable Foam::patchToFace::usage_ ( patchToFace::typeName, "\n Usage: patchToFace patch\n\n" - " Select all faces in the patch\n\n" + " Select all faces in the patch. Note:accepts wildcards for patch.\n\n" ); diff --git a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C index 12cbab560d68ff36281aa34ca6bead1a4b8926f9..465632f2b1091fcdf774b99a0eb076ab16600d15 100644 --- a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C +++ b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C @@ -47,7 +47,8 @@ Foam::topoSetSource::addToUsageTable Foam::zoneToFace::usage_ ( zoneToFace::typeName, "\n Usage: zoneToFace zone\n\n" - " Select all faces in the faceZone\n\n" + " Select all faces in the faceZone." + " Note:accepts wildcards for zone.\n\n" ); diff --git a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C index 4b5148c558c8d0915109d9e87591076d705db5fc..0558093afa54d58b53c6c6eed6435a7dba6f6798 100644 --- a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C +++ b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C @@ -47,7 +47,8 @@ Foam::topoSetSource::addToUsageTable Foam::zoneToPoint::usage_ ( zoneToPoint::typeName, "\n Usage: zoneToPoint zone\n\n" - " Select all points in the pointZone\n\n" + " Select all points in the pointZone." + " Note:accepts wildcards for zone.\n\n" ); diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake index 62175e440fb768dec572cec706bdb787b360c2c7..7fbee69034eae6d4ec0cff99068f1a44b1cfee24 100755 --- a/src/thermophysicalModels/Allwmake +++ b/src/thermophysicalModels/Allwmake @@ -10,7 +10,7 @@ wmake libso solids wmake libso solidMixture wmake libso basic -wmake libso combustion +wmake libso reactionThermo wmake libso laminarFlameSpeed wmake libso chemistryModel wmake libso pdfs diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 4cea8bf57d4c6f7e179760a661e095f4a862044c..dcf9c8f4c0cbe6686de6b4db1b501dea7e45ed6a 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -1,13 +1,16 @@ -basicMixture = mixtures/basicMixture -basicThermo = basicThermo +mixtures/basicMixture/basicMixture.C +mixtures/basicMixture/basicMixtures.C -$(basicMixture)/basicMixture.C -$(basicMixture)/basicMixtures.C -$(basicThermo)/basicThermo.C -$(basicThermo)/newBasicThermo.C +basicThermo/basicThermo.C -hThermo/hThermos.C -eThermo/eThermos.C +psiThermo/basicPsiThermo/basicPsiThermo.C +psiThermo/basicPsiThermo/newBasicPsiThermo.C +psiThermo/hPsiThermo/hPsiThermos.C +psiThermo/ePsiThermo/ePsiThermos.C + +rhoThermo/basicRhoThermo/basicRhoThermo.C +rhoThermo/basicRhoThermo/newBasicRhoThermo.C +rhoThermo/hRhoThermo/hRhoThermos.C derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 14d2e235924b1d80b023d87613b6f89cc7d0078f..4a1e7f19f9422250e8336734715cceb9d97dc5ac 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -35,20 +35,16 @@ License #include "gradientInternalEnergyFvPatchScalarField.H" #include "mixedInternalEnergyFvPatchScalarField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ namespace Foam { - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -defineTypeNameAndDebug(basicThermo, 0); -defineRunTimeSelectionTable(basicThermo, fvMesh); - + defineTypeNameAndDebug(basicThermo, 0); +} // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -wordList basicThermo::hBoundaryTypes() +Foam::wordList Foam::basicThermo::hBoundaryTypes() { const volScalarField::GeometricBoundaryField& tbf = T_.boundaryField(); @@ -77,7 +73,8 @@ wordList basicThermo::hBoundaryTypes() return hbt; } -void basicThermo::hBoundaryCorrection(volScalarField& h) + +void Foam::basicThermo::hBoundaryCorrection(volScalarField& h) { volScalarField::GeometricBoundaryField& hbf = h.boundaryField(); @@ -96,7 +93,8 @@ void basicThermo::hBoundaryCorrection(volScalarField& h) } } -wordList basicThermo::eBoundaryTypes() + +Foam::wordList Foam::basicThermo::eBoundaryTypes() { const volScalarField::GeometricBoundaryField& tbf = T_.boundaryField(); @@ -125,7 +123,8 @@ wordList basicThermo::eBoundaryTypes() return ebt; } -void basicThermo::eBoundaryCorrection(volScalarField& e) + +void Foam::basicThermo::eBoundaryCorrection(volScalarField& e) { volScalarField::GeometricBoundaryField& ebf = e.boundaryField(); @@ -146,7 +145,7 @@ void basicThermo::eBoundaryCorrection(volScalarField& e) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -basicThermo::basicThermo(const fvMesh& mesh) +Foam::basicThermo::basicThermo(const fvMesh& mesh) : IOdictionary ( @@ -173,31 +172,31 @@ basicThermo::basicThermo(const fvMesh& mesh) mesh ), - T_ + psi_ ( IOobject ( - "T", + "psi", mesh.time().timeName(), mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE + IOobject::NO_READ, + IOobject::NO_WRITE ), - mesh + mesh, + dimensionSet(0, -2, 2, 0, 0) ), - psi_ + T_ ( IOobject ( - "psi", + "T", mesh.time().timeName(), mesh, - IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::MUST_READ, + IOobject::AUTO_WRITE ), - mesh, - dimensionSet(0, -2, 2, 0, 0) + mesh ), mu_ @@ -232,20 +231,184 @@ basicThermo::basicThermo(const fvMesh& mesh) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -basicThermo::~basicThermo() +Foam::basicThermo::~basicThermo() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool basicThermo::read() +Foam::volScalarField& Foam::basicThermo::p() { - return regIOobject::read(); + return p_; +} + + +const Foam::volScalarField& Foam::basicThermo::p() const +{ + return p_; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +const Foam::volScalarField& Foam::basicThermo::psi() const +{ + return psi_; +} + + +Foam::volScalarField& Foam::basicThermo::h() +{ + notImplemented("basicThermo::h()"); + return const_cast<volScalarField&>(volScalarField::null()); +} + + +const Foam::volScalarField& Foam::basicThermo::h() const +{ + notImplemented("basicThermo::h() const"); + return volScalarField::null(); +} + + +Foam::tmp<Foam::scalarField> Foam::basicThermo::h +( + const scalarField& T, + const labelList& cells +) const +{ + notImplemented + ( + "basicThermo::h" + "(const scalarField& T, const labelList& cells) const" + ); + return tmp<scalarField>(NULL); +} + + +Foam::tmp<Foam::scalarField> Foam::basicThermo::h +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::h" + "(const scalarField& T, const label patchi) const" + ); + return tmp<scalarField>(NULL); +} + + +Foam::volScalarField& Foam::basicThermo::e() +{ + notImplemented("basicThermo::e()"); + return const_cast<volScalarField&>(volScalarField::null()); +} + + +const Foam::volScalarField& Foam::basicThermo::e() const +{ + notImplemented("basicThermo::e()"); + return volScalarField::null(); +} + + +Foam::tmp<Foam::scalarField> Foam::basicThermo::e +( + const scalarField& T, + const labelList& cells +) const +{ + notImplemented + ( + "basicThermo::e" + "(const scalarField& T, const labelList& cells) const" + ); + return tmp<scalarField>(NULL); +} + + +Foam::tmp<Foam::scalarField> Foam::basicThermo::e +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::e" + "(const scalarField& T, const label patchi) const" + ); + return tmp<scalarField>(NULL); +} + + +const Foam::volScalarField& Foam::basicThermo::T() const +{ + return T_; +} + + +Foam::tmp<Foam::scalarField> Foam::basicThermo::Cp +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::Cp" + "(const scalarField& T, const label patchi) const" + ); + return tmp<scalarField>(NULL); +} + + +Foam::tmp<Foam::volScalarField> Foam::basicThermo::Cp() const +{ + notImplemented("basicThermo::Cp() const"); + return volScalarField::null(); +} + + +Foam::tmp<Foam::scalarField> Foam::basicThermo::Cv +( + const scalarField& T, + const label patchi +) const +{ + notImplemented + ( + "basicThermo::Cv" + "(const scalarField& T, const label patchi) const" + ); + return tmp<scalarField>(NULL); +} + + +Foam::tmp<Foam::volScalarField> Foam::basicThermo::Cv() const +{ + notImplemented("basicThermo::Cv() const"); + return volScalarField::null(); +} + + +const Foam::volScalarField& Foam::basicThermo::mu() const +{ + return mu_; +} + + +const Foam::volScalarField& Foam::basicThermo::alpha() const +{ + return alpha_; +} + + +bool Foam::basicThermo::read() +{ + return regIOobject::read(); +} -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 4b316fc1c9ba5a9ad6d94734908e4e5c0144b1ec..1b5425852530ca30ec9cb6328adb12b777d473ab 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -41,7 +41,6 @@ SourceFiles #include "typeInfo.H" #include "IOdictionary.H" #include "autoPtr.H" -#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +48,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class basicThermo Declaration + Class basicThermo Declaration \*---------------------------------------------------------------------------*/ class basicThermo @@ -61,21 +60,45 @@ protected: // Protected data - volScalarField p_; - volScalarField T_; - volScalarField psi_; + // Fields - volScalarField mu_; - volScalarField alpha_; + //- Pressure [Pa] + volScalarField p_; + + //- Compressibility [s^2/m^2] + volScalarField psi_; + + //- Temperature [K] + volScalarField T_; + + //- Laminar dynamic viscosity [kg/m/s] + volScalarField mu_; + + //- Laminar thermal diffusuvity [kg/m/s] + volScalarField alpha_; // Protected member functions - wordList hBoundaryTypes(); - void hBoundaryCorrection(volScalarField& h); + // Enthalpy + + //- Return the enthalpy field boundary types by interrogating the + // temperature field boundary types + wordList hBoundaryTypes(); + + //- Correct the enthalpy field boundaries + void hBoundaryCorrection(volScalarField& h); + + + // Internal energy + + //- Return the internal energy field boundary types by + // interrogating the temperature field boundary types + wordList eBoundaryTypes(); + + //- Correct the internal energy field boundaries + void eBoundaryCorrection(volScalarField& e); - wordList eBoundaryTypes(); - void eBoundaryCorrection(volScalarField& e); //- Construct as copy (not implemented) basicThermo(const basicThermo&); @@ -87,29 +110,12 @@ public: TypeName("basicThermo"); - // Declare run-time constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - basicThermo, - fvMesh, - (const fvMesh& mesh), - (mesh) - ); - - // Constructors //- Construct from mesh basicThermo(const fvMesh&); - // Selectors - - static autoPtr<basicThermo> New(const fvMesh&); - - //- Destructor virtual ~basicThermo(); @@ -120,193 +126,101 @@ public: virtual void correct() = 0; - // Access to thermodynamic state variables. + // Access to thermodynamic state variables //- Pressure [Pa] // Non-const access allowed for transport equations - virtual volScalarField& p() - { - return p_; - } + virtual volScalarField& p(); //- Pressure [Pa] - virtual const volScalarField& p() const - { - return p_; - } + virtual const volScalarField& p() const; + + //- Density [kg/m^3] + virtual tmp<volScalarField> rho() const = 0; + + //- Compressibility [s^2/m^2] + virtual const volScalarField& psi() const; //- Enthalpy [J/kg] // Non-const access allowed for transport equations - virtual volScalarField& h() - { - notImplemented("basicThermo::h()"); - return const_cast<volScalarField&>(volScalarField::null()); - } + virtual volScalarField& h(); //- Enthalpy [J/kg] - virtual const volScalarField& h() const - { - notImplemented("basicThermo::h() const"); - return volScalarField::null(); - } + virtual const volScalarField& h() const; //- Enthalpy for cell-set [J/kg] virtual tmp<scalarField> h ( const scalarField& T, const labelList& cells - ) const - { - notImplemented - ( - "basicThermo::h" - "(const scalarField& T, const labelList& cells) const" - ); - return tmp<scalarField>(NULL); - } + ) const; //- Enthalpy for patch [J/kg] virtual tmp<scalarField> h ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::h" - "(const scalarField& T, const label patchi) const" - ); - return tmp<scalarField>(NULL); - } + ) const; //- Internal energy [J/kg] // Non-const access allowed for transport equations - virtual volScalarField& e() - { - notImplemented("basicThermo::e()"); - return const_cast<volScalarField&>(volScalarField::null()); - } + virtual volScalarField& e(); //- Internal energy [J/kg] - virtual const volScalarField& e() const - { - notImplemented("basicThermo::e()"); - return volScalarField::null(); - } + virtual const volScalarField& e() const; //- Internal energy for cell-set [J/kg] virtual tmp<scalarField> e ( const scalarField& T, const labelList& cells - ) const - { - notImplemented - ( - "basicThermo::e" - "(const scalarField& T, const labelList& cells) const" - ); - return tmp<scalarField>(NULL); - } + ) const; //-Internal energy for patch [J/kg] virtual tmp<scalarField> e ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::e" - "(const scalarField& T, const label patchi) const" - ); - return tmp<scalarField>(NULL); - } + ) const; + // Fields derived from thermodynamic state variables //- Temperature [K] - virtual const volScalarField& T() const - { - return T_; - } - - //- Density [kg/m^3] - virtual tmp<volScalarField> rho() const - { - return p_*psi(); - } - - //- Compressibility [s^2/m^2] - virtual const volScalarField& psi() const - { - return psi_; - } + virtual const volScalarField& T() const; //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp<scalarField> Cp ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::Cp" - "(const scalarField& T, const label patchi) const" - ); - return tmp<scalarField>(NULL); - } + ) const; //- Heat capacity at constant pressure [J/kg/K] - virtual tmp<volScalarField> Cp() const - { - notImplemented("basicThermo::Cp() const"); - return volScalarField::null(); - } + virtual tmp<volScalarField> Cp() const; //- Heat capacity at constant volume for patch [J/kg/K] virtual tmp<scalarField> Cv ( const scalarField& T, const label patchi - ) const - { - notImplemented - ( - "basicThermo::Cv" - "(const scalarField& T, const label patchi) const" - ); - return tmp<scalarField>(NULL); - } + ) const; //- Heat capacity at constant volume [J/kg/K] - virtual tmp<volScalarField> Cv() const - { - notImplemented("basicThermo::Cv() const"); - return volScalarField::null(); - } + virtual tmp<volScalarField> Cv() const; // Access to transport state variables - //- Dynamic viscosity of mixture [kg/ms] - virtual const volScalarField& mu() const - { - return mu_; - } + //- Dynamic viscosity of mixture [kg/m/s] + virtual const volScalarField& mu() const; - //- Thermal diffusivity for enthalpy of mixture [kg/ms] - virtual const volScalarField& alpha() const - { - return alpha_; - } + //- Thermal diffusivity for enthalpy of mixture [kg/m/s] + virtual const volScalarField& alpha() const; //- Read thermophysicalProperties dictionary - virtual bool read() = 0; + virtual bool read(); }; diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C index bbe76c43ef88703329699fa36975ac7f094d089a..0167d9c4cb7c4ce61fa4b90bf9e932e5975a7b6b 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "error.H" diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H index d44f5483f99e4efdcf1945e19d25ab77ab4be168..a976184530cff94190f0666f8140617ecd22b2f5 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H @@ -47,7 +47,7 @@ class fvMesh; class dictionary; /*---------------------------------------------------------------------------*\ - Class basicMixture Declaration + Class basicMixture Declaration \*---------------------------------------------------------------------------*/ class basicMixture @@ -65,9 +65,8 @@ public: basicMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~basicMixture(); + //- Destructor + virtual ~basicMixture(); }; diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C index c3bad32fc14616e383f5cbb897bd9c42b064ac22..0aced02618e2baaa73623f635396b8763a5583c1 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for internal energy based thermodynamics package. + Mixture instantiation \*---------------------------------------------------------------------------*/ @@ -34,6 +34,8 @@ Description #include "perfectGas.H" +#include "eConstThermo.H" + #include "hConstThermo.H" #include "janafThermo.H" #include "specieThermo.H" @@ -68,6 +70,22 @@ makeBasicMixture perfectGas ); +makeBasicMixture +( + pureMixture, + constTransport, + eConstThermo, + perfectGas +); + +makeBasicMixture +( + pureMixture, + sutherlandTransport, + eConstThermo, + perfectGas +); + makeBasicMixture ( pureMixture, diff --git a/src/OpenFOAM/containers/Lists/List/undefListLoopM.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C similarity index 76% rename from src/OpenFOAM/containers/Lists/List/undefListLoopM.H rename to src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C index 3c125e2376c580a43c5eceb9c906ff01f5cb40bf..6464e9e71b04e93fb050293f8caa2d5ae2ba3a1f 100644 --- a/src/OpenFOAM/containers/Lists/List/undefListLoopM.H +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C @@ -22,25 +22,31 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - A List\<Type\> is a 1D array of objects of type 'Type', - where the size of the array is known and used for subscript - bounds checking, etc. - \*---------------------------------------------------------------------------*/ -#ifdef List_FOR_ALL +#include "basicPsiThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#undef List_FOR_ALL -#undef List_END_FOR_ALL -#undef List_ELEM -#undef List_ACCESS -#undef List_CONST_ACCESS +namespace Foam +{ + defineTypeNameAndDebug(basicPsiThermo, 0); + defineRunTimeSelectionTable(basicPsiThermo, fvMesh); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#endif +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::basicPsiThermo::basicPsiThermo(const fvMesh& mesh) +: + basicThermo(mesh) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::basicPsiThermo::~basicPsiThermo() +{} + // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..df6d21b9ab65f41845130e1221b1f056cbdbd37c --- /dev/null +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Class + Foam::basicPsiThermo + +Description + Basic thermodynamic properties based on compressibility + +SourceFiles + basicPsiThermo.C + newBasicPsiThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicPsiThermo_H +#define basicPsiThermo_H + +#include "basicThermo.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicPsiThermo Declaration +\*---------------------------------------------------------------------------*/ + +class basicPsiThermo +: + public basicThermo +{ + +protected: + + // Protected member functions + + //- Construct as copy (not implemented) + basicPsiThermo(const basicPsiThermo&); + + +public: + + //- Runtime type information + TypeName("basicPsiThermo"); + + + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + basicPsiThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + + // Constructors + + //- Construct from mesh + basicPsiThermo(const fvMesh&); + + + //- Selector + static autoPtr<basicPsiThermo> New(const fvMesh&); + + //- Destructor + virtual ~basicPsiThermo(); + + + // Member functions + + // Fields derived from thermodynamic state variables + + //- Density [kg/m^3] - uses current value of pressure + virtual tmp<volScalarField> rho() const + { + return p_*psi(); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/makeCombustionThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H similarity index 67% rename from src/thermophysicalModels/combustion/hCombustionThermo/makeCombustionThermo.H rename to src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H index f961d0ca0c532d035828d8dc2cd6183755392fa0..c36ec8da9103544a364d5db3cef0d609ec7abaad 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/makeCombustionThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H @@ -23,39 +23,38 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA InClass - Foam::hCombustionThermo + Foam::basicPsiThermo Description + Macros for creating 'basic' compresibility-based thermo packages \*---------------------------------------------------------------------------*/ -#ifndef makeCombustionThermo_H -#define makeCombustionThermo_H +#ifndef makeBasicPsiThermo_H +#define makeBasicPsiThermo_H + +#include "basicPsiThermo.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeCombustionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ +#define makeBasicPsiThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ \ -typedef MixtureThermo \ - <Mixture<Transport<specieThermo<Thermo<EqnOfState> > > > > \ - MixtureThermo##Mixture##Transport##Thermo##EqnOfState; \ +typedef Cthermo<Mixture<Transport<specieThermo<Thermo<EqnOfState> > > > > \ + Cthermo##Mixture##Transport##Thermo##EqnOfState; \ \ defineTemplateTypeNameAndDebugWithName \ - (MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ - #MixtureThermo \ - "<"#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">>>>>", 0); \ - \ -addToRunTimeSelectionTable \ ( \ - basicThermo, \ - MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ - fvMesh \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ + #Cthermo \ + "<"#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">>>>>", \ + 0 \ ); \ \ addToRunTimeSelectionTable \ ( \ - CThermo, \ - MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + basicPsiThermo, \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ ) diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/newhCombustionThermo.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C similarity index 68% rename from src/thermophysicalModels/combustion/hCombustionThermo/newhCombustionThermo.C rename to src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C index 2345a2b6d7e1b76f2e8121691c4725a1892850c2..3f9c43a0f9ee4f1edb837fa43becbea43f9e194c 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/newhCombustionThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/newBasicPsiThermo.C @@ -24,19 +24,16 @@ License \*---------------------------------------------------------------------------*/ -#include "hCombustionThermo.H" -#include "fvMesh.H" +#include "basicPsiThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +Foam::autoPtr<Foam::basicPsiThermo> Foam::basicPsiThermo::New +( + const fvMesh& mesh +) { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr<hCombustionThermo> hCombustionThermo::New(const fvMesh& mesh) -{ - word hCombustionThermoTypeName; + word thermoTypeName; // Enclose the creation of the thermophysicalProperties to ensure it is // deleted before the turbulenceModel is created otherwise the dictionary @@ -54,31 +51,25 @@ autoPtr<hCombustionThermo> hCombustionThermo::New(const fvMesh& mesh) ) ); - thermoDict.lookup("thermoType") >> hCombustionThermoTypeName; + thermoDict.lookup("thermoType") >> thermoTypeName; } - Info<< "Selecting thermodynamics package " - << hCombustionThermoTypeName << endl; + Info<< "Selecting thermodynamics package " << thermoTypeName << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName); + fvMeshConstructorTablePtr_->find(thermoTypeName); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("hCombustionThermo::New(const fvMesh&)") - << "Unknown hCombustionThermo type " - << hCombustionThermoTypeName << endl << endl - << "Valid hCombustionThermo types are :" << endl - << fvMeshConstructorTablePtr_->toc() + FatalErrorIn("basicPsiThermo::New(const fvMesh&)") + << "Unknown basicPsiThermo type " << thermoTypeName << nl << nl + << "Valid basicPsiThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } - return autoPtr<hCombustionThermo>(cstrIter()(mesh)); + return autoPtr<basicPsiThermo>(cstrIter()(mesh)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/eThermo/eThermo.C b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.C similarity index 72% rename from src/thermophysicalModels/basic/eThermo/eThermo.C rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.C index 3c7562b9785e0de63c899aafccbc0af29fd73981..789f35bed9e275c24e24abb0555fd92ce54b9894 100644 --- a/src/thermophysicalModels/basic/eThermo/eThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.C @@ -24,72 +24,22 @@ License \*---------------------------------------------------------------------------*/ -#include "eThermo.H" +#include "ePsiThermo.H" #include "fvMesh.H" #include "fixedValueFvPatchFields.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class MixtureType> -Foam::eThermo<MixtureType>::eThermo(const fvMesh& mesh) -: - basicThermo(mesh), - MixtureType(*this, mesh), - - e_ - ( - IOobject - ( - "e", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(0, 2, -2, 0, 0), - eBoundaryTypes() - ) -{ - scalarField& eCells = e_.internalField(); - const scalarField& TCells = T_.internalField(); - - forAll(eCells, celli) - { - eCells[celli] = this->cellMixture(celli).E(TCells[celli]); - } - - forAll(e_.boundaryField(), patchi) - { - e_.boundaryField()[patchi] == e(T_.boundaryField()[patchi], patchi); - } - - eBoundaryCorrection(e_); - - calculate(); - psi_.oldTime(); // Switch on saving old time -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class MixtureType> -Foam::eThermo<MixtureType>::~eThermo() -{} - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class MixtureType> -void Foam::eThermo<MixtureType>::calculate() +void Foam::ePsiThermo<MixtureType>::calculate() { const scalarField& eCells = e_.internalField(); - const scalarField& pCells = p_.internalField(); + const scalarField& pCells = this->p_.internalField(); - scalarField& TCells = T_.internalField(); - scalarField& psiCells = psi_.internalField(); - scalarField& muCells = mu_.internalField(); - scalarField& alphaCells = alpha_.internalField(); + scalarField& TCells = this->T_.internalField(); + scalarField& psiCells = this->psi_.internalField(); + scalarField& muCells = this->mu_.internalField(); + scalarField& alphaCells = this->alpha_.internalField(); forAll(TCells, celli) { @@ -103,16 +53,16 @@ void Foam::eThermo<MixtureType>::calculate() alphaCells[celli] = mixture_.alpha(TCells[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - fvPatchScalarField& pp = p_.boundaryField()[patchi]; - fvPatchScalarField& pT = T_.boundaryField()[patchi]; - fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; + fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; fvPatchScalarField& pe = e_.boundaryField()[patchi]; - fvPatchScalarField& pmu = mu_.boundaryField()[patchi]; - fvPatchScalarField& palpha = alpha_.boundaryField()[patchi]; + fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; if (pT.fixesValue()) { @@ -146,30 +96,83 @@ void Foam::eThermo<MixtureType>::calculate() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::ePsiThermo<MixtureType>::ePsiThermo(const fvMesh& mesh) +: + basicPsiThermo(mesh), + MixtureType(*this, mesh), + + e_ + ( + IOobject + ( + "e", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->eBoundaryTypes() + ) +{ + scalarField& eCells = e_.internalField(); + const scalarField& TCells = this->T_.internalField(); + + forAll(eCells, celli) + { + eCells[celli] = this->cellMixture(celli).E(TCells[celli]); + } + + forAll(e_.boundaryField(), patchi) + { + e_.boundaryField()[patchi] == + e(this->T_.boundaryField()[patchi], patchi); + } + + this->eBoundaryCorrection(e_); + + calculate(); + + // Switch on saving old time + this->psi_.oldTime(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::ePsiThermo<MixtureType>::~ePsiThermo() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class MixtureType> -void Foam::eThermo<MixtureType>::correct() +void Foam::ePsiThermo<MixtureType>::correct() { if (debug) { - Info<< "entering eThermo<MixtureType>::correct()" << endl; + Info<< "entering ePsiThermo<MixtureType>::correct()" << endl; } // force the saving of the old-time values - psi_.oldTime(); + this->psi_.oldTime(); calculate(); if (debug) { - Info<< "exiting eThermo<MixtureType>::correct()" << endl; + Info<< "exiting ePsiThermo<MixtureType>::correct()" << endl; } } template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::e +Foam::tmp<Foam::scalarField> Foam::ePsiThermo<MixtureType>::e ( const scalarField& T, const labelList& cells @@ -188,7 +191,7 @@ Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::e template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::e +Foam::tmp<Foam::scalarField> Foam::ePsiThermo<MixtureType>::e ( const scalarField& T, const label patchi @@ -205,8 +208,9 @@ Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::e return te; } + template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::Cp +Foam::tmp<Foam::scalarField> Foam::ePsiThermo<MixtureType>::Cp ( const scalarField& T, const label patchi @@ -223,10 +227,11 @@ Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::Cp return tCp; } + template<class MixtureType> -Foam::tmp<Foam::volScalarField> Foam::eThermo<MixtureType>::Cp() const +Foam::tmp<Foam::volScalarField> Foam::ePsiThermo<MixtureType>::Cp() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp<volScalarField> tCp ( @@ -242,20 +247,20 @@ Foam::tmp<Foam::volScalarField> Foam::eThermo<MixtureType>::Cp() const ), mesh, dimensionSet(0, 2, -2, -1, 0), - T_.boundaryField().types() + this->T_.boundaryField().types() ) ); volScalarField& cp = tCp(); - forAll(T_, celli) + forAll(this->T_, celli) { - cp[celli] = this->cellMixture(celli).Cp(T_[celli]); + cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - const fvPatchScalarField& pT = T_.boundaryField()[patchi]; + const fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; fvPatchScalarField& pCp = cp.boundaryField()[patchi]; forAll(pT, facei) @@ -269,7 +274,7 @@ Foam::tmp<Foam::volScalarField> Foam::eThermo<MixtureType>::Cp() const template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::Cv +Foam::tmp<Foam::scalarField> Foam::ePsiThermo<MixtureType>::Cv ( const scalarField& T, const label patchi @@ -288,9 +293,9 @@ Foam::tmp<Foam::scalarField> Foam::eThermo<MixtureType>::Cv template<class MixtureType> -Foam::tmp<Foam::volScalarField> Foam::eThermo<MixtureType>::Cv() const +Foam::tmp<Foam::volScalarField> Foam::ePsiThermo<MixtureType>::Cv() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp<volScalarField> tCv ( @@ -311,14 +316,15 @@ Foam::tmp<Foam::volScalarField> Foam::eThermo<MixtureType>::Cv() const volScalarField& cv = tCv(); - forAll(T_, celli) + forAll(this->T_, celli) { - cv[celli] = this->cellMixture(celli).Cv(T_[celli]); + cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - cv.boundaryField()[patchi] = Cv(T_.boundaryField()[patchi], patchi); + cv.boundaryField()[patchi] = + Cv(this->T_.boundaryField()[patchi], patchi); } return tCv; @@ -326,9 +332,9 @@ Foam::tmp<Foam::volScalarField> Foam::eThermo<MixtureType>::Cv() const template<class MixtureType> -bool Foam::eThermo<MixtureType>::read() +bool Foam::ePsiThermo<MixtureType>::read() { - if (basicThermo::read()) + if (basicPsiThermo::read()) { MixtureType::read(*this); return true; diff --git a/src/thermophysicalModels/basic/eThermo/eThermo.H b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.H similarity index 89% rename from src/thermophysicalModels/basic/eThermo/eThermo.H rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.H index b573ca4aa4e377ce98d162101526ab37c61b9353..6952edc42389bfc222ecc8955367a012f70e17c9 100644 --- a/src/thermophysicalModels/basic/eThermo/eThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermo.H @@ -23,20 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::eThermo + Foam::ePsiThermo Description - Internal energy for a mixture + Internal energy for a mixture based on compressibility SourceFiles - eThermo.C + ePsiThermo.C \*---------------------------------------------------------------------------*/ -#ifndef eThermo_H -#define eThermo_H +#ifndef ePsiThermo_H +#define ePsiThermo_H -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "basicMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,42 +45,44 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class eThermo Declaration + Class ePsiThermo Declaration \*---------------------------------------------------------------------------*/ template<class MixtureType> -class eThermo +class ePsiThermo : - public basicThermo, + public basicPsiThermo, public MixtureType { // Private data + //- Internal energy field volScalarField e_; // Private member functions + //- Calculate the thermo variables void calculate(); //- Construct as copy (not implemented) - eThermo(const eThermo<MixtureType>&); + ePsiThermo(const ePsiThermo<MixtureType>&); public: //- Runtime type information - TypeName("eThermo"); + TypeName("ePsiThermo"); // Constructors //- Construct from mese - eThermo(const fvMesh&); + ePsiThermo(const fvMesh&); //- Destructor - virtual ~eThermo(); + virtual ~ePsiThermo(); // Member functions @@ -166,7 +168,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #ifdef NoRepository -# include "eThermo.C" +# include "ePsiThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermos.C b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C similarity index 84% rename from src/thermophysicalModels/basic/basicThermo/basicThermos.C rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C index 7a837bcc9baf6ffe7a5c9bca0162ecb6e2cbe9e8..0517a06ec20498b1cf01e9ab211f1cb8be325ceb 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C @@ -22,30 +22,22 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for internal energy based thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "basicThermo.H" -#include "makeBasicThermo.H" +#include "makeBasicPsiThermo.H" #include "perfectGas.H" -#include "hConstThermo.H" +#include "eConstThermo.H" #include "janafThermo.H" #include "specieThermo.H" #include "constTransport.H" #include "sutherlandTransport.H" -#include "hThermo.H" +#include "ePsiThermo.H" #include "pureMixture.H" -#include "addToRunTimeSelectionTable.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -53,27 +45,27 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + ePsiThermo, pureMixture, constTransport, - hConstThermo, + eConstThermo, perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + ePsiThermo, pureMixture, sutherlandTransport, - hConstThermo, + eConstThermo, perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + ePsiThermo, pureMixture, sutherlandTransport, janafThermo, diff --git a/src/thermophysicalModels/basic/hThermo/hThermo.C b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C similarity index 73% rename from src/thermophysicalModels/basic/hThermo/hThermo.C rename to src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C index 74e80601b9ae9f5f3b7e8fed64efbe1d5107baee..ab85557cf478222b30631345410042555ac97b9b 100644 --- a/src/thermophysicalModels/basic/hThermo/hThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C @@ -24,72 +24,20 @@ License \*---------------------------------------------------------------------------*/ -#include "hThermo.H" -#include "fvMesh.H" -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class MixtureType> -Foam::hThermo<MixtureType>::hThermo(const fvMesh& mesh) -: - basicThermo(mesh), - MixtureType(*this, mesh), - - h_ - ( - IOobject - ( - "h", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionSet(0, 2, -2, 0, 0), - hBoundaryTypes() - ) -{ - scalarField& hCells = h_.internalField(); - const scalarField& TCells = T_.internalField(); - - forAll(hCells, celli) - { - hCells[celli] = this->cellMixture(celli).H(TCells[celli]); - } - - forAll(h_.boundaryField(), patchi) - { - h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); - } - - hBoundaryCorrection(h_); - - calculate(); - psi_.oldTime(); // Switch on saving old time -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class MixtureType> -Foam::hThermo<MixtureType>::~hThermo() -{} - +#include "hPsiThermo.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class MixtureType> -void Foam::hThermo<MixtureType>::calculate() +void Foam::hPsiThermo<MixtureType>::calculate() { const scalarField& hCells = h_.internalField(); - const scalarField& pCells = p_.internalField(); + const scalarField& pCells = this->p_.internalField(); - scalarField& TCells = T_.internalField(); - scalarField& psiCells = psi_.internalField(); - scalarField& muCells = mu_.internalField(); - scalarField& alphaCells = alpha_.internalField(); + scalarField& TCells = this->T_.internalField(); + scalarField& psiCells = this->psi_.internalField(); + scalarField& muCells = this->mu_.internalField(); + scalarField& alphaCells = this->alpha_.internalField(); forAll(TCells, celli) { @@ -105,14 +53,14 @@ void Foam::hThermo<MixtureType>::calculate() forAll(T_.boundaryField(), patchi) { - fvPatchScalarField& pp = p_.boundaryField()[patchi]; - fvPatchScalarField& pT = T_.boundaryField()[patchi]; - fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; + fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; fvPatchScalarField& ph = h_.boundaryField()[patchi]; - fvPatchScalarField& pmu = mu_.boundaryField()[patchi]; - fvPatchScalarField& palpha = alpha_.boundaryField()[patchi]; + fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; if (pT.fixesValue()) { @@ -146,30 +94,83 @@ void Foam::hThermo<MixtureType>::calculate() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hPsiThermo<MixtureType>::hPsiThermo(const fvMesh& mesh) +: + basicPsiThermo(mesh), + MixtureType(*this, mesh), + + h_ + ( + IOobject + ( + "h", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->hBoundaryTypes() + ) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = this->T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == + h(this->T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); + + // Switch on saving old time + this->psi_.oldTime(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hPsiThermo<MixtureType>::~hPsiThermo() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class MixtureType> -void Foam::hThermo<MixtureType>::correct() +void Foam::hPsiThermo<MixtureType>::correct() { if (debug) { - Info<< "entering hThermo<MixtureType>::correct()" << endl; + Info<< "entering hPsiThermo<MixtureType>::correct()" << endl; } // force the saving of the old-time values - psi_.oldTime(); + this->psi_.oldTime(); calculate(); if (debug) { - Info<< "exiting hThermo<MixtureType>::correct()" << endl; + Info<< "exiting hPsiThermo<MixtureType>::correct()" << endl; } } template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::h +Foam::tmp<Foam::scalarField> Foam::hPsiThermo<MixtureType>::h ( const scalarField& T, const labelList& cells @@ -188,7 +189,7 @@ Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::h template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::h +Foam::tmp<Foam::scalarField> Foam::hPsiThermo<MixtureType>::h ( const scalarField& T, const label patchi @@ -205,8 +206,9 @@ Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::h return th; } + template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::Cp +Foam::tmp<Foam::scalarField> Foam::hPsiThermo<MixtureType>::Cp ( const scalarField& T, const label patchi @@ -223,10 +225,11 @@ Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::Cp return tCp; } + template<class MixtureType> -Foam::tmp<Foam::volScalarField> Foam::hThermo<MixtureType>::Cp() const +Foam::tmp<Foam::volScalarField> Foam::hPsiThermo<MixtureType>::Cp() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp<volScalarField> tCp ( @@ -242,20 +245,20 @@ Foam::tmp<Foam::volScalarField> Foam::hThermo<MixtureType>::Cp() const ), mesh, dimensionSet(0, 2, -2, -1, 0), - T_.boundaryField().types() + this->T_.boundaryField().types() ) ); volScalarField& cp = tCp(); - forAll(T_, celli) + forAll(this->T_, celli) { - cp[celli] = this->cellMixture(celli).Cp(T_[celli]); + cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - const fvPatchScalarField& pT = T_.boundaryField()[patchi]; + const fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; fvPatchScalarField& pCp = cp.boundaryField()[patchi]; forAll(pT, facei) @@ -269,7 +272,7 @@ Foam::tmp<Foam::volScalarField> Foam::hThermo<MixtureType>::Cp() const template<class MixtureType> -Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::Cv +Foam::tmp<Foam::scalarField> Foam::hPsiThermo<MixtureType>::Cv ( const scalarField& T, const label patchi @@ -288,9 +291,9 @@ Foam::tmp<Foam::scalarField> Foam::hThermo<MixtureType>::Cv template<class MixtureType> -Foam::tmp<Foam::volScalarField> Foam::hThermo<MixtureType>::Cv() const +Foam::tmp<Foam::volScalarField> Foam::hPsiThermo<MixtureType>::Cv() const { - const fvMesh& mesh = T_.mesh(); + const fvMesh& mesh = this->T_.mesh(); tmp<volScalarField> tCv ( @@ -311,23 +314,25 @@ Foam::tmp<Foam::volScalarField> Foam::hThermo<MixtureType>::Cv() const volScalarField& cv = tCv(); - forAll(T_, celli) + forAll(this->T_, celli) { - cv[celli] = this->cellMixture(celli).Cv(T_[celli]); + cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]); } - forAll(T_.boundaryField(), patchi) + forAll(this->T_.boundaryField(), patchi) { - cv.boundaryField()[patchi] = Cv(T_.boundaryField()[patchi], patchi); + cv.boundaryField()[patchi] = + Cv(this->T_.boundaryField()[patchi], patchi); } return tCv; } + template<class MixtureType> -bool Foam::hThermo<MixtureType>::read() +bool Foam::hPsiThermo<MixtureType>::read() { - if (basicThermo::read()) + if (basicPsiThermo::read()) { MixtureType::read(*this); return true; diff --git a/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..c1d9b513a37b691f7ec8185ec9afd458b35fd068 --- /dev/null +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.H @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Class + Foam::hPsiThermo + +Description + Enthalpy for a mixture based on compressibility + +SourceFiles + hPsiThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hPsiThermo_H +#define hPsiThermo_H + +#include "basicPsiThermo.H" +#include "basicMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hPsiThermo Declaration +\*---------------------------------------------------------------------------*/ + +template<class MixtureType> +class hPsiThermo +: + public basicPsiThermo, + public MixtureType +{ + // Private data + + //- Enthalpy field + volScalarField h_; + + + // Private member functions + + //- Calculate the thermo variables + void calculate(); + + //- Construct as copy (not implemented) + hPsiThermo(const hPsiThermo<MixtureType>&); + + +public: + + //- Runtime type information + TypeName("hPsiThermo"); + + + // Constructors + + //- Construct from mesh + hPsiThermo(const fvMesh&); + + + //- Destructor + virtual ~hPsiThermo(); + + + // Member functions + + //- Return the compostion of the combustion mixture + virtual basicMixture& composition() + { + return *this; + } + + //- Return the compostion of the combustion mixture + virtual const basicMixture& composition() const + { + return *this; + } + + //- Update properties + virtual void correct(); + + + // Access to thermodynamic state variables + + //- Enthalpy [J/kg] + // Non-const access allowed for transport equations + virtual volScalarField& h() + { + return h_; + } + + //- Enthalpy [J/kg] + virtual const volScalarField& h() const + { + return h_; + } + + + // Fields derived from thermodynamic state variables + + //- Enthalpy for cell-set [J/kg] + virtual tmp<scalarField> h + ( + const scalarField& T, + const labelList& cells + ) const; + + //- Enthalpy for patch [J/kg] + virtual tmp<scalarField> h + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure for patch [J/kg/K] + virtual tmp<scalarField> Cp + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure [J/kg/K] + virtual tmp<volScalarField> Cp() const; + + //- Heat capacity at constant volume for patch [J/kg/K] + virtual tmp<scalarField> Cv + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant volume [J/kg/K] + virtual tmp<volScalarField> Cv() const; + + + //- Read thermophysicalProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +#ifdef NoRepository +# include "hPsiThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/hThermo/hThermos.C b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C similarity index 86% rename from src/thermophysicalModels/basic/hThermo/hThermos.C rename to src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C index 0ed152ec5fb31fbe2052b5a8f7411c5ca9dacfb2..04ed4722adfbb5f952749d6a1534dd51bcc17237 100644 --- a/src/thermophysicalModels/basic/hThermo/hThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermos.C @@ -22,15 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for internal energy based thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "basicThermo.H" -#include "makeBasicThermo.H" +#include "makeBasicPsiThermo.H" #include "perfectGas.H" @@ -41,11 +35,9 @@ Description #include "constTransport.H" #include "sutherlandTransport.H" -#include "hThermo.H" +#include "hPsiThermo.H" #include "pureMixture.H" -#include "addToRunTimeSelectionTable.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -53,34 +45,34 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + hPsiThermo, pureMixture, constTransport, hConstThermo, perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + hPsiThermo, pureMixture, sutherlandTransport, hConstThermo, perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + hPsiThermo, pureMixture, sutherlandTransport, janafThermo, perfectGas ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/basic/rhoThermo/.directory b/src/thermophysicalModels/basic/rhoThermo/.directory new file mode 100644 index 0000000000000000000000000000000000000000..72608b79a0c4cea5c3d5399ea62dac6e34f75df9 --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/.directory @@ -0,0 +1,5 @@ +[Dolphin] +AdditionalInfo=3 +SortOrder=0 +Timestamp=2009,6,10,15,58,20 +ViewMode=1 diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C similarity index 65% rename from src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.C rename to src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C index 80f1dcaaf7063eb8b7899cd284c268f518a8bfe8..dff5dac38796abe255ee0ba5c3ba4246b07e9f80 100644 --- a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.C @@ -24,49 +24,56 @@ License \*---------------------------------------------------------------------------*/ -#include "ParticleTrackingData.H" +#include "basicRhoThermo.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::label Foam::ParticleTrackingData<ParcelType>::PARTICLE_COUNT = 0; +namespace Foam +{ + defineTypeNameAndDebug(basicRhoThermo, 0); + defineRunTimeSelectionTable(basicRhoThermo, fvMesh); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData -( - const Cloud<ParcelType>& cloud -) +Foam::basicRhoThermo::basicRhoThermo(const fvMesh& mesh) : - cloud_(cloud), - origProc_(Pstream::myProcNo()), - id_(PARTICLE_COUNT++) + basicThermo(mesh), + rho_ + ( + IOobject + ( + "rhoThermo", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimDensity + ) {} -template<class ParcelType> -Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData -( - const ParticleTrackingData& ptd -) -: - cloud_(ptd.cloud_), - origProc_(ptd.origProc_), - id_(ptd.id_) +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::basicRhoThermo::~basicRhoThermo() {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -Foam::ParticleTrackingData<ParcelType>::~ParticleTrackingData() -{} +Foam::tmp<Foam::volScalarField> Foam::basicRhoThermo::rho() const +{ + return rho_; +} -// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // +Foam::volScalarField& Foam::basicRhoThermo::rho() +{ + return rho_; +} -#include "ParticleTrackingDataIO.C" // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..04e8ea1c3308809298de16480fa32c9fd64dd2f5 --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/basicRhoThermo.H @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Class + Foam::basicRhoThermo + +Description + Basic thermodynamic properties based on density + +SourceFiles + basicRhoThermo.C + newBasicRhoThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicRhoThermo_H +#define basicRhoThermo_H + +#include "basicThermo.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicRhoThermo Declaration +\*---------------------------------------------------------------------------*/ + +class basicRhoThermo +: + public basicThermo +{ + +protected: + + // Protected data + + //- Density field [kg/m^3] + // Named 'rhoThermo' to avoid (potential) conflict with solver density + volScalarField rho_; + + + // Protected member functions + + //- Construct as copy (not implemented) + basicRhoThermo(const basicRhoThermo&); + + +public: + + //- Runtime type information + TypeName("basicRhoThermo"); + + + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + basicRhoThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + + + // Constructors + + //- Construct from mesh + basicRhoThermo(const fvMesh&); + + + //- Selector + static autoPtr<basicRhoThermo> New(const fvMesh&); + + + //- Destructor + virtual ~basicRhoThermo(); + + + // Member functions + + // Fields derived from thermodynamic state variables + + //- Density [kg/m^3] + virtual tmp<volScalarField> rho() const; + + //- Return non-const access to the local density field [kg/m^3] + virtual volScalarField& rho(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H similarity index 76% rename from src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H rename to src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H index 59165247a470305374d758aee6475680bf4cc9b5..e6302bea8c382a4edee96badd71cfb2bfec2ef2c 100644 --- a/src/thermophysicalModels/basic/basicThermo/makeBasicThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H @@ -23,36 +23,42 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA InClass - Foam::basicThermo + Foam::basicRhoThermo Description + Macros for creating 'basic' density-based thermo packages \*---------------------------------------------------------------------------*/ -#ifndef makeBasicThermo_H -#define makeBasicThermo_H +#ifndef makeBasicRhoThermo_H +#define makeBasicRhoThermo_H -#include "basicThermo.H" +#include "basicRhoThermo.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeBasicThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ +#define makeBasicRhoThermo(Cthermo,Mixture,Transport,Thermo,EqnOfState) \ \ typedef Cthermo<Mixture<Transport<specieThermo<Thermo<EqnOfState> > > > > \ Cthermo##Mixture##Transport##Thermo##EqnOfState; \ \ defineTemplateTypeNameAndDebugWithName \ - (Cthermo##Mixture##Transport##Thermo##EqnOfState, \ +( \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ #Cthermo \ - "<"#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">>>>>", 0); \ + "<"#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">>>>>", \ + 0 \ +); \ \ addToRunTimeSelectionTable \ ( \ - basicThermo, \ + basicRhoThermo, \ Cthermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ ) + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C similarity index 68% rename from src/thermophysicalModels/basic/basicThermo/newBasicThermo.C rename to src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C index 3ff6bc9dd19716ce001259383d23e175e2102ae4..9a7ec5ac86f19c77078dc9a2ce899baa732d2bda 100644 --- a/src/thermophysicalModels/basic/basicThermo/newBasicThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/newBasicRhoThermo.C @@ -23,23 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Selection function for internal energy based thermodynamics package. + Selection function for 'basic' density-based thermodynamics \*---------------------------------------------------------------------------*/ -#include "basicThermo.H" -#include "fvMesh.H" +#include "basicRhoThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +Foam::autoPtr<Foam::basicRhoThermo> Foam::basicRhoThermo::New +( + const fvMesh& mesh +) { - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -autoPtr<basicThermo> basicThermo::New(const fvMesh& mesh) -{ - word basicThermoTypeName; + word thermoTypeName; // Enclose the creation of the thermophysicalProperties to ensure it is // deleted before the turbulenceModel is created otherwise the dictionary @@ -57,30 +54,25 @@ autoPtr<basicThermo> basicThermo::New(const fvMesh& mesh) ) ); - thermoDict.lookup("thermoType") >> basicThermoTypeName; + thermoDict.lookup("thermoType") >> thermoTypeName; } - Info<< "Selecting thermodynamics package " << basicThermoTypeName << endl; + Info<< "Selecting thermodynamics package " << thermoTypeName << endl; fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(basicThermoTypeName); + fvMeshConstructorTablePtr_->find(thermoTypeName); if (cstrIter == fvMeshConstructorTablePtr_->end()) { - FatalErrorIn("basicThermo::New(const fvMesh&)") - << "Unknown basicThermo type " << basicThermoTypeName - << endl << endl - << "Valid basicThermo types are :" << endl - << fvMeshConstructorTablePtr_->toc() + FatalErrorIn("basicRhoThermo::New(const fvMesh&)") + << "Unknown basicRhoThermo type " << thermoTypeName << nl << nl + << "Valid basicRhoThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); } - return autoPtr<basicThermo>(cstrIter()(mesh)); + return autoPtr<basicRhoThermo>(cstrIter()(mesh)); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..ce3486fa152124a02503f5bdd6c6787eb888438c --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C @@ -0,0 +1,346 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "hRhoThermo.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class MixtureType> +void Foam::hRhoThermo<MixtureType>::calculate() +{ + const scalarField& hCells = this->h_.internalField(); + const scalarField& pCells = this->p_.internalField(); + + scalarField& TCells = this->T_.internalField(); + scalarField& psiCells = this->psi_.internalField(); + scalarField& rhoCells = this->rho_.internalField(); + scalarField& muCells = this->mu_.internalField(); + scalarField& alphaCells = this->alpha_.internalField(); + + forAll(TCells, celli) + { + const typename MixtureType::thermoType& mixture_ = + this->cellMixture(celli); + + TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); + psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); + rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); + + muCells[celli] = mixture_.mu(TCells[celli]); + alphaCells[celli] = mixture_.alpha(TCells[celli]); + } + + forAll(this->T_.boundaryField(), patchi) + { + fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; + fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; + fvPatchScalarField& prho = this->rho_.boundaryField()[patchi]; + + fvPatchScalarField& ph = this->h_.boundaryField()[patchi]; + + fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; + + if (pT.fixesValue()) + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + ph[facei] = mixture_.H(pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu[facei] = mixture_.mu(pT[facei]); + palpha[facei] = mixture_.alpha(pT[facei]); + } + } + else + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + pT[facei] = mixture_.TH(ph[facei], pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu[facei] = mixture_.mu(pT[facei]); + palpha[facei] = mixture_.alpha(pT[facei]); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hRhoThermo<MixtureType>::hRhoThermo(const fvMesh& mesh) +: + basicRhoThermo(mesh), + MixtureType(*this, mesh), + + h_ + ( + IOobject + ( + "h", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->hBoundaryTypes() + ) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = this->T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == + h(this->T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hRhoThermo<MixtureType>::~hRhoThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class MixtureType> +void Foam::hRhoThermo<MixtureType>::correct() +{ + if (debug) + { + Info<< "entering hRhoThermo<MixtureType>::correct()" << endl; + } + + calculate(); + + if (debug) + { + Info<< "exiting hRhoThermo<MixtureType>::correct()" << endl; + } +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> Foam::hRhoThermo<MixtureType>::h +( + const scalarField& T, + const labelList& cells +) const +{ + tmp<scalarField> th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, celli) + { + h[celli] = this->cellMixture(cells[celli]).H(T[celli]); + } + + return th; +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> Foam::hRhoThermo<MixtureType>::h +( + const scalarField& T, + const label patchi +) const +{ + tmp<scalarField> th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, facei) + { + h[facei] = this->patchFaceMixture(patchi, facei).H(T[facei]); + } + + return th; +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> Foam::hRhoThermo<MixtureType>::Cp +( + const scalarField& T, + const label patchi +) const +{ + tmp<scalarField> tCp(new scalarField(T.size())); + scalarField& cp = tCp(); + + forAll(T, facei) + { + cp[facei] = this->patchFaceMixture(patchi, facei).Cp(T[facei]); + } + + return tCp; +} + + +template<class MixtureType> +Foam::tmp<Foam::volScalarField> Foam::hRhoThermo<MixtureType>::Cp() const +{ + const fvMesh& mesh = this->T_.mesh(); + + tmp<volScalarField> tCp + ( + new volScalarField + ( + IOobject + ( + "Cp", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, -1, 0), + this->T_.boundaryField().types() + ) + ); + + volScalarField& cp = tCp(); + + forAll(this->T_, celli) + { + cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]); + } + + forAll(this->T_.boundaryField(), patchi) + { + const fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; + fvPatchScalarField& pCp = cp.boundaryField()[patchi]; + + forAll(pT, facei) + { + pCp[facei] = this->patchFaceMixture(patchi, facei).Cp(pT[facei]); + } + } + + return tCp; +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> Foam::hRhoThermo<MixtureType>::Cv +( + const scalarField& T, + const label patchi +) const +{ + tmp<scalarField> tCv(new scalarField(T.size())); + scalarField& cv = tCv(); + + forAll(T, facei) + { + cv[facei] = this->patchFaceMixture(patchi, facei).Cv(T[facei]); + } + + return tCv; +} + + +template<class MixtureType> +Foam::tmp<Foam::volScalarField> Foam::hRhoThermo<MixtureType>::Cv() const +{ + const fvMesh& mesh = this->T_.mesh(); + + tmp<volScalarField> tCv + ( + new volScalarField + ( + IOobject + ( + "Cv", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, -1, 0) + ) + ); + + volScalarField& cv = tCv(); + + forAll(this->T_, celli) + { + cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]); + } + + forAll(this->T_.boundaryField(), patchi) + { + cv.boundaryField()[patchi] = + Cv(this->T_.boundaryField()[patchi], patchi); + } + + return tCv; +} + + +template<class MixtureType> +bool Foam::hRhoThermo<MixtureType>::read() +{ + if (basicRhoThermo::read()) + { + MixtureType::read(*this); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/hThermo/hThermo.H b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H similarity index 89% rename from src/thermophysicalModels/basic/hThermo/hThermo.H rename to src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H index ead0088a7cae670e2e340f63bf59069ff7a965aa..a83a241c26354dfad0d1d4cd18f46f9dde950e72 100644 --- a/src/thermophysicalModels/basic/hThermo/hThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H @@ -23,20 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::hThermo + Foam::hPsiThermo Description - Enthalpy for a mixture + Enthalpy for a mixture based on density SourceFiles - hThermo.C + hRhoThermo.C \*---------------------------------------------------------------------------*/ -#ifndef hThermo_H -#define hThermo_H +#ifndef hRhoThermo_H +#define hRhoThermo_H -#include "basicThermo.H" +#include "basicRhoThermo.H" #include "basicMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,42 +45,44 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hThermo Declaration + Class hRhoThermo Declaration \*---------------------------------------------------------------------------*/ template<class MixtureType> -class hThermo +class hRhoThermo : - public basicThermo, + public basicRhoThermo, public MixtureType { // Private data + //- Enthalpy field volScalarField h_; // Private member functions + //- Calculate the thermo variables void calculate(); //- Construct as copy (not implemented) - hThermo(const hThermo<MixtureType>&); + hRhoThermo(const hRhoThermo<MixtureType>&); public: //- Runtime type information - TypeName("hThermo"); + TypeName("hRhoThermo"); // Constructors //- Construct from mesh - hThermo(const fvMesh&); + hRhoThermo(const fvMesh&); //- Destructor - virtual ~hThermo(); + virtual ~hRhoThermo(); // Member functions @@ -166,7 +168,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #ifdef NoRepository -# include "hThermo.C" +# include "hRhoThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/eThermo/eThermos.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C similarity index 86% rename from src/thermophysicalModels/basic/eThermo/eThermos.C rename to src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C index b34bd9ce01ef460ddb2d24a206afd63e4dd336ca..233ee905dccf4f49d6f7c3472d4715612f388d1d 100644 --- a/src/thermophysicalModels/basic/eThermo/eThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermos.C @@ -22,15 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - Selection function for internal energy based thermodynamics package. - \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "basicThermo.H" -#include "makeBasicThermo.H" +#include "makeBasicRhoThermo.H" #include "perfectGas.H" @@ -41,11 +35,9 @@ Description #include "constTransport.H" #include "sutherlandTransport.H" -#include "eThermo.H" +#include "hRhoThermo.H" #include "pureMixture.H" -#include "addToRunTimeSelectionTable.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -53,34 +45,34 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeBasicThermo +makeBasicRhoThermo ( - eThermo, + hRhoThermo, pureMixture, constTransport, hConstThermo, perfectGas ); -makeBasicThermo +makeBasicRhoThermo ( - eThermo, + hRhoThermo, pureMixture, sutherlandTransport, hConstThermo, perfectGas ); -makeBasicThermo +makeBasicRhoThermo ( - eThermo, + hRhoThermo, pureMixture, sutherlandTransport, janafThermo, perfectGas ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/chemistryModel/Make/files b/src/thermophysicalModels/chemistryModel/Make/files index 542393735ccb741fd7a016d60f550aae527f5ec0..b92108d63a23df223262b8b2e597a8a09100a1f1 100644 --- a/src/thermophysicalModels/chemistryModel/Make/files +++ b/src/thermophysicalModels/chemistryModel/Make/files @@ -1,12 +1,13 @@ -chemistryModel = chemistryModel -chemistrySolver = chemistrySolver +chemistryModel/basicChemistryModel/basicChemistryModel.C -$(chemistryModel)/chemistryModel.C +chemistryModel/psiChemistryModel/psiChemistryModel.C +chemistryModel/psiChemistryModel/newPsiChemistryModel.C +chemistryModel/psiChemistryModel/psiChemistryModels.C -$(chemistrySolver)/chemistrySolver/chemistrySolver.C -$(chemistrySolver)/chemistrySolver/newChemistrySolver.C -$(chemistrySolver)/sequential/sequential.C -$(chemistrySolver)/EulerImplicit/EulerImplicit.C -$(chemistrySolver)/ode/ode.C +chemistryModel/rhoChemistryModel/rhoChemistryModel.C +chemistryModel/rhoChemistryModel/newRhoChemistryModel.C +chemistryModel/rhoChemistryModel/rhoChemistryModels.C + +chemistrySolver/chemistrySolver/makeChemistrySolvers.C LIB = $(FOAM_LIBBIN)/libchemistryModel diff --git a/src/thermophysicalModels/chemistryModel/Make/options b/src/thermophysicalModels/chemistryModel/Make/options index 80ca3a7c6d6d35bb53db55f03a433f29602fa7c8..3cdfbc22ac450a66d647c677a8730c6c1f8ff1f7 100644 --- a/src/thermophysicalModels/chemistryModel/Make/options +++ b/src/thermophysicalModels/chemistryModel/Make/options @@ -1,15 +1,16 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/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/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/functions/Polynomial \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude LIB_LIBS = \ - -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lbasicThermophysicalModels \ + -lreactionThermophysicalModels \ + -lspecie \ -lthermophysicalFunctions \ - -lspecie \ - -lODE + -lODE diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C similarity index 59% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 78ce070b1972b9e1127471865d4e5714b438cc21..dfe226da197e43ebeca9e6f333c2e4e76bb3f18d 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.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-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,96 +24,91 @@ License \*---------------------------------------------------------------------------*/ -#include "chemistryModel.H" +#include "ODEChemistryModel.H" #include "chemistrySolver.H" -#include "multiComponentMixture.H" +#include "reactingMixture.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::chemistryModel::chemistryModel +template<class CompType, class ThermoType> +Foam::ODEChemistryModel<CompType, ThermoType>::ODEChemistryModel ( - hCombustionThermo& thermo, - const volScalarField& rho + const fvMesh& mesh, + const word& compTypeName, + const word& thermoTypeName ) : - thermo_(thermo), + CompType(mesh, thermoTypeName), - Y_(thermo.composition().Y()), - rho_(rho), + ODE(), - chemistryProperties_ + Y_(this->thermo().composition().Y()), + + reactions_ ( - IOobject - ( - "chemistryProperties", - rho_.time().constant(), - rho_.db(), - IOobject::MUST_READ, - IOobject::NO_WRITE - ) + dynamic_cast<const reactingMixture<ThermoType>&>(this->thermo()) + ), + specieThermo_ + ( + dynamic_cast<const reactingMixture<ThermoType>&> + (this->thermo()).speciesData() ), - chemistry_(chemistryProperties_.lookup("chemistry")), - - reactions_(dynamic_cast<const reactingMixture&>(thermo)), - specieThermo_(dynamic_cast<const reactingMixture&>(thermo).speciesData()), - Ns_(thermo.composition().Y().size()), - Nr_(reactions_.size()), + nSpecie_(Y_.size()), + nReaction_(reactions_.size()), solver_ ( - chemistrySolver::New + chemistrySolver<CompType, ThermoType>::New ( - chemistryProperties_, - *this + *this, + compTypeName, + thermoTypeName ) ), - deltaTChem_ - ( - rho_.size(), - readScalar(chemistryProperties_.lookup("initialChemicalTimeStep")) - ) + + RR_(nSpecie_) { - // set the size of the chemistry sources - RR_.setSize(Ns()); - for(label i=0; i<Ns(); i++) + // create the fields for the chemistry sources + forAll(RR_, fieldI) { RR_.set ( - i, - new scalarField(rho_.size(), 0.0) + fieldI, + new scalarField(mesh.nCells(), 0.0) ); } - Info<< "chemistryModel::chemistryModel: Number of species = " << Ns() - << " and reactions = " << Nr() << endl; + Info<< "ODEChemistryModel: Number of species = " << nSpecie_ + << " and reactions = " << nReaction_ << endl; } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::chemistryModel::~chemistryModel() +template<class CompType, class ThermoType> +Foam::ODEChemistryModel<CompType, ThermoType>::~ODEChemistryModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalarField Foam::chemistryModel::omega +template<class CompType, class ThermoType> +Foam::scalarField Foam::ODEChemistryModel<CompType, ThermoType>::omega ( const scalarField& c, const scalar T, const scalar p ) const { - scalar pf,cf,pr,cr; + scalar pf, cf, pr, cr; label lRef, rRef; scalarField om(nEqns(), 0.0); forAll(reactions_, i) { - const reaction& R = reactions_[i]; + const Reaction<ThermoType>& R = reactions_[i]; scalar omegai = omega ( @@ -136,12 +131,13 @@ Foam::scalarField Foam::chemistryModel::omega } return om; -} // end omega +} -Foam::scalar Foam::chemistryModel::omega +template<class CompType, class ThermoType> +Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::omega ( - const reaction& R, + const Reaction<ThermoType>& R, const scalarField& c, const scalar T, const scalar p, @@ -153,8 +149,8 @@ Foam::scalar Foam::chemistryModel::omega label& rRef ) const { - scalarField c2(Ns(), 0.0); - for(label i=0; i<Ns(); i++) + scalarField c2(nSpecie_, 0.0); + for (label i=0; i<nSpecie_; i++) { c2[i] = max(0.0, c[i]); } @@ -172,7 +168,7 @@ Foam::scalar Foam::chemistryModel::omega lRef = R.lhs()[slRef].index; pf = kf; - for(label s=1; s<Nl; s++) + for (label s=1; s<Nl; s++) { label si = R.lhs()[s].index; @@ -197,7 +193,7 @@ Foam::scalar Foam::chemistryModel::omega { if (cf > SMALL) { - pf *= pow(cf, exp-1.0); + pf *= pow(cf, exp - 1.0); } else { @@ -206,7 +202,7 @@ Foam::scalar Foam::chemistryModel::omega } else { - pf *= pow(cf, exp-1.0); + pf *= pow(cf, exp - 1.0); } } @@ -215,7 +211,7 @@ Foam::scalar Foam::chemistryModel::omega // find the matrix element and element position for the rhs pr = kr; - for(label s=1; s<Nr; s++) + for (label s=1; s<Nr; s++) { label si = R.rhs()[s].index; if (c[si] < c[rRef]) @@ -239,7 +235,7 @@ Foam::scalar Foam::chemistryModel::omega { if (cr>SMALL) { - pr *= pow(cr, exp-1.0); + pr *= pow(cr, exp - 1.0); } else { @@ -248,25 +244,26 @@ Foam::scalar Foam::chemistryModel::omega } else { - pr *= pow(cr, exp-1.0); + pr *= pow(cr, exp - 1.0); } } return pf*cf - pr*cr; -} // end omega +} -void Foam::chemistryModel::derivatives +template<class CompType, class ThermoType> +void Foam::ODEChemistryModel<CompType, ThermoType>::derivatives ( const scalar time, const scalarField &c, scalarField& dcdt ) const { - scalar T = c[Ns_]; - scalar p = c[Ns_ + 1]; + scalar T = c[nSpecie_]; + scalar p = c[nSpecie_ + 1]; dcdt = omega(c, T, p); @@ -274,7 +271,7 @@ void Foam::chemistryModel::derivatives // dT/dt = ... scalar rho = 0.0; scalar cSum = 0.0; - for(label i=0; i<Ns(); i++) + for (label i=0; i<nSpecie_; i++) { scalar W = specieThermo_[i].W(); cSum += c[i]; @@ -282,7 +279,7 @@ void Foam::chemistryModel::derivatives } scalar mw = rho/cSum; scalar cp = 0.0; - for(label i=0; i<Ns(); i++) + for (label i=0; i<nSpecie_; i++) { scalar cpi = specieThermo_[i].cp(T); scalar Xi = c[i]/rho; @@ -291,7 +288,7 @@ void Foam::chemistryModel::derivatives cp /= mw; scalar dT = 0.0; - for(label i=0; i<Ns(); i++) + for (label i=0; i<nSpecie_; i++) { scalar hi = specieThermo_[i].h(T); dT += hi*dcdt[i]; @@ -301,14 +298,15 @@ void Foam::chemistryModel::derivatives // limit the time-derivative, this is more stable for the ODE // solver when calculating the allowed time step scalar dtMag = min(500.0, mag(dT)); - dcdt[Ns_] = -dT*dtMag/(mag(dT) + 1.0e-10); + dcdt[nSpecie_] = -dT*dtMag/(mag(dT) + 1.0e-10); // dp/dt = ... - dcdt[Ns_+1] = 0.0; + dcdt[nSpecie_+1] = 0.0; } -void Foam::chemistryModel::jacobian +template<class CompType, class ThermoType> +void Foam::ODEChemistryModel<CompType, ThermoType>::jacobian ( const scalar t, const scalarField& c, @@ -316,29 +314,29 @@ void Foam::chemistryModel::jacobian scalarSquareMatrix& dfdc ) const { - scalar T = c[Ns_]; - scalar p = c[Ns_ + 1]; + scalar T = c[nSpecie_]; + scalar p = c[nSpecie_ + 1]; - scalarField c2(Ns(), 0.0); - for(label i=0; i<Ns(); i++) + scalarField c2(nSpecie_, 0.0); + for (label i=0; i<nSpecie_; i++) { c2[i] = max(c[i], 0.0); } - for(label i=0; i<nEqns(); i++) + for (label i=0; i<nEqns(); i++) { - for(label j=0; j<nEqns(); j++) + for (label j=0; j<nEqns(); j++) { dfdc[i][j] = 0.0; } } - // length of the first argument must be Ns() + // length of the first argument must be nSpecie() dcdt = omega(c2, T, p); for (label ri=0; ri<reactions_.size(); ri++) { - const reaction& R = reactions_[ri]; + const Reaction<ThermoType>& R = reactions_[ri]; scalar kf0 = R.kf(T, p, c2); scalar kr0 = R.kr(T, p, c2); @@ -357,7 +355,7 @@ void Foam::chemistryModel::jacobian { if (c2[si]>SMALL) { - kf *= el*pow(c2[si]+VSMALL, el-1.0); + kf *= el*pow(c2[si] + VSMALL, el - 1.0); } else { @@ -366,7 +364,7 @@ void Foam::chemistryModel::jacobian } else { - kf *= el*pow(c2[si], el-1.0); + kf *= el*pow(c2[si], el - 1.0); } } else @@ -403,7 +401,7 @@ void Foam::chemistryModel::jacobian { if (c2[si]>SMALL) { - kr *= er*pow(c2[si]+VSMALL, er-1.0); + kr *= er*pow(c2[si] + VSMALL, er - 1.0); } else { @@ -412,7 +410,7 @@ void Foam::chemistryModel::jacobian } else { - kr *= er*pow(c2[si], er-1.0); + kr *= er*pow(c2[si], er - 1.0); } } else @@ -438,40 +436,54 @@ void Foam::chemistryModel::jacobian // calculate the dcdT elements numerically scalar delta = 1.0e-8; - scalarField dcdT0 = omega(c2, T-delta, p); - scalarField dcdT1 = omega(c2, T+delta, p); + scalarField dcdT0 = omega(c2, T - delta, p); + scalarField dcdT1 = omega(c2, T + delta, p); - for(label i=0; i<nEqns(); i++) + for (label i=0; i<nEqns(); i++) { - dfdc[i][Ns()] = 0.5*(dcdT1[i]-dcdT0[i])/delta; + dfdc[i][nSpecie()] = 0.5*(dcdT1[i] - dcdT0[i])/delta; } -} // end jacobian +} -Foam::tmp<Foam::volScalarField> Foam::chemistryModel::tc() const +template<class CompType, class ThermoType> +Foam::tmp<Foam::volScalarField> +Foam::ODEChemistryModel<CompType, ThermoType>::tc() const { - scalar pf,cf,pr,cr; label lRef, rRef; - label nCells = rho_.size(); - label Nr = reactions_.size(); + const volScalarField rho + ( + IOobject + ( + "rho", + this->time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + this->thermo().rho() + ); + + label nCells = rho.size(); + label nReaction = reactions_.size(); scalarField t(nCells, SMALL); - if (chemistry_) + if (this->chemistry_) { - - for(label celli=0; celli<nCells; celli++) + forAll(rho, celli) { - scalar rhoi = rho_[celli]; - scalar Ti = thermo_.T()[celli]; - scalar pi = thermo_.p()[celli]; - scalarField c(Ns_); + scalar rhoi = rho[celli]; + scalar Ti = this->thermo().T()[celli]; + scalar pi = this->thermo().p()[celli]; + scalarField c(nSpecie_); scalar cSum = 0.0; - for(label i=0; i<Ns_; i++) + for (label i=0; i<nSpecie_; i++) { scalar Yi = Y_[i][celli]; c[i] = rhoi*Yi/specieThermo_[i].W(); @@ -480,7 +492,7 @@ Foam::tmp<Foam::volScalarField> Foam::chemistryModel::tc() const forAll(reactions_, i) { - const reaction& R = reactions_[i]; + const Reaction<ThermoType>& R = reactions_[i]; omega ( @@ -493,7 +505,7 @@ Foam::tmp<Foam::volScalarField> Foam::chemistryModel::tc() const t[celli] += sr*pf*cf; } } - t[celli] = Nr*cSum/t[celli]; + t[celli] = nReaction*cSum/t[celli]; } } @@ -504,13 +516,13 @@ Foam::tmp<Foam::volScalarField> Foam::chemistryModel::tc() const IOobject ( "tc", - rho_.time().timeName(), - rho_.db(), + this->mesh_.time().timeName(), + this->mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), - rho_.mesh(), - dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0), + this->mesh_, + dimensionedScalar("zero", dimTime, 0.0), zeroGradientFvPatchScalarField::typeName ) ); @@ -522,37 +534,103 @@ Foam::tmp<Foam::volScalarField> Foam::chemistryModel::tc() const } -Foam::label Foam::chemistryModel::nEqns() const +template<class CompType, class ThermoType> +Foam::tmp<Foam::volScalarField> +Foam::ODEChemistryModel<CompType, ThermoType>::dQ() const +{ + tmp<volScalarField> tdQ + ( + new volScalarField + ( + IOobject + ( + "dQ", + this->mesh_.time().timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar + ( + "zero", + dimensionSet(1, -3, -1 , 0, 0, 0, 0), + 0.0 + ) + ) + ); + + if (this->chemistry_) + { + scalarField& dQ = tdQ(); + + scalarField cp(dQ.size(), 0.0); + + forAll(Y_, i) + { + forAll(dQ, cellI) + { + scalar Ti = this->thermo().T()[cellI]; + cp[cellI] += Y_[i][cellI]*specieThermo_[i].Cp(Ti); + scalar hi = specieThermo_[i].h(Ti); + dQ[cellI] -= hi*RR_[i][cellI]; + } + } + + dQ /= cp; + } + + return tdQ; +} + + +template<class CompType, class ThermoType> +Foam::label Foam::ODEChemistryModel<CompType, ThermoType>::nEqns() const { // nEqns = number of species + temperature + pressure - return Ns_ + 2; + return nSpecie_ + 2; } -void Foam::chemistryModel::calculate() +template<class CompType, class ThermoType> +void Foam::ODEChemistryModel<CompType, ThermoType>::calculate() { - for(label i=0; i<Ns(); i++) + const volScalarField rho + ( + IOobject + ( + "rho", + this->time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + this->thermo().rho() + ); + + for (label i=0; i<nSpecie_; i++) { - RR_[i].setSize(rho_.size()); + RR_[i].setSize(rho.size()); } - if (chemistry_) + if (this->chemistry_) { - for(label celli=0; celli<rho_.size(); celli++) + forAll(rho, celli) { - for(label i=0; i<Ns(); i++) + for (label i=0; i<nSpecie_; i++) { RR_[i][celli] = 0.0; } - scalar rhoi = rho_[celli]; - scalar Ti = thermo_.T()[celli]; - scalar pi = thermo_.p()[celli]; + scalar rhoi = rho[celli]; + scalar Ti = this->thermo().T()[celli]; + scalar pi = this->thermo().p()[celli]; - scalarField c(Ns_); + scalarField c(nSpecie_); scalarField dcdt(nEqns(), 0.0); - for(label i=0; i<Ns_; i++) + for (label i=0; i<nSpecie_; i++) { scalar Yi = Y_[i][celli]; c[i] = rhoi*Yi/specieThermo_[i].W(); @@ -560,7 +638,7 @@ void Foam::chemistryModel::calculate() dcdt = omega(c, Ti, pi); - for(label i=0; i<Ns_; i++) + for (label i=0; i<nSpecie_; i++) { RR_[i][celli] = dcdt[i]*specieThermo_[i].W(); } @@ -569,44 +647,63 @@ void Foam::chemistryModel::calculate() } -Foam::scalar Foam::chemistryModel::solve(const scalar t0, const scalar deltaT) +template<class CompType, class ThermoType> +Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::solve +( + const scalar t0, + const scalar deltaT +) { - for(label i=0; i<Ns(); i++) + const volScalarField rho + ( + IOobject + ( + "rho", + this->time().timeName(), + this->mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + this->thermo().rho() + ); + + for (label i=0; i<nSpecie_; i++) { - RR_[i].setSize(rho_.size()); + RR_[i].setSize(rho.size()); } - if (!chemistry_) + if (!this->chemistry_) { return GREAT; } scalar deltaTMin = GREAT; - for(label celli=0; celli<rho_.size(); celli++) + forAll(rho, celli) { - for(label i=0; i<Ns(); i++) + for (label i=0; i<nSpecie(); i++) { RR_[i][celli] = 0.0; } - scalar rhoi = rho_[celli]; - scalar Ti = thermo_.T()[celli]; - scalar hi = thermo_.h()[celli]; - scalar pi = thermo_.p()[celli]; + scalar rhoi = rho[celli]; + scalar Ti = this->thermo().T()[celli]; + scalar hi = this->thermo().h()[celli]; + scalar pi = this->thermo().p()[celli]; - scalarField c(Ns_); - scalarField c0(Ns_); - scalarField dc(Ns_, 0.0); + scalarField c(nSpecie_); + scalarField c0(nSpecie_); + scalarField dc(nSpecie_, 0.0); - for(label i=0; i<Ns_; i++) + for (label i=0; i<nSpecie_; i++) { c[i] = rhoi*Y_[i][celli]/specieThermo_[i].W(); } c0 = c; scalar t = t0; - scalar tauC = deltaTChem_[celli]; + scalar tauC = this->deltaTChem_[celli]; scalar dt = min(deltaT, tauC); scalar timeLeft = deltaT; @@ -620,15 +717,15 @@ Foam::scalar Foam::chemistryModel::solve(const scalar t0, const scalar deltaT) // update the temperature cTot = sum(c); - reactionThermo mixture(0.0*specieThermo_[0]); - for(label i=0; i<Ns_; i++) + ThermoType mixture(0.0*specieThermo_[0]); + for (label i=0; i<nSpecie_; i++) { mixture += (c[i]/cTot)*specieThermo_[i]; } Ti = mixture.TH(hi, Ti); timeLeft -= dt; - deltaTChem_[celli] = tauC; + this->deltaTChem_[celli] = tauC; dt = min(timeLeft, tauC); dt = max(dt, SMALL); } @@ -636,13 +733,13 @@ Foam::scalar Foam::chemistryModel::solve(const scalar t0, const scalar deltaT) dc = c - c0; scalar WTot = 0.0; - for(label i=0; i<Ns_; i++) + for (label i=0; i<nSpecie_; i++) { WTot += c[i]*specieThermo_[i].W(); } WTot /= cTot; - for(label i=0; i<Ns_; i++) + for (label i=0; i<nSpecie_; i++) { RR_[i][celli] = dc[i]*specieThermo_[i].W()/deltaT; } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H new file mode 100644 index 0000000000000000000000000000000000000000..ac8c10e086fcb6a8eebbc8ad39701c28c6438477 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.H @@ -0,0 +1,227 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 + +Class + Foam::ODEChemistryModel + +Description + Extends base chemistry model by adding a thermo package, and ODE functions. + Introduces chemistry equation system and evaluation of chemical source + terms. + +SourceFiles + ODEChemistryModelI.H + ODEChemistryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ODEChemistryModel_H +#define ODEChemistryModel_H + +#include "hCombustionThermo.H" +#include "Reaction.H" +#include "ODE.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template<class CompType, class ThermoType> +class chemistrySolver; + +/*---------------------------------------------------------------------------*\ + Class ODEChemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class CompType, class ThermoType> +class ODEChemistryModel +: + public CompType, + public ODE +{ + // Private Member Functions + + //- Disallow default bitwise assignment + void operator=(const ODEChemistryModel&); + + +protected: + + // Private data + + //- Reference to the field of specie mass fractions + PtrList<volScalarField>& Y_; + + //- Reactions + const PtrList<Reaction<ThermoType> >& reactions_; + + //- Thermodynamic data of the species + const PtrList<ThermoType>& specieThermo_; + + //- Number of species + label nSpecie_; + + //- Number of reactions + label nReaction_; + + //- Chemistry solver + autoPtr<chemistrySolver<CompType, ThermoType> > solver_; + + //- Chemical source term + PtrList<scalarField> RR_; + + + // Protected Member Functions + + //- Write access to chemical source terms + // (e.g. for multi-chemistry model) + inline PtrList<scalarField>& RR(); + + +public: + + //- Runtime type information + TypeName("ODEChemistryModel"); + + + // Constructors + + //- Construct from components + ODEChemistryModel + ( + const fvMesh& mesh, + const word& compTypeName, + const word& thermoTypeName + ); + + + //- Destructor + virtual ~ODEChemistryModel(); + + + // Member Functions + + //- The reactions + inline const PtrList<Reaction<ThermoType> >& reactions() const; + + //- Thermodynamic data of the species + inline const PtrList<ThermoType>& specieThermo() const; + + //- The number of species + inline label nSpecie() const; + + //- The number of reactions + inline label nReaction() const; + + //- Return the chemisty solver + inline const chemistrySolver<CompType, ThermoType>& solver() const; + + //- dc/dt = omega, rate of change in concentration, for each species + virtual scalarField omega + ( + const scalarField& c, + const scalar T, + const scalar p + ) const; + + //- Return the reaction rate for reaction r and the reference + // species and charateristic times + virtual scalar omega + ( + const Reaction<ThermoType>& r, + const scalarField& c, + const scalar T, + const scalar p, + scalar& pf, + scalar& cf, + label& lRef, + scalar& pr, + scalar& cr, + label& rRef + ) const; + + //- Calculates the reaction rates + virtual void calculate(); + + + // Chemistry model functions (overriding abstract functions in + // chemistryModel.H) + + //- Return const access to the chemical source terms + inline tmp<volScalarField> RR(const label i) const; + + //- Solve the reaction system for the given start time and time + // step and return the characteristic time + virtual scalar solve(const scalar t0, const scalar deltaT); + + //- Return the chemical time scale + virtual tmp<volScalarField> tc() const; + + //- Return the heat release + virtual tmp<volScalarField> dQ() const; + + + // ODE functions (overriding abstract functions in ODE.H) + + //- Number of ODE's to solve + virtual label nEqns() const; + + virtual void derivatives + ( + const scalar t, + const scalarField& c, + scalarField& dcdt + ) const; + + virtual void jacobian + ( + const scalar t, + const scalarField& c, + scalarField& dcdt, + scalarSquareMatrix& dfdc + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "ODEChemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ODEChemistryModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H similarity index 56% rename from src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModelI.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.H index cec949f5cb7529fd686cc8137a8931cd4c1b08db..b5264a28d43c2c9dd88ac18610ce0b14ae918cfa 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModelI.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModelI.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) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,57 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::tmp<Foam::volScalarField> Foam::chemistryModel::RR +template<class CompType, class ThermoType> +inline Foam::PtrList<Foam::scalarField>& +Foam::ODEChemistryModel<CompType, ThermoType>::RR() +{ + return RR_; +} + + +template<class CompType, class ThermoType> +inline const Foam::PtrList<Foam::Reaction<ThermoType> >& +Foam::ODEChemistryModel<CompType, ThermoType>::reactions() const +{ + return reactions_; +} + + +template<class CompType, class ThermoType> +inline const Foam::PtrList<ThermoType>& +Foam::ODEChemistryModel<CompType, ThermoType>::specieThermo() const +{ + return specieThermo_; +} + + +template<class CompType, class ThermoType> +inline Foam::label +Foam::ODEChemistryModel<CompType, ThermoType>::nSpecie() const +{ + return nSpecie_; +} + + +template<class CompType, class ThermoType> +inline Foam::label +Foam::ODEChemistryModel<CompType, ThermoType>::nReaction() const +{ + return nReaction_; +} + + +template<class CompType, class ThermoType> +inline const Foam::chemistrySolver<CompType, ThermoType>& +Foam::ODEChemistryModel<CompType, ThermoType>::solver() const +{ + return solver_; +} + + +template<class CompType, class ThermoType> +inline Foam::tmp<Foam::volScalarField> +Foam::ODEChemistryModel<CompType, ThermoType>::RR ( const label i ) const @@ -39,19 +89,19 @@ inline Foam::tmp<Foam::volScalarField> Foam::chemistryModel::RR ( IOobject ( - "RR(" + Y_[i].name() + ')', - rho_.time().timeName(), - rho_.db(), + "RR(" + this->Y_[i].name() + ')', + this->time().timeName(), + this->mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), - rho_.mesh(), + this->mesh(), dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0), zeroGradientFvPatchScalarField::typeName ) ); - if (chemistry_) + if (this->chemistry_) { tRR().internalField() = RR_[i]; tRR().correctBoundaryConditions(); diff --git a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.C b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C similarity index 61% rename from src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C index 4b94788812116369124865291873fe467239e525..e7bd4f1e35970f5f92b88dffcd9e85ba9dd046ec 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,47 +24,46 @@ License \*---------------------------------------------------------------------------*/ -#include "BasicTrackedReactingCloud.H" +#include "basicChemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(basicChemistryModel, 0); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class ThermoType> -Foam::BasicTrackedReactingCloud<ThermoType>::BasicTrackedReactingCloud -( - const word& cloudName, - const volScalarField& rho, - const volVectorField& U, - const dimensionedVector& g, - hCombustionThermo& thermo -) +Foam::basicChemistryModel::basicChemistryModel(const fvMesh& mesh) : - ReactingCloud<BasicTrackedReactingParcel<ThermoType> > + IOdictionary ( - cloudName, - rho, - U, - g, - thermo + IOobject + ( + "chemistryProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + mesh_(mesh), + chemistry_(lookup("chemistry")), + deltaTChem_ + ( + mesh.nCells(), + readScalar(lookup("initialChemicalTimeStep")) ) -{ - BasicTrackedReactingParcel<ThermoType>::readFields(*this); -} +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template<class ThermoType> -Foam::BasicTrackedReactingCloud<ThermoType>::~BasicTrackedReactingCloud() +Foam::basicChemistryModel::~basicChemistryModel() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class ThermoType> -void Foam::BasicTrackedReactingCloud<ThermoType>::writeFields() const -{ - BasicTrackedReactingParcel<ThermoType>::writeFields(*this); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H new file mode 100644 index 0000000000000000000000000000000000000000..c8fcdd9863e58ec43bc58046c845634c128fb864 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 + +Class + Foam::basicChemistryModel + +Description + Base class for chemistry models + +SourceFiles + basicChemistryModelI.H + basicChemistryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicChemistryModel_H +#define basicChemistryModel_H + +#include "IOdictionary.H" +#include "Switch.H" +#include "scalarField.H" +#include "volFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class fvMesh; + +/*---------------------------------------------------------------------------*\ + class basicChemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +class basicChemistryModel +: + public IOdictionary +{ + // Private Member Functions + + //- Construct as copy (not implemented) + basicChemistryModel(const basicChemistryModel&); + + //- Disallow default bitwise assignment + void operator=(const basicChemistryModel&); + + +protected: + + // Protected data + + //- Reference to the mesh database + const fvMesh& mesh_; + + //- Chemistry activation switch + Switch chemistry_; + + //- Latest estimation of integration step + scalarField deltaTChem_; + + + // Protected member functions + + //- Return non-const access to the latest estimation of integration + // step, e.g. for multi-chemistry model + scalarField& deltaTChem(); + + +public: + + //- Runtime type information + TypeName("basicChemistryModel"); + + + // Constructors + + //- Construct from mesh + basicChemistryModel(const fvMesh& mesh); + + + //- Destructor + virtual ~basicChemistryModel(); + + + // Member Functions + + //- Return const access to the mesh database + inline const fvMesh& mesh() const; + + //- Chemistry activation switch + inline Switch chemistry() const; + + //- Return the latest estimation of integration step + inline const scalarField& deltaTChem() const; + + + // Functions to be derived in derived classes + + // Fields + + //- Return const access to chemical source terms + virtual tmp<volScalarField> RR(const label i) const = 0; + + + // Chemistry solution + + //- Solve the reaction system for the given start time and + // timestep and return the characteristic time + virtual scalar solve(const scalar t0, const scalar deltaT) = 0; + + //- Return the chemical time scale + virtual tmp<volScalarField> tc() const = 0; + + //- Return the heat release + virtual tmp<volScalarField> dQ() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "basicChemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H new file mode 100644 index 0000000000000000000000000000000000000000..214d17bac1c9a7f6ae263744abd19a732c881f11 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModelI.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::fvMesh& Foam::basicChemistryModel::mesh() const +{ + return mesh_; +} + + +inline Foam::Switch Foam::basicChemistryModel::chemistry() const +{ + return chemistry_; +} + + +inline const Foam::scalarField& Foam::basicChemistryModel::deltaTChem() const +{ + return deltaTChem_; +} + + +inline Foam::scalarField& Foam::basicChemistryModel::deltaTChem() +{ + return deltaTChem_; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H new file mode 100644 index 0000000000000000000000000000000000000000..d0b893629e18416c4c925206290950b5b71cf688 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/makeChemistryModel.H @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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::psiChemistryModel + +Description + Macros for instantiating chemistry models based on compressibility and + transport types + +\*---------------------------------------------------------------------------*/ + +#ifndef makeChemistryModel_H +#define makeChemistryModel_H + +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeChemistryModel(SS, Comp, Thermo) \ + \ +typedef SS<Comp, Thermo> SS##Comp##Thermo; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + SS##Comp##Thermo, \ + #SS"<"#Comp","#Thermo">", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + Comp, \ + SS##Comp##Thermo, \ + fvMesh \ +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H deleted file mode 100644 index a194b31ac9ff01ed112fdfe23bebb8f536b88854..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel.H +++ /dev/null @@ -1,281 +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 - -Class - Foam::chemistryModel - -Description - Foam::chemistryModel - -SourceFiles - chemistryModelI.H - chemistryModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef chemistryModel_H -#define chemistryModel_H - -#include "hCombustionThermo.H" -#include "reactingMixture.H" -#include "ODE.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -class chemistrySolver; - -/*---------------------------------------------------------------------------*\ - Class chemistryModel Declaration -\*---------------------------------------------------------------------------*/ - -class chemistryModel -: - public ODE -{ - -public: - - typedef reactingMixture::reaction reaction; - typedef reactingMixture::reactionThermo reactionThermo; - - -private: - - // Private data - - const hCombustionThermo& thermo_; - - PtrList<volScalarField>& Y_; - const volScalarField& rho_; - - IOdictionary chemistryProperties_; - - //- Do the chemistry or not. - Switch chemistry_; - - //- The reactions - const PtrList<reaction>& reactions_; - - //- thermodynamic data of the species - const PtrList<reactionThermo>& specieThermo_; - - //- The number of species - label Ns_; - - //- The number of reactions - label Nr_; - - //- chemistry solver - autoPtr<chemistrySolver> solver_; - - //- the chemical source term - PtrList<scalarField> RR_; - - //- Latest estimation of integration step - scalarField deltaTChem_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator=(const chemistryModel&); - -protected: - - // Protected Member Functions - - //- Write access to chemical source terms - // (eg, for multi-chemistry model) - PtrList<scalarField>& RR() - { - return RR_; - } - - //- Return the latest estimation of integration step - // (eg, for multi-chemistry model) - scalarField& deltaTChem() - { - return deltaTChem_; - } - -public: - - // Constructors - - //- Construct from components - chemistryModel - ( - hCombustionThermo& thermo, - const volScalarField& rho - ); - - - // Destructor - - virtual ~chemistryModel(); - - - // Member Functions - - //- Return the thermodynamics model - const hCombustionThermo& thermo() const - { - return thermo_; - } - - //- Access the fractions of the species - const PtrList<volScalarField>& Y() const - { - return Y_; - } - - //- Access the density field - const volScalarField& rho() const - { - return rho_; - } - - //- Return the chemistry properties - inline const IOdictionary& chemistryProperties() const - { - return chemistryProperties_; - } - - //- Do the chemistry or not. - inline Switch chemistry() const - { - return chemistry_; - } - - inline const PtrList<reaction>& reactions() const - { - return reactions_; - } - - inline const PtrList<reactionThermo>& specieThermo() const - { - return specieThermo_; - } - - //- The number of species - inline label Ns() const - { - return Ns_; - } - - //- The number of reactions - inline label Nr() const - { - return Nr_; - } - - // Return the chemisty solver - inline const chemistrySolver& solver() const - { - return solver_; - } - - //- Return the chemical source terms - inline tmp<volScalarField> RR(const label i) const; - - //- Return the latest estimation of integration step - const scalarField& deltaTChem() const - { - return deltaTChem_; - } - - //- The chemical time scale - tmp<volScalarField> tc() const; - - //- dc/dt = omega, rate of change in concentration, for each species - scalarField omega - ( - const scalarField& c, - const scalar T, - const scalar p - ) const; - - //- return the reaction rate for reaction r and the reference - // species and charateristic times - scalar omega - ( - const reaction& r, - const scalarField& c, - const scalar T, - const scalar p, - scalar& pf, - scalar& cf, - label& lRef, - scalar& pr, - scalar& cr, - label& rRef - ) const; - - //- The number of ODE to solve - label nEqns() const; - - void derivatives - ( - const scalar t, - const scalarField& c, - scalarField& dcdt - ) const; - - void jacobian - ( - const scalar t, - const scalarField& c, - scalarField& dcdt, - scalarSquareMatrix& dfdc - ) const; - - //- Calculates the reaction rates - void calculate(); - - //- Solve the reaction system for the given start time and time-step - // and return the characteristic time - scalar solve - ( - const scalar t0, - const scalar deltaT - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "chemistryModelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C new file mode 100644 index 0000000000000000000000000000000000000000..6a5606d0e73f13bdc636512e8e5217d95a5f5f8e --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/newPsiChemistryModel.C @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "psiChemistryModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::psiChemistryModel> Foam::psiChemistryModel::New +( + const fvMesh& mesh +) +{ + word psiChemistryModelType; + word thermoTypeName; + word userModel; + + // Enclose the creation of the chemistrtyProperties to ensure it is + // deleted before the chemistrtyProperties is created otherwise the + // dictionary is entered in the database twice + { + IOdictionary chemistryPropertiesDict + ( + IOobject + ( + "chemistryProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + chemistryPropertiesDict.lookup("psiChemistryModel") >> userModel; + + // construct chemistry model type name by inserting first template + // argument + label tempOpen = userModel.find('<'); + label tempClose = userModel.find('>'); + + word className = userModel(0, tempOpen); + thermoTypeName = userModel(tempOpen + 1, tempClose - tempOpen - 1); + + psiChemistryModelType = + className + '<' + typeName + ',' + thermoTypeName + '>'; + } + + if (debug) + { + Info<< "Selecting psiChemistryModel " << psiChemistryModelType << endl; + } + else + { + Info<< "Selecting psiChemistryModel " << userModel << endl; + } + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(psiChemistryModelType); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + if (debug) + { + FatalErrorIn("psiChemistryModelBase::New(const mesh&)") + << "Unknown psiChemistryModel type " << psiChemistryModelType + << nl << nl << "Valid psiChemistryModel types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); + } + else + { + wordList models = fvMeshConstructorTablePtr_->toc(); + forAll(models, i) + { + models[i] = models[i].replace(typeName + ',', ""); + } + + FatalErrorIn("psiChemistryModelBase::New(const mesh&)") + << "Unknown psiChemistryModel type " << userModel + << nl << nl << "Valid psiChemistryModel types are:" << nl + << models << nl << exit(FatalError); + } + } + + return autoPtr<psiChemistryModel> + (cstrIter()(mesh, typeName, thermoTypeName)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C new file mode 100644 index 0000000000000000000000000000000000000000..7381d12a1df87d1a9aebe58a622c990173eb98ef --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "psiChemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(psiChemistryModel, 0); + defineRunTimeSelectionTable(psiChemistryModel, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::psiChemistryModel::psiChemistryModel +( + const fvMesh& mesh, + const word& thermoTypeName +) +: + basicChemistryModel(mesh), + thermo_(hCombustionThermo::NewType(mesh, thermoTypeName)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::psiChemistryModel::~psiChemistryModel() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H new file mode 100644 index 0000000000000000000000000000000000000000..4cf7af58ec89920d63395302ee0d84feb72df17c --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModel.H @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 + +Class + Foam::psiChemistryModel + +Description + Chemistry model for compressibility-based thermodynamics + +SourceFiles + psiChemistryModelI.H + psiChemistryModel.C + newChemistryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef psiChemistryModel_H +#define psiChemistryModel_H + +#include "basicChemistryModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "hCombustionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class fvMesh; + +/*---------------------------------------------------------------------------*\ + class psiChemistryModel Declaration +\*---------------------------------------------------------------------------*/ + +class psiChemistryModel +: + public basicChemistryModel +{ + // Private Member Functions + + //- Construct as copy (not implemented) + psiChemistryModel(const psiChemistryModel&); + + //- Disallow default bitwise assignment + void operator=(const psiChemistryModel&); + + +protected: + + // Protected data + + //- Thermo package + autoPtr<hCombustionThermo> thermo_; + + +public: + + //- Runtime type information + TypeName("psiChemistryModel"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + psiChemistryModel, + fvMesh, + ( + const fvMesh& mesh, + const word& compTypeName, + const word& thermoTypeName + ), + (mesh, compTypeName, thermoTypeName) + ); + + + // Constructors + + //- Construct from mesh + psiChemistryModel(const fvMesh& mesh, const word& thermoTypeName); + + + //- Selector + static autoPtr<psiChemistryModel> New(const fvMesh& mesh); + + + //- Destructor + virtual ~psiChemistryModel(); + + + // Member Functions + + //- Return access to the thermo package + inline hCombustionThermo& thermo(); + + //- Return const access to the thermo package + inline const hCombustionThermo& thermo() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "psiChemistryModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H similarity index 79% rename from src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H index 5c946ca09cb63f6391327416104bc11f4cb3406b..a6122b8b6840fbcf94afb92a5b99227000719d01 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,15 +24,18 @@ License \*---------------------------------------------------------------------------*/ -#include "createReactingCloudTypes.H" -#include "BasicTrackedReactingCloud.H" +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() +{ + return thermo_(); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +inline const Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() const { - createReactingCloudType(BasicTrackedReactingCloud); -}; + return thermo_(); +} // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C new file mode 100644 index 0000000000000000000000000000000000000000..819156ee51b852829e078fabab1c29dd1491ad3f --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModels.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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::psiChemistryModel + +Description + Creates chemistry model instances templated on the type of thermodynamics + +\*---------------------------------------------------------------------------*/ + +#include "makeChemistryModel.H" + +#include "psiChemistryModel.H" +#include "ODEChemistryModel.H" +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + gasThermoPhysics + ); + makeChemistryModel + ( + ODEChemistryModel, + psiChemistryModel, + icoPoly8ThermoPhysics + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C new file mode 100644 index 0000000000000000000000000000000000000000..c59a607f872dd92a5f569b245b95e22cfd34a2cb --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/newRhoChemistryModel.C @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "rhoChemistryModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::rhoChemistryModel> Foam::rhoChemistryModel::New +( + const fvMesh& mesh +) +{ + word rhoChemistryModelType; + word thermoTypeName; + word userModel; + + // Enclose the creation of the chemistrtyProperties to ensure it is + // deleted before the chemistrtyProperties is created otherwise the + // dictionary is entered in the database twice + { + IOdictionary chemistryPropertiesDict + ( + IOobject + ( + "chemistryProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + chemistryPropertiesDict.lookup("rhoChemistryModel") >> userModel; + + // construct chemistry model type name by inserting first template + // argument + label tempOpen = userModel.find('<'); + label tempClose = userModel.find('>'); + + word className = userModel(0, tempOpen); + thermoTypeName = userModel(tempOpen + 1, tempClose - tempOpen - 1); + + rhoChemistryModelType = + className + '<' + typeName + ',' + thermoTypeName + '>'; + } + + if (debug) + { + Info<< "Selecting rhoChemistryModel " << rhoChemistryModelType << endl; + } + else + { + Info<< "Selecting rhoChemistryModel " << userModel << endl; + } + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(rhoChemistryModelType); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + if (debug) + { + FatalErrorIn("rhoChemistryModelBase::New(const mesh&)") + << "Unknown rhoChemistryModel type " << rhoChemistryModelType + << nl << nl << "Valid rhoChemistryModel types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl << exit(FatalError); + } + else + { + wordList models = fvMeshConstructorTablePtr_->toc(); + forAll(models, i) + { + models[i] = models[i].replace(typeName + ',', ""); + } + + FatalErrorIn("rhoChemistryModelBase::New(const mesh&)") + << "Unknown rhoChemistryModel type " << userModel + << nl << nl << "Valid rhoChemistryModel types are:" << nl + << models << nl << exit(FatalError); + } + } + + return autoPtr<rhoChemistryModel> + (cstrIter()(mesh, typeName, thermoTypeName)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C new file mode 100644 index 0000000000000000000000000000000000000000..73a3f00e9cf8c4fc81e5532264566a9b5c0eadc5 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "rhoChemistryModel.H" +#include "fvMesh.H" +#include "Time.H" + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +namespace Foam +{ + defineTypeNameAndDebug(rhoChemistryModel, 0); + defineRunTimeSelectionTable(rhoChemistryModel, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::rhoChemistryModel::rhoChemistryModel +( + const fvMesh& mesh, + const word& thermoTypeName +) +: + basicChemistryModel(mesh), + thermo_(hReactionThermo::NewType(mesh, thermoTypeName)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::rhoChemistryModel::~rhoChemistryModel() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.H b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H similarity index 56% rename from src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H index 5c3cd8148f2654b2588fb4cd3282768268cdb8a5..43df6e0406ee2ed27d0de94b832bd399864648d5 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,21 +23,25 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::BasicTrackedReactingCloud + Foam::rhoChemistryModel Description - Tracked racting cloud templated on the type of carrier phase thermodynamics + Chemistry model for compressibility-based thermodynamics SourceFiles - BasicTrackedReactingCloud.C + rhoChemistryModelI.H + rhoChemistryModel.C + newChemistryModel.C \*---------------------------------------------------------------------------*/ -#ifndef BasicTrackedReactingCloud_H -#define BasicTrackedReactingCloud_H +#ifndef rhoChemistryModel_H +#define rhoChemistryModel_H -#include "ReactingCloud.H" -#include "BasicTrackedReactingParcel.H" +#include "basicChemistryModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "hReactionThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,54 +49,75 @@ namespace Foam { // Forward declaration of classes -template<class ThermoType> -class BasicTrackedReactingCloud; +class fvMesh; /*---------------------------------------------------------------------------*\ - Class BasicTrackedReactingCloud Declaration + class rhoChemistryModel Declaration \*---------------------------------------------------------------------------*/ -template<class ThermoType> -class BasicTrackedReactingCloud +class rhoChemistryModel : - public ReactingCloud<BasicTrackedReactingParcel<ThermoType> > + public basicChemistryModel { // Private Member Functions - //- Disallow default bitwise copy construct - BasicTrackedReactingCloud(const BasicTrackedReactingCloud&); + //- Construct as copy (not implemented) + rhoChemistryModel(const rhoChemistryModel&); //- Disallow default bitwise assignment - void operator=(const BasicTrackedReactingCloud&); + void operator=(const rhoChemistryModel&); + + +protected: + + // Protected data + + //- Thermo package + autoPtr<hReactionThermo> thermo_; public: //- Runtime type information - TypeName("BasicTrackedReactingCloud"); + TypeName("rhoChemistryModel"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + rhoChemistryModel, + fvMesh, + ( + const fvMesh& mesh, + const word& compTypeName, + const word& thermoTypeName + ), + (mesh, compTypeName, thermoTypeName) + ); // Constructors - //- Construct given carrier gas fields - BasicTrackedReactingCloud - ( - const word& cloudName, - const volScalarField& rho, - const volVectorField& U, - const dimensionedVector& g, - hCombustionThermo& thermo - ); + //- Construct from mesh + rhoChemistryModel(const fvMesh& mesh, const word& thermoTypeName); + + + //- Selector + static autoPtr<rhoChemistryModel> New(const fvMesh& mesh); //- Destructor - ~BasicTrackedReactingCloud(); + virtual ~rhoChemistryModel(); // Member Functions - //- Write fields - void writeFields() const; + //- Return access to the thermo package + inline hReactionThermo& thermo(); + + //- Return const access to the thermo package + inline const hReactionThermo& thermo() const; }; @@ -102,9 +127,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository - #include "BasicTrackedReactingCloud.C" -#endif +#include "rhoChemistryModelI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H similarity index 79% rename from src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H index 239ebccb3b451a6178984693820f21a66687fac1..d96171001b694bb6fdd721b835a358c52eaef13f 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,14 +24,17 @@ License \*---------------------------------------------------------------------------*/ -#include "createTrackedReactingParcelTypes.H" -#include "BasicTrackedReactingParcel.H" +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() +{ + return thermo_(); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +inline const Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() const { - createTrackedReactingParcelType(BasicTrackedReactingParcel); + return thermo_(); } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C new file mode 100644 index 0000000000000000000000000000000000000000..69d3f75a66756d97594cff0b7d5d9f1fe40147ed --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModels.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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::rhoChemistryModel + +Description + Creates chemistry model instances templated on the type of thermodynamics + +\*---------------------------------------------------------------------------*/ + +#include "makeChemistryModel.H" + +#include "rhoChemistryModel.H" +#include "ODEChemistryModel.H" +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + gasThermoPhysics + ); + makeChemistryModel + ( + ODEChemistryModel, + rhoChemistryModel, + icoPoly8ThermoPhysics + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C index 53398178a70d09c3e2022b38233ba4f2a798b5a6..95cfc763881b4ae68bb1e1db21e0402501299a55 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C @@ -28,30 +28,17 @@ License #include "addToRunTimeSelectionTable.H" #include "simpleMatrix.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(EulerImplicit, 0); - addToRunTimeSelectionTable - ( - chemistrySolver, - EulerImplicit, - dictionary - ); -}; - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::EulerImplicit::EulerImplicit +template<class CompType, class ThermoType> +Foam::EulerImplicit<CompType, ThermoType>::EulerImplicit ( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ) : - chemistrySolver(dict, chemistry), - coeffsDict_(dict.subDict(typeName + "Coeffs")), + chemistrySolver<CompType, ThermoType>(model, modelName), + coeffsDict_(model.subDict(modelName + "Coeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), equil_(coeffsDict_.lookup("equilibriumRateLimiter")) {} @@ -59,13 +46,15 @@ Foam::EulerImplicit::EulerImplicit // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::EulerImplicit::~EulerImplicit() +template<class CompType, class ThermoType> +Foam::EulerImplicit<CompType, ThermoType>::~EulerImplicit() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::EulerImplicit::solve +template<class CompType, class ThermoType> +Foam::scalar Foam::EulerImplicit<CompType, ThermoType>::solve ( scalarField &c, const scalar T, @@ -74,28 +63,27 @@ Foam::scalar Foam::EulerImplicit::solve const scalar dt ) const { - scalar pf, cf, pr, cr; label lRef, rRef; - label Ns = chemistry_.Ns(); - simpleMatrix<scalar> RR(Ns); - - for(label i=0; i<Ns; i++) + label nSpecie = this->model_.nSpecie(); + simpleMatrix<scalar> RR(nSpecie); + + for (label i=0; i<nSpecie; i++) { c[i] = max(0.0, c[i]); } - for(label i=0; i<Ns; i++) + for (label i=0; i<nSpecie; i++) { RR.source()[i] = c[i]/dt; } - for(label i=0; i<chemistry_.reactions().size(); i++) + for (label i=0; i<this->model_.reactions().size(); i++) { - const chemistryModel::reaction& R = chemistry_.reactions()[i]; + const Reaction<ThermoType>& R = this->model_.reactions()[i]; - scalar omegai = chemistry_.omega + scalar omegai = this->model_.omega ( R, c, T, p, pf, cf, lRef, pr, cr, rRef ); @@ -113,59 +101,59 @@ Foam::scalar Foam::EulerImplicit::solve } } - for(label s=0; s<R.lhs().size(); s++) + for (label s=0; s<R.lhs().size(); s++) { label si = R.lhs()[s].index; scalar sl = R.lhs()[s].stoichCoeff; RR[si][rRef] -= sl*pr*corr; RR[si][lRef] += sl*pf*corr; } - - for(label s=0; s<R.rhs().size(); s++) + + for (label s=0; s<R.rhs().size(); s++) { label si = R.rhs()[s].index; scalar sr = R.rhs()[s].stoichCoeff; RR[si][lRef] -= sr*pf*corr; RR[si][rRef] += sr*pr*corr; } - + } // end for(label i... - - for(label i=0; i<Ns; i++) + + for (label i=0; i<nSpecie; i++) { RR[i][i] += 1.0/dt; } c = RR.LUsolve(); - for(label i=0; i<Ns; i++) + for (label i=0; i<nSpecie; i++) { c[i] = max(0.0, c[i]); } // estimate the next time step scalar tMin = GREAT; - label n = chemistry_.nEqns(); - scalarField c1(n, 0.0); + label nEqns = this->model_.nEqns(); + scalarField c1(nEqns, 0.0); - for(label i=0; i<Ns; i++) + for (label i=0; i<nSpecie; i++) { c1[i] = c[i]; } - c1[Ns] = T; - c1[Ns+1] = p; + c1[nSpecie] = T; + c1[nSpecie+1] = p; + + scalarField dcdt(nEqns, 0.0); + this->model_.derivatives(0.0, c1, dcdt); - scalarField dcdt(n, 0.0); - chemistry_.derivatives(0.0, c1, dcdt); - scalar sumC = sum(c); - for(label i=0; i<Ns; i++) + for (label i=0; i<nSpecie; i++) { scalar d = dcdt[i]; if (d < -SMALL) { - tMin = min(tMin, -(c[i]+SMALL)/d); + tMin = min(tMin, -(c[i] + SMALL)/d); } else { @@ -173,10 +161,9 @@ Foam::scalar Foam::EulerImplicit::solve scalar cm = max(sumC - c[i], 1.0e-5); tMin = min(tMin, cm/d); } - } + } return cTauChem_*tMin; - } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H index b5d6eb5cc50c3e9f0132165774021ed35a0167d3..521a06e2768ddd4e10bb97ac3eac62271f3fe140 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.H @@ -43,20 +43,25 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template<class CompType, class ThermoType> +class EulerImplicit; + /*---------------------------------------------------------------------------*\ Class EulerImplicit Declaration \*---------------------------------------------------------------------------*/ +template<class CompType, class ThermoType> class EulerImplicit : - public chemistrySolver + public chemistrySolver<CompType, ThermoType> { // Private data dictionary coeffsDict_; - // model constants - + // Model constants + scalar cTauChem_; Switch equil_; @@ -72,14 +77,13 @@ public: //- Construct from components EulerImplicit ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ); - // Destructor - - ~EulerImplicit(); + //- Destructor + virtual ~EulerImplicit(); // Member Functions @@ -102,6 +106,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "EulerImplicit.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C index 4b3463f03e9c581e151f527d07427c66c7a9ca80..129bcabb00e470caeeb4837d379095459109f191 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.C @@ -29,29 +29,24 @@ License namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(chemistrySolver, 0); -defineRunTimeSelectionTable(chemistrySolver, dictionary); - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::chemistrySolver::chemistrySolver +template<class CompType, class ThermoType> +Foam::chemistrySolver<CompType, ThermoType>::chemistrySolver ( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ) : - dict_(dict), - chemistry_(chemistry) + model_(model), + name_(modelName) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::chemistrySolver::~chemistrySolver() +template<class CompType, class ThermoType> +Foam::chemistrySolver<CompType, ThermoType>::~chemistrySolver() {} diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H index 6a1a9f6ade3446122258694823c9375e20535b78..0a21a2755c2b2f79f25bc9fc7545d1ff0e64d3f6 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/chemistrySolver.H @@ -26,7 +26,7 @@ Class Foam::chemistrySolver Description - An abstract class for solving chemistry + An abstract base class for solving chemistry SourceFiles chemistrySolver.C @@ -36,7 +36,7 @@ SourceFiles #ifndef chemistrySolver_H #define chemistrySolver_H -#include "chemistryModel.H" +#include "ODEChemistryModel.H" #include "IOdictionary.H" #include "scalarField.H" #include "autoPtr.H" @@ -47,17 +47,26 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template<class CompType, class ThermoType> +class chemistrySolver; + /*---------------------------------------------------------------------------*\ - Class chemistrySolver Declaration + Class chemistrySolver Declaration \*---------------------------------------------------------------------------*/ +template<class CompType, class ThermoType> class chemistrySolver { - protected: - const dictionary& dict_; - chemistryModel& chemistry_; + // Protected data + + //- Reference to the chemistry model + ODEChemistryModel<CompType, ThermoType>& model_; + + //- Name of the chemistry solver + const word name_; public: @@ -73,10 +82,10 @@ public: chemistrySolver, dictionary, ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ), - (dict, chemistry) + (model, modelName) ); @@ -85,23 +94,22 @@ public: //- Construct from components chemistrySolver ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ); - // Selectors - - static autoPtr<chemistrySolver> New - ( - const dictionary& dict, - chemistryModel& chemistry - ); - + //- Selector + static autoPtr<chemistrySolver> New + ( + ODEChemistryModel<CompType, ThermoType>& model, + const word& compTypeName, + const word& thermoTypeName + ); - // Destructor - virtual ~chemistrySolver(); + //- Destructor + virtual ~chemistrySolver(); // Member Functions @@ -124,6 +132,50 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#define makeChemistrySolver(Comp, Thermo) \ + \ + typedef chemistrySolver<Comp, Thermo> \ + chemistrySolver##Comp##Thermo; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + chemistrySolver##Comp##Thermo, \ + "chemistryModel<"#Comp","#Thermo">", \ + 0 \ + ); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + chemistrySolver##Comp##Thermo, \ + dictionary \ + ); + + +#define makeChemistrySolverType(SS, Comp, Thermo) \ + \ + typedef SS<Comp, Thermo> SS##Comp##Thermo; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + SS##Comp##Thermo, \ + #SS"<"#Comp","#Thermo">", \ + 0 \ + ); \ + \ + chemistrySolver<Comp, Thermo>:: \ + adddictionaryConstructorToTable<SS<Comp, Thermo> > \ + add##SS##Comp##Thermo##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "chemistrySolver.C" +# include "newChemistrySolver.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C new file mode 100644 index 0000000000000000000000000000000000000000..b371931f5fd55b7b817873f27a30ea34533f57a6 --- /dev/null +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/makeChemistrySolvers.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "thermoPhysicsTypes.H" +#include "chemistrySolver.H" + +#include "psiChemistryModel.H" +#include "rhoChemistryModel.H" + +#include "EulerImplicit.H" +#include "ode.H" +#include "sequential.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeChemistrySolver(psiChemistryModel, gasThermoPhysics) + makeChemistrySolverType(EulerImplicit, psiChemistryModel, gasThermoPhysics) + makeChemistrySolverType(ode, psiChemistryModel, gasThermoPhysics) + makeChemistrySolverType(sequential, psiChemistryModel, gasThermoPhysics) + + makeChemistrySolver(psiChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + EulerImplicit, + psiChemistryModel, + icoPoly8ThermoPhysics + ) + makeChemistrySolverType(ode, psiChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + sequential, + psiChemistryModel, + icoPoly8ThermoPhysics + ) + + makeChemistrySolver(rhoChemistryModel, gasThermoPhysics) + makeChemistrySolverType(EulerImplicit, rhoChemistryModel, gasThermoPhysics) + makeChemistrySolverType(ode, rhoChemistryModel, gasThermoPhysics) + makeChemistrySolverType(sequential, rhoChemistryModel, gasThermoPhysics) + + makeChemistrySolver(rhoChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + EulerImplicit, + rhoChemistryModel, + icoPoly8ThermoPhysics + ) + makeChemistrySolverType(ode, rhoChemistryModel, icoPoly8ThermoPhysics) + makeChemistrySolverType + ( + sequential, + rhoChemistryModel, + icoPoly8ThermoPhysics + ) +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C index 37869dcf30b4c3c10a77e55be795fc19df296614..b0baa00fbe9068c1c61e487296a66fe88871c45c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/chemistrySolver/newChemistrySolver.C @@ -26,33 +26,54 @@ License #include "chemistrySolver.H" - // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::chemistrySolver> Foam::chemistrySolver::New +template<class CompType, class ThermoType> +Foam::autoPtr<Foam::chemistrySolver<CompType, ThermoType> > +Foam::chemistrySolver<CompType, ThermoType>::New ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& compTypeName, + const word& thermoTypeName ) { - word chemistrySolverType(dict.lookup("chemistrySolver")); + word modelName(model.lookup("chemistrySolver")); + + word chemistrySolverType = + modelName + '<' + compTypeName + ',' + thermoTypeName + '>'; - dictionaryConstructorTable::iterator cstrIter = + Info<< "Selecting chemistrySolver " << modelName << endl; + + typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(chemistrySolverType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { + wordList models = dictionaryConstructorTablePtr_->toc(); + forAll(models, i) + { + models[i] = models[i].replace + ( + '<' + compTypeName + ',' + thermoTypeName + '>', + "" + ); + } + FatalErrorIn ( - "chemistrySolver::New(const dictionary&, const chemistryModel&)" - ) << "Unknown chemistrySolverType type " << chemistrySolverType - << endl << endl - << "Valid chemistrySolverType types are :" << endl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); + "chemistrySolver::New" + "(" + "const ODEChemistryModel&, " + "const word&, " + "const word&" + ")" + ) << "Unknown chemistrySolver type " << modelName + << nl << nl << "Valid chemistrySolver types are:" << nl + << models << nl << exit(FatalError); } - return autoPtr<chemistrySolver>(cstrIter()(dict, chemistry)); + return autoPtr<chemistrySolver<CompType, ThermoType> > + (cstrIter()(model, modelName)); } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C index dcc05caaf182e23dec6879d67846a3d91d838adc..7a4bde923f7610abde7a598c8d1d97d09e114a39 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.C @@ -25,36 +25,21 @@ License \*---------------------------------------------------------------------------*/ #include "ode.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(ode, 0); - addToRunTimeSelectionTable - ( - chemistrySolver, - ode, - dictionary - ); -} - +#include "ODEChemistryModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::ode::ode +template<class CompType, class ThermoType> +Foam::ode<CompType, ThermoType>::ode ( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ) : - chemistrySolver(dict, chemistry), - chemistry_(chemistry), - coeffsDict_(dict.subDict(typeName + "Coeffs")), + chemistrySolver<CompType, ThermoType>(model, modelName), + coeffsDict_(model.subDict(modelName + "Coeffs")), solverName_(coeffsDict_.lookup("ODESolver")), - odeSolver_(ODESolver::New(solverName_, chemistry)), + odeSolver_(ODESolver::New(solverName_, model)), eps_(readScalar(coeffsDict_.lookup("eps"))), scale_(readScalar(coeffsDict_.lookup("scale"))) {} @@ -62,14 +47,15 @@ Foam::ode::ode // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::ode::~ode() +template<class CompType, class ThermoType> +Foam::ode<CompType, ThermoType>::~ode() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::ode::solve +template<class CompType, class ThermoType> +Foam::scalar Foam::ode<CompType, ThermoType>::solve ( scalarField& c, const scalar T, @@ -78,22 +64,22 @@ Foam::scalar Foam::ode::solve const scalar dt ) const { - label Ns = chemistry_.Ns(); - scalarField c1(chemistry_.nEqns(), 0.0); + label nSpecie = this->model_.nSpecie(); + scalarField c1(this->model_.nEqns(), 0.0); // copy the concentration, T and P to the total solve-vector - for(label i=0; i<Ns; i++) + for (label i=0; i<nSpecie; i++) { c1[i] = c[i]; } - c1[Ns] = T; - c1[Ns+1] = p; + c1[nSpecie] = T; + c1[nSpecie+1] = p; scalar dtEst = dt; odeSolver_->solve ( - chemistry_, + this->model_, t0, t0 + dt, c1, @@ -101,7 +87,7 @@ Foam::scalar Foam::ode::solve dtEst ); - for(label i=0; i<c.size(); i++) + for (label i=0; i<c.size(); i++) { c[i] = max(0.0, c1[i]); } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H index 4c0cf1d007339cc2b9449fea5ace9d6b4e237477..faac5ca2ad2826a51967d4b7c2dfe18077c14183 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/ode/ode.H @@ -44,24 +44,27 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template<class CompType, class ThermoType> +class ode; + /*---------------------------------------------------------------------------*\ - Class ode Declaration + Class ode Declaration \*---------------------------------------------------------------------------*/ +template<class CompType, class ThermoType> class ode : - public chemistrySolver + public chemistrySolver<CompType, ThermoType> { // Private data - chemistryModel& chemistry_; - dictionary coeffsDict_; const word solverName_; autoPtr<ODESolver> odeSolver_; - // model constants - + // Model constants + scalar eps_; scalar scale_; @@ -77,14 +80,13 @@ public: //- Construct from components ode ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ); - // Destructor - - ~ode(); + //- Destructor + virtual ~ode(); // Member Functions @@ -106,6 +108,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "ode.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C index 1837f533db343fa6b7d6d5286797a96713678830..d929c5aea2e12a3d426441418db6319ffead318c 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.C @@ -27,31 +27,17 @@ License #include "sequential.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(sequential, 0); - addToRunTimeSelectionTable - ( - chemistrySolver, - sequential, - dictionary - ); -}; - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components -Foam::sequential::sequential +template<class CompType, class ThermoType> +Foam::sequential<CompType, ThermoType>::sequential ( - const Foam::dictionary& dict, - Foam::chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ) : - chemistrySolver(dict, chemistry), - coeffsDict_(dict.subDict(typeName + "Coeffs")), + chemistrySolver<CompType, ThermoType>(model, modelName), + coeffsDict_(model.subDict(modelName + "Coeffs")), cTauChem_(readScalar(coeffsDict_.lookup("cTauChem"))), equil_(coeffsDict_.lookup("equilibriumRateLimiter")) {} @@ -59,13 +45,15 @@ Foam::sequential::sequential // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::sequential::~sequential() +template<class CompType, class ThermoType> +Foam::sequential<CompType, ThermoType>::~sequential() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::scalar Foam::sequential::solve +template<class CompType, class ThermoType> +Foam::scalar Foam::sequential<CompType, ThermoType>::solve ( scalarField &c, const scalar T, @@ -79,11 +67,11 @@ Foam::scalar Foam::sequential::solve scalar pf, cf, pb, cb; label lRef, rRef; - for(label i=0; i<chemistry_.reactions().size(); i++) + for (label i=0; i<this->model_.reactions().size(); i++) { - const chemistryModel::reaction& R = chemistry_.reactions()[i]; + const Reaction<ThermoType>& R = this->model_.reactions()[i]; - scalar om0 = chemistry_.omega + scalar om0 = this->model_.omega ( R, c, T, p, pf, cf, lRef, pb, cb, rRef ); @@ -108,23 +96,23 @@ Foam::scalar Foam::sequential::solve // update species - for(label s=0; s<R.lhs().size(); s++) + for (label s=0; s<R.lhs().size(); s++) { label si = R.lhs()[s].index; scalar sl = R.lhs()[s].stoichCoeff; c[si] -= dt*sl*omeg; c[si] = max(0.0, c[si]); - } + } - for(label s=0; s<R.rhs().size(); s++) + for (label s=0; s<R.rhs().size(); s++) { label si = R.rhs()[s].index; scalar sr = R.rhs()[s].stoichCoeff; c[si] += dt*sr*omeg; c[si] = max(0.0, c[si]); - } + } - } // end for(label i... + } // end for (label i... return cTauChem_/tChemInv; } diff --git a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H index e128b900d92a4ecbf93cd8164377265cdb7e1037..c72692a40faaf68e29885d714a99cc2657952bbc 100644 --- a/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H +++ b/src/thermophysicalModels/chemistryModel/chemistrySolver/sequential/sequential.H @@ -45,19 +45,24 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template<class CompType, class ThermoType> +class sequential; + /*---------------------------------------------------------------------------*\ - Class sequential Declaration + Class sequential Declaration \*---------------------------------------------------------------------------*/ +template<class CompType, class ThermoType> class sequential : - public chemistrySolver + public chemistrySolver<CompType, ThermoType> { // Private data dictionary coeffsDict_; - // model constants + // Model constants scalar cTauChem_; Switch equil_; @@ -75,14 +80,13 @@ public: //- Construct from components sequential ( - const dictionary& dict, - chemistryModel& chemistry + ODEChemistryModel<CompType, ThermoType>& model, + const word& modelName ); - // Destructor - - ~sequential(); + //- Destructor + virtual ~sequential(); // Member Functions @@ -105,6 +109,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "sequential.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/Make/files b/src/thermophysicalModels/combustion/Make/files deleted file mode 100644 index 70e985783d90225deba8fb5cf844354112e82e48..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/combustion/Make/files +++ /dev/null @@ -1,33 +0,0 @@ -hCombustionThermo = hCombustionThermo -hhuCombustionThermo = hhuCombustionThermo -hThermo = hThermo - -chemistryReader = chemistryReaders/chemistryReader -foamChemistryReader = chemistryReaders/foamChemistryReader -chemkinReader = chemistryReaders/chemkinReader - -mixtures = mixtureThermos/mixtures -combustionMixture = $(mixtures)/combustionMixture -reactingMixture = $(mixtures)/reactingMixture - -$(chemistryReader)/chemistryReader.C -$(foamChemistryReader)/foamChemistryReader.C -$(chemkinReader)/chemkinReader.C -$(chemkinReader)/chemkinLexer.L - -$(combustionMixture)/combustionMixture.C -$(reactingMixture)/reactingMixture.C - -$(hCombustionThermo)/hCombustionThermo.C -$(hCombustionThermo)/newhCombustionThermo.C -$(hCombustionThermo)/hCombustionThermos.C - -$(hhuCombustionThermo)/hhuCombustionThermo.C -$(hhuCombustionThermo)/newhhuCombustionThermo.C -$(hhuCombustionThermo)/hhuCombustionThermos.C - -derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C -derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C -derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C - -LIB = $(FOAM_LIBBIN)/libcombustionThermophysicalModels diff --git a/src/thermophysicalModels/laminarFlameSpeed/Make/options b/src/thermophysicalModels/laminarFlameSpeed/Make/options index d3f9e6993df72cb8197451476c7ece3f24750e4d..fe682dababbceea0e6ce13b0400a55e8bfb59bae 100644 --- a/src/thermophysicalModels/laminarFlameSpeed/Make/options +++ b/src/thermophysicalModels/laminarFlameSpeed/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/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 LIB_LIBS = \ -lfiniteVolume diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index 567eff9dafc283e9f8d44f86aee7fd4d19bb0de8..80c3c2dc694839322ceaf2cfa40b1df6929fe6be 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H index 005fe768652354f712917046ac6cdc302a0aeec5..cad873ab725423ad055a576793f9c4149a356dc6 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index b3669bd6fa45708e430c6cea388bf13254f1c8a3..08dbb061ed6e9c8b63b9032c0b7e33ce8e6ee277 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 9d170131b273ef0843fa59f291551c92b66b5662..60ba567ba33882f6eb5b66fc843617c62e418982 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/include/createRadiationModel.H b/src/thermophysicalModels/radiation/include/createRadiationModel.H index babe3c4dbe103dfafed9d392eebf0ea11d51ea4d..d61082c36fdc563e400e4f47bb6ee0050597bc2c 100644 --- a/src/thermophysicalModels/radiation/include/createRadiationModel.H +++ b/src/thermophysicalModels/radiation/include/createRadiationModel.H @@ -1,5 +1,5 @@ Info<< "Creating radiation model\n" << endl; autoPtr<radiation::radiationModel> radiation ( - radiation::radiationModel::New(thermo->T()) + radiation::radiationModel::New(thermo.T()) ); diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C index 3452797b3eb23f61faf17dc2d07f56be7cf7f820..eeec89cef8fc178dfe5cec174c300a3a159976a9 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H index 1a79e310b908f435d1c23ea41fd2a8355d46bc15..685d1052195db864aec04aec74b26a7c0f17dcce 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffs.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H index c7759db4772a908cbc4f7b8ce8640436f5c8125b..9ae17155cd41aee4d1b6ebe11442fbae14726922 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/absorptionCoeffs/absorptionCoeffsI.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C index dee5647366936e75e202bf93426e042bd8f49ea2..bc21f3bfe0bfc027479aef047315895b4db061c4 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H index 01719e50764880cb8d436034a8ffba5366f706c4..958f6d6d7e0bb1a9e6a611e625ad42f6def1b957 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/blackBodyEmission/blackBodyEmission.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index 296b99ff9e93c1faab2f43c463a1d4219f503663..bfcf1309e881dd41bea7d8f97671ca315f8d2236 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H index f91163805a46f899a8253d65ea5b22f267861cb7..183ce1b9a8320984e21a2ad43bd87599a67c9740 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H index 594b5bee0ac72a6dde43be556d2d616813353e4a..0995efa43643a76ec9a58e6649a332e3d22da4bf 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOMI.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C index f000e43fa3910ef87653e3d620b315809d67388f..b9af5e65b6c62a28bcbe2939db17ae7c22e33ea8 100755 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H index 6140ae4bc3a6527acc6f1b30b3e05419c0f15b62..7768fb48ca2586fbefd811c4fd482469061e50d5 100755 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H index 5829db3148e534ecdbcaaeb797427426db55acd0..8019d1c64fc20aa3cbf4dcca5645e75acfd0c166 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTableI.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C index 7441b900d695a91f3c6e81617d3d8f342ce53c83..ff22c6335933fb2ba307b82cfb7093432b4f7c30 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H index 1e558c8f3cdf4e42b7a92498be2c07e8744aed98..c139a3633427827c6a2ca2629c0cbe00070ba84d 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRay.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H index 0efd423a6dc08efb6a113900e5ac8c6f43b44874..649f5b7c9e4820110461b5c91c338dc8bd518850 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/radiativeIntensityRay/radiativeIntensityRayI.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H b/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H index 2527ab1211fac521aa8d55b8fb4a4b90ca873316..c171ce23bd40cb919c9562953b3f6eeb5def57f2 100644 --- a/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H +++ b/src/thermophysicalModels/radiation/radiationModel/noRadiation/noRadiation.H @@ -66,7 +66,7 @@ class noRadiation public: //- Runtime type information - TypeName("noRadiation"); + TypeName("none"); // Constructors diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C index dccbbbad25064f2f278d6b93a813041fdc8b3d38..cdb57c0f5397ea63334fca60594b9595c4df2493 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H index 2c24af42c49d7ceb08cd90209c717cd6183f009e..a5921d7c40802d09d49a3b31b0f135862fd43286 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/greyMeanAbsorptionEmission/greyMeanAbsorptionEmission.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C index a96deeb0b40273b0e69d26305bde5bb38c0f9924..1665519e3e711fdaa8c80493c77f91c1be972fdb 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.C +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H index 21e10c400b63385c9a047b1d655e1a0f662c8c2f..5a0dd1d20e0a6477110bc084537fa3ba2b13a4af 100644 --- a/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.H +++ b/src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/wideBandAbsorptionEmission/wideBandAbsorptionEmission.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) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/reactionThermo/Make/files b/src/thermophysicalModels/reactionThermo/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..c2f9612ec5d5a462cbf6139bc7086ef1d0b55dae --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/Make/files @@ -0,0 +1,24 @@ +chemistryReaders/chemkinReader/chemkinReader.C +chemistryReaders/chemkinReader/chemkinLexer.C +chemistryReaders/chemistryReader/makeChemistryReaders.C + +mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C + +combustionThermo/hCombustionThermo/hCombustionThermo.C +combustionThermo/hCombustionThermo/newhCombustionThermo.C +combustionThermo/hCombustionThermo/hCombustionThermos.C + +combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C +combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C +combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C + +reactionThermo/hReactionThermo/hReactionThermo.C +reactionThermo/hReactionThermo/newhReactionThermo.C +reactionThermo/hReactionThermo/hReactionThermos.C + + +derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C +derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C +derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C + +LIB = $(FOAM_LIBBIN)/libreactionThermophysicalModels diff --git a/src/thermophysicalModels/combustion/Make/options b/src/thermophysicalModels/reactionThermo/Make/options similarity index 100% rename from src/thermophysicalModels/combustion/Make/options rename to src/thermophysicalModels/reactionThermo/Make/options diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C similarity index 78% rename from src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.C rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C index 38ad6e1f9801336b11ee9f3351bed30e8545051c..e178bd0338f685001280eba5f0433b0e6572b84a 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.C @@ -26,17 +26,11 @@ License #include "chemistryReader.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(chemistryReader, 0); - defineRunTimeSelectionTable(chemistryReader, dictionary); -}; - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::chemistryReader> Foam::chemistryReader::New +template<class ThermoType> +Foam::autoPtr<Foam::chemistryReader<ThermoType> > +Foam::chemistryReader<ThermoType>::New ( const dictionary& thermoDict ) @@ -50,9 +44,8 @@ Foam::autoPtr<Foam::chemistryReader> Foam::chemistryReader::New Info<< "Selecting chemistryReader " << chemistryReaderTypeName << endl; - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_ - ->find(chemistryReaderTypeName); + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(chemistryReaderTypeName); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -60,13 +53,13 @@ Foam::autoPtr<Foam::chemistryReader> Foam::chemistryReader::New ( "chemistryReader::New(const dictionary& thermoDict)" ) << "Unknown chemistryReader type " - << chemistryReaderTypeName << endl << endl - << "Valid chemistryReaders are : " << endl + << chemistryReaderTypeName << nl << nl + << "Valid chemistryReaders are: " << nl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } - return autoPtr<chemistryReader>(cstrIter()(thermoDict)); + return autoPtr<chemistryReader<ThermoType> >(cstrIter()(thermoDict)); } diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H similarity index 57% rename from src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H index bd5f4eaa1a5db8b80ac9778e1ea56573339bc7ad..550d44c79ad8cc60e464c4d7ec4c55a72bf5774e 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemistryReader/chemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H @@ -39,10 +39,6 @@ SourceFiles #include "typeInfo.H" #include "runTimeSelectionTables.H" #include "Reaction.H" -#include "sutherlandTransport.H" -#include "specieThermo.H" -#include "janafThermo.H" -#include "perfectGas.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,23 +46,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class chemistryReader Declaration + Class chemistryReader Declaration \*---------------------------------------------------------------------------*/ +template<class ThermoType> class chemistryReader { - -public: - - // Public data types - - typedef sutherlandTransport<specieThermo<janafThermo<perfectGas> > > - reactionThermo; - - typedef Reaction<reactionThermo> reaction; - -private: - // Private Member Functions //- Disallow default bitwise copy construct @@ -81,6 +66,9 @@ public: //- Runtime type information TypeName("chemistryReader"); + //- The type of thermo package the reader was instantiated for + typedef ThermoType thermoType; + // Constructors @@ -109,17 +97,18 @@ public: static autoPtr<chemistryReader> New(const dictionary& thermoDict); - // Destructor - - virtual ~chemistryReader() - {} + //- Destructor + virtual ~chemistryReader() + {} // Member Functions virtual const speciesTable& species() const = 0; - virtual const HashPtrTable<reactionThermo>& speciesThermo() const = 0; - virtual const SLPtrList<reaction>& reactions() const = 0; + + virtual const HashPtrTable<ThermoType>& speciesThermo() const = 0; + + virtual const SLPtrList<Reaction<ThermoType> >& reactions() const = 0; }; @@ -129,6 +118,41 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#define makeChemistryReader(Thermo) \ + \ +defineTemplateTypeNameAndDebug \ +( \ + chemistryReader<Thermo>, \ + 0 \ +); \ + \ +defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary); + + +#define makeChemistryReaderType(SS, Thermo) \ + \ + defineNamedTemplateTypeNameAndDebug(SS<Thermo>, 0); \ + \ + chemistryReader<Thermo>::adddictionaryConstructorToTable<SS<Thermo> > \ + add##SS##Thermo##ConstructorToTable_; + + +#define addChemistryReaderType(SS, Thermo) \ + \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ + \ + chemistryReader<Thermo>::adddictionaryConstructorToTable<SS> \ + add##SS##Thermo##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "chemistryReader.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListLoopM.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C similarity index 76% rename from src/OpenFOAM/containers/Lists/PtrList/PtrListLoopM.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index cbd6fd10dfbf6525f5984f1d208447cb3426ce02..35ab18220b048c0777b8cca86b613dd85d2ce15b 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrListLoopM.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -22,35 +22,29 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - simple generic PtrList MACROS for looping - \*---------------------------------------------------------------------------*/ -#ifndef PtrListLoop_H -#define PtrListLoop_H - -#include "undefListLoopM.H" +#include "makeReactionThermo.H" +#include "thermoPhysicsTypes.H" +#include "chemistryReader.H" +#include "foamChemistryReader.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Element access looping using [] for vector and parallel machines - -#define List_FOR_ALL(f, i) \ - forAll(f, i) \ - { \ +namespace Foam +{ -#define List_END_FOR_ALL } - -#define List_ELEM(f, fp, i) ((f)[i]) +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define List_ACCESS(type, f, fp) -#define List_CONST_ACCESS(type, f, fp) +makeChemistryReader(gasThermoPhysics); +makeChemistryReader(icoPoly8ThermoPhysics); +makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#endif +} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L similarity index 98% rename from src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L index d32e172daec2b66d0330a231fae88c3e260ffc71..f7ec61e3314c059b889fd1f07cf1d9643b11046c 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinLexer.L +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L @@ -1,4 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------*\ +/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | @@ -306,13 +306,13 @@ List<specieElement> currentSpecieComposition(5); scalar currentLowT = 0; scalar currentHighT = 0; scalar currentCommonT = 0; -reactionThermo::coeffArray highCpCoeffs; -reactionThermo::coeffArray lowCpCoeffs; +gasThermoPhysics::coeffArray highCpCoeffs; +gasThermoPhysics::coeffArray lowCpCoeffs; -reaction::specieCoeffs currentSpecieCoeff; +gasReaction::specieCoeffs currentSpecieCoeff; -DynamicList<reaction::specieCoeffs> lhs; -DynamicList<reaction::specieCoeffs> rhs; +DynamicList<gasReaction::specieCoeffs> lhs; +DynamicList<gasReaction::specieCoeffs> rhs; scalarList ArrheniusCoeffs(3); DynamicList<scalar> reactionCoeffs; @@ -322,7 +322,7 @@ label currentThirdBodyIndex = -1; word reactionCoeffsName = word::null; HashTable<scalarList> reactionCoeffsTable; -DynamicList<reaction::specieCoeffs> *lrhsPtr = &lhs; +DynamicList<gasReaction::specieCoeffs> *lrhsPtr = &lhs; reactionType rType = unknownReactionType; reactionRateType rrType = Arrhenius; @@ -614,7 +614,7 @@ bool finishReaction = false; <readThermoLineLabel4>{thermoLineLabel4} { - HashPtrTable<reactionThermo>::iterator specieThermoIter + HashPtrTable<gasThermoPhysics>::iterator specieThermoIter ( speciesThermo_.find(currentSpecieName) ); @@ -627,7 +627,7 @@ bool finishReaction = false; speciesThermo_.insert ( currentSpecieName, - new reactionThermo + new gasThermoPhysics ( janafThermo<perfectGas> ( @@ -863,7 +863,7 @@ bool finishReaction = false; { case unimolecularFallOffReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "LOW keyword given for a unimolecular fall-off" @@ -898,7 +898,7 @@ bool finishReaction = false; case chemicallyActivatedBimolecularReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "HIGH keyword given for a chemically" @@ -935,7 +935,7 @@ bool finishReaction = false; case TroeReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "TROE keyword given for a" @@ -969,7 +969,7 @@ bool finishReaction = false; case SRIReactionType: { - if (pDependentSpecieName.empty()) + if (!pDependentSpecieName.size()) { FatalErrorIn("chemkinReader::lex()") << "SRI keyword given for a" @@ -1434,7 +1434,7 @@ bool finishReaction = false; <readReactionOrder>{reactionCoeff}{endReactionCoeffs} { - DynamicList<reaction::specieCoeffs>& lrhs = *lrhsPtr; + DynamicList<gasReaction::specieCoeffs>& lrhs = *lrhsPtr; bool found = false; @@ -1535,5 +1535,5 @@ bool finishReaction = false; %% /* ------------------------------------------------------------------------- *\ - ------ End of STLToFoam.L + ------ End of chemkinLexer.L \* ------------------------------------------------------------------------- */ diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C similarity index 96% rename from src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C index f04995cd3e241f41090f6f2b08f211dfb4bd2ecd..a6841241225ab9ced70ca0466d3c6fcb0d34347a 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C @@ -46,8 +46,7 @@ License namespace Foam { - defineTypeNameAndDebug(chemkinReader, 0); - addToRunTimeSelectionTable(chemistryReader, chemkinReader, dictionary); + addChemistryReaderType(chemkinReader, gasThermoPhysics); }; /* * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * */ @@ -164,8 +163,8 @@ template<class ReactionRateType> void Foam::chemkinReader::addReactionType ( const reactionType rType, - DynamicList<reaction::specieCoeffs>& lhs, - DynamicList<reaction::specieCoeffs>& rhs, + DynamicList<gasReaction::specieCoeffs>& lhs, + DynamicList<gasReaction::specieCoeffs>& rhs, const ReactionRateType& rr ) { @@ -175,9 +174,9 @@ void Foam::chemkinReader::addReactionType { reactions_.append ( - new IrreversibleReaction<reactionThermo, ReactionRateType> + new IrreversibleReaction<gasThermoPhysics, ReactionRateType> ( - Reaction<reactionThermo> + Reaction<gasThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -194,9 +193,9 @@ void Foam::chemkinReader::addReactionType { reactions_.append ( - new ReversibleReaction<reactionThermo, ReactionRateType> + new ReversibleReaction<gasThermoPhysics, ReactionRateType> ( - Reaction<reactionThermo> + Reaction<gasThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -234,8 +233,8 @@ void Foam::chemkinReader::addPressureDependentReaction ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList<reaction::specieCoeffs>& lhs, - DynamicList<reaction::specieCoeffs>& rhs, + DynamicList<gasReaction::specieCoeffs>& lhs, + DynamicList<gasReaction::specieCoeffs>& rhs, const scalarList& efficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -417,8 +416,8 @@ void Foam::chemkinReader::addPressureDependentReaction void Foam::chemkinReader::addReaction ( - DynamicList<reaction::specieCoeffs>& lhs, - DynamicList<reaction::specieCoeffs>& rhs, + DynamicList<gasReaction::specieCoeffs>& lhs, + DynamicList<gasReaction::specieCoeffs>& rhs, const scalarList& efficiencies, const reactionType rType, const reactionRateType rrType, @@ -493,9 +492,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - <reactionThermo, ArrheniusReactionRate> + <gasThermoPhysics, ArrheniusReactionRate> ( - Reaction<reactionThermo> + Reaction<gasThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -546,9 +545,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - <reactionThermo, thirdBodyArrheniusReactionRate> + <gasThermoPhysics, thirdBodyArrheniusReactionRate> ( - Reaction<reactionThermo> + Reaction<gasThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -651,9 +650,9 @@ void Foam::chemkinReader::addReaction reactions_.append ( new NonEquilibriumReversibleReaction - <reactionThermo, LandauTellerReactionRate> + <gasThermoPhysics, LandauTellerReactionRate> ( - Reaction<reactionThermo> + Reaction<gasThermoPhysics> ( speciesTable_, lhs.shrink(), @@ -797,7 +796,7 @@ void Foam::chemkinReader::read const fileName& thermoFileName ) { - if (thermoFileName.size()) + if (thermoFileName != fileName::null) { std::ifstream thermoStream(thermoFileName.c_str()); diff --git a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H similarity index 93% rename from src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H index cdb9bc9095e26efd5bc7abefbee4493aad2fcb48..de679103806b55e96a6a8a9faad1edd41bca973a 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/chemkinReader/chemkinReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.H @@ -47,6 +47,8 @@ SourceFiles #include "speciesTable.H" #include "atomicWeights.H" +#include "reactionTypes.H" + #include <FlexLexer.h> // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -55,12 +57,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class chemkin Declaration + Class chemkinReader Declaration \*---------------------------------------------------------------------------*/ class chemkinReader : - public chemistryReader, + public chemistryReader<gasThermoPhysics>, public yyFlexLexer { @@ -198,13 +200,13 @@ private: HashTable<phase> speciePhase_; //- Table of the thermodynamic data given in the CHEMKIN file - HashPtrTable<reactionThermo> speciesThermo_; + HashPtrTable<gasThermoPhysics> speciesThermo_; //- Table of species composition HashTable<List<specieElement> > specieComposition_; //- List of the reactions - SLPtrList<reaction> reactions_; + SLPtrList<gasReaction> reactions_; // Private Member Functions @@ -256,8 +258,8 @@ private: void addReactionType ( const reactionType rType, - DynamicList<reaction::specieCoeffs>& lhs, - DynamicList<reaction::specieCoeffs>& rhs, + DynamicList<gasReaction::specieCoeffs>& lhs, + DynamicList<gasReaction::specieCoeffs>& rhs, const ReactionRateType& rr ); @@ -266,8 +268,8 @@ private: ( const reactionType rType, const fallOffFunctionType fofType, - DynamicList<reaction::specieCoeffs>& lhs, - DynamicList<reaction::specieCoeffs>& rhs, + DynamicList<gasReaction::specieCoeffs>& lhs, + DynamicList<gasReaction::specieCoeffs>& rhs, const scalarList& thirdBodyEfficiencies, const scalarList& k0Coeffs, const scalarList& kInfCoeffs, @@ -279,8 +281,8 @@ private: void addReaction ( - DynamicList<reaction::specieCoeffs>& lhs, - DynamicList<reaction::specieCoeffs>& rhs, + DynamicList<gasReaction::specieCoeffs>& lhs, + DynamicList<gasReaction::specieCoeffs>& rhs, const scalarList& thirdBodyEfficiencies, const reactionType rType, const reactionRateType rrType, @@ -363,7 +365,7 @@ public: } //- Table of the thermodynamic data given in the CHEMKIN file - const HashPtrTable<reactionThermo>& speciesThermo() const + const HashPtrTable<gasThermoPhysics>& speciesThermo() const { return speciesThermo_; } @@ -375,7 +377,7 @@ public: } //- List of the reactions - const SLPtrList<reaction>& reactions() const + const SLPtrList<gasReaction>& reactions() const { return reactions_; } diff --git a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C similarity index 81% rename from src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C rename to src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C index e0913fe3d10e5add98f17cd5bd1dbae380c7b420..7e06956ab5e49488a3d0afb34b55cd6276e2749d 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.C @@ -28,36 +28,33 @@ License #include "IFstream.H" #include "addToRunTimeSelectionTable.H" -/* * * * * * * * * * * * * * * * * Static data * * * * * * * * * * * * * * * */ - -namespace Foam -{ - defineTypeNameAndDebug(foamChemistryReader, 0); - addToRunTimeSelectionTable(chemistryReader, foamChemistryReader, dictionary); -}; - // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // -// Construct from components -Foam::foamChemistryReader::foamChemistryReader +template<class ThermoType> +Foam::foamChemistryReader<ThermoType>::foamChemistryReader ( const fileName& reactionsFileName, const fileName& thermoFileName ) : + chemistryReader<ThermoType>(), speciesThermo_(IFstream(thermoFileName)()), speciesTable_(dictionary(IFstream(reactionsFileName)()).lookup("species")), reactions_ ( dictionary(IFstream(reactionsFileName)()).lookup("reactions"), - reaction::iNew(speciesTable_, speciesThermo_) + Reaction<ThermoType>::iNew(speciesTable_, speciesThermo_) ) {} -// Construct from components -Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) +template<class ThermoType> +Foam::foamChemistryReader<ThermoType>::foamChemistryReader +( + const dictionary& thermoDict +) : + chemistryReader<ThermoType>(), speciesThermo_ ( IFstream @@ -84,7 +81,7 @@ Foam::foamChemistryReader::foamChemistryReader(const dictionary& thermoDict) fileName(thermoDict.lookup("foamChemistryFile")).expand() )() ).lookup("reactions"), - reaction::iNew(speciesTable_, speciesThermo_) + typename Reaction<ThermoType>::iNew(speciesTable_, speciesThermo_) ) {} diff --git a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H similarity index 86% rename from src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H rename to src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H index 2fa851462d140262fd6b9dc899450ce685a9910b..129cf1c811c180a18dcc6ba9a2bd6f65dda6b4f4 100644 --- a/src/thermophysicalModels/combustion/chemistryReaders/foamChemistryReader/foamChemistryReader.H +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/foamChemistryReader/foamChemistryReader.H @@ -51,21 +51,22 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class foamChemistry Declaration + Class foamChemistry Declaration \*---------------------------------------------------------------------------*/ +template<class ThermoType> class foamChemistryReader : - public chemistryReader + public chemistryReader<ThermoType> { //- Table of the thermodynamic data given in the foamChemistry file - HashPtrTable<reactionThermo> speciesThermo_; + HashPtrTable<ThermoType> speciesThermo_; //- Table of species speciesTable speciesTable_; //- List of the reactions - SLPtrList<reaction> reactions_; + SLPtrList<Reaction<ThermoType> > reactions_; // Private Member Functions @@ -97,10 +98,9 @@ public: foamChemistryReader(const dictionary& thermoDict); - // Destructor - - virtual ~foamChemistryReader() - {} + //- Destructor + virtual ~foamChemistryReader() + {} // Member functions @@ -112,13 +112,13 @@ public: } //- Table of the thermodynamic data given in the foamChemistry file - const HashPtrTable<reactionThermo>& speciesThermo() const + const HashPtrTable<ThermoType>& speciesThermo() const { return speciesThermo_; } //- List of the reactions - const SLPtrList<reaction>& reactions() const + const SLPtrList<Reaction<ThermoType> >& reactions() const { return reactions_; } @@ -131,6 +131,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "foamChemistryReader.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.C similarity index 81% rename from src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.C index 8f455f4eb4a15e80b42d1bc0a4e99ea7f115d830..5ea740221712048cb0c13bc85afc9a87f4fdf27e 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.C @@ -31,17 +31,15 @@ License namespace Foam { - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -defineTypeNameAndDebug(hCombustionThermo, 0); -defineRunTimeSelectionTable(hCombustionThermo, fvMesh); + defineTypeNameAndDebug(hCombustionThermo, 0); + defineRunTimeSelectionTable(hCombustionThermo, fvMesh); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -hCombustionThermo::hCombustionThermo(const fvMesh& mesh) +Foam::hCombustionThermo::hCombustionThermo(const fvMesh& mesh) : - basicThermo(mesh), + basicPsiThermo(mesh), h_ ( @@ -55,19 +53,15 @@ hCombustionThermo::hCombustionThermo(const fvMesh& mesh) ), mesh, dimensionSet(0, 2, -2, 0, 0), - hBoundaryTypes() + this->hBoundaryTypes() ) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -hCombustionThermo::~hCombustionThermo() +Foam::hCombustionThermo::~hCombustionThermo() {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.H similarity index 77% rename from src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.H index fe1e12adc0615064f97298a1c08657cfb87ecd9c..b4b66b55bdb3dcefc0ad5143773cb400e03d2f78 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermo.H @@ -30,15 +30,14 @@ Description SourceFiles hCombustionThermo.C - newhCombustionThermo.C \*---------------------------------------------------------------------------*/ #ifndef hCombustionThermo_H #define hCombustionThermo_H -#include "basicThermo.H" -#include "combustionMixture.H" +#include "basicPsiThermo.H" +#include "basicMultiComponentMixture.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" @@ -48,18 +47,19 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hCombustionThermo Declaration + Class hCombustionThermo Declaration \*---------------------------------------------------------------------------*/ class hCombustionThermo : - public basicThermo + public basicPsiThermo { protected: // Protected data + //- Enthalpy field volScalarField h_; @@ -69,16 +69,15 @@ public: TypeName("hCombustionThermo"); - // Declare run-time constructor selection tables - - declareRunTimeSelectionTable - ( - autoPtr, - hCombustionThermo, - fvMesh, - (const fvMesh& mesh), - (mesh) - ); + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + hCombustionThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); // Constructors @@ -89,8 +88,16 @@ public: // Selectors + //- Standard selection based on fvMesh static autoPtr<hCombustionThermo> New(const fvMesh&); + //- Select and check that package contains 'thermoType' + static autoPtr<hCombustionThermo> NewType + ( + const fvMesh&, + const word& thermoType + ); + //- Destructor virtual ~hCombustionThermo(); @@ -98,11 +105,11 @@ public: // Member functions - //- Return the composition of the combustion mixture - virtual combustionMixture& composition() = 0; + //- Return the composition of the multi-component mixture + virtual basicMultiComponentMixture& composition() = 0; - //- Return the composition of the combustion mixture - virtual const combustionMixture& composition() const = 0; + //- Return the composition of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const = 0; // Access to thermodynamic state variables diff --git a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C similarity index 80% rename from src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C index fbfa73c85626e09068c819b01f2c6852bec099d0..94846bb75c09efee4ea8745991bd161959a353a2 100644 --- a/src/thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C @@ -24,11 +24,10 @@ License \*---------------------------------------------------------------------------*/ -#include "hCombustionThermo.H" -#include "hMixtureThermo.H" - #include "makeCombustionThermo.H" -#include "addToRunTimeSelectionTable.H" + +#include "hCombustionThermo.H" +#include "hPsiMixtureThermo.H" #include "perfectGas.H" @@ -46,6 +45,7 @@ License #include "multiComponentMixture.H" #include "reactingMixture.H" +#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ namespace Foam makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, homogeneousMixture, constTransport, hConstThermo, @@ -67,7 +67,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, inhomogeneousMixture, constTransport, hConstThermo, @@ -77,7 +77,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, veryInhomogeneousMixture, constTransport, hConstThermo, @@ -87,7 +87,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, homogeneousMixture, sutherlandTransport, janafThermo, @@ -97,7 +97,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, inhomogeneousMixture, sutherlandTransport, janafThermo, @@ -107,7 +107,7 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, veryInhomogeneousMixture, sutherlandTransport, janafThermo, @@ -117,43 +117,32 @@ makeCombustionThermo makeCombustionThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, dieselMixture, sutherlandTransport, janafThermo, perfectGas ); - -makeCombustionThermo + +// Multi-component thermo + +makeCombustionMixtureThermo ( hCombustionThermo, - hMixtureThermo, + hPsiMixtureThermo, multiComponentMixture, - sutherlandTransport, - janafThermo, - perfectGas + gasThermoPhysics ); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Reaction thermo - -defineTemplateTypeNameAndDebug(hMixtureThermo<reactingMixture>, 0); - -typedef hMixtureThermo<reactingMixture> hMixtureThermoReactingMixture; +// Multi-component reaction thermo -addToRunTimeSelectionTable +makeCombustionMixtureThermo ( hCombustionThermo, - hMixtureThermoReactingMixture, - fvMesh -); - -addToRunTimeSelectionTable -( - basicThermo, - hMixtureThermoReactingMixture, - fvMesh + hPsiMixtureThermo, + reactingMixture, + gasThermoPhysics ); diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..4ee0c2a022a3ed2c37656e4910724923b580a2b4 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/makeCombustionThermo.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::hCombustionThermo + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef makeCombustionThermo_H +#define makeCombustionThermo_H + +#include "addToRunTimeSelectionTable.H" +#include "basicPsiThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeCombustionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ + \ +typedef MixtureThermo \ + <Mixture<Transport<specieThermo<Thermo<EqnOfState> > > > > \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + #MixtureThermo \ + "<"#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">>>>>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicPsiThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +) + + +#define makeCombustionMixtureThermo(CThermo,MixtureThermo,Mixture,ThermoPhys) \ + \ +typedef MixtureThermo<Mixture<ThermoPhys> > \ + MixtureThermo##Mixture##ThermoPhys; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##ThermoPhys, \ + #MixtureThermo"<"#Mixture"<"#ThermoPhys">>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicPsiThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ + fvMesh \ +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..788a298d0d841b2d09d258cb2c35a904dd254bd7 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/newhCombustionThermo.C @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "hCombustionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::hCombustionThermo> Foam::hCombustionThermo::New +( + const fvMesh& mesh +) +{ + word hCombustionThermoTypeName; + + // 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") >> hCombustionThermoTypeName; + } + + Info<< "Selecting thermodynamics package " << hCombustionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hCombustionThermo::New(const fvMesh&)") + << "Unknown hCombustionThermo type " + << hCombustionThermoTypeName << nl << nl + << "Valid hCombustionThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr<hCombustionThermo>(cstrIter()(mesh)); +} + + +Foam::autoPtr<Foam::hCombustionThermo> Foam::hCombustionThermo::NewType +( + const fvMesh& mesh, + const word& thermoType +) +{ + word hCombustionThermoTypeName; + + // 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") >> hCombustionThermoTypeName; + + if (hCombustionThermoTypeName.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->toc(); + DynamicList<word> validModels; + forAll(allModels, i) + { + if (allModels[i].find(thermoType) != string::npos) + { + validModels.append(allModels[i]); + } + } + + FatalErrorIn + ( + "autoPtr<hCombustionThermo> hCombustionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << hCombustionThermoTypeName << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); + } + } + + Info<< "Selecting thermodynamics package " << hCombustionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hCombustionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hCombustionThermo::New(const fvMesh&)") + << "Unknown hCombustionThermo type " + << hCombustionThermoTypeName << nl << nl + << "Valid hCombustionThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr<hCombustionThermo>(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.C diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.H similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermo.H diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/hhuCombustionThermos.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/hhuCombustionThermos.C diff --git a/src/thermophysicalModels/combustion/hhuCombustionThermo/newhhuCombustionThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/hhuCombustionThermo/newhhuCombustionThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/hhuCombustionThermo/newhhuCombustionThermo.C diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C similarity index 91% rename from src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C index 57d054ad43f118cc7e1d45875b2d4072d6dd8ed5..7ca86904611be7395d295351c68891042e1353c3 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.C +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.C @@ -24,49 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "hMixtureThermo.H" +#include "hPsiMixtureThermo.H" #include "fvMesh.H" #include "fixedValueFvPatchFields.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class MixtureType> -Foam::hMixtureThermo<MixtureType>::hMixtureThermo(const fvMesh& mesh) -: - hCombustionThermo(mesh), - MixtureType(*this, mesh) -{ - scalarField& hCells = h_.internalField(); - const scalarField& TCells = T_.internalField(); - - forAll(hCells, celli) - { - hCells[celli] = this->cellMixture(celli).H(TCells[celli]); - } - - forAll(h_.boundaryField(), patchi) - { - h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); - } - - hBoundaryCorrection(h_); - - calculate(); - psi_.oldTime(); // Switch on saving old time -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class MixtureType> -Foam::hMixtureThermo<MixtureType>::~hMixtureThermo() -{} - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class MixtureType> -void Foam::hMixtureThermo<MixtureType>::calculate() +void Foam::hPsiMixtureThermo<MixtureType>::calculate() { const scalarField& hCells = h_.internalField(); const scalarField& pCells = p_.internalField(); @@ -131,14 +96,51 @@ void Foam::hMixtureThermo<MixtureType>::calculate() } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hPsiMixtureThermo<MixtureType>::hPsiMixtureThermo(const fvMesh& mesh) +: + hCombustionThermo(mesh), + MixtureType(*this, mesh) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); + + // Switch on saving old time + psi_.oldTime(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hPsiMixtureThermo<MixtureType>::~hPsiMixtureThermo() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class MixtureType> -void Foam::hMixtureThermo<MixtureType>::correct() +void Foam::hPsiMixtureThermo<MixtureType>::correct() { if (debug) { - Info<< "entering hMixtureThermo<MixtureType>::correct()" << endl; + Info<< "entering hPsiMixtureThermo<MixtureType>::correct()" << endl; } // force the saving of the old-time values @@ -148,14 +150,14 @@ void Foam::hMixtureThermo<MixtureType>::correct() if (debug) { - Info<< "exiting hMixtureThermo<MixtureType>::correct()" << endl; + Info<< "exiting hPsiMixtureThermo<MixtureType>::correct()" << endl; } } template<class MixtureType> Foam::tmp<Foam::volScalarField> -Foam::hMixtureThermo<MixtureType>::hs() const +Foam::hPsiMixtureThermo<MixtureType>::hs() const { const fvMesh& mesh = T_.mesh(); @@ -202,7 +204,7 @@ Foam::hMixtureThermo<MixtureType>::hs() const template<class MixtureType> Foam::tmp<Foam::volScalarField> -Foam::hMixtureThermo<MixtureType>::hc() const +Foam::hPsiMixtureThermo<MixtureType>::hc() const { const fvMesh& mesh = T_.mesh(); @@ -247,7 +249,7 @@ Foam::hMixtureThermo<MixtureType>::hc() const template<class MixtureType> Foam::tmp<Foam::scalarField> -Foam::hMixtureThermo<MixtureType>::h +Foam::hPsiMixtureThermo<MixtureType>::h ( const scalarField& T, const labelList& cells @@ -267,7 +269,7 @@ Foam::hMixtureThermo<MixtureType>::h template<class MixtureType> Foam::tmp<Foam::scalarField> -Foam::hMixtureThermo<MixtureType>::h +Foam::hPsiMixtureThermo<MixtureType>::h ( const scalarField& T, const label patchi @@ -287,7 +289,7 @@ Foam::hMixtureThermo<MixtureType>::h template<class MixtureType> Foam::tmp<Foam::scalarField> -Foam::hMixtureThermo<MixtureType>::Cp +Foam::hPsiMixtureThermo<MixtureType>::Cp ( const scalarField& T, const label patchi @@ -308,7 +310,7 @@ Foam::hMixtureThermo<MixtureType>::Cp template<class MixtureType> Foam::tmp<Foam::volScalarField> -Foam::hMixtureThermo<MixtureType>::Cp() const +Foam::hPsiMixtureThermo<MixtureType>::Cp() const { const fvMesh& mesh = T_.mesh(); @@ -349,7 +351,7 @@ Foam::hMixtureThermo<MixtureType>::Cp() const template<class MixtureType> -bool Foam::hMixtureThermo<MixtureType>::read() +bool Foam::hPsiMixtureThermo<MixtureType>::read() { if (hCombustionThermo::read()) { diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H similarity index 83% rename from src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H index 62d7943400e809a9891c1684c82a3012cf3cc247..64503284478016985773a5cef53b5de87af8d299 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/hMixtureThermo/hMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hPsiMixtureThermo/hPsiMixtureThermo.H @@ -23,18 +23,18 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::hMixtureThermo + Foam::hPsiMixtureThermo Description - Foam::hMixtureThermo + Foam::hPsiMixtureThermo SourceFiles - hMixtureThermo.C + hPsiMixtureThermo.C \*---------------------------------------------------------------------------*/ -#ifndef hMixtureThermo_H -#define hMixtureThermo_H +#ifndef hPsiMixtureThermo_H +#define hPsiMixtureThermo_H #include "hCombustionThermo.H" @@ -44,11 +44,11 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hMixtureThermo Declaration + Class hPsiMixtureThermo Declaration \*---------------------------------------------------------------------------*/ template<class MixtureType> -class hMixtureThermo +class hPsiMixtureThermo : public hCombustionThermo, public MixtureType @@ -58,35 +58,35 @@ class hMixtureThermo void calculate(); //- Construct as copy (not implemented) - hMixtureThermo(const hMixtureThermo<MixtureType>&); + hPsiMixtureThermo(const hPsiMixtureThermo<MixtureType>&); public: //- Runtime type information - TypeName("hMixtureThermo"); + TypeName("hPsiMixtureThermo"); // Constructors //- Construct from mesh - hMixtureThermo(const fvMesh&); + hPsiMixtureThermo(const fvMesh&); //- Destructor - virtual ~hMixtureThermo(); + virtual ~hPsiMixtureThermo(); // Member functions - //- Return the compostion of the combustion mixture - virtual combustionMixture& composition() + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() { return *this; } - //- Return the compostion of the combustion mixture - virtual const combustionMixture& composition() const + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const { return *this; } @@ -100,6 +100,7 @@ public: //- Chemical enthalpy [J/kg] virtual tmp<volScalarField> hc() const; + // Fields derived from thermodynamic state variables //- Enthalpy for cell-set [J/kg] @@ -139,7 +140,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "hMixtureThermo.C" +# include "hPsiMixtureThermo.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C similarity index 100% rename from src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.C diff --git a/src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H similarity index 93% rename from src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H rename to src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H index 99cf720488d528ae062af50470dd184cee98a359..5e9834e86c086b036855efa7f9ba3ae66a1a0e33 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H +++ b/src/thermophysicalModels/reactionThermo/combustionThermo/mixtureThermos/hhuMixtureThermo/hhuMixtureThermo.H @@ -36,7 +36,7 @@ SourceFiles #ifndef hhuMixtureThermo_H #define hhuMixtureThermo_H -#include "hMixtureThermo.H" +//#include "hPsiMixtureThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class hhuMixtureThermo Declaration + Class hhuMixtureThermo Declaration \*---------------------------------------------------------------------------*/ template<class MixtureType> @@ -79,14 +79,14 @@ public: // Member functions - //- Return the compostion of the combustion mixture - virtual combustionMixture& composition() + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() { return *this; } - //- Return the compostion of the combustion mixture - virtual const combustionMixture& composition() const + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const { return *this; } diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H index 6da82e29eb7a0748135f434c39408abf662f1866..d55a9585a10017ba20ec70678dbadc17290afa94 100644 --- a/src/thermophysicalModels/combustion/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class fixedUnburntEnthalpyFvPatchScalarField Declaration + Class fixedUnburntEnthalpyFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class fixedUnburntEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H index 081ff77d91e7bf76934330f6edc08f69436ff90d..f237bb98ba814c18bc58286bc19b39f90a8aa497 100644 --- a/src/thermophysicalModels/combustion/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class gradientUnburntEnthalpyFvPatchScalarField Declaration + Class gradientUnburntEnthalpyFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class gradientUnburntEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C diff --git a/src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H similarity index 98% rename from src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H rename to src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H index f97d9ebf2c2202696c445a3a8344a64f35b58779..28d6c939a44ee7bd468cbd467a6827220ed61833 100644 --- a/src/thermophysicalModels/combustion/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.H @@ -44,7 +44,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class mixedUnburntEnthalpyFvPatchScalarField Declaration + Class mixedUnburntEnthalpyFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class mixedUnburntEnthalpyFvPatchScalarField diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C similarity index 88% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C index 0744a4e2ead014599f3ff00d532d7ee67e0c2c13..1016a33a97bb9d11a365fc09b3a96b91423da34e 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.C @@ -24,17 +24,29 @@ License \*---------------------------------------------------------------------------*/ -#include "combustionMixture.H" -#include "fvMesh.H" +#include "basicMultiComponentMixture.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -namespace Foam +void Foam::basicMultiComponentMixture::correctMassFractions() { + volScalarField Yt = Y_[0]; + + for(label n=1; n<Y_.size(); n++) + { + Yt += Y_[n]; + } + + forAll (Y_, n) + { + Y_[n] /= Yt; + } +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -combustionMixture::combustionMixture +Foam::basicMultiComponentMixture::basicMultiComponentMixture ( const dictionary& thermoDict, const wordList& specieNames, @@ -107,11 +119,9 @@ combustionMixture::combustionMixture ); } } -} + correctMassFractions(); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H similarity index 67% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H index 5e00e79e80471bed612bd2b5b5e791ef2c0575d1..a21485889a666654d49d88f5da946a35b12892a6 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H @@ -23,18 +23,18 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::combustionMixture + Foam::basicMultiComponentMixture Description combustion mixture SourceFiles - combustionMixture.C + basicMultiComponentMixture.C \*---------------------------------------------------------------------------*/ -#ifndef combustionMixture_H -#define combustionMixture_H +#ifndef basicMultiComponentMixture_H +#define basicMultiComponentMixture_H #include "volFields.H" #include "PtrList.H" @@ -46,29 +46,35 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class combustionMixture Declaration + Class basicMultiComponentMixture Declaration \*---------------------------------------------------------------------------*/ -class combustionMixture +class basicMultiComponentMixture { protected: // Protected data - //- The table of species + //- Table of specie names speciesTable species_; //- Species mass fractions PtrList<volScalarField> Y_; + // Protected member functions + + //- Correct the mass fractions to sum to 1 + void correctMassFractions(); + + public: // Constructors //- Construct from dictionary and mesh - combustionMixture + basicMultiComponentMixture ( const dictionary&, const wordList& specieNames, @@ -76,10 +82,9 @@ public: ); - // Destructor - - virtual ~combustionMixture() - {} + //- Destructor + virtual ~basicMultiComponentMixture() + {} // Member functions @@ -91,60 +96,33 @@ public: } //- Return the mass-fraction fields - PtrList<volScalarField>& Y() - { - return Y_; - } + inline PtrList<volScalarField>& Y(); //- Return the const mass-fraction fields - const PtrList<volScalarField>& Y() const - { - return Y_; - } + inline const PtrList<volScalarField>& Y() const; //- Return the mass-fraction field for a specie given by index - volScalarField& Y(const label i) - { - return Y_[i]; - } + inline volScalarField& Y(const label i); //- Return the const mass-fraction field for a specie given by index - const volScalarField& Y(const label i) const - { - return Y_[i]; - } + inline const volScalarField& Y(const label i) const; //- Return the mass-fraction field for a specie given by name - volScalarField& Y(const word& specieName) - { - return Y_[species_[specieName]]; - } + inline volScalarField& Y(const word& specieName); //- Return the const mass-fraction field for a specie given by name - const volScalarField& Y(const word& specieName) const - { - return Y_[species_[specieName]]; - } + inline const volScalarField& Y(const word& specieName) const; - //- does the mixture include this specie - bool contains(const word& specieName) const - { - return species_.contains(specieName); - } + //- Does the mixture include this specie? + inline bool contains(const word& specieName) const; - scalar fres(const scalar ft, const scalar stoicRatio) const - { - return max(ft - (1.0 - ft)/stoicRatio, 0.0); - } + inline scalar fres(const scalar ft, const scalar stoicRatio) const; - tmp<volScalarField> fres + inline tmp<volScalarField> fres ( const volScalarField& ft, const dimensionedScalar& stoicRatio - ) const - { - return max(ft - (scalar(1) - ft)/stoicRatio.value(), scalar(0)); - } + ) const; }; @@ -154,6 +132,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "basicMultiComponentMixtureI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H new file mode 100644 index 0000000000000000000000000000000000000000..593cb6c47b4a3404a2fd0d6cbafb6d5fe2f23678 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixtureI.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +\*---------------------------------------------------------------------------*/ + +inline Foam::PtrList<Foam::volScalarField>& +Foam::basicMultiComponentMixture::Y() +{ + return Y_; +} + + +inline const Foam::PtrList<Foam::volScalarField>& +Foam::basicMultiComponentMixture::Y() const +{ + return Y_; +} + + +inline Foam::volScalarField& Foam::basicMultiComponentMixture::Y(const label i) +{ + return Y_[i]; +} + + +inline const Foam::volScalarField& Foam::basicMultiComponentMixture::Y +( + const label i +) const +{ + return Y_[i]; +} + + +inline Foam::volScalarField& Foam::basicMultiComponentMixture::Y +( + const word& specieName +) +{ + return Y_[species_[specieName]]; +} + + +inline const Foam::volScalarField& Foam::basicMultiComponentMixture::Y +( + const word& specieName +) const +{ + return Y_[species_[specieName]]; +} + + +inline bool Foam::basicMultiComponentMixture::contains +( + const word& specieName +) const +{ + return species_.contains(specieName); +} + + +inline Foam::scalar Foam::basicMultiComponentMixture::fres +( + const scalar ft, + const scalar stoicRatio +) const +{ + return max(ft - (1.0 - ft)/stoicRatio, 0.0); +} + + +inline Foam::tmp<Foam::volScalarField> Foam::basicMultiComponentMixture::fres +( + const volScalarField& ft, + const dimensionedScalar& stoicRatio +) const +{ + return max(ft - (scalar(1) - ft)/stoicRatio.value(), scalar(0)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C similarity index 83% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C index 09a12153a9089e141d16b8d1bef66a969c35a6e4..ff069468315f6dbf56a08a628197f49da191d66d 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C @@ -27,28 +27,27 @@ License #include "dieselMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template<class ThermoType> -const char* dieselMixture<ThermoType>::specieNames_[2] = - {"ft", "fu"}; +const char* Foam::dieselMixture<ThermoType>::specieNames_[2] = {"ft", "fu"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ThermoType> -dieselMixture<ThermoType>::dieselMixture +Foam::dieselMixture<ThermoType>::dieselMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -66,7 +65,7 @@ dieselMixture<ThermoType>::dieselMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ThermoType> -const ThermoType& dieselMixture<ThermoType>::mixture +const ThermoType& Foam::dieselMixture<ThermoType>::mixture ( const scalar ft, const scalar fu @@ -91,7 +90,7 @@ const ThermoType& dieselMixture<ThermoType>::mixture template<class ThermoType> -void dieselMixture<ThermoType>::read(const dictionary& thermoDict) +void Foam::dieselMixture<ThermoType>::read(const dictionary& thermoDict) { fuel_ = ThermoType(thermoDict.lookup("fuel")); oxidant_ = ThermoType(thermoDict.lookup("oxidant")); @@ -99,8 +98,4 @@ void dieselMixture<ThermoType>::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H index 02e0605238d183a17cfc6ef2721c605656f7f00f..cc2a2e8fc2afda30ec8d4c5fac1ce01645685524 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/dieselMixture/dieselMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef dieselMixture_H #define dieselMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class dieselMixture Declaration + Class dieselMixture Declaration \*---------------------------------------------------------------------------*/ template<class ThermoType> class dieselMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -84,10 +84,9 @@ public: dieselMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~dieselMixture() - {} + //- Destructor + virtual ~dieselMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C similarity index 84% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C index b61ad10f4be6f095cf4be9c6b8346ae51f599734..5e9e70e69f4916ca36bdbf5b70831f6ec1af1cea 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -27,27 +27,27 @@ License #include "egrMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template<class ThermoType> -const char* egrMixture<ThermoType>::specieNames_[3] = {"ft", "b", "egr"}; +const char* Foam::egrMixture<ThermoType>::specieNames_[3] = {"ft", "b", "egr"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ThermoType> -egrMixture<ThermoType>::egrMixture +Foam::egrMixture<ThermoType>::egrMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -66,7 +66,7 @@ egrMixture<ThermoType>::egrMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ThermoType> -const ThermoType& egrMixture<ThermoType>::mixture +const ThermoType& Foam::egrMixture<ThermoType>::mixture ( const scalar ft, const scalar b, @@ -79,13 +79,13 @@ const ThermoType& egrMixture<ThermoType>::mixture } else { - + scalar fu = b*ft + (1.0 - b)*fres(ft, stoicRatio().value()); scalar ox = 1 - ft - (ft - fu)*stoicRatio().value(); - + fu *= (1.0 - egr); ox *= (1.0 - egr); - + scalar pr = 1 - fu - ox; mixture_ = fu/fuel_.W()*fuel_; @@ -98,7 +98,7 @@ const ThermoType& egrMixture<ThermoType>::mixture template<class ThermoType> -void egrMixture<ThermoType>::read(const dictionary& thermoDict) +void Foam::egrMixture<ThermoType>::read(const dictionary& thermoDict) { stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio"); @@ -108,8 +108,4 @@ void egrMixture<ThermoType>::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H similarity index 96% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H index fc1b3fba39b9b1abddda743ed1a482d8bb12fecc..e53029155006c848158e9fc1104da1ee41e6b323 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/egrMixture/egrMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef egrMixture_H #define egrMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class egrMixture Declaration + Class egrMixture Declaration \*---------------------------------------------------------------------------*/ template<class ThermoType> class egrMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -90,10 +90,9 @@ public: egrMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~egrMixture() - {} + //- Destructor + virtual ~egrMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C similarity index 80% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C index e71614f3e7c368da372952ca0c3cc9c507bb1c19..09fbc701d82ddb7a9e23acec69cb09548687ccab 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C @@ -27,27 +27,27 @@ License #include "homogeneousMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template<class ThermoType> -const char* homogeneousMixture<ThermoType>::specieNames_[1] = {"b"}; +const char* Foam::homogeneousMixture<ThermoType>::specieNames_[1] = {"b"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ThermoType> -homogeneousMixture<ThermoType>::homogeneousMixture +Foam::homogeneousMixture<ThermoType>::homogeneousMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), reactants_(thermoDict.lookup("reactants")), products_(thermoDict.lookup("products")), @@ -59,7 +59,10 @@ homogeneousMixture<ThermoType>::homogeneousMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ThermoType> -const ThermoType& homogeneousMixture<ThermoType>::mixture(const scalar b) const +const ThermoType& Foam::homogeneousMixture<ThermoType>::mixture +( + const scalar b +) const { if (b > 0.999) { @@ -80,15 +83,11 @@ const ThermoType& homogeneousMixture<ThermoType>::mixture(const scalar b) const template<class ThermoType> -void homogeneousMixture<ThermoType>::read(const dictionary& thermoDict) +void Foam::homogeneousMixture<ThermoType>::read(const dictionary& thermoDict) { reactants_ = ThermoType(thermoDict.lookup("reactants")); products_ = ThermoType(thermoDict.lookup("products")); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H similarity index 94% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H index 50e1952f497890ae7a3f365869ea6a097b267c2c..91c495fcc516b8665a6867dc6be5bb44a8539f53 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/homogeneousMixture/homogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef homogeneousMixture_H #define homogeneousMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class homogeneousMixture Declaration + Class homogeneousMixture Declaration \*---------------------------------------------------------------------------*/ template<class ThermoType> class homogeneousMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -81,10 +81,9 @@ public: homogeneousMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~homogeneousMixture() - {} + //- Destructor + virtual ~homogeneousMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C similarity index 83% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C index 0f916f5353fb8ee8f7861d0b55463921ec4b37d3..f491a70446b31f16db155f88e9f942d0cd49c191 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -27,27 +27,28 @@ License #include "inhomogeneousMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template<class ThermoType> -const char* inhomogeneousMixture<ThermoType>::specieNames_[2] = {"ft", "b"}; +const char* Foam::inhomogeneousMixture<ThermoType>::specieNames_[2] = + {"ft", "b"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ThermoType> -inhomogeneousMixture<ThermoType>::inhomogeneousMixture +Foam::inhomogeneousMixture<ThermoType>::inhomogeneousMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -65,7 +66,7 @@ inhomogeneousMixture<ThermoType>::inhomogeneousMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ThermoType> -const ThermoType& inhomogeneousMixture<ThermoType>::mixture +const ThermoType& Foam::inhomogeneousMixture<ThermoType>::mixture ( const scalar ft, const scalar b @@ -91,7 +92,7 @@ const ThermoType& inhomogeneousMixture<ThermoType>::mixture template<class ThermoType> -void inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) +void Foam::inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) { stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio"); @@ -101,8 +102,4 @@ void inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index cb95973f5413233aba935ecb80c13158f606963b..22fbb83f3ca0aa065e7fd0fad06535abe3d601f9 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef inhomogeneousMixture_H #define inhomogeneousMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class inhomogeneousMixture Declaration + Class inhomogeneousMixture Declaration \*---------------------------------------------------------------------------*/ template<class ThermoType> class inhomogeneousMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -87,10 +87,9 @@ public: inhomogeneousMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~inhomogeneousMixture() - {} + //- Destructor + virtual ~inhomogeneousMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C similarity index 73% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index 5e27d6caebedc79a446e374e6219c652ebd266d6..521959a2e9c4907cab5d5341690a263bc800a5c3 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -25,17 +25,11 @@ License \*---------------------------------------------------------------------------*/ #include "multiComponentMixture.H" -#include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class ThermoType> -const ThermoType& multiComponentMixture<ThermoType>::constructSpeciesData +const ThermoType& Foam::multiComponentMixture<ThermoType>::constructSpeciesData ( const dictionary& thermoDict ) @@ -53,27 +47,10 @@ const ThermoType& multiComponentMixture<ThermoType>::constructSpeciesData } -template<class ThermoType> -void multiComponentMixture<ThermoType>::correctMassFractions() -{ - volScalarField Yt = Y_[0]; - - for(label n=1; n<Y_.size(); n++) - { - Yt += Y_[n]; - } - - forAll (Y_, n) - { - Y_[n] /= Yt; - } -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ThermoType> -multiComponentMixture<ThermoType>::multiComponentMixture +Foam::multiComponentMixture<ThermoType>::multiComponentMixture ( const dictionary& thermoDict, const wordList& specieNames, @@ -81,7 +58,7 @@ multiComponentMixture<ThermoType>::multiComponentMixture const fvMesh& mesh ) : - combustionMixture(thermoDict, specieNames, mesh), + basicMultiComponentMixture(thermoDict, specieNames, mesh), speciesData_(species_.size()), mixture_("mixture", *specieThermoData[specieNames[0]]) { @@ -93,30 +70,26 @@ multiComponentMixture<ThermoType>::multiComponentMixture new ThermoType(*specieThermoData[species_[i]]) ); } - - correctMassFractions(); } template<class ThermoType> -multiComponentMixture<ThermoType>::multiComponentMixture +Foam::multiComponentMixture<ThermoType>::multiComponentMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, thermoDict.lookup("species"), mesh), + basicMultiComponentMixture(thermoDict, thermoDict.lookup("species"), mesh), speciesData_(species_.size()), mixture_("mixture", constructSpeciesData(thermoDict)) -{ - correctMassFractions(); -} +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ThermoType> -const ThermoType& multiComponentMixture<ThermoType>::cellMixture +const ThermoType& Foam::multiComponentMixture<ThermoType>::cellMixture ( const label celli ) const @@ -127,13 +100,13 @@ const ThermoType& multiComponentMixture<ThermoType>::cellMixture { mixture_ += Y_[n][celli]/speciesData_[n].W()*speciesData_[n]; } - + return mixture_; } template<class ThermoType> -const ThermoType& multiComponentMixture<ThermoType>::patchFaceMixture +const ThermoType& Foam::multiComponentMixture<ThermoType>::patchFaceMixture ( const label patchi, const label facei @@ -149,13 +122,16 @@ const ThermoType& multiComponentMixture<ThermoType>::patchFaceMixture Y_[n].boundaryField()[patchi][facei] /speciesData_[n].W()*speciesData_[n]; } - + return mixture_; } template<class ThermoType> -void multiComponentMixture<ThermoType>::read(const dictionary& thermoDict) +void Foam::multiComponentMixture<ThermoType>::read +( + const dictionary& thermoDict +) { forAll(species_, i) { @@ -164,8 +140,4 @@ void multiComponentMixture<ThermoType>::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H index e0298314980f4a919f65936c6c5abe7f837b02bc..cb02f56683ee715c04e479cc988fc721b3685561 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/multiComponentMixture/multiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef multiComponentMixture_H #define multiComponentMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" #include "HashPtrTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,13 +45,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class multiComponentMixture Declaration + Class multiComponentMixture Declaration \*---------------------------------------------------------------------------*/ template<class ThermoType> class multiComponentMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -96,10 +96,9 @@ public: multiComponentMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~multiComponentMixture() - {} + //- Destructor + virtual ~multiComponentMixture() + {} // Member functions diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C similarity index 70% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C index 9c020b3ade387de1c9c064c85be56bb53bb93efc..0247c643dfa4cbf72007e90d98979d969ca9f44a 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.C @@ -27,44 +27,41 @@ License #include "reactingMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -reactingMixture::reactingMixture +template<class ThermoType> +Foam::reactingMixture<ThermoType>::reactingMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - autoPtr<chemistryReader>(chemistryReader::New(thermoDict)), - multiComponentMixture<chemistryReader::reactionThermo> + autoPtr<chemistryReader<ThermoType> > + ( + chemistryReader<ThermoType>::New(thermoDict) + ), + multiComponentMixture<ThermoType> ( thermoDict, - autoPtr<chemistryReader>::operator()().species(), - autoPtr<chemistryReader>::operator()().speciesThermo(), + autoPtr<chemistryReader<ThermoType> >::operator()().species(), + autoPtr<chemistryReader<ThermoType> >::operator()().speciesThermo(), mesh ), - PtrList<chemistryReader::reaction> + PtrList<Reaction<ThermoType> > ( - autoPtr<chemistryReader>::operator()().reactions(), species_ + autoPtr<chemistryReader<ThermoType> >::operator()().reactions(), + this->species_ ) { - autoPtr<chemistryReader>::clear(); + autoPtr<chemistryReader<ThermoType> >::clear(); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void reactingMixture::read(const dictionary& thermoDict) +template<class ThermoType> +void Foam::reactingMixture<ThermoType>::read(const dictionary& thermoDict) {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H similarity index 82% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H index a280ed834a5d1611f712e1b7d67d0bc42bb406d0..be8aa476c5617a451f390bc92d727c101cea531b 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/reactingMixture/reactingMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/reactingMixture/reactingMixture.H @@ -45,24 +45,16 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class reactingMixture Declaration + Class reactingMixture Declaration \*---------------------------------------------------------------------------*/ +template<class ThermoType> class reactingMixture : - public autoPtr<chemistryReader>, - public multiComponentMixture<chemistryReader::reactionThermo>, - public PtrList<chemistryReader::reaction> + public autoPtr<chemistryReader<ThermoType> >, + public multiComponentMixture<ThermoType>, + public PtrList<Reaction<ThermoType> > { - -public: - - typedef chemistryReader::reaction reaction; - typedef chemistryReader::reactionThermo reactionThermo; - - -private: - // Private member functions //- Disallow default bitwise copy construct @@ -74,16 +66,19 @@ private: public: + //- The type of thermo package this mixture is instantiated for + typedef ThermoType thermoType; + + // Constructors //- Construct from dictionary and mesh reactingMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~reactingMixture() - {} + //- Destructor + virtual ~reactingMixture() + {} // Member functions @@ -99,6 +94,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "reactingMixture.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C similarity index 82% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C rename to src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C index 06a4e0f9ba24fc08b71802c6d645c2246caae4b0..82476163ea6a2940d327f00c16cd6a4811610b60 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -27,28 +27,28 @@ License #include "veryInhomogeneousMixture.H" #include "fvMesh.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template<class ThermoType> -const char* veryInhomogeneousMixture<ThermoType>::specieNames_[3] = +const char* Foam::veryInhomogeneousMixture<ThermoType>::specieNames_[3] = {"ft", "fu", "b"}; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ThermoType> -veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture +Foam::veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture ( const dictionary& thermoDict, const fvMesh& mesh ) : - combustionMixture(thermoDict, speciesTable(nSpecies_, specieNames_), mesh), + basicMultiComponentMixture + ( + thermoDict, + speciesTable(nSpecies_, specieNames_), + mesh + ), stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")), @@ -67,7 +67,7 @@ veryInhomogeneousMixture<ThermoType>::veryInhomogeneousMixture // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ThermoType> -const ThermoType& veryInhomogeneousMixture<ThermoType>::mixture +const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::mixture ( const scalar ft, const scalar fu @@ -92,7 +92,10 @@ const ThermoType& veryInhomogeneousMixture<ThermoType>::mixture template<class ThermoType> -void veryInhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) +void Foam::veryInhomogeneousMixture<ThermoType>::read +( + const dictionary& thermoDict +) { fuel_ = ThermoType(thermoDict.lookup("fuel")); oxidant_ = ThermoType(thermoDict.lookup("oxidant")); @@ -100,8 +103,4 @@ void veryInhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H similarity index 95% rename from src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H rename to src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index fe0e1a7b69ba34a2f17e071e32ac47b1f5dce355..c257334690649b27ca90491f37a07088f01e32b9 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -36,7 +36,7 @@ SourceFiles #ifndef veryInhomogeneousMixture_H #define veryInhomogeneousMixture_H -#include "combustionMixture.H" +#include "basicMultiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,13 +44,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class veryInhomogeneousMixture Declaration + Class veryInhomogeneousMixture Declaration \*---------------------------------------------------------------------------*/ template<class ThermoType> class veryInhomogeneousMixture : - public combustionMixture + public basicMultiComponentMixture { // Private data @@ -90,10 +90,9 @@ public: veryInhomogeneousMixture(const dictionary&, const fvMesh&); - // Destructor - - virtual ~veryInhomogeneousMixture() - {} + //- Destructor + virtual ~veryInhomogeneousMixture() + {} // Member functions diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..fca95dff16ae6b108ba5507eccff140072f8d37f --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.C @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "hReactionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(hReactionThermo, 0); + defineRunTimeSelectionTable(hReactionThermo, fvMesh); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::hReactionThermo::hReactionThermo(const fvMesh& mesh) +: + basicRhoThermo(mesh), + + h_ + ( + IOobject + ( + "h", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, 0, 0), + this->hBoundaryTypes() + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::hReactionThermo::~hReactionThermo() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..3d5c37614c3c16e3ec5fd7786bc667da322bb900 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermo.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 + +Class + Foam::hReactionThermo + +Description + Foam::hReactionThermo + +SourceFiles + hReactionThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hReactionThermo_H +#define hReactionThermo_H + +#include "basicRhoThermo.H" +#include "basicMultiComponentMixture.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hReactionThermo Declaration +\*---------------------------------------------------------------------------*/ + +class hReactionThermo +: + public basicRhoThermo +{ + +protected: + + // Protected data + + //- Enthalpy field + volScalarField h_; + + +public: + + //- Runtime type information + TypeName("hReactionThermo"); + + + //- Declare run-time constructor selection tables + declareRunTimeSelectionTable + ( + autoPtr, + hReactionThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + + + // Constructors + + //- Construct from dictionary and mesh + hReactionThermo(const fvMesh&); + + + // Selectors + + //- Standard selection based on fvMesh + static autoPtr<hReactionThermo> New(const fvMesh&); + + //- Select and check that package contains 'thermoType' + static autoPtr<hReactionThermo> NewType + ( + const fvMesh&, + const word& thermoType + ); + + + //- Destructor + virtual ~hReactionThermo(); + + + // Member functions + + //- Return the composition of the multi-component mixture + virtual basicMultiComponentMixture& composition() = 0; + + //- Return the composition of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const = 0; + + + // Access to thermodynamic state variables + + //- Enthalpy [J/kg] + // Non-const access allowed for transport equations + virtual volScalarField& h() + { + return h_; + } + + //- Enthalpy [J/kg] + virtual const volScalarField& h() const + { + return h_; + } + + + //- Sensible enthalpy [J/kg] + virtual tmp<volScalarField> hs() const = 0; + + //- Chemical enthalpy [J/kg] + virtual tmp<volScalarField> hc() const = 0; + + //- Update properties + virtual void correct() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C new file mode 100644 index 0000000000000000000000000000000000000000..006e45b588b265d3f43ed8da174bc7d6efd2d5e5 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/hReactionThermos.C @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "makeReactionThermo.H" + +#include "hReactionThermo.H" +#include "hRhoMixtureThermo.H" + +#include "perfectGas.H" + +#include "hConstThermo.H" +#include "janafThermo.H" +#include "specieThermo.H" + +#include "constTransport.H" +#include "sutherlandTransport.H" + +#include "homogeneousMixture.H" +#include "inhomogeneousMixture.H" +#include "veryInhomogeneousMixture.H" +#include "dieselMixture.H" +#include "multiComponentMixture.H" +#include "reactingMixture.H" + +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + homogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + inhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + veryInhomogeneousMixture, + constTransport, + hConstThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + homogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + inhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + veryInhomogeneousMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + +makeReactionThermo +( + hReactionThermo, + hRhoMixtureThermo, + dieselMixture, + sutherlandTransport, + janafThermo, + perfectGas +); + + +// Multi-component thermo + +makeReactionMixtureThermo +( + hReactionThermo, + hRhoMixtureThermo, + multiComponentMixture, + icoPoly8ThermoPhysics +); + + +// Multi-component reaction thermo + +makeReactionMixtureThermo +( + hReactionThermo, + hRhoMixtureThermo, + reactingMixture, + icoPoly8ThermoPhysics +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..a74bded0bf74e571e8e43d9d9126075112034ea9 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/makeReactionThermo.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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::hReactionThermo + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactionThermo_H +#define makeReactionThermo_H + +#include "addToRunTimeSelectionTable.H" +#include "basicRhoThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactionThermo(CThermo,MixtureThermo,Mixture,Transport,Thermo,EqnOfState) \ + \ +typedef MixtureThermo \ + <Mixture<Transport<specieThermo<Thermo<EqnOfState> > > > > \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + #MixtureThermo \ + "<"#Mixture"<"#Transport"<specieThermo<"#Thermo"<"#EqnOfState">>>>>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicRhoThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +) + + +#define makeReactionMixtureThermo(CThermo,MixtureThermo,Mixture,ThermoPhys) \ + \ +typedef MixtureThermo<Mixture<ThermoPhys> > \ + MixtureThermo##Mixture##ThermoPhys; \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + MixtureThermo##Mixture##ThermoPhys, \ + #MixtureThermo"<"#Mixture"<"#ThermoPhys">>", \ + 0 \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicRhoThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + CThermo, \ + MixtureThermo##Mixture##ThermoPhys, \ + fvMesh \ +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..688b37b6d2a726a82771119fd896c3649bcf59df --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/hReactionThermo/newhReactionThermo.C @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "hReactionThermo.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::New +( + const fvMesh& mesh +) +{ + word hReactionThermoTypeName; + + // 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") >> hReactionThermoTypeName; + } + + Info<< "Selecting thermodynamics package " << hReactionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hReactionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hReactionThermo::New(const fvMesh&)") + << "Unknown hReactionThermo type " + << hReactionThermoTypeName << nl << nl + << "Valid hReactionThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr<hReactionThermo>(cstrIter()(mesh)); +} + + +Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::NewType +( + const fvMesh& mesh, + const word& thermoType +) +{ + word hReactionThermoTypeName; + + // 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") >> hReactionThermoTypeName; + + if (hReactionThermoTypeName.find(thermoType) == string::npos) + { + wordList allModels = fvMeshConstructorTablePtr_->toc(); + DynamicList<word> validModels; + forAll(allModels, i) + { + if (allModels[i].find(thermoType) != string::npos) + { + validModels.append(allModels[i]); + } + } + + FatalErrorIn + ( + "autoPtr<hReactionThermo> hReactionThermo::NewType" + "(" + "const fvMesh&, " + "const word&" + ")" + ) << "Inconsistent thermo package selected:" << nl << nl + << hReactionThermoTypeName << nl << nl << "Please select a " + << "thermo package based on " << thermoType + << ". Valid options include:" << nl << validModels << nl + << exit(FatalError); + } + } + + Info<< "Selecting thermodynamics package " << hReactionThermoTypeName + << endl; + + fvMeshConstructorTable::iterator cstrIter = + fvMeshConstructorTablePtr_->find(hReactionThermoTypeName); + + if (cstrIter == fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn("hReactionThermo::New(const fvMesh&)") + << "Unknown hReactionThermo type " + << hReactionThermoTypeName << nl << nl + << "Valid hReactionThermo types are:" << nl + << fvMeshConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr<hReactionThermo>(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C new file mode 100644 index 0000000000000000000000000000000000000000..0c763fd78a155936e122e8b2438b8e284b6c67e2 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.C @@ -0,0 +1,367 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "hRhoMixtureThermo.H" +#include "fvMesh.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class MixtureType> +void Foam::hRhoMixtureThermo<MixtureType>::calculate() +{ + const scalarField& hCells = h_.internalField(); + const scalarField& pCells = p_.internalField(); + + scalarField& TCells = T_.internalField(); + scalarField& psiCells = psi_.internalField(); + scalarField& rhoCells = rho_.internalField(); + scalarField& muCells = mu_.internalField(); + scalarField& alphaCells = alpha_.internalField(); + + forAll(TCells, celli) + { + const typename MixtureType::thermoType& mixture_ = + this->cellMixture(celli); + + TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); + psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); + rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); + + muCells[celli] = mixture_.mu(TCells[celli]); + alphaCells[celli] = mixture_.alpha(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + fvPatchScalarField& pp = p_.boundaryField()[patchi]; + fvPatchScalarField& pT = T_.boundaryField()[patchi]; + fvPatchScalarField& ppsi = psi_.boundaryField()[patchi]; + fvPatchScalarField& prho = rho_.boundaryField()[patchi]; + + fvPatchScalarField& ph = h_.boundaryField()[patchi]; + + fvPatchScalarField& pmu_ = mu_.boundaryField()[patchi]; + fvPatchScalarField& palpha_ = alpha_.boundaryField()[patchi]; + + if (pT.fixesValue()) + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + ph[facei] = mixture_.H(pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu_[facei] = mixture_.mu(pT[facei]); + palpha_[facei] = mixture_.alpha(pT[facei]); + } + } + else + { + forAll(pT, facei) + { + const typename MixtureType::thermoType& mixture_ = + this->patchFaceMixture(patchi, facei); + + pT[facei] = mixture_.TH(ph[facei], pT[facei]); + + ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); + prho[facei] = mixture_.rho(pp[facei], pT[facei]); + pmu_[facei] = mixture_.mu(pT[facei]); + palpha_[facei] = mixture_.alpha(pT[facei]); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hRhoMixtureThermo<MixtureType>::hRhoMixtureThermo(const fvMesh& mesh) +: + hReactionThermo(mesh), + MixtureType(*this, mesh) +{ + scalarField& hCells = h_.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(hCells, celli) + { + hCells[celli] = this->cellMixture(celli).H(TCells[celli]); + } + + forAll(h_.boundaryField(), patchi) + { + h_.boundaryField()[patchi] == h(T_.boundaryField()[patchi], patchi); + } + + hBoundaryCorrection(h_); + + calculate(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class MixtureType> +Foam::hRhoMixtureThermo<MixtureType>::~hRhoMixtureThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class MixtureType> +void Foam::hRhoMixtureThermo<MixtureType>::correct() +{ + if (debug) + { + Info<< "entering hRhoMixtureThermo<MixtureType>::correct()" << endl; + } + + calculate(); + + if (debug) + { + Info<< "exiting hRhoMixtureThermo<MixtureType>::correct()" << endl; + } +} + + +template<class MixtureType> +Foam::tmp<Foam::volScalarField> +Foam::hRhoMixtureThermo<MixtureType>::hs() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp<volScalarField> ths + ( + new volScalarField + ( + IOobject + ( + "hs", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + h_.dimensions() + ) + ); + + volScalarField& hsf = ths(); + scalarField& hsCells = hsf.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(TCells, celli) + { + hsCells[celli] = this->cellMixture(celli).Hs(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + scalarField& hsp = hsf.boundaryField()[patchi]; + const scalarField& Tp = T_.boundaryField()[patchi]; + + forAll(Tp, facei) + { + hsp[facei] = this->patchFaceMixture(patchi, facei).Hs(Tp[facei]); + } + } + + return ths; +} + + +template<class MixtureType> +Foam::tmp<Foam::volScalarField> +Foam::hRhoMixtureThermo<MixtureType>::hc() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp<volScalarField> thc + ( + new volScalarField + ( + IOobject + ( + "hc", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + h_.dimensions() + ) + ); + + volScalarField& hcf = thc(); + scalarField& hcCells = hcf.internalField(); + + forAll(hcCells, celli) + { + hcCells[celli] = this->cellMixture(celli).Hc(); + } + + forAll(hcf.boundaryField(), patchi) + { + scalarField& hcp = hcf.boundaryField()[patchi]; + + forAll(hcp, facei) + { + hcp[facei] = this->patchFaceMixture(patchi, facei).Hc(); + } + } + + return thc; +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> +Foam::hRhoMixtureThermo<MixtureType>::h +( + const scalarField& T, + const labelList& cells +) const +{ + tmp<scalarField> th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, celli) + { + h[celli] = this->cellMixture(cells[celli]).H(T[celli]); + } + + return th; +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> +Foam::hRhoMixtureThermo<MixtureType>::h +( + const scalarField& T, + const label patchi +) const +{ + tmp<scalarField> th(new scalarField(T.size())); + scalarField& h = th(); + + forAll(T, facei) + { + h[facei] = this->patchFaceMixture(patchi, facei).H(T[facei]); + } + + return th; +} + + +template<class MixtureType> +Foam::tmp<Foam::scalarField> +Foam::hRhoMixtureThermo<MixtureType>::Cp +( + const scalarField& T, + const label patchi +) const +{ + tmp<scalarField> tCp(new scalarField(T.size())); + + scalarField& cp = tCp(); + + forAll(T, facei) + { + cp[facei] = this->patchFaceMixture(patchi, facei).Cp(T[facei]); + } + + return tCp; +} + + +template<class MixtureType> +Foam::tmp<Foam::volScalarField> +Foam::hRhoMixtureThermo<MixtureType>::Cp() const +{ + const fvMesh& mesh = T_.mesh(); + + tmp<volScalarField> tCp + ( + new volScalarField + ( + IOobject + ( + "Cp", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionSet(0, 2, -2, -1, 0) + ) + ); + + volScalarField& cp = tCp(); + + scalarField& cpCells = cp.internalField(); + const scalarField& TCells = T_.internalField(); + + forAll(TCells, celli) + { + cpCells[celli] = this->cellMixture(celli).Cp(TCells[celli]); + } + + forAll(T_.boundaryField(), patchi) + { + cp.boundaryField()[patchi] = Cp(T_.boundaryField()[patchi], patchi); + } + + return tCp; +} + + +template<class MixtureType> +bool Foam::hRhoMixtureThermo<MixtureType>::read() +{ + if (hReactionThermo::read()) + { + MixtureType::read(*this); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..570f696bac41be646b72fdf814b648c1811b285f --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/reactionThermo/mixtureThermos/hRhoMixtureThermo/hRhoMixtureThermo.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 + +Class + Foam::hRhoMixtureThermo + +Description + Foam::hRhoMixtureThermo + +SourceFiles + hRhoMixtureThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hRhoMixtureThermo_H +#define hRhoMixtureThermo_H + +#include "hReactionThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class hRhoMixtureThermo Declaration +\*---------------------------------------------------------------------------*/ + +template<class MixtureType> +class hRhoMixtureThermo +: + public hReactionThermo, + public MixtureType +{ + // Private member functions + + void calculate(); + + //- Construct as copy (not implemented) + hRhoMixtureThermo(const hRhoMixtureThermo<MixtureType>&); + + +public: + + //- Runtime type information + TypeName("hRhoMixtureThermo"); + + + // Constructors + + //- Construct from mesh + hRhoMixtureThermo(const fvMesh&); + + + //- Destructor + virtual ~hRhoMixtureThermo(); + + + // Member functions + + //- Return the compostion of the multi-component mixture + virtual basicMultiComponentMixture& composition() + { + return *this; + } + + //- Return the compostion of the multi-component mixture + virtual const basicMultiComponentMixture& composition() const + { + return *this; + } + + //- Update properties + virtual void correct(); + + //- Sensible enthalpy [J/kg] + virtual tmp<volScalarField> hs() const; + + //- Chemical enthalpy [J/kg] + virtual tmp<volScalarField> hc() const; + + + // Fields derived from thermodynamic state variables + + //- Enthalpy for cell-set [J/kg] + virtual tmp<scalarField> h + ( + const scalarField& T, + const labelList& cells + ) const; + + //- Enthalpy for patch [J/kg] + virtual tmp<scalarField> h + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure for patch [J/kg/K] + virtual tmp<scalarField> Cp + ( + const scalarField& T, + const label patchi + ) const; + + //- Heat capacity at constant pressure [J/kg/K] + virtual tmp<volScalarField> Cp() const; + + + //- Read thermophysicalProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "hRhoMixtureThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/Make/files b/src/thermophysicalModels/specie/Make/files index 2f0e008422b669478807fc035629ef717bf462e1..428f6d8fc7784f5ba6e2226740d0ffddfada9b4f 100644 --- a/src/thermophysicalModels/specie/Make/files +++ b/src/thermophysicalModels/specie/Make/files @@ -1,14 +1,15 @@ atomicWeights = atomicWeights specie = specie speciesTable = speciesTable -perfectGas = equationOfState/perfectGas +equationOfState = equationOfState reactions = reaction/reactions $(atomicWeights)/atomicWeights.C $(specie)/specie.C $(speciesTable)/speciesTable.C -$(perfectGas)/perfectGas.C +$(equationOfState)/perfectGas/perfectGas.C $(reactions)/makeChemkinReactions.C +$(reactions)/makeReactionThermoReactions.C $(reactions)/makeLangmuirHinshelwoodReactions.C LIB = $(FOAM_LIBBIN)/libspecie diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C new file mode 100644 index 0000000000000000000000000000000000000000..9fd15c2986c5fe3365f6c6d65b8af2bb2198aa34 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "icoPolynomial.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<int PolySize> +icoPolynomial<PolySize>::icoPolynomial(Istream& is) +: + specie(is), + rhoPolynomial_("rhoPolynomial", is) +{} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template<int PolySize> +Ostream& operator<<(Ostream& os, const icoPolynomial<PolySize>& ip) +{ + os << static_cast<const specie&>(ip); + + os.check + ( + "Ostream& operator<<(Ostream& os, const icoPolynomial<PolySize>& ip)" + ); + + return os; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H new file mode 100644 index 0000000000000000000000000000000000000000..27190fd833bfdedf79961cfb0b7467faaf42e84f --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H @@ -0,0 +1,212 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +Class + Foam::icoPolynomial + +Description + Incompressible, polynomial form of equation of state, using a polynomial + function for density. + +SourceFiles + icoPolynomialI.H + icoPolynomial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef icoPolynomial_H +#define icoPolynomial_H + +#include "specie.H" +#include "autoPtr.H" +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<int PolySize> +class icoPolynomial; + +template<int PolySize> +icoPolynomial<PolySize> operator+ +( + const icoPolynomial<PolySize>&, + const icoPolynomial<PolySize>& +); + +template<int PolySize> +icoPolynomial<PolySize> operator- +( + const icoPolynomial<PolySize>&, + const icoPolynomial<PolySize>& +); + +template<int PolySize> +icoPolynomial<PolySize> operator* +( + const scalar, + const icoPolynomial<PolySize>& +); + +template<int PolySize> +icoPolynomial<PolySize> operator== +( + const icoPolynomial<PolySize>&, + const icoPolynomial<PolySize>& +); + +template<int PolySize> +Ostream& operator<< +( + Ostream&, + const icoPolynomial<PolySize>& +); + + +/*---------------------------------------------------------------------------*\ + Class icoPolynomial Declaration +\*---------------------------------------------------------------------------*/ + +template<int PolySize> +class icoPolynomial +: + public specie +{ + // Private data + + //- Density + Polynomial<PolySize> rhoPolynomial_; + + +public: + + // Constructors + + //- Construct from components + inline icoPolynomial + ( + const specie& sp, + const Polynomial<PolySize>& rhoPoly + ); + + //- Construct from Istream + icoPolynomial(Istream&); + + //- Construct as named copy + inline icoPolynomial(const word& name, const icoPolynomial&); + + //- Construct and return a clone + inline autoPtr<icoPolynomial> clone() const; + + // Selector from Istream + inline static autoPtr<icoPolynomial> New(Istream& is); + + + // Member functions + + //- Return density [kg/m^3] + inline scalar rho(scalar p, scalar T) const; + + //- Return compressibility rho/p [s^2/m^2] + inline scalar psi(scalar p, scalar T) const; + + //- Return compression factor [] + inline scalar Z(scalar p, scalar T) const; + + + // Member operators + + inline void operator+=(const icoPolynomial&); + inline void operator-=(const icoPolynomial&); + + inline void operator*=(const scalar); + + + // Friend operators + + friend icoPolynomial operator+ <PolySize> + ( + const icoPolynomial&, + const icoPolynomial& + ); + + friend icoPolynomial operator- <PolySize> + ( + const icoPolynomial&, + const icoPolynomial& + ); + + friend icoPolynomial operator* <PolySize> + ( + const scalar s, + const icoPolynomial& + ); + + friend icoPolynomial operator== <PolySize> + ( + const icoPolynomial&, + const icoPolynomial& + ); + + + // Ostream Operator + + friend Ostream& operator<< <PolySize>(Ostream&, const icoPolynomial&); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeIcoPolynomial(PolySize) \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + icoPolynomial<PolySize>, \ + "icoPolynomial<"#PolySize">", \ + 0 \ +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "icoPolynomialI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "icoPolynomial.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H new file mode 100644 index 0000000000000000000000000000000000000000..d174c57192bac3d842188fc6a03ddda8eeb23aac --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomialI.H @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "icoPolynomial.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<int PolySize> +inline Foam::icoPolynomial<PolySize>::icoPolynomial +( + const specie& sp, + const Polynomial<PolySize>& rhoPoly +) +: + specie(sp), + rhoPolynomial_(rhoPoly) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<int PolySize> +inline Foam::icoPolynomial<PolySize>::icoPolynomial +( + const word& name, + const icoPolynomial<PolySize>& ip +) +: + specie(name, ip), + rhoPolynomial_(ip.rhoPolynomial_) +{} + + +template<int PolySize> +inline Foam::autoPtr<Foam::icoPolynomial<PolySize> > +Foam::icoPolynomial<PolySize>::clone() const +{ + return autoPtr<icoPolynomial<PolySize> > + ( + new icoPolynomial<PolySize>(*this) + ); +} + + +template<int PolySize> +inline Foam::autoPtr<Foam::icoPolynomial<PolySize> > +Foam::icoPolynomial<PolySize>::New(Istream& is) +{ + return autoPtr<icoPolynomial<PolySize> >(new icoPolynomial<PolySize>(is)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<int PolySize> +inline Foam::scalar Foam::icoPolynomial<PolySize>::rho(scalar, scalar T) const +{ + return rhoPolynomial_.evaluate(T); +} + + +template<int PolySize> +inline Foam::scalar Foam::icoPolynomial<PolySize>::psi(scalar, scalar) const +{ + return 0.0; +} + + +template<int PolySize> +inline Foam::scalar Foam::icoPolynomial<PolySize>::Z(scalar, scalar) const +{ + return 0.0; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<int PolySize> +inline void Foam::icoPolynomial<PolySize>::operator+= +( + const icoPolynomial<PolySize>& ip +) +{ + scalar molr1 = this->nMoles(); + + specie::operator+=(ip); + + molr1 /= this->nMoles(); + scalar molr2 = ip.nMoles()/this->nMoles(); + + rhoPolynomial_ = molr1*rhoPolynomial_ + molr2*ip.rhoPolynomial_; +} + + +template<int PolySize> +inline void Foam::icoPolynomial<PolySize>::operator-= +( + const icoPolynomial<PolySize>& ip +) +{ + scalar molr1 = this->nMoles(); + specie::operator-=(ip); + + molr1 /= this->nMoles(); + scalar molr2 = ip.nMoles()/this->nMoles(); + + rhoPolynomial_ = molr1*rhoPolynomial_ - molr2*ip.rhoPolynomial_; +} + + +template<int PolySize> +inline void Foam::icoPolynomial<PolySize>::operator*=(const scalar s) +{ + specie::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<int PolySize> +Foam::icoPolynomial<PolySize> Foam::operator+ +( + const icoPolynomial<PolySize>& ip1, + const icoPolynomial<PolySize>& ip2 +) +{ + scalar mol1 = ip1.nMoles(); + scalar mol2 = ip2.nMoles(); + scalar nMoles = mol1 + mol2; + + return icoPolynomial<PolySize> + ( + static_cast<const specie&>(ip1) + + static_cast<const specie&>(ip2), + (mol1/nMoles)*ip1.rhoPolynomial_ + (mol2/nMoles)*ip2.rhoPolynomial_ + ); +} + + +template<int PolySize> +Foam::icoPolynomial<PolySize> Foam::operator- +( + const icoPolynomial<PolySize>& ip1, + const icoPolynomial<PolySize>& ip2 +) +{ + scalar mol1 = ip1.nMoles(); + scalar mol2 = ip2.nMoles(); + scalar nMoles = mol1 + mol2; + + return icoPolynomial<PolySize> + ( + static_cast<const specie&>(ip1) + - static_cast<const specie&>(ip2), + (mol1/nMoles)*ip1.rhoPolynomial_ - (mol2/nMoles)*ip2.rhoPolynomial_ + ); +} + + +template<int PolySize> +Foam::icoPolynomial<PolySize> Foam::operator* +( + const scalar s, + const icoPolynomial<PolySize>& ip +) +{ + return icoPolynomial<PolySize> + ( + s*static_cast<const specie&>(ip), + ip.rhoPolynomial_ + ); +} + + +template<int PolySize> +Foam::icoPolynomial<PolySize> Foam::operator== +( + const icoPolynomial<PolySize>& ip1, + const icoPolynomial<PolySize>& ip2 +) +{ + return ip2 - ip1; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/sprayThermoTypes/sprayThermoTypes.H b/src/thermophysicalModels/specie/include/reactionTypes.H similarity index 77% rename from src/lagrangian/dieselSpray/sprayThermoTypes/sprayThermoTypes.H rename to src/thermophysicalModels/specie/include/reactionTypes.H index b52f690b5f88384469aea4b0c402217db41993a7..531c9760bf1783a33d7a9f001906370ee9bb63b6 100644 --- a/src/lagrangian/dieselSpray/sprayThermoTypes/sprayThermoTypes.H +++ b/src/thermophysicalModels/specie/include/reactionTypes.H @@ -22,31 +22,33 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Typedef - Foam::specieProperties +Typedefs + Foam::reactionTypes Description - Foam::specieProperties + Type definitions for reactions \*---------------------------------------------------------------------------*/ -#ifndef sprayThermoTypes_H -#define sprayThermoTypes_H +#ifndef reactionTypes_H +#define reactionTypes_H -#include "sutherlandTransport.H" -#include "specieThermo.H" -#include "janafThermo.H" -#include "perfectGas.H" +#include "thermoPhysicsTypes.H" +#include "Reaction.H" + +#include "icoPolynomial.H" +#include "polynomialThermo.H" +#include "polynomialTransport.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef sutherlandTransport<specieThermo<janafThermo<perfectGas> > > - specieProperties; + typedef Reaction<gasThermoPhysics> gasReaction; + + typedef Reaction<constGasThermoPhysics> constGasReaction; - // typedef sutherlandTransport<specieThermo<hConstThermo<perfectGas> > > - // specieProperties; + typedef Reaction<icoPoly8ThermoPhysics> icoPoly8Reaction; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,3 +56,4 @@ namespace Foam #endif // ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H similarity index 73% rename from src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H rename to src/thermophysicalModels/specie/include/thermoPhysicsTypes.H index 9f176ade30950836f3971d65998686b82dab5234..2b85b224747d1657f80d868b583331307be3b6e4 100644 --- a/src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H +++ b/src/thermophysicalModels/specie/include/thermoPhysicsTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,15 +23,15 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Typedefs - Foam::ReactingCloudThermoTypes + Foam::thermoPhysicsTypes Description - Type definitions for available thermo pacakges + Type definitions for thermo-physics models \*---------------------------------------------------------------------------*/ -#ifndef reactingThermoTypes_H -#define reactingThermoTypes_H +#ifndef thermoPhysicsTypes_H +#define thermoPhysicsTypes_H #include "perfectGas.H" #include "hConstThermo.H" @@ -40,15 +40,33 @@ Description #include "sutherlandTransport.H" #include "constTransport.H" +#include "icoPolynomial.H" +#include "polynomialThermo.H" +#include "polynomialTransport.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef sutherlandTransport<specieThermo<janafThermo<perfectGas> > > - specieReactingProperties; + gasThermoPhysics; typedef constTransport<specieThermo<hConstThermo<perfectGas> > > - specieConstProperties; + constGasThermoPhysics; + + typedef polynomialTransport + < + specieThermo + < + polynomialThermo + < + icoPolynomial<8>, + 8 + > + >, + 8 + > + icoPoly8ThermoPhysics; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,3 +74,4 @@ namespace Foam #endif // ************************************************************************* // + diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C index 3bd2e3d0de95388b6a3914f9fe2814f9247e09ae..3756f2e3657a0b1a5dce610248a9250fcb1d02a5 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeChemkinReactions.C @@ -26,7 +26,8 @@ Description \*---------------------------------------------------------------------------*/ -#include "makeReactionJanaf.H" +#include "reactionTypes.H" +#include "makeReactionThermo.H" #include "ArrheniusReactionRate.H" #include "thirdBodyArrheniusReactionRate.H" @@ -47,21 +48,39 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTemplateTypeNameAndDebug(reaction, 0); -defineTemplateRunTimeSelectionTable(reaction, Istream); +defineTemplateTypeNameAndDebug(gasReaction, 0); +defineTemplateRunTimeSelectionTable(gasReaction, Istream); // * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * // -makeIRNReactions(ArrheniusReactionRate) -makeIRNReactions(LandauTellerReactionRate) -makeIRNReactions(thirdBodyArrheniusReactionRate) -makeIRReactions(JanevReactionRate) -makeIRReactions(powerSeriesReactionRate) +makeIRNReactions(gasThermoPhysics, ArrheniusReactionRate) +makeIRNReactions(gasThermoPhysics, LandauTellerReactionRate) +makeIRNReactions(gasThermoPhysics, thirdBodyArrheniusReactionRate) +makeIRReactions(gasThermoPhysics, JanevReactionRate) +makeIRReactions(gasThermoPhysics, powerSeriesReactionRate) + +makePressureDependentReactions +( + gasThermoPhysics, + ArrheniusReactionRate, + LindemannFallOffFunction +) + +makePressureDependentReactions +( + gasThermoPhysics, + ArrheniusReactionRate, + TroeFallOffFunction +) + +makePressureDependentReactions +( + gasThermoPhysics, + ArrheniusReactionRate, + SRIFallOffFunction +) -makePressureDependentReactions(ArrheniusReactionRate, LindemannFallOffFunction) -makePressureDependentReactions(ArrheniusReactionRate, TroeFallOffFunction) -makePressureDependentReactions(ArrheniusReactionRate, SRIFallOffFunction) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C index 8a4b2f6ad87747979a644823d50b1774c9901c69..1789fe80fc4d513d6c0b3b7de485ba7f1fd2daf3 100644 --- a/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C +++ b/src/thermophysicalModels/specie/reaction/reactions/makeLangmuirHinshelwoodReactions.C @@ -26,17 +26,16 @@ Description \*---------------------------------------------------------------------------*/ -#include "makeReactionJanaf.H" +#include "makeReactionThermo.H" +#include "reactionTypes.H" #include "LangmuirHinshelwoodReactionRate.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - - makeIRReactions(LangmuirHinshelwoodReactionRate) - + makeIRReactions(gasThermoPhysics, LangmuirHinshelwoodReactionRate) + makeIRReactions(icoPoly8ThermoPhysics, LangmuirHinshelwoodReactionRate) } // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H b/src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H deleted file mode 100644 index 7a4de043f6dde0b06cbdfde930893a31661ac217..0000000000000000000000000000000000000000 --- a/src/thermophysicalModels/specie/reaction/reactions/makeReactionJanaf.H +++ /dev/null @@ -1,118 +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::makeReactionJanaf - -Description - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactionJanaf_H -#define makeReactionJanaf_H - -#include "Reaction.H" - -#include "IrreversibleReaction.H" -#include "ReversibleReaction.H" -#include "NonEquilibriumReversibleReaction.H" - -#include "sutherlandTransport.H" -#include "specieThermo.H" -#include "janafThermo.H" -#include "perfectGas.H" - -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -typedef sutherlandTransport<specieThermo<janafThermo<perfectGas> > > - reactionThermo; - -typedef Reaction<reactionThermo> - reaction; - -#define makeReaction(Reaction, ReactionRate) \ - \ - typedef Reaction<reactionThermo, ReactionRate> \ - Reaction##ReactionRate; \ - \ - template<> \ - const word Reaction##ReactionRate::typeName \ - ( \ - Reaction::typeName_() \ - + ReactionRate::type() \ - + reaction::typeName_() \ - ); \ - \ - addToRunTimeSelectionTable(reaction, Reaction##ReactionRate, Istream); - -#define makePressureDependentReaction(Reaction, PressureDependentReactionRate, ReactionRate, FallOffFunction) \ - \ - typedef PressureDependentReactionRate<ReactionRate, FallOffFunction> \ - PressureDependentReactionRate##ReactionRate##FallOffFunction; \ - \ - makeReaction \ - (Reaction, PressureDependentReactionRate##ReactionRate##FallOffFunction) - -#define makeIRReactions(ReactionRate) \ - makeReaction(IrreversibleReaction, ReactionRate) \ - makeReaction(ReversibleReaction, ReactionRate) - -#define makeIRNReactions(ReactionRate) \ - makeIRReactions(ReactionRate) \ - makeReaction(NonEquilibriumReversibleReaction, ReactionRate) - -#define makePressureDependentReactions(ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (IrreversibleReaction, FallOffReactionRate, \ - ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (ReversibleReaction, FallOffReactionRate, \ - ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (IrreversibleReaction, ChemicallyActivatedReactionRate, \ - ReactionRate, FallOffFunction) \ - \ - makePressureDependentReaction \ - (ReversibleReaction, ChemicallyActivatedReactionRate, \ - ReactionRate, FallOffFunction) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..89cf9875d037aa6bc17c131113ee0edb14cd644f --- /dev/null +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermo.H @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::makeReactionThermo + +Description + Macros for instantiating reactions on given thermo packages + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactionTherno_H +#define makeReactionThermo_H + +#include "Reaction.H" + +#include "IrreversibleReaction.H" +#include "ReversibleReaction.H" +#include "NonEquilibriumReversibleReaction.H" + +#include "specieThermo.H" + +#include "sutherlandTransport.H" +#include "janafThermo.H" +#include "perfectGas.H" + +#include "polynomialTransport.H" +#include "polynomialThermo.H" +#include "icoPolynomial.H" + +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReaction(Thermo, ReactionType, ReactionRate) \ + \ + typedef Reaction<Thermo> Reaction##Thermo; \ + \ + typedef ReactionType<Thermo, ReactionRate> \ + ReactionType##Thermo##ReactionRate; \ + \ + template<> \ + const word ReactionType##Thermo##ReactionRate::typeName \ + ( \ + ReactionType::typeName_() \ + + ReactionRate::type() \ + + Reaction##Thermo::typeName_() \ + ); \ + \ + addToRunTimeSelectionTable \ + ( \ + Reaction##Thermo, \ + ReactionType##Thermo##ReactionRate, \ + Istream \ + ); + + +#define makePressureDependentReaction(Thermo, Reaction, PressureDependentReactionRate, ReactionRate, FallOffFunction) \ + \ + typedef PressureDependentReactionRate<ReactionRate, FallOffFunction> \ + PressureDependentReactionRate##ReactionRate##FallOffFunction; \ + \ + makeReaction \ + ( \ + Thermo, \ + Reaction, \ + PressureDependentReactionRate##ReactionRate##FallOffFunction \ + ) + + +#define makeIRReactions(Thermo, ReactionRate) \ + \ + makeReaction(Thermo, IrreversibleReaction, ReactionRate) \ + \ + makeReaction(Thermo, ReversibleReaction, ReactionRate) + + +#define makeIRNReactions(Thermo, ReactionRate) \ + \ + makeIRReactions(Thermo, ReactionRate) \ + \ + makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate) + + +#define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + IrreversibleReaction, \ + FallOffReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + ReversibleReaction, \ + FallOffReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + IrreversibleReaction, \ + ChemicallyActivatedReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) \ + \ + makePressureDependentReaction \ + ( \ + Thermo, \ + ReversibleReaction, \ + ChemicallyActivatedReactionRate, \ + ReactionRate, \ + FallOffFunction \ + ) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C new file mode 100644 index 0000000000000000000000000000000000000000..1a054b11249f50609912d1fd90f49f7a01376f4f --- /dev/null +++ b/src/thermophysicalModels/specie/reaction/reactions/makeReactionThermoReactions.C @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + +Description + +\*---------------------------------------------------------------------------*/ + +#include "reactionTypes.H" +#include "makeReactionThermo.H" + +#include "ArrheniusReactionRate.H" +#include "thirdBodyArrheniusReactionRate.H" +#include "FallOffReactionRate.H" +#include "ChemicallyActivatedReactionRate.H" +#include "LindemannFallOffFunction.H" +#include "TroeFallOffFunction.H" +#include "SRIFallOffFunction.H" +#include "LandauTellerReactionRate.H" +#include "JanevReactionRate.H" +#include "powerSeriesReactionRate.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTemplateTypeNameAndDebug(icoPoly8Reaction, 0); +defineTemplateRunTimeSelectionTable(icoPoly8Reaction, Istream); + + +// * * * * * * * * * * * * * Make CHEMKIN reactions * * * * * * * * * * * * // + +makeIRNReactions(icoPoly8ThermoPhysics, ArrheniusReactionRate) +makeIRNReactions(icoPoly8ThermoPhysics, LandauTellerReactionRate) +makeIRNReactions(icoPoly8ThermoPhysics, thirdBodyArrheniusReactionRate) +makeIRReactions(icoPoly8ThermoPhysics, JanevReactionRate) +makeIRReactions(icoPoly8ThermoPhysics, powerSeriesReactionRate) + +makePressureDependentReactions +( + icoPoly8ThermoPhysics, + ArrheniusReactionRate, + LindemannFallOffFunction +) + +makePressureDependentReactions +( + icoPoly8ThermoPhysics, + ArrheniusReactionRate, + TroeFallOffFunction +) + +makePressureDependentReactions +( + icoPoly8ThermoPhysics, + ArrheniusReactionRate, + SRIFallOffFunction +) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/specie/specie.H b/src/thermophysicalModels/specie/specie/specie.H index 38f36e34f2c6af4e8eb894e8f98a3807916ad04e..10238c220cd617dc51d0b4a365fdd8ec5ae451dc 100644 --- a/src/thermophysicalModels/specie/specie/specie.H +++ b/src/thermophysicalModels/specie/specie/specie.H @@ -62,7 +62,7 @@ class specie //- Number of moles of this component in the mixture scalar nMoles_; - //- Molecular weight of specie + //- Molecular weight of specie [kg/kmol] scalar molWeight_; diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C index 8d62be816fbbe6806de8e0fada75ebfa8561879a..e13eb5b0ab3c77b8e520bc5ef9c006016cd92619 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C @@ -29,9 +29,10 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::eConstThermo::eConstThermo(Istream& is) +template<class equationOfState> +Foam::eConstThermo<equationOfState>::eConstThermo(Istream& is) : - specieThermo(is), + equationOfState(is), Cv_(readScalar(is)), Hf_(readScalar(is)) { @@ -41,9 +42,15 @@ Foam::eConstThermo::eConstThermo(Istream& is) // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const eConstThermo& ct) +template<class equationOfState> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const eConstThermo<equationOfState>& ct +) { - os << (const specieThermo&)ct << tab << ct.Cv_ << tab << ct.Hf_; + os << static_cast<const equationOfState&>(ct) << tab + << ct.Cv_ << tab << ct.Hf_; os.check("Ostream& operator<<(Ostream& os, const eConstThermo& ct)"); return os; diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H index c01600eabdbc52d7b1df70b739305ac340fb568c..6d9bef74233c05173010b7595c627bb9d40eacc7 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H @@ -26,8 +26,8 @@ Class Foam::eConstThermo Description - Constant properties thermodynamics package derived from the basic - thermo package data type specieThermo. + Constant properties thermodynamics package templated on an equation of + state SourceFiles eConstThermoI.H @@ -86,12 +86,13 @@ Ostream& operator<< /*---------------------------------------------------------------------------*\ - Class eConstThermo Declaration + Class eConstThermo Declaration \*---------------------------------------------------------------------------*/ +template<class equationOfState> class eConstThermo : - public specieThermo + public equationOfState { // Private data @@ -104,7 +105,7 @@ class eConstThermo //- Construct from components inline eConstThermo ( - const specieThermo& st, + const equationOfState& st, const scalar cv, const scalar hf ); @@ -147,20 +148,10 @@ public: inline scalar s(const scalar T) const; - // Some derived properties - // Other derived properties obtained from specieThermo base type - - //- Temperature from Enthalpy given an initial temperature T0 - inline scalar TH(const scalar h, const scalar T0) const; - - //- Temperature from internal energy given an initial temperature T0 - inline scalar TE(const scalar e, const scalar T0) const; - - // Member operators - inline void operator+=(const hConstThermo&); - inline void operator-=(const hConstThermo&); + inline void operator+=(const eConstThermo&); + inline void operator-=(const eConstThermo&); // Friend operators @@ -194,7 +185,8 @@ public: friend Ostream& operator<< <equationOfState> ( - Ostream&, const eConstThermo& + Ostream&, + const eConstThermo& ); }; @@ -207,6 +199,10 @@ public: #include "eConstThermoI.H" +#ifdef NoRepository +# include "eConstThermo.C" +#endif + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H index aba6da1eef53a90a480ccc694c106be2a2170d6d..8e021c53ab403ba935b1dccfa4cd158edbc7a459 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H @@ -26,14 +26,15 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -inline Foam::eConstThermo::eConstThermo +template<class equationOfState> +inline Foam::eConstThermo<equationOfState>::eConstThermo ( - const specieThermo& st, + const equationOfState& st, const scalar cv, const scalar hf ) : - specieThermo(st), + equationOfState(st), Cv_(cv), Hf_(hf) {} @@ -41,20 +42,21 @@ inline Foam::eConstThermo::eConstThermo // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -inline Foam::eConstThermo::eConstThermo +template<class equationOfState> +inline Foam::eConstThermo<equationOfState>::eConstThermo ( const word& name, - const eConstThermo& ct + const eConstThermo<equationOfState>& ct ) : - specieThermo(name, ct), + equationOfState(name, ct), Cv_(ct.Cv_), Hf_(ct.Hf_) {} template<class equationOfState> -inline Foam::autoPtr<eConstThermo<equationOfState> > +inline Foam::autoPtr<Foam::eConstThermo<equationOfState> > Foam::eConstThermo<equationOfState>::clone() const { return autoPtr<eConstThermo<equationOfState> > @@ -65,7 +67,7 @@ Foam::eConstThermo<equationOfState>::clone() const template<class equationOfState> -inline autoPtr<eConstThermo<equationOfState> > +inline Foam::autoPtr<Foam::eConstThermo<equationOfState> > Foam::eConstThermo<equationOfState>::New(Istream& is) { return autoPtr<eConstThermo<equationOfState> > @@ -77,19 +79,31 @@ Foam::eConstThermo<equationOfState>::New(Istream& is) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::scalar Foam::eConstThermo::cp(const scalar) const +template<class equationOfState> +inline Foam::scalar Foam::eConstThermo<equationOfState>::cp +( + const scalar +) const { - return Cv_*W() + RR; + return Cv_*this->W() + specie::RR; } -inline Foam::scalar Foam::eConstThermo::h(const scalar T) const +template<class equationOfState> +inline Foam::scalar Foam::eConstThermo<equationOfState>::h +( + const scalar T +) const { - return cp(T)*T + Hf_*W(); + return cp(T)*T + Hf_*this->W(); } -inline Foam::scalar Foam::eConstThermo::hs(const scalar T) const +template<class equationOfState> +inline Foam::scalar Foam::eConstThermo<equationOfState>::hs +( + const scalar T +) const { return cp(T)*T; } @@ -102,104 +116,126 @@ inline Foam::scalar Foam::eConstThermo<equationOfState>::hc() const } -inline Foam::scalar Foam::eConstThermo::s(const scalar T) const +template<class equationOfState> +inline Foam::scalar Foam::eConstThermo<equationOfState>::s +( + const scalar T +) const { notImplemented("scalar eConstThermo::s(const scalar T) const"); return T; } -inline Foam::scalar Foam::eConstThermo::TH +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class equationOfState> +inline void Foam::eConstThermo<equationOfState>::operator+= ( - const scalar h, - const scalar T0 -) const + const eConstThermo<equationOfState>& ct +) { - return (h - Hf_)/Cp(T0); -} + scalar molr1 = this->nMoles(); + equationOfState::operator+=(ct); -inline Foam::scalar Foam::eConstThermo::TE -( - const scalar e, - const scalar -) const -{ - return (e - Hf_)/Cv_; + molr1 /= this->nMoles(); + scalar molr2 = ct.nMoles()/this->nMoles(); + + Cv_ = molr1*Cv_ + molr2*ct.Cv_; + Hf_ = molr1*Hf_ + molr2*ct.Hf_; } -// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // - -inline Foam::eConstThermo& Foam::eConstThermo::operator= +template<class equationOfState> +inline void Foam::eConstThermo<equationOfState>::operator-= ( - const eConstThermo& ct + const eConstThermo<equationOfState>& ct ) { - specieThermo::operator=(ct); + scalar molr1 = this->nMoles(); - Cv_ = ct.Cv_; - Hf_ = ct.Hf_; + equationOfState::operator-=(ct); - return *this; + molr1 /= this->nMoles(); + scalar molr2 = ct.nMoles()/this->nMoles(); + + Cv_ = molr1*Cv_ - molr2*ct.Cv_; + Hf_ = molr1*Hf_ - molr2*ct.Hf_; } // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // -inline Foam::eConstThermo Foam::operator+ +template<class equationOfState> +inline Foam::eConstThermo<equationOfState> Foam::operator+ ( - const eConstThermo& ct1, - const eConstThermo& ct2 + const eConstThermo<equationOfState>& ct1, + const eConstThermo<equationOfState>& ct2 ) { - specieThermo st(((const specieThermo&)ct1) + ((const specieThermo&)ct2)); + equationOfState eofs + ( + static_cast<const equationOfState&>(ct1) + + static_cast<const equationOfState&>(ct2) + ); - return eConstThermo + return eConstThermo<equationOfState> ( - st, - ct1.nMoles()/st.nMoles()*ct1.Cv_ + ct2.nMoles()/st.nMoles()*ct2.Cv_, - ct1.nMoles()/st.nMoles()*ct1.Hf_ + ct2.nMoles()/st.nMoles()*ct2.Hf_ + eofs, + ct1.nMoles()/eofs.nMoles()*ct1.Cv_ + + ct2.nMoles()/eofs.nMoles()*ct2.Cv_, + ct1.nMoles()/eofs.nMoles()*ct1.Hf_ + + ct2.nMoles()/eofs.nMoles()*ct2.Hf_ ); } -inline Foam::eConstThermo Foam::operator- +template<class equationOfState> +inline Foam::eConstThermo<equationOfState> Foam::operator- ( - const eConstThermo& ct1, - const eConstThermo& ct2 + const eConstThermo<equationOfState>& ct1, + const eConstThermo<equationOfState>& ct2 ) { - specieThermo st(((const specieThermo&)ct1) - ((const specieThermo&)ct2)); + equationOfState eofs + ( + static_cast<const equationOfState&>(ct1) + - static_cast<const equationOfState&>(ct2) + ); - return eConstThermo + return eConstThermo<equationOfState> ( - st, - ct1.nMoles()/st.nMoles()*ct1.Cv_ - ct2.nMoles()/st.nMoles()*ct2.Cv_, - ct1.nMoles()/st.nMoles()*ct1.Hf_ - ct2.nMoles()/st.nMoles()*ct2.Hf_ + eofs, + ct1.nMoles()/eofs.nMoles()*ct1.Cv_ + - ct2.nMoles()/eofs.nMoles()*ct2.Cv_, + ct1.nMoles()/eofs.nMoles()*ct1.Hf_ + - ct2.nMoles()/eofs.nMoles()*ct2.Hf_ ); } -inline Foam::eConstThermo Foam::operator* +template<class equationOfState> +inline Foam::eConstThermo<equationOfState> Foam::operator* ( const scalar s, - const eConstThermo& ct + const eConstThermo<equationOfState>& ct ) { - return eConstThermo + return eConstThermo<equationOfState> ( - s*((const specieThermo&)ct), + s*static_cast<const equationOfState&>(ct), ct.Cv_, ct.Hf_ ); } -inline Foam::eConstThermo Foam::operator== +template<class equationOfState> +inline Foam::eConstThermo<equationOfState> Foam::operator== ( - const eConstThermo& ct1, - const eConstThermo& ct2 + const eConstThermo<equationOfState>& ct1, + const eConstThermo<equationOfState>& ct2 ) { return ct2 - ct1; diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelI.H b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C similarity index 58% rename from src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelI.H rename to src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C index a3bf01eb35772d6f5fdd64feafc21de6449b8a61..c764426bbece5b913f6c6386ddaa8884ded89270 100644 --- a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelI.H +++ b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.C @@ -24,49 +24,46 @@ License \*---------------------------------------------------------------------------*/ +#include "polynomialThermo.H" +#include "IOstreams.H" + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template <class ParcelType> -inline Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel -( - ReactingCloud<ParcelType>& owner, - const vector& position, - const label cellI -) +template<class EquationOfState, int PolySize> +Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo(Istream& is) : - ReactingParcel<ParcelType>(owner, position, cellI), - ParticleTrackingData<ParcelType>(owner) + EquationOfState(is), + Hf_(readScalar(is)), + Sf_(readScalar(is)), + cpPolynomial_("cpPolynomial", is), + dhPolynomial_("dhPolynomial", cpPolynomial_.integrate()), + sPolynomial_("sPolynomial", cpPolynomial_.integrateMinus1()) {} -template <class ParcelType> -inline Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +template<class EquationOfState, int PolySize> +Foam::Ostream& Foam::operator<< ( - ReactingCloud<ParcelType>& owner, - const vector& position, - const label cellI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const vector& U0, - const scalarField& Y0, - const constantProperties& constProps + Ostream& os, + const polynomialThermo<EquationOfState, PolySize>& pt ) -: - ReactingParcel<ParcelType> +{ + os << static_cast<const EquationOfState&>(pt) << tab + << pt.Hf_ << tab + << pt.Sf_ << tab + << pt.cpPolynomial_ << tab + << pt.dhPolynomial_ << tab + << pt.sPolynomial; + + os.check ( - owner, - position, - cellI, - typeId, - nParticle0, - d0, - U0, - Y0, - constProps - ), - ParticleTrackingData<ParcelType>(owner) -{} + "operator<<(Ostream& os, const polynomialThermo<EquationOfState>& pt)" + ); + + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..5f76a826d7735ea915038a937db2cbb27209d9ef --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermo.H @@ -0,0 +1,221 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +Class + Foam::polynomialThermo + +Description + Thermodynamics package templated on the equation of state, using polynomial + functions for cp, h and s + + Polynomials for h and s derived from cp + +SourceFiles + polynomialThermoI.H + polynomialThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef polynomialThermo_H +#define polynomialThermo_H + +#include "scalar.H" +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<class EquationOfState, int PolySize> +class polynomialThermo; + +template<class EquationOfState, int PolySize> +inline polynomialThermo<EquationOfState, PolySize> operator+ +( + const polynomialThermo<EquationOfState, PolySize>&, + const polynomialThermo<EquationOfState, PolySize>& +); + +template<class EquationOfState, int PolySize> +inline polynomialThermo<EquationOfState, PolySize> operator- +( + const polynomialThermo<EquationOfState, PolySize>&, + const polynomialThermo<EquationOfState, PolySize>& +); + +template<class EquationOfState, int PolySize> +inline polynomialThermo<EquationOfState, PolySize> operator* +( + const scalar, + const polynomialThermo<EquationOfState, PolySize>& +); + +template<class EquationOfState, int PolySize> +inline polynomialThermo<EquationOfState, PolySize> operator== +( + const polynomialThermo<EquationOfState, PolySize>&, + const polynomialThermo<EquationOfState, PolySize>& +); + +template<class EquationOfState, int PolySize> +Ostream& operator<< +( + Ostream&, + const polynomialThermo<EquationOfState, PolySize>& +); + + +/*---------------------------------------------------------------------------*\ + Class polynomialThermo Declaration +\*---------------------------------------------------------------------------*/ + +template<class EquationOfState, int PolySize> +class polynomialThermo +: + public EquationOfState +{ + // Private data + + //- Heat of formation [J/kg] + scalar Hf_; + + //- Standard entropy [J/(kg.K)] + scalar Sf_; + + //- Specific heat at constant pressure + Polynomial<PolySize> cpPolynomial_; + + //- Enthalpy - derived from cp + typename Polynomial<PolySize>::intPolyType dhPolynomial_; + + //- Entropy - derived from cp + Polynomial<PolySize> sPolynomial_; + + + // Private member functions + + //- Construct from components + inline polynomialThermo + ( + const EquationOfState& pt, + const scalar Hf, + const scalar Sf, + const Polynomial<PolySize>& cpPoly, + const typename Polynomial<PolySize>::intPolyType& hPoly, + const Polynomial<PolySize>& sPoly + ); + + +public: + + // Constructors + + //- Construct from dictionary + polynomialThermo(Istream& is); + + //- Construct as a named copy + inline polynomialThermo(const word&, const polynomialThermo&); + + + // Member Functions + + //- Heat capacity at constant pressure [J/(kmol K)] + inline scalar cp(const scalar T) const; + + //- Enthalpy [J/kmol] + inline scalar h(const scalar T) const; + + //- Sensible enthalpy [J/kmol] + inline scalar hs(const scalar T) const; + + //- Chemical enthalpy [J/kmol] + inline scalar hc() const; + + //- Entropy [J/(kmol K)] + inline scalar s(const scalar T) const; + + + // Member operators + + inline void operator+=(const polynomialThermo&); + inline void operator-=(const polynomialThermo&); + + + // Friend operators + + friend polynomialThermo operator+ <EquationOfState, PolySize> + ( + const polynomialThermo&, + const polynomialThermo& + ); + + friend polynomialThermo operator- <EquationOfState, PolySize> + ( + const polynomialThermo&, + const polynomialThermo& + ); + + friend polynomialThermo operator* <EquationOfState, PolySize> + ( + const scalar, + const polynomialThermo& + ); + + friend polynomialThermo operator== <EquationOfState, PolySize> + ( + const polynomialThermo&, + const polynomialThermo& + ); + + + // Ostream Operator + + friend Ostream& operator<< <EquationOfState, PolySize> + ( + Ostream&, + const polynomialThermo& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "polynomialThermoI.H" + +#ifdef NoRepository +# include "polynomialThermo.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H new file mode 100644 index 0000000000000000000000000000000000000000..28e80c5d5fc6741abf56786622d59e858db4bfe6 --- /dev/null +++ b/src/thermophysicalModels/specie/thermo/polynomial/polynomialThermoI.H @@ -0,0 +1,249 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "polynomialThermo.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class EquationOfState, int PolySize> +inline Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo +( + const EquationOfState& pt, + const scalar Hf, + const scalar Sf, + const Polynomial<PolySize>& cpPoly, + const typename Polynomial<PolySize>::intPolyType& dhPoly, + const Polynomial<PolySize>& sPoly +) +: + EquationOfState(pt), + Hf_(Hf), + Sf_(Sf), + cpPolynomial_(cpPoly), + dhPolynomial_(dhPoly), + sPolynomial_(sPoly) +{} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class EquationOfState, int PolySize> +inline Foam::polynomialThermo<EquationOfState, PolySize>::polynomialThermo +( + const word& name, + const polynomialThermo& pt +) +: + EquationOfState(name, pt), + Hf_(pt.Hf_), + Sf_(pt.Sf_), + cpPolynomial_(pt.cpPolynomial_), + dhPolynomial_(pt.dhPolynomial_), + sPolynomial_(pt.sPolynomial_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::cp +( + const scalar T +) const +{ + return cpPolynomial_.evaluate(T)*this->W(); +} + + +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::h +( + const scalar T +) const +{ + return (dhPolynomial_.evaluate(T) + Hf_)*this->W(); +} + + +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::hs +( + const scalar T +) const +{ + return dhPolynomial_.evaluate(T)*this->W(); +} + + +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::hc() +const +{ + return Hf_*this->W(); +} + + +template<class EquationOfState, int PolySize> +inline Foam::scalar Foam::polynomialThermo<EquationOfState, PolySize>::s +( + const scalar T +) const +{ + return (sPolynomial_.evaluate(T) + Sf_)*this->W(); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class EquationOfState, int PolySize> +inline void Foam::polynomialThermo<EquationOfState, PolySize>::operator+= +( + const polynomialThermo<EquationOfState, PolySize>& pt +) +{ + scalar molr1 = this->nMoles(); + + EquationOfState::operator+=(pt); + + molr1 /= this->nMoles(); + scalar molr2 = pt.nMoles()/this->nMoles(); + + Hf_ = molr1*Hf_ + molr2*pt.Hf_; + Sf_ = molr1*Sf_ + molr2*pt.Sf_; + cpPolynomial_ = molr1*cpPolynomial_ + molr2*pt.cpPolynomial_; + dhPolynomial_ = molr1*dhPolynomial_ + molr2*pt.dhPolynomial_; + sPolynomial_ = molr1*sPolynomial_ + molr2*pt.sPolynomial_; +} + + +template<class EquationOfState, int PolySize> +inline void Foam::polynomialThermo<EquationOfState, PolySize>::operator-= +( + const polynomialThermo<EquationOfState, PolySize>& pt +) +{ + scalar molr1 = this->nMoles(); + + EquationOfState::operator-=(pt); + + molr1 /= this->nMoles(); + scalar molr2 = pt.nMoles()/this->nMoles(); + + Hf_ = molr1*Hf_ - molr2*pt.Hf_; + Sf_ = molr1*Hf_ - molr2*pt.Sf_; + cpPolynomial_ = molr1*cpPolynomial_ - molr2*pt.cpPolynomial_; + dhPolynomial_ = molr1*dhPolynomial_ - molr2*pt.dhPolynomial_; + sPolynomial_ = molr1*sPolynomial_ - molr2*pt.sPolynomial_; +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<class EquationOfState, int PolySize> +inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator+ +( + const polynomialThermo<EquationOfState, PolySize>& pt1, + const polynomialThermo<EquationOfState, PolySize>& pt2 +) +{ + EquationOfState eofs + ( + static_cast<const EquationOfState&>(pt1) + + static_cast<const EquationOfState&>(pt2) + ); + + scalar molr1 = pt1.nMoles()/eofs.nMoles(); + scalar molr2 = pt2.nMoles()/eofs.nMoles(); + return polynomialThermo<EquationOfState, PolySize> + ( + eofs, + molr1*pt1.Hf_ + molr2*pt2.Hf_, + molr1*pt1.Sf_ + molr2*pt2.Sf_, + molr1*pt1.cpPolynomial_ + molr2*pt2.cpPolynomial_, + molr1*pt1.dhPolynomial_ + molr2*pt2.dhPolynomial_, + molr1*pt1.sPolynomial_ + molr2*pt2.sPolynomial_ + ); +} + + +template<class EquationOfState, int PolySize> +inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator- +( + const polynomialThermo<EquationOfState, PolySize>& pt1, + const polynomialThermo<EquationOfState, PolySize>& pt2 +) +{ + EquationOfState eofs + ( + static_cast<const EquationOfState&>(pt1) + - static_cast<const EquationOfState&>(pt2) + ); + + scalar molr1 = pt1.nMoles()/eofs.nMoles(); + scalar molr2 = pt2.nMoles()/eofs.nMoles(); + return polynomialThermo<EquationOfState, PolySize> + ( + eofs, + molr1*pt1.Hf_ - molr2*pt2.Hf_, + molr1*pt1.Sf_ - molr2*pt2.Sf_, + molr1*pt1.cpPolynomial_ - molr2*pt2.cpPolynomial_, + molr1*pt1.dhPolynomial_ - molr2*pt2.dhPolynomial_, + molr1*pt1.sPolynomial_ - molr2*pt2.sPolynomial_ + ); +} + + +template<class EquationOfState, int PolySize> +inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator* +( + const scalar s, + const polynomialThermo<EquationOfState, PolySize>& pt +) +{ + return polynomialThermo<EquationOfState, PolySize> + ( + s*static_cast<const EquationOfState&>(pt), + pt.Hf_, + pt.Sf_, + pt.cpPolynomial_, + pt.dhPolynomial_, + pt.sPolynomial_ + ); +} + + +template<class EquationOfState, int PolySize> +inline Foam::polynomialThermo<EquationOfState, PolySize> Foam::operator== +( + const polynomialThermo<EquationOfState, PolySize>& pt1, + const polynomialThermo<EquationOfState, PolySize>& pt2 +) +{ + return pt2 - pt1; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C new file mode 100644 index 0000000000000000000000000000000000000000..2744d4a97990960136447bbbda36ab1408c92def --- /dev/null +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "polynomialTransport.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Thermo, int PolySize> +Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport(Istream& is) +: + Thermo(is), + muPolynomial_("muPolynomial", is), + kappaPolynomial_("kappaPolynomial", is) +{} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template<class Thermo, int PolySize> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const polynomialTransport<Thermo, PolySize>& pt +) +{ + os << static_cast<const Thermo&>(pt); + + os.check + ( + "Ostream& operator<<" + "(" + "Ostream&, " + "const polynomialTransport<Thermo, PolySize>&" + ")" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H new file mode 100644 index 0000000000000000000000000000000000000000..3ab3879e64a203ac3915828d4bb667a1172b7443 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H @@ -0,0 +1,206 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +Class + Foam::polynomialTransport + +Description + Transport package using polynomial functions for mu and kappa + +SourceFiles + polynomialTransportI.H + polynomialTransport.C + +\*---------------------------------------------------------------------------*/ + +#ifndef polynomialTransport_H +#define polynomialTransport_H + +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<class Thermo, int PolySize> class polynomialTransport; + +template<class Thermo, int PolySize> +inline polynomialTransport<Thermo, PolySize> operator+ +( + const polynomialTransport<Thermo, PolySize>&, + const polynomialTransport<Thermo, PolySize>& +); + +template<class Thermo, int PolySize> +inline polynomialTransport<Thermo, PolySize> operator- +( + const polynomialTransport<Thermo, PolySize>&, + const polynomialTransport<Thermo, PolySize>& +); + +template<class Thermo, int PolySize> +inline polynomialTransport<Thermo, PolySize> operator* +( + const scalar, + const polynomialTransport<Thermo, PolySize>& +); + +template<class Thermo, int PolySize> +inline polynomialTransport<Thermo, PolySize> operator== +( + const polynomialTransport<Thermo, PolySize>&, + const polynomialTransport<Thermo, PolySize>& +); + +template<class Thermo, int PolySize> +Ostream& operator<< +( + Ostream&, + const polynomialTransport<Thermo, PolySize>& +); + + +/*---------------------------------------------------------------------------*\ + Class polynomialTransport Declaration +\*---------------------------------------------------------------------------*/ + +template<class Thermo, int PolySize> +class polynomialTransport +: + public Thermo +{ + // Private data + + //- Dynamic viscosity + Polynomial<PolySize> muPolynomial_; + + //- Thermal conductivity + Polynomial<PolySize> kappaPolynomial_; + + + // Private member functions + + //- Construct from components + inline polynomialTransport + ( + const Thermo& t, + const Polynomial<PolySize>& muPoly, + const Polynomial<PolySize>& kappaPoly + ); + + +public: + + // Constructors + + //- Construct as named copy + inline polynomialTransport(const word&, const polynomialTransport&); + + //- Construct from Istream + polynomialTransport(Istream& is); + + //- Construct and return a clone + inline autoPtr<polynomialTransport> clone() const; + + // Selector from Istream + inline static autoPtr<polynomialTransport> New(Istream& is); + + + // Member functions + + //- Dynamic viscosity [kg/ms] + inline scalar mu(const scalar T) const; + + //- Thermal conductivity [W/mK] + inline scalar kappa(const scalar T) const; + + //- Thermal diffusivity for enthalpy [kg/ms] + inline scalar alpha(const scalar T) const; + + // Species diffusivity + //inline scalar D(const scalar T) const; + + + // Member operators + + inline polynomialTransport& operator=(const polynomialTransport&); + + + // Friend operators + + friend polynomialTransport operator+ <Thermo, PolySize> + ( + const polynomialTransport&, + const polynomialTransport& + ); + + friend polynomialTransport operator- <Thermo, PolySize> + ( + const polynomialTransport&, + const polynomialTransport& + ); + + friend polynomialTransport operator* <Thermo, PolySize> + ( + const scalar, + const polynomialTransport& + ); + + friend polynomialTransport operator== <Thermo, PolySize> + ( + const polynomialTransport&, + const polynomialTransport& + ); + + + // Ostream Operator + + friend Ostream& operator<< <Thermo, PolySize> + ( + Ostream&, + const polynomialTransport& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "polynomialTransportI.H" + +#ifdef NoRepository +# include "polynomialTransport.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H new file mode 100644 index 0000000000000000000000000000000000000000..9e6e00e6e3c603146007caa7866e2e9aaf6751b1 --- /dev/null +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H @@ -0,0 +1,213 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "specie.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport +( + const Thermo& t, + const Polynomial<PolySize>& muPoly, + const Polynomial<PolySize>& kappaPoly +) +: + Thermo(t), + muPolynomial_(muPoly), + kappaPolynomial_(kappaPoly) +{} + + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport +( + const word& name, + const polynomialTransport& pt +) +: + Thermo(name, pt), + muPolynomial_(pt.muPolynomial_), + kappaPolynomial_(pt.kappaPolynomial_) +{} + + +template<class Thermo, int PolySize> +inline Foam::autoPtr<Foam::polynomialTransport<Thermo, PolySize> > +Foam::polynomialTransport<Thermo, PolySize>::clone() const +{ + return autoPtr<polynomialTransport<Thermo, PolySize> > + ( + new polynomialTransport<Thermo, PolySize>(*this) + ); +} + + +template<class Thermo, int PolySize> +inline Foam::autoPtr<Foam::polynomialTransport<Thermo, PolySize> > +Foam::polynomialTransport<Thermo, PolySize>::New(Istream& is) +{ + return autoPtr<polynomialTransport<Thermo, PolySize> > + ( + new polynomialTransport<Thermo, PolySize>(is) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Thermo, int PolySize> +inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::mu +( + const scalar T +) const +{ + return muPolynomial_.evaluate(T); +} + + +template<class Thermo, int PolySize> +inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::kappa +( + const scalar T +) const +{ + return kappaPolynomial_.evaluate(T); +} + + +template<class Thermo, int PolySize> +inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::alpha +( + const scalar T +) const +{ + scalar deltaT = T - specie::Tstd; + scalar CpBar = + (deltaT*(this->H(T) - this->H(specie::Tstd)) + this->Cp(T)) + /(sqr(deltaT) + 1); + + return kappa(T)/CpBar; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize>& +Foam::polynomialTransport<Thermo, PolySize>::operator= +( + const polynomialTransport<Thermo, PolySize>& pt +) +{ + Thermo::operator=(pt); + + muPolynomial_ = pt.muPolynomial_; + kappaPolynomial_ = pt.kappaPolynomial_; + + return *this; +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator+ +( + const polynomialTransport<Thermo, PolySize>& pt1, + const polynomialTransport<Thermo, PolySize>& pt2 +) +{ + Thermo t + ( + static_cast<const Thermo&>(pt1) + static_cast<const Thermo&>(pt2) + ); + + + scalar molr1 = pt1.nMoles()/t.nMoles(); + scalar molr2 = pt2.nMoles()/t.nMoles(); + + return polynomialTransport<Thermo, PolySize> + ( + t, + molr1*pt1.muPolynomial_ + molr2*pt2.muPolynomial_, + molr1*pt1.kappaPolynomial_ + molr2*pt2.kappaPolynomial_ + ); +} + + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator- +( + const polynomialTransport<Thermo, PolySize>& pt1, + const polynomialTransport<Thermo, PolySize>& pt2 +) +{ + Thermo t + ( + static_cast<const Thermo&>(pt1) - static_cast<const Thermo&>(pt2) + ); + + scalar molr1 = pt1.nMoles()/t.nMoles(); + scalar molr2 = pt2.nMoles()/t.nMoles(); + + return polynomialTransport<Thermo, PolySize> + ( + t, + molr1*pt1.muPolynomial_ - molr2*pt2.muPolynomial_, + molr1*pt1.kappaPolynomial_ - molr2*pt2.kappaPolynomial_ + ); +} + + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator* +( + const scalar s, + const polynomialTransport<Thermo, PolySize>& pt +) +{ + return polynomialTransport<Thermo, PolySize> + ( + s*static_cast<const Thermo&>(pt), + pt.muPolynomial_, + pt.kappaPolynomial_ + ); +} + + +template<class Thermo, int PolySize> +inline Foam::polynomialTransport<Thermo, PolySize> Foam::operator== +( + const polynomialTransport<Thermo, PolySize>& pt1, + const polynomialTransport<Thermo, PolySize>& pt2 +) +{ + return pt2 - pt1; +} + + +// ************************************************************************* // diff --git a/tutorials/combustion/XiFoam/les/Allrun b/tutorials/combustion/XiFoam/les/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..e43b54e4e3cdb7855d57135780c0565913132761 --- /dev/null +++ b/tutorials/combustion/XiFoam/les/Allrun @@ -0,0 +1,17 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name from directory +application="XiFoam" + +cases=" \ +pitzDaily \ +pitzDaily3D +" + +for i in $cases; do + blockMesh -case $i + $application -case $i +done + diff --git a/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs b/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs new file mode 100644 index 0000000000000000000000000000000000000000..9a83c0337ed2a698047bce788505fcaf4fd037eb --- /dev/null +++ b/tutorials/combustion/XiFoam/les/pitzDaily/0/alphaSgs @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphaSgs; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet + { + type zeroGradient; + } + + upperWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs b/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs new file mode 100644 index 0000000000000000000000000000000000000000..c5331748aea22d1d09e92cbd2d3387342f312a82 --- /dev/null +++ b/tutorials/combustion/XiFoam/les/pitzDaily3D/0/alphaSgs @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphaSgs; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet + { + type zeroGradient; + } + + upperWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + frontAndBack + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/combustion/XiFoam/Allclean b/tutorials/combustion/XiFoam/ras/Allclean similarity index 100% rename from tutorials/combustion/XiFoam/Allclean rename to tutorials/combustion/XiFoam/ras/Allclean diff --git a/tutorials/combustion/XiFoam/Allrun b/tutorials/combustion/XiFoam/ras/Allrun similarity index 100% rename from tutorials/combustion/XiFoam/Allrun rename to tutorials/combustion/XiFoam/ras/Allrun diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/alphat b/tutorials/combustion/dieselFoam/aachenBomb/0/alphat index 2684dd73c822be130389cc925a29ebd9cb627ec0..c56c4724ce2969ef2ccaa17e5b3344125efc1596 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/alphat +++ b/tutorials/combustion/dieselFoam/aachenBomb/0/alphat @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -23,7 +23,7 @@ boundaryField { walls { - type alphatWallFunction; + type compressible::alphatWallFunction; value uniform 0; } } diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon b/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon index e9dd46eb33ab84ca1e8bab21d748bfc6f058750a..e38ed02784cfef654a658662ead0d66dd32c48a6 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon +++ b/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -23,7 +23,7 @@ boundaryField { walls { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 90; } } diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/k b/tutorials/combustion/dieselFoam/aachenBomb/0/k index 251a39ce81061432f904f98f80de677eb38ebce6..b037171c72f46447a17c3aa8a16e71f5ae3acc3b 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/k +++ b/tutorials/combustion/dieselFoam/aachenBomb/0/k @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -23,7 +23,7 @@ boundaryField { walls { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 1; } } diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/mut b/tutorials/combustion/dieselFoam/aachenBomb/0/mut index e687f9b8fa216ba2de2f97e045c11372525473ae..2750ce32ecd5ed962213674d95930ff9b34920c5 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/mut +++ b/tutorials/combustion/dieselFoam/aachenBomb/0/mut @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties index be340ec092624c3700ecdf023d551ed099f103da..72c8fd655e70457a8d5c5a2e6d71c6c8c111423e 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties +++ b/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties @@ -15,9 +15,11 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +psiChemistryModel ODEChemistryModel<gasThermoPhysics>; + chemistry off; -chemistrySolver ODE; +chemistrySolver ode; initialChemicalTimeStep 1e-07; @@ -32,7 +34,7 @@ EulerImplicitCoeffs equilibriumRateLimiter off; } -ODECoeffs +odeCoeffs { ODESolver SIBS; eps 0.05; diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties index 24238233850126a97429b47c579583a711ef9122..f94afe7312e74472fc63442c3c4e59e0c6794e81 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties +++ b/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hMixtureThermo<reactingMixture>; +thermoType hPsiMixtureThermo<reactingMixture<gasThermoPhysics>>; CHEMKINFile "$FOAM_CASE/chemkin/chem.inp"; diff --git a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/constant/thermophysicalProperties index 9081551c6f6942e27458d17f287b256ba4c3ea2f..6fff161f863eab88afe4fcca0e5ba1f5fcc980d8 100644 --- a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.96 1004.5 0 1.458e-06 110.4; diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties index a4d934aeb2e5b8a50cb0e200272cff6f61f4483d..140131eb07a96a0fe4afdf9fe2dd261ceed10c8f 100644 --- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/constant/thermophysicalProperties @@ -17,7 +17,7 @@ FoamFile Pr Pr [ 0 0 0 0 0 0 0 ] 0.72; -thermoType hThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>; mixture N2 1 28.01348 100 10000 1000 2.9525407 0.0013968838 -4.9262577e-07 7.8600091e-11 -4.6074978e-15 -923.93753 5.8718221 3.5309628 -0.0001236595 -5.0299339e-07 2.4352768e-09 -1.4087954e-12 -1046.9637 2.9674391 1.458e-06 110; diff --git a/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties index 841a143c18ed9bb76e2fa5d864cbdf9ca93fed50..41f4c6be09c194abc58193ca7b00c15564660992 100644 --- a/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/forwardStep/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture normalisedGas 1 11640.3 2.5 0 0 1; diff --git a/tutorials/compressible/rhoCentralFoam/obliqueShock/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/obliqueShock/constant/thermophysicalProperties index 841a143c18ed9bb76e2fa5d864cbdf9ca93fed50..41f4c6be09c194abc58193ca7b00c15564660992 100644 --- a/tutorials/compressible/rhoCentralFoam/obliqueShock/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/obliqueShock/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture normalisedGas 1 11640.3 2.5 0 0 1; diff --git a/tutorials/compressible/rhoCentralFoam/shockTube/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/shockTube/constant/thermophysicalProperties index 919fec0ceab7d526193af6520876a6a75fe08f7a..613fd43883bcdefdfd3e4ec65f8d4a360a47b432 100644 --- a/tutorials/compressible/rhoCentralFoam/shockTube/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/shockTube/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.96 1004.5 2.544e+06 0 1; diff --git a/tutorials/compressible/rhoCentralFoam/wedge15Ma5/constant/thermophysicalProperties b/tutorials/compressible/rhoCentralFoam/wedge15Ma5/constant/thermophysicalProperties index 841a143c18ed9bb76e2fa5d864cbdf9ca93fed50..41f4c6be09c194abc58193ca7b00c15564660992 100644 --- a/tutorials/compressible/rhoCentralFoam/wedge15Ma5/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoCentralFoam/wedge15Ma5/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture normalisedGas 1 11640.3 2.5 0 0 1; diff --git a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/alphat b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/alphat index f609fa6c14c41bba0ec2726af2cf56a9ca8c949a..dc2104f83c5ce3f90987cad077de403fcd15988e 100644 --- a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/alphat +++ b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/alphat @@ -23,22 +23,22 @@ boundaryField { front { - type alphatWallFunction; + type compressible::alphatWallFunction; value uniform 0; } back { - type alphatWallFunction; + type compressible::alphatWallFunction; value uniform 0; } wall { - type alphatWallFunction; + type compressible::alphatWallFunction; value uniform 0; } porosityWall { - type alphatWallFunction; + type compressible::alphatWallFunction; value uniform 0; } inlet diff --git a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/epsilon index 502e0489570c5c063dd34ce656009712bd077300..e4dccfe57777d09934d55a61d67f94e2917585f0 100644 --- a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/epsilon +++ b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/epsilon @@ -23,27 +23,27 @@ boundaryField { front { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 200; } back { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 200; } wall { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 200; } porosityWall { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 200; } inlet { - type turbulentMixingLengthDissipationRateInlet; + type compressible::turbulentMixingLengthDissipationRateInlet; mixingLength 0.005; value uniform 200; } diff --git a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/k b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/k index 6171b9506b8a48d2de911a5c485b6c2bd13d6028..36be49f2ea41fa4546f2b605b525f151f624a334 100644 --- a/tutorials/compressible/rhoPimpleFoam/angledDuct/0/k +++ b/tutorials/compressible/rhoPimpleFoam/angledDuct/0/k @@ -23,22 +23,22 @@ boundaryField { front { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 1; } back { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 1; } wall { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 1; } porosityWall { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 1; } inlet diff --git a/tutorials/compressible/rhoPimpleFoam/angledDuct/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/angledDuct/constant/thermophysicalProperties index bd1a6c1f0496c414f331f2d0c1357fd1918e36a8..a94ec3d442ef2ea46e7b3a863dd5512f05d8ae85 100644 --- a/tutorials/compressible/rhoPimpleFoam/angledDuct/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/angledDuct/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1007 0 1.4792e-06 116; diff --git a/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/thermophysicalProperties b/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/thermophysicalProperties index 7f85f2afd5e60654d526bf686b5f4f2819841dab..3c52e2545f8de88e10ecba0a455f73b2a3565e66 100644 --- a/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; diff --git a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/epsilon b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/epsilon index 1b7c6c0d70a42a55f17e2b579fa12cf5403e1412..698ff247d3588ecf485750ed392cd0745e137d2c 100644 --- a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/epsilon +++ b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/epsilon @@ -23,13 +23,13 @@ boundaryField { movingWall { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 0; } fixedWalls { - type epsilonWallFunction; + type compressible::epsilonWallFunction; value uniform 0; } diff --git a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/k b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/k index 64ea0ca8fbd25e149a023c3c3ecee9af977197a8..8f645b088c807cbc6b2215416a42a7e5e316c791 100644 --- a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/k +++ b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/k @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 0 2 -2 0 0 0 0 ]; +dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.00325; @@ -23,16 +23,14 @@ boundaryField { movingWall { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 0; } - fixedWalls { - type kQRWallFunction; + type compressible::kQRWallFunction; value uniform 0; } - frontAndBack { type empty; diff --git a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut index 3aaa8e77f82971aa58a9b96e84e20178a824085a..a0f4c473102445c3741b8324de193086abc82af1 100644 --- a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut +++ b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/mut @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 1 -1 -1 0 0 0 0 ]; +dimensions [1 -1 -1 0 0 0 0]; internalField uniform 0; @@ -26,13 +26,11 @@ boundaryField type mutWallFunction; value uniform 0; } - fixedWalls { type mutWallFunction; value uniform 0; } - frontAndBack { type empty; diff --git a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/omega b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/omega index fa4f022f0140184baac96f3b5198908e796c1cf2..863c2292b647b2cee86d4fe26c990f3677ed9502 100644 --- a/tutorials/compressible/rhoPisoFoam/ras/cavity/0/omega +++ b/tutorials/compressible/rhoPisoFoam/ras/cavity/0/omega @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 0 0 -1 0 0 0 0 ]; +dimensions [0 0 -1 0 0 0 0]; internalField uniform 2.6; @@ -23,16 +23,14 @@ boundaryField { movingWall { - type omegaWallFunction; + type compressible::omegaWallFunction; value uniform 0; } - fixedWalls { - type omegaWallFunction; + type compressible::omegaWallFunction; value uniform 0; } - frontAndBack { type empty; diff --git a/tutorials/compressible/rhoPisoFoam/ras/cavity/constant/thermophysicalProperties b/tutorials/compressible/rhoPisoFoam/ras/cavity/constant/thermophysicalProperties index d02b85fec4397d8da50129dd6d2374b56619abe6..f7638810ff7a4d465637cea0b9f7caca2680d98f 100644 --- a/tutorials/compressible/rhoPisoFoam/ras/cavity/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPisoFoam/ras/cavity/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1007 0 1.84e-05 0.7; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties index ab0fa0fe3c8b725dac44909a43c7849d66428e8c..81db5fe944aba427c44fb2a6289733bb6ef6eb44 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1007 0 1.4792e-06 116; diff --git a/tutorials/compressible/sonicFoam/Allrun b/tutorials/compressible/sonicFoam/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..4f1a1e464a13287c4b685a7fdc8fc94ae46230b9 --- /dev/null +++ b/tutorials/compressible/sonicFoam/Allrun @@ -0,0 +1,5 @@ +#!/bin/sh +set -x + +(cd laminar && ./Allrun) +(cd ras && ./Allrun) diff --git a/tutorials/compressible/sonicFoam/laminar/Allrun b/tutorials/compressible/sonicFoam/laminar/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..573ff3a12dff2b3e37cb14a13f0d7ed7454b3abf --- /dev/null +++ b/tutorials/compressible/sonicFoam/laminar/Allrun @@ -0,0 +1,22 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name from directory +application=sonicFoam + +cases=" \ +forwardStep \ +shockTube \ +" +for case in $cases +do + (cd $case && runApplication blockMesh) +# + if [ "$case" = "shockTube" ] ; then + (cd $case && ./Allrun) + else + (cd $case && runApplication $application) + fi +# +done diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties b/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..82d43de5709a190f9567de1b5d3e6b9abe8e119a --- /dev/null +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermophysicalProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>; + +mixture air 1 11640.31 1.78571 0 0 0.7; + + +// ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/constant/thermodynamicProperties b/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/turbulenceProperties similarity index 79% rename from tutorials/compressible/sonicFoam/laminar/shockTube/constant/thermodynamicProperties rename to tutorials/compressible/sonicFoam/laminar/forwardStep/constant/turbulenceProperties index 99575bf65f9fdb7cb344ff2a4c3b245e342c8b7e..c2c3b28a1b4e8f4a2cae55f58bd61f9b1a67b488 100644 --- a/tutorials/compressible/sonicFoam/laminar/shockTube/constant/thermodynamicProperties +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/turbulenceProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -11,13 +11,11 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermodynamicProperties; + object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Cv Cv [ 0 2 -2 -1 0 0 0 ] 717.5; - -R R [ 0 2 -2 -1 0 0 0 ] 287; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes index 1c36c50aa67708935b325763ac50f49fc7fc4a44..6bebe35dfbbc69607c1b0588b7573526be914b21 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes @@ -30,17 +30,19 @@ gradSchemes divSchemes { default none; - div(phi,U) Gauss limitedLinearV 1; + div(phi,U) Gauss upwind; div(phid,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; + div(phiU,p) Gauss limitedLinear 1; + div((muEff*dev2(grad(U).T()))) Gauss linear 1; } laplacianSchemes { default none; - laplacian(mu,U) Gauss linear corrected; - laplacian(mu,e) Gauss linear corrected; laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(muEff,U) Gauss linear corrected; + laplacian(alphaEff,e) Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermodynamicProperties b/tutorials/compressible/sonicFoam/laminar/shockTube/constant/thermophysicalProperties similarity index 75% rename from tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermodynamicProperties rename to tutorials/compressible/sonicFoam/laminar/shockTube/constant/thermophysicalProperties index c6bf31c073b282576473751b3d19f08f877cb84a..2560f39757b887a4b0539ac5a9e4972df349cf7b 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/thermodynamicProperties +++ b/tutorials/compressible/sonicFoam/laminar/shockTube/constant/thermophysicalProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -11,13 +11,13 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermodynamicProperties; + object thermophysicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Cv Cv [ 0 2 -2 -1 0 0 0 ] 1.78571; +thermoType ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>; -R R [ 0 2 -2 -1 0 0 0 ] 0.714286; +mixture air 1 28.9 717.5 0 0 0.7; // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old b/tutorials/compressible/sonicFoam/laminar/shockTube/constant/turbulenceProperties similarity index 79% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old rename to tutorials/compressible/sonicFoam/laminar/shockTube/constant/turbulenceProperties index 23213bdb87781ea3f3191ce47a8397401db7f408..c2c3b28a1b4e8f4a2cae55f58bd61f9b1a67b488 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old +++ b/tutorials/compressible/sonicFoam/laminar/shockTube/constant/turbulenceProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -9,15 +9,13 @@ FoamFile { version 2.0; format ascii; - class topoSet; - location "constant/polyMesh/sets"; - object filter_old; + class dictionary; + location "constant"; + object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +simulationType laminar; -0 -( -) // ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes index deef4abd2614ed5708f90773817385c711ea18e4..6bebe35dfbbc69607c1b0588b7573526be914b21 100644 --- a/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes @@ -33,14 +33,16 @@ divSchemes div(phi,U) Gauss upwind; div(phid,p) Gauss limitedLinear 1; div(phi,e) Gauss limitedLinear 1; + div(phiU,p) Gauss limitedLinear 1; + div((muEff*dev2(grad(U).T()))) Gauss linear 1; } laplacianSchemes { default none; - laplacian(mu,U) Gauss linear corrected; - laplacian(mu,e) Gauss linear corrected; laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(muEff,U) Gauss linear corrected; + laplacian(alphaEff,e) Gauss linear corrected; } interpolationSchemes diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/thermophysicalProperties b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/thermophysicalProperties index 8e15891e509cc2f3819180595b2f41133983d22c..5580ffd632eb5654f28b94c1895a31d40aff2e8c 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/thermophysicalProperties +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/thermophysicalProperties @@ -15,9 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>; -mixture air 1 28.9 1000 2.544e+06 1.8e-05 0.7; +mixture air 1 28.9 717.5 0 1.8e-05 0.7; // ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/turbulenceProperties b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..3721a46a2ead37eb2bf10434bcde59afa9fe9bf6 --- /dev/null +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/controlDict b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/controlDict index ce2e9218c9147050f7603bc262f792b96c0dd5d6..aad6ecd97e30ebec71a08d33a00af3cdc2d8d691 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/controlDict +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/controlDict @@ -49,7 +49,12 @@ functions { type forceCoeffs; functionObjectLibs ( "libforces.so" ); - patches ( WALL10 ); + outputControl timeStep; + outputInterval 1; + patches + ( + WALL10 + ); pName p; UName U; log true; diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes index 0cab17b88eec287ffaaa417e472a94fefbc2d732..444443d62d3df4f18f9189082ba3d4f6b18c613c 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(R) Gauss linear; div(phid,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; - div(phi,h) Gauss limitedLinear 1; + div(phi,e) Gauss limitedLinear 1; div((muEff*dev2(grad(U).T()))) Gauss linear; } @@ -47,7 +47,7 @@ laplacianSchemes laplacian(DREff,R) Gauss linear limited 0.5; laplacian(DepsilonEff,epsilon) Gauss linear limited 0.5; laplacian((rho*(1|A(U))),p) Gauss linear limited 0.5; - laplacian(alphaEff,h) Gauss linear limited 0.5; + laplacian(alphaEff,e) Gauss linear limited 0.5; } interpolationSchemes @@ -63,7 +63,7 @@ snGradSchemes fluxRequired { default no; - p ; + p; } diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSolution b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSolution index a1782db6853bdb92132e5fc1a5e57cffb57a091f..d46dcd13cf44c7d474ea2f11965f7e2cc907cada 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSolution +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSolution @@ -41,7 +41,7 @@ solvers relTol 0; } - h + e { solver PBiCG; preconditioner DILU; diff --git a/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties b/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties index 754163e2a972e3860710533ee809e51d9c3a99d7..5580ffd632eb5654f28b94c1895a31d40aff2e8c 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties +++ b/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -15,9 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>; -mixture air 1 28.9 1300 2.544e+06 1.84e-05 0.7; +mixture air 1 28.9 717.5 0 1.8e-05 0.7; // ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/ras/prism/constant/turbulenceProperties b/tutorials/compressible/sonicFoam/ras/prism/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..3721a46a2ead37eb2bf10434bcde59afa9fe9bf6 --- /dev/null +++ b/tutorials/compressible/sonicFoam/ras/prism/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes b/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes index 7b3c03466f4a90b221e27fd07136ba28a964021b..9737d97c289fa4fbab2e69809936f7e094fc7463 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(R) Gauss linear; div(phid,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1; - div(phi,h) Gauss limitedLinear 1; + div(phi,e) Gauss limitedLinear 1; div((muEff*dev2(grad(U).T()))) Gauss linear; } @@ -47,7 +47,7 @@ laplacianSchemes laplacian(DREff,R) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian((rho*(1|A(U))),p) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; + laplacian(alphaEff,e) Gauss linear corrected; } interpolationSchemes @@ -63,7 +63,7 @@ snGradSchemes fluxRequired { default no; - p ; + p; } diff --git a/tutorials/compressible/sonicFoam/ras/prism/system/fvSolution b/tutorials/compressible/sonicFoam/ras/prism/system/fvSolution index 5341a980f476377d047e400880c6756dafccccc2..5ff77210a9690153b90dde73e1370197d85d7cbe 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/system/fvSolution +++ b/tutorials/compressible/sonicFoam/ras/prism/system/fvSolution @@ -41,7 +41,7 @@ solvers relTol 0; } - h + e { solver PBiCG; preconditioner DILU; diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/T b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/T new file mode 100644 index 0000000000000000000000000000000000000000..a5a03f6a2e3944867bd11d1adb15e3f468569dc6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/T @@ -0,0 +1,443 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type fixedValue; + value nonuniform List<scalar> +400 +( +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +) +; + } + ceiling + { + type fixedValue; + value uniform 300; + } + fixedWalls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/T.org b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/T.org new file mode 100644 index 0000000000000000000000000000000000000000..a5a03f6a2e3944867bd11d1adb15e3f468569dc6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/T.org @@ -0,0 +1,443 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type fixedValue; + value nonuniform List<scalar> +400 +( +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +) +; + } + ceiling + { + type fixedValue; + value uniform 300; + } + fixedWalls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/U b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/U new file mode 100644 index 0000000000000000000000000000000000000000..0b6b191dab023e6aa4c9701188dd93252aeb7aa9 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/U @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + floor + { + type fixedValue; + value uniform (0 0 0); + } + + ceiling + { + type fixedValue; + value uniform (0 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/alphat b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..3bcb9c03b13cf7d96e3456eabea33e5f6d0ee8e1 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/alphat @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type alphatWallFunction; + value uniform 0; + } + ceiling + { + type alphatWallFunction; + value uniform 0; + } + fixedWalls + { + type alphatWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/epsilon b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..892d69375d9d5eab2aa804a87ee6661bbc1a9f06 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/epsilon @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type epsilonWallFunction; + value uniform 0.01; + } + ceiling + { + type epsilonWallFunction; + value uniform 0.01; + } + fixedWalls + { + type epsilonWallFunction; + value uniform 0.01; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/epsilon.old similarity index 71% rename from tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon rename to tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/epsilon.old index 50b54646b3d3d5ab88f13d0619c6e4afbcdba413..23851291dc60d3b0df3be887acfbeb0bb5067ef8 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/epsilon.old @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -17,18 +17,24 @@ FoamFile dimensions [0 2 -3 0 0 0 0]; -internalField uniform 5390.5; +internalField uniform 0.01; boundaryField { - walls + floor { type compressible::epsilonWallFunction; - value uniform 5390.5; + value uniform 0.01; } - frontAndBack + ceiling { - type empty; + type compressible::epsilonWallFunction; + value uniform 0.01; + } + fixedWalls + { + type compressible::epsilonWallFunction; + value uniform 0.01; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/k b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/k new file mode 100644 index 0000000000000000000000000000000000000000..38c2a542ef4c0c57799adb46dbd114f24947f474 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/k @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type kQRWallFunction; + value uniform 0.1; + } + ceiling + { + type kQRWallFunction; + value uniform 0.1; + } + fixedWalls + { + type kQRWallFunction; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/k.old similarity index 71% rename from tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k rename to tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/k.old index 26fcff0babb808a41223f7d9d5732248b4ea2aec..4ec7f08960c175a6d955e2c1d3cfb98453524647 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/k.old @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -17,18 +17,24 @@ FoamFile dimensions [0 2 -2 0 0 0 0]; -internalField uniform 37.5; +internalField uniform 0.1; boundaryField { - walls + floor { type compressible::kQRWallFunction; - value uniform 37.5; + value uniform 0.1; } - frontAndBack + ceiling { - type empty; + type compressible::kQRWallFunction; + value uniform 0.1; + } + fixedWalls + { + type compressible::kQRWallFunction; + value uniform 0.1; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut new file mode 100644 index 0000000000000000000000000000000000000000..a81ad6b59fd8d4b8617763e08058fbb36b3b8aef --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/nut @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type nutWallFunction; + value uniform 0; + } + ceiling + { + type nutWallFunction; + value uniform 0; + } + fixedWalls + { + type nutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/p similarity index 88% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd rename to tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/p index 1841d7882f5c06e25080901cd800391c09d11868..2014ca6e8c05c4140f60fa97f5d77545a31b68c8 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/0/p @@ -10,11 +10,11 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; +dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; @@ -23,24 +23,21 @@ boundaryField floor { type fixedFluxBuoyantPressure; + rho rhok; value uniform 0; } ceiling { type fixedFluxBuoyantPressure; + rho rhok; value uniform 0; } fixedWalls { type fixedFluxBuoyantPressure; - value uniform 0; - } - - box - { - type fixedFluxBuoyantPressure; + rho rhok; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..83fcec83ecad6243fdfd74b8afb16acd55518f36 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +cp 0/T.org 0/T diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..92490b5b5ea392da192d42ec102f629c87c73e60 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application="buoyantBoussinesqPisoFoam" + +compileApplication ../../buoyantPisoFoam/hotRoom/setHotRoom +runApplication blockMesh +runApplication setHotRoom +runApplication $application diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/RASProperties b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..35b5a409f230c180f07469bfe0679cdf00cb419d --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/RASProperties @@ -0,0 +1,100 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 0.85; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +RNGkEpsilonCoeffs +{ + Cmu 0.0845; + C1 1.42; + C2 1.68; + C3 -0.33; + alphah 1; + alphak 1.39; + alphaEps 1.39; + eta0 4.38; + beta 0.012; +} + +LaunderSharmaKECoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +LRRCoeffs +{ + Cmu 0.09; + Clrr1 1.8; + Clrr2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +LaunderGibsonRSTMCoeffs +{ + Cmu 0.09; + Clg1 1.8; + Clg2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + C1Ref 0.5; + C2Ref 0.3; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +wallFunctionCoeffs +{ + kappa 0.4187; + E 9; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/environmentalProperties similarity index 89% rename from tutorials/compressible/sonicFoam/laminar/shockTube/constant/transportProperties rename to tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/environmentalProperties index 1e9d5be60c285c2403250e1961ee8d1552dd14a8..a866ff549fd799e63d2d6946a66cf3da14d092bd 100644 --- a/tutorials/compressible/sonicFoam/laminar/shockTube/constant/transportProperties +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/environmentalProperties @@ -11,11 +11,11 @@ FoamFile format ascii; class dictionary; location "constant"; - object transportProperties; + object environmentalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -mu mu [ 1 -1 -1 0 0 0 0 ] 0; +g g [ 0 1 -2 0 0 0 0 ] ( 0 -9.81 0 ); // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..fa2bb5c4c6e834caba8be30e1825ea1a45c22c92 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/polyMesh/blockMeshDict @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (10 0 0) + (10 5 0) + (0 5 0) + (0 0 10) + (10 0 10) + (10 5 10) + (0 5 10) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 10 20) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall floor + ( + (1 5 4 0) + ) + wall ceiling + ( + (3 7 6 2) + ) + wall fixedWalls + ( + (0 4 7 3) + (2 6 5 1) + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/polyMesh/boundary similarity index 58% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft rename to tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/polyMesh/boundary index 637d83fb4b41e5bbe9495fc5d1f3383a49045f61..0d4d0e498dae524c835cc1addc9707eb5af47fb3 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -9,55 +9,32 @@ FoamFile { version 2.0; format ascii; - class faceSet; - location "constant/polyMesh/sets"; - object cycLeft; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -40 +3 ( -3506 -3507 -3508 -3509 -3510 -3511 -3512 -3513 -3514 -3515 -3516 -3517 -3518 -3519 -3520 -3521 -3522 -3523 -3524 -3525 -3526 -3527 -3528 -3529 -3530 -3531 -3532 -3533 -3534 -3535 -3536 -3537 -3538 -3539 -3540 -3541 -3542 -3543 -3544 -3545 + floor + { + type wall; + nFaces 400; + startFace 11200; + } + ceiling + { + type wall; + nFaces 400; + startFace 11600; + } + fixedWalls + { + type wall; + nFaces 800; + startFace 12000; + } ) // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..f48fda19ccac705f76f1573b7ba40cce45abfd5b --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/constant/transportProperties @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object transportProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +// Laminar viscosity +nu nu [0 2 -1 0 0 0 0] 1e-05; + +// Thermal expansion coefficient +beta beta [0 0 0 -1 0 0 0] 3e-03; + +// Reference temperature +TRef TRef [0 0 0 1 0 0 0] 300; + +// Laminar Prandtl number +Pr Pr [0 0 0 0 0 0 0] 0.9; + +// Turbulent Prandtl number +Prt Prt [0 0 0 0 0 0 0] 0.7; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/controlDict b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..26a1219ee04433266c5a0540f5ecf239fc0d0f93 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/controlDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..6be8f0129f6c5ae27dae2d20c5e0cd28fcf26f12 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSchemes @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,T) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div((nuEff*dev(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; + laplacian(kappaEff,T) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..7afa2f50aa9b1dc663a24bada8c0971be911c656 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqPisoFoam/hotRoom/system/fvSolution @@ -0,0 +1,87 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0.1; + } + + pFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + T + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } +} + +PISO +{ + momentumPredictor yes; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T new file mode 100644 index 0000000000000000000000000000000000000000..a5a03f6a2e3944867bd11d1adb15e3f468569dc6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T @@ -0,0 +1,443 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type fixedValue; + value nonuniform List<scalar> +400 +( +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +) +; + } + ceiling + { + type fixedValue; + value uniform 300; + } + fixedWalls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org new file mode 100644 index 0000000000000000000000000000000000000000..a5a03f6a2e3944867bd11d1adb15e3f468569dc6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org @@ -0,0 +1,443 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type fixedValue; + value nonuniform List<scalar> +400 +( +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +600 +600 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +300 +) +; + } + ceiling + { + type fixedValue; + value uniform 300; + } + fixedWalls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/U b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/U new file mode 100644 index 0000000000000000000000000000000000000000..0b6b191dab023e6aa4c9701188dd93252aeb7aa9 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/U @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + floor + { + type fixedValue; + value uniform (0 0 0); + } + + ceiling + { + type fixedValue; + value uniform (0 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/alphat b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..3bcb9c03b13cf7d96e3456eabea33e5f6d0ee8e1 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/alphat @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type alphatWallFunction; + value uniform 0; + } + ceiling + { + type alphatWallFunction; + value uniform 0; + } + fixedWalls + { + type alphatWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/epsilon b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..892d69375d9d5eab2aa804a87ee6661bbc1a9f06 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/epsilon @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type epsilonWallFunction; + value uniform 0.01; + } + ceiling + { + type epsilonWallFunction; + value uniform 0.01; + } + fixedWalls + { + type epsilonWallFunction; + value uniform 0.01; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/epsilon.old b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/epsilon.old new file mode 100644 index 0000000000000000000000000000000000000000..23851291dc60d3b0df3be887acfbeb0bb5067ef8 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/epsilon.old @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } + ceiling + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } + fixedWalls + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/k b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/k new file mode 100644 index 0000000000000000000000000000000000000000..38c2a542ef4c0c57799adb46dbd114f24947f474 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/k @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type kQRWallFunction; + value uniform 0.1; + } + ceiling + { + type kQRWallFunction; + value uniform 0.1; + } + fixedWalls + { + type kQRWallFunction; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/k.old b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/k.old new file mode 100644 index 0000000000000000000000000000000000000000..4ec7f08960c175a6d955e2c1d3cfb98453524647 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/k.old @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type compressible::kQRWallFunction; + value uniform 0.1; + } + ceiling + { + type compressible::kQRWallFunction; + value uniform 0.1; + } + fixedWalls + { + type compressible::kQRWallFunction; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut new file mode 100644 index 0000000000000000000000000000000000000000..a81ad6b59fd8d4b8617763e08058fbb36b3b8aef --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/nut @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type nutWallFunction; + value uniform 0; + } + ceiling + { + type nutWallFunction; + value uniform 0; + } + fixedWalls + { + type nutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/pd b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p similarity index 88% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/pd rename to tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p index 1841d7882f5c06e25080901cd800391c09d11868..2014ca6e8c05c4140f60fa97f5d77545a31b68c8 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/pd +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/p @@ -10,11 +10,11 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; +dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; @@ -23,24 +23,21 @@ boundaryField floor { type fixedFluxBuoyantPressure; + rho rhok; value uniform 0; } ceiling { type fixedFluxBuoyantPressure; + rho rhok; value uniform 0; } fixedWalls { type fixedFluxBuoyantPressure; - value uniform 0; - } - - box - { - type fixedFluxBuoyantPressure; + rho rhok; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..83fcec83ecad6243fdfd74b8afb16acd55518f36 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +cp 0/T.org 0/T diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..628624c70292d70d593effaa1a4e9fc9e2281550 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application="buoyantBoussinesqSimpleFoam" + +compileApplication ../../buoyantPisoFoam/hotRoom/setHotRoom +runApplication blockMesh +runApplication setHotRoom +runApplication $application diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/RASProperties b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..35b5a409f230c180f07469bfe0679cdf00cb419d --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/RASProperties @@ -0,0 +1,100 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 0.85; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +RNGkEpsilonCoeffs +{ + Cmu 0.0845; + C1 1.42; + C2 1.68; + C3 -0.33; + alphah 1; + alphak 1.39; + alphaEps 1.39; + eta0 4.38; + beta 0.012; +} + +LaunderSharmaKECoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +LRRCoeffs +{ + Cmu 0.09; + Clrr1 1.8; + Clrr2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +LaunderGibsonRSTMCoeffs +{ + Cmu 0.09; + Clg1 1.8; + Clg2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + C1Ref 0.5; + C2Ref 0.3; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +wallFunctionCoeffs +{ + kappa 0.4187; + E 9; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/environmentalProperties similarity index 89% rename from tutorials/compressible/sonicFoam/laminar/forwardStep/constant/transportProperties rename to tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/environmentalProperties index 1e9d5be60c285c2403250e1961ee8d1552dd14a8..a866ff549fd799e63d2d6946a66cf3da14d092bd 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/constant/transportProperties +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/environmentalProperties @@ -11,11 +11,11 @@ FoamFile format ascii; class dictionary; location "constant"; - object transportProperties; + object environmentalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -mu mu [ 1 -1 -1 0 0 0 0 ] 0; +g g [ 0 1 -2 0 0 0 0 ] ( 0 -9.81 0 ); // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..fa2bb5c4c6e834caba8be30e1825ea1a45c22c92 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/polyMesh/blockMeshDict @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (10 0 0) + (10 5 0) + (0 5 0) + (0 0 10) + (10 0 10) + (10 5 10) + (0 5 10) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 10 20) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall floor + ( + (1 5 4 0) + ) + wall ceiling + ( + (3 7 6 2) + ) + wall fixedWalls + ( + (0 4 7 3) + (2 6 5 1) + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/polyMesh/boundary similarity index 58% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight rename to tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/polyMesh/boundary index 37cdc37250e049cea02c4c9272fc7629bfe4e90e..0d4d0e498dae524c835cc1addc9707eb5af47fb3 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -9,55 +9,32 @@ FoamFile { version 2.0; format ascii; - class faceSet; - location "constant/polyMesh/sets"; - object cycRight; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -40 +3 ( -3546 -3547 -3548 -3549 -3550 -3551 -3552 -3553 -3554 -3555 -3556 -3557 -3558 -3559 -3560 -3561 -3562 -3563 -3564 -3565 -3566 -3567 -3568 -3569 -3570 -3571 -3572 -3573 -3574 -3575 -3576 -3577 -3578 -3579 -3580 -3581 -3582 -3583 -3584 -3585 + floor + { + type wall; + nFaces 400; + startFace 11200; + } + ceiling + { + type wall; + nFaces 400; + startFace 11600; + } + fixedWalls + { + type wall; + nFaces 800; + startFace 12000; + } ) // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..f48fda19ccac705f76f1573b7ba40cce45abfd5b --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/constant/transportProperties @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object transportProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +// Laminar viscosity +nu nu [0 2 -1 0 0 0 0] 1e-05; + +// Thermal expansion coefficient +beta beta [0 0 0 -1 0 0 0] 3e-03; + +// Reference temperature +TRef TRef [0 0 0 1 0 0 0] 300; + +// Laminar Prandtl number +Pr Pr [0 0 0 0 0 0 0] 0.9; + +// Turbulent Prandtl number +Prt Prt [0 0 0 0 0 0 0] 0.7; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..bfc52cf914e6d70563729bb9790dda8a20daaa70 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..b54bb8631600a594830b214816d8a858bcf83a02 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSchemes @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,T) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div((nuEff*dev(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; + laplacian(kappaEff,T) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..e11f41a5e1170f98a9414a25be8204bf3748df53 --- /dev/null +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/fvSolution @@ -0,0 +1,88 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-08; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + T + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + rho 1; + p 0.7; + U 0.2; + T 0.7; + k 0.7; + epsilon 0.7; + R 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/thermophysicalProperties index f826516c2ebc44480f764103bbcc05c3f2e83efd..fb233e2de3b1b75cced36021ada8f28f58c58802 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/controlDict b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/controlDict index cb2e7470f67597540554a58b19942872bab68d34..26a1219ee04433266c5a0540f5ecf239fc0d0f93 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/controlDict +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/controlDict @@ -21,9 +21,9 @@ startTime 0; stopAt endTime; -endTime 400; +endTime 1000; -deltaT 0.25; +deltaT 1; writeControl timeStep; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties index f826516c2ebc44480f764103bbcc05c3f2e83efd..6d55fcba3d7dd3a1e149ef0dd6f1582e917b7e7d 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution index 9ff08c3657a4d84256fde4866772cbca40ae5dcf..c543e875278062213cdf99ae620a9d1b1810c10f 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution @@ -76,9 +76,9 @@ SIMPLE relaxationFactors { rho 1; - p 0.3; - U 0.7; - h 0.1; + p 0.7; + U 0.2; + h 0.7; k 0.7; epsilon 0.7; R 0.7; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p index f200e3eeb0f918f10cf34f5b87e5d04abd76b21d..bb1ff51259ac287aadde6157a1719177c2bfdb7c 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p @@ -22,25 +22,25 @@ boundaryField { floor { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } ceiling { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } fixedWalls { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } box { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties index f826516c2ebc44480f764103bbcc05c3f2e83efd..6d55fcba3d7dd3a1e149ef0dd6f1582e917b7e7d 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes index 2263c0977531361f056a900481ca7409854ed755..cd290308eb8752ef4ba6ef50fe5e3a17a2aba085 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes @@ -41,7 +41,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; @@ -62,7 +62,7 @@ snGradSchemes fluxRequired { default no; - pd ; + p; } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution index f6c1f9453a3985e9e77725582bd8f113f91cf78a..25a07616b314a40fd7a0dc43cfa299b9ec71f295 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - pd + p { solver PCG; preconditioner DIC; @@ -69,14 +69,14 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pdRefCell 0; - pdRefValue 0; + pRefCell 0; + pRefValue 0; } relaxationFactors { rho 1; - pd 0.3; + p 0.3; U 0.7; h 0.7; k 0.7; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p index f200e3eeb0f918f10cf34f5b87e5d04abd76b21d..bb1ff51259ac287aadde6157a1719177c2bfdb7c 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p @@ -22,25 +22,25 @@ boundaryField { floor { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } ceiling { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } fixedWalls { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } box { - type calculated; + type fixedFluxBuoyantPressure; value uniform 100000; } } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties index f826516c2ebc44480f764103bbcc05c3f2e83efd..6d55fcba3d7dd3a1e149ef0dd6f1582e917b7e7d 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes index 0800e9f9323d8477caa278e74075c327f307206a..ee909d216c664b3d7ac374a3cb0cb9b79754ac02 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes @@ -42,7 +42,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; @@ -63,7 +63,7 @@ snGradSchemes fluxRequired { default no; - pd ; + p; } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution index a5d6208674369243cbae66f6912c317406ef60d3..685132185bffc4cc62e02c64eacc88582fbd3f4c 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - pd + p { solver GAMG; tolerance 1e-06; @@ -73,14 +73,14 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pdRefCell 0; - pdRefValue 0; + pRefCell 0; + pRefValue 0; } relaxationFactors { rho 1.0; - pd 0.3; + p 0.3; U 0.7; h 0.7; k 0.7; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun index 1fce68e81c1dad9bb03027069d2cacfc6df06c26..c3c4b5e504a38eb0b761783bd9d0dd0dd4c396eb 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun @@ -15,13 +15,13 @@ runApplication splitMeshRegions -cellZones for i in bottomAir topAir heater leftSolid rightSolid do - changeDictionary -region $i + changeDictionary -region $i >& log.changeDictionary.$i done # remove fluid fields from solid regions (important for post-processing) for i in heater leftSolid rightSolid do - rm -f 0*/$i/{mut,alphat,epsilon,k,p,pd,U} + rm -f 0*/$i/{mut,alphat,epsilon,k,p,p,U} done # remove solid fields from fluid regions (important for post-processing) @@ -37,7 +37,7 @@ done # Decompose for i in bottomAir topAir heater leftSolid rightSolid do - decomposePar -region $i + decomposePar -region $i >& log.decomposePar.$i done # Run @@ -47,7 +47,7 @@ runParallel chtMultiRegionFoam 4 system/machines # Reconstruct for i in bottomAir topAir heater leftSolid rightSolid do - reconstructPar -region $i + reconstructPar -region $i >& log.reconstructPar.$i done diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties index 7eb3ee5b9f430e1429510ce0cf7063914b1f4f41..02fdc143ae4770b373a64bc74f3704da6d5ab69e 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/topAir/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/topAir/thermophysicalProperties deleted file mode 120000 index bd35030a13bd2a596bd156fcb37634090c0342a4..0000000000000000000000000000000000000000 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/topAir/thermophysicalProperties +++ /dev/null @@ -1 +0,0 @@ -../bottomAir/thermophysicalProperties \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/topAir/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/topAir/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..02fdc143ae4770b373a64bc74f3704da6d5ab69e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/topAir/thermophysicalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture air 1 28.9 1000 0 1.8e-05 0.7; + +// ************************************************************************* // diff --git a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh b/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh index b0be10d8e5f2b0525cec8f23c93585fde73f5879..b4fc1a22ef1aa0decb5ae200a0ada926514b79ab 100755 --- a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh +++ b/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh @@ -1,11 +1,13 @@ #!/bin/sh +set -x m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict -blockMesh -cellSet +blockMesh >& log.blockMesh +cellSet >& log.cellSet + #- MRF determines its own faceZone if not supplied #cp system/faceSetDict_rotorFaces system/faceSetDict #faceSet #cp system/faceSetDict_noBoundaryFaces system/faceSetDict #faceSet -setsToZones -noFlipMap +setsToZones -noFlipMap >& log.setsToZones diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon index e5ed472a8b8b551fb4ab7245a9318c590c271030..9fcf588c0c292537815ea7ef2c72563a85a14851 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/k b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/k index 1d9c0d007fb294979895e61912032922c75639cd..9abb57fdb013a1d9dd1ac7859f9554dc0c642b71 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/k +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/k @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties index a13dc664a59cac61c012ec36d0c56ee450d07929..e2b9a595b5ba44d4910abfc165727a737243a2f1 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties @@ -15,17 +15,20 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +psiChemistryModel ODEChemistryModel<gasThermoPhysics>; + chemistry on; turbulentReaction on; -chemistrySolver ODE; +chemistrySolver ode; initialChemicalTimeStep 1e-07; sequentialCoeffs { cTauChem 0.001; + equilibriumRateLimiter off; } EulerImplicitCoeffs @@ -34,7 +37,7 @@ EulerImplicitCoeffs equilibriumRateLimiter off; } -ODECoeffs +odeCoeffs { ODESolver SIBS; eps 0.05; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties index 4936c35ab1a0392631456c8a0dcee3d6b7883db2..e5c06a7e043b893bddb9f7131f5e087ae3fac0b6 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hMixtureThermo<reactingMixture>; +thermoType hPsiMixtureThermo<reactingMixture<gasThermoPhysics>>; chemistryReader foamChemistryReader; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/G b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/G similarity index 87% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/G rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/G index 0b9581fe5cd0c4ddd5b7eea8b4487e96400da5f3..67b9372a4c833e5cb37a1784aa59daa2fd9ffb0e 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/G +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/G @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -25,37 +25,35 @@ boundaryField { type MarshakRadiation; T T; - emissivity 1.0; + emissivity 1; value uniform 0; } - inlet { type MarshakRadiation; T T; - emissivity 1.0; + emissivity 1; value uniform 0; } - outlet { type zeroGradient; } - cycLeft { type cyclic; + value uniform 0; } - cycRight { type cyclic; + value uniform 0; } - frontAndBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/H2O b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/H2O similarity index 88% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/H2O rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/H2O index cb32465490b8e610dfa66873fc9271648ecf6f5f..6ab71d183d314c4c8382de0b8163a07698a0e468 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/H2O +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/H2O @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -15,10 +15,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - dimensions [0 0 0 0 0 0 0]; -internalField uniform 0.0; +internalField uniform 0; boundaryField { @@ -26,28 +25,25 @@ boundaryField { type zeroGradient; } - inlet { type fixedValue; value uniform 0; } - outlet { type zeroGradient; } - cycLeft { type cyclic; + value uniform 0; } - cycRight { type cyclic; + value uniform 0; } - frontAndBack { type empty; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/N2 b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/N2 similarity index 90% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/N2 rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/N2 index 73ed14ee5dc38ff8073289c5f68bf0295d92bd7a..67821f8aba70a97b41c4bd07f990c5c478eb721e 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/N2 +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/N2 @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -15,7 +15,6 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - dimensions [0 0 0 0 0 0 0]; internalField uniform 0.79; @@ -26,28 +25,25 @@ boundaryField { type zeroGradient; } - inlet { type fixedValue; value uniform 0.79; } - outlet { type zeroGradient; } - cycLeft { type cyclic; + value uniform 0.79; } - cycRight { type cyclic; + value uniform 0.79; } - frontAndBack { type empty; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/O2 b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/O2 similarity index 90% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/O2 rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/O2 index 708683ea5597ae05bc13c7c2b35a1ddddbaac0cb..af16fd7a8f19fa4773d71180162a5d4f770b7a95 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/O2 +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/O2 @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -13,7 +13,6 @@ FoamFile location "0"; object O2; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; @@ -26,28 +25,25 @@ boundaryField { type zeroGradient; } - inlet { type fixedValue; value uniform 0.21; } - outlet { type zeroGradient; } - cycLeft { type cyclic; + value uniform 0.21; } - cycRight { type cyclic; + value uniform 0.21; } - frontAndBack { type empty; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/T b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/T similarity index 99% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/T rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/T index 0d04413e056717eb2f0b91539c8f3a9b4b8cfa2e..b03d0dbaa27890d0e183110582183068747425b3 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/T +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/T @@ -9,8 +9,8 @@ FoamFile { version 2.0; format ascii; - location "0"; class volScalarField; + location "0"; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -26,32 +26,28 @@ boundaryField type fixedValue; value uniform 400; } - inlet { type fixedValue; value uniform 350; } - outlet { type zeroGradient; } - cycLeft { type cyclic; } - cycRight { type cyclic; - ] - + } frontAndBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/U b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/U similarity index 96% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/U rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/U index 206079cdbf9a0895a5bafee07d51eb6471efef91..58adc402f91bb3c19cfcf119b40ec2bb3798f1a2 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/U +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/U @@ -9,8 +9,8 @@ FoamFile { version 2.0; format ascii; - location "0"; class volVectorField; + location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -26,32 +26,28 @@ boundaryField type fixedValue; value uniform (0 0 0); } - inlet { type fixedValue; - value uniform (0.5 0 0); + value uniform (5 0 0); } - outlet { type zeroGradient; } - cycLeft { type cyclic; } - cycRight { type cyclic; } - frontAndBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/alphat b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/alphat new file mode 100644 index 0000000000000000000000000000000000000000..f298ca2ef79c4a4bf795c89ed7b22a9783eddd1e --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/alphat @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type compressible::alphatWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/epsilon b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/epsilon similarity index 82% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/epsilon rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/epsilon index 481f993b2829d6a1dcf4117d17ae7cb7e69bcacf..529618d2afbba64ffaa99f8f4c6963eaf77895f9 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/epsilon +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/epsilon @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -17,37 +17,34 @@ FoamFile dimensions [0 2 -3 0 0 0 0]; -internalField uniform 4.49e-05; +internalField uniform 0.0449; boundaryField { walls { type compressible::epsilonWallFunction; - value uniform 4.49e-05; + value uniform 0.0449; } - inlet { type fixedValue; - value uniform 4.49e-05; + value uniform 0.0449; } - outlet { type zeroGradient; } - cycLeft { type cyclic; + value uniform 0.0449; } - cycRight { type cyclic; + value uniform 0.0449; } - frontAndBack { type empty; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/k b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/k similarity index 82% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/k rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/k index 55c9edb64c6304fac7c7ed48a9767bfac5681b76..eed0dcdd366eab874e4fb2dc3ba7e5c542e35b76 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/k +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/k @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -17,37 +17,34 @@ FoamFile dimensions [0 2 -2 0 0 0 0]; -internalField uniform 9.38e-04; +internalField uniform 0.0938; boundaryField { walls { type compressible::kQRWallFunction; - value uniform 9.38e-04; + value uniform 0.0938; } - inlet { type fixedValue; - value uniform 9.38e-04; + value uniform 0.0938; } - outlet { type zeroGradient; } - cycLeft { type cyclic; + value uniform 0.0938; } - cycRight { type cyclic; + value uniform 0.0938; } - frontAndBack { type empty; diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut new file mode 100644 index 0000000000000000000000000000000000000000..0ad81e27201c3bcec3bbf206d5abfa4617fc6e28 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/mut @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type mutWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/p b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/p similarity index 94% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/0/p rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/p index 00a08bfea05e9cb76becb60bfc27cf7c07b6942e..55f9cd7aee3de50282b8c4417d9ba21173ddcbe9 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/p +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0.org/p @@ -25,32 +25,30 @@ boundaryField { type zeroGradient; } - inlet { type zeroGradient; } - outlet { type fixedValue; value uniform 100000; } - cycLeft { type cyclic; + value uniform 100000; } - cycRight { type cyclic; + value uniform 100000; } - frontAndBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/G b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/G new file mode 100644 index 0000000000000000000000000000000000000000..67b9372a4c833e5cb37a1784aa59daa2fd9ffb0e --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/G @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object G; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + inlet + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/H2O b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/H2O new file mode 100644 index 0000000000000000000000000000000000000000..6ab71d183d314c4c8382de0b8163a07698a0e468 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/H2O @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object H2O; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type zeroGradient; + } + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/N2 b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/N2 new file mode 100644 index 0000000000000000000000000000000000000000..67821f8aba70a97b41c4bd07f990c5c478eb721e --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/N2 @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object N2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.79; + +boundaryField +{ + walls + { + type zeroGradient; + } + inlet + { + type fixedValue; + value uniform 0.79; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + value uniform 0.79; + } + cycRight + { + type cyclic; + value uniform 0.79; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/O2 b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/O2 new file mode 100644 index 0000000000000000000000000000000000000000..af16fd7a8f19fa4773d71180162a5d4f770b7a95 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/O2 @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object O2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.21; + +boundaryField +{ + walls + { + type zeroGradient; + } + inlet + { + type fixedValue; + value uniform 0.21; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + value uniform 0.21; + } + cycRight + { + type cyclic; + value uniform 0.21; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/T b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/T new file mode 100644 index 0000000000000000000000000000000000000000..b03d0dbaa27890d0e183110582183068747425b3 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/T @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField +{ + walls + { + type fixedValue; + value uniform 400; + } + inlet + { + type fixedValue; + value uniform 350; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + } + cycRight + { + type cyclic; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/U b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/U new file mode 100644 index 0000000000000000000000000000000000000000..58adc402f91bb3c19cfcf119b40ec2bb3798f1a2 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/U @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + walls + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type fixedValue; + value uniform (5 0 0); + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + } + cycRight + { + type cyclic; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/alphat b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..f298ca2ef79c4a4bf795c89ed7b22a9783eddd1e --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/alphat @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type compressible::alphatWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/epsilon b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..529618d2afbba64ffaa99f8f4c6963eaf77895f9 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/epsilon @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.0449; + +boundaryField +{ + walls + { + type compressible::epsilonWallFunction; + value uniform 0.0449; + } + inlet + { + type fixedValue; + value uniform 0.0449; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + value uniform 0.0449; + } + cycRight + { + type cyclic; + value uniform 0.0449; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/k b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/k new file mode 100644 index 0000000000000000000000000000000000000000..eed0dcdd366eab874e4fb2dc3ba7e5c542e35b76 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/k @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.0938; + +boundaryField +{ + walls + { + type compressible::kQRWallFunction; + value uniform 0.0938; + } + inlet + { + type fixedValue; + value uniform 0.0938; + } + outlet + { + type zeroGradient; + } + cycLeft + { + type cyclic; + value uniform 0.0938; + } + cycRight + { + type cyclic; + value uniform 0.0938; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..0ad81e27201c3bcec3bbf206d5abfa4617fc6e28 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/mut @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type mutWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/p b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/p new file mode 100644 index 0000000000000000000000000000000000000000..55f9cd7aee3de50282b8c4417d9ba21173ddcbe9 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/0/p @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + walls + { + type zeroGradient; + } + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value uniform 100000; + } + cycLeft + { + type cyclic; + value uniform 100000; + } + cycRight + { + type cyclic; + value uniform 100000; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allclean b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..d8e9677f468d08ae8544c26fb6363dd0f7c97eed --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allclean @@ -0,0 +1,15 @@ +#!/bin/sh +set -x + +# remove old cell sets +rm -rf constant/polyMesh/sets + +# remove old time folders +rm -rf 0 *[1-9]* + +# remove old log files +rm -f log* + +# copy 0.org to 0 +cp -r 0.org 0 + diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/Allrun b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/Allrun rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/RASProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..71270c8d7cdd49831a45d2e34e2020fb49265ed1 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/RASProperties @@ -0,0 +1,169 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + // Cmu + Cmu 0.09; + // C1 + C1 1.44; + // C2 + C2 1.92; + // C3 + C3 -0.33; + // alphah + alphah 1; + // alphak + alphak 1; + // alphaEps + alphaEps 0.76923; +} + +// RNG k-epsilon model coefficients +RNGkEpsilonCoeffs +{ + // Cmu + Cmu 0.0845; + // C1 + C1 1.42; + // C2 + C2 1.68; + // C3 + C3 -0.33; + // alphah + alphah 1; + // alphak + alphak 1.39; + // alphaEps + alphaEps 1.39; + // eta0 + eta0 4.38; + // beta + beta 0.012; +} + +LaunderSharmaKECoeffs +{ + // Cmu + Cmu 0.09; + // C1 + C1 1.44; + // C2 + C2 1.92; + // C3 + C3 -0.33; + // alphah + alphah 1; + // alphak + alphak 1; + // alphaEps + alphaEps 0.76923; +} + +// Launder-Reece-Rodi RSTM with wall functions model coefficients +LRRCoeffs +{ + // Cmu + Cmu 0.09; + // Clrr1 + Clrr1 1.8; + // Clrr2 + Clrr2 0.6; + // C1 + C1 1.44; + // C2 + C2 1.92; + // Cs + Cs 0.25; + // Ceps + Ceps 0.15; + // alphah + alphah 1; + // alphaEps + alphaEps 0.76923; + // alphaR + alphaR 1.22; +} + +LaunderGibsonRSTMCoeffs +{ + // Cmu + Cmu 0.09; + // Clg1 + Clg1 1.8; + // Clg2 + Clg2 0.6; + // C1 + C1 1.44; + // C2 + C2 1.92; + // C1Ref + C1Ref 0.5; + // C2Ref + C2Ref 0.3; + // Cs + Cs 0.25; + // Ceps + Ceps 0.15; + // alphah + alphah 1; + // alphaEps + alphaEps 0.76923; + // alphaR + alphaR 1.22; +} + +kOmegaSSTCoeffs +{ + alphaK1 0.85034; + alphaK2 1.0; + alphaOmega1 0.5; + alphaOmega2 0.85616; + gamma1 0.5532; + gamma2 0.4403; + beta1 0.0750; + beta2 0.0828; + betaStar 0.09; + a1 0.31; + c1 10; + + Cmu 0.09; + + alphah 1; +} + +wallFunctionCoeffs +{ + // kappa + kappa 0.4187; + // E + E 9; + // Prt + Prt 1; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/chemistryProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/chemistryProperties similarity index 90% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/chemistryProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/chemistryProperties index 53a5860d33ad658f415a68c944c3a89007fe22d3..9123a87ab7d2aad3c5f07fc31d6ce381b056d0f8 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/chemistryProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/chemistryProperties @@ -15,17 +15,20 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +rhoChemistryModel ODEChemistryModel<icoPoly8ThermoPhysics>; + chemistry off; turbulentReaction off; -chemistrySolver ODE; +chemistrySolver ode; initialChemicalTimeStep 1e-07; sequentialCoeffs { cTauChem 0.001; + equilibriumRateLimiter off; } EulerImplicitCoeffs @@ -34,7 +37,7 @@ EulerImplicitCoeffs equilibriumRateLimiter off; } -ODECoeffs +odeCoeffs { ODESolver RK; eps 0.05; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/environmentalProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/environmentalProperties similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/environmentalProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/environmentalProperties diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/parcelInjectionProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/parcelInjectionProperties similarity index 75% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/parcelInjectionProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/parcelInjectionProperties index fd263fee4922111dce6b8189d52a3017aec70c06..529c8f0749c2c38e599d0dca625759435cf48f72 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/parcelInjectionProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/parcelInjectionProperties @@ -16,11 +16,10 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // x y z u v w d rho mDot T cp Y0..YN ( - (0.1 0.3 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) - (0.1 0.4 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) - (0.1 0.5 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) - (0.1 0.6 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) - (0.1 0.7 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.32 0.0 0.5 0.25 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.44 0.0 0.5 0.1 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.56 0.0 0.5 -0.1.0 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.68 0.0 0.5 -0.25 0.0 0.001 1000 0.2 300 4200 1.0) ); diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/particleTrackProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/particleTrackProperties similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/particleTrackProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/particleTrackProperties diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/pointMassSourcesProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/pointMassSourcesProperties similarity index 93% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/pointMassSourcesProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/pointMassSourcesProperties index e4f61e9a20ca2f71479b0f558fdd4e3611920f55..063399d211d5ed531385d746779244fe2a970c8f 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/pointMassSourcesProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/pointMassSourcesProperties @@ -15,18 +15,18 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -active true; +active false; pointSources ( source1 { timeStart 0.2; - duration 0.5; + duration 2.0; location (2.75 0.5 0); fieldData ( - (H2O 0.1) + (H2O 0.01) ); } ); diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/blockMeshDict rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/polyMesh/blockMeshDict diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/porousZones b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/porousZones similarity index 92% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/porousZones rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/porousZones index f938b2836e47c4ea4f1ffe254d9381dc282e7653..d4881e37faef085bf267cf142da01aff1055a12f 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/porousZones +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/porousZones @@ -21,12 +21,12 @@ FoamFile coordinateSystem { e1 (1 0 0); - e2 (0 1 1); + e2 (0 1 0); } Darcy { - d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); + d d [0 -2 0 0 0 0 0] (500000 -1000 -1000); f f [0 -1 0 0 0 0 0] (0 0 0); } } diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/radiationProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/radiationProperties similarity index 97% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/radiationProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/radiationProperties index 59468cd924256aa242b4f679efcef467ddf95b20..19c0ae1defc736d068c0f5f29ac120c4d50efb48 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/radiationProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/radiationProperties @@ -17,11 +17,11 @@ FoamFile radiation off; -radiationModel P1; +radiationModel none; solverFreq 10; -noRadiation +noRadiationCoeffs { } diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Positions b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Positions similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Positions rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Positions diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties similarity index 94% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Properties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties index a1d4354ab1137adc7835e5cd87b3997653e0e40f..d33cf9f91c5231a7ebe6270c19343006e7ac1b55 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties @@ -81,7 +81,7 @@ particleForces ManualInjectionCoeffs { - massTotal massTotal [ 1 0 0 0 0 ] 1e-7; + massTotal massTotal [ 1 0 0 0 0 ] 1e-2; parcelBasisType mass; SOI 0; positionsFile "reactingCloud1Positions"; @@ -99,12 +99,12 @@ ManualInjectionCoeffs ReactingLookupTableInjectionCoeffs { - massTotal massTotal [ 1 0 0 0 0 ] 1e-7; + massTotal massTotal [ 1 0 0 0 0 ] 1e-2; parcelBasisType mass; - SOI 0; + SOI 0.5; inputFile "parcelInjectionProperties"; duration 1.0; - parcelsPerSecond 1e2; + parcelsPerSecond 250; } @@ -123,7 +123,7 @@ LocalInteractionCoeffs e 1; mu 0; } - cycLeft + cycLeft { e 1; mu 0; @@ -157,6 +157,8 @@ LiquidEvaporationCoeffs PatchPostProcessingCoeffs { + maxStoredParcels 20; + patches ( cycLeft diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.inp b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactions similarity index 92% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.inp rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactions index 80d66f62c04dbc0e5638ad8912f02619e526e7be..45f51fa38f951d4b102156822f97ba53ee005efb 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.inp +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactions @@ -1,10 +1,9 @@ species ( + N2 O2 H2O - N2 -) -; +); reactions ( diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/thermo.incompressiblePoly b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/thermo.incompressiblePoly new file mode 100644 index 0000000000000000000000000000000000000000..4ca40c05fb3aacf603b749e1f3630ca8cb5bc778 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/thermo.incompressiblePoly @@ -0,0 +1,143 @@ +( +N2 N2 1 28.0134 + rhoPolynomial + ( + 3.88E+000 + -1.64E-002 + 3.18E-005 + -2.89E-008 + 9.90E-012 + 0 + 0 + 0 + ) + 0.0 // Heat of formation + 0.0 // Standard entropy + cpPolynomial + ( + 2.75E+004 + 1.12E+001 + -3.12E-002 + 4.45E-005 + -1.92E-008 + 0 + 0 + 0 + ) + muPolynomial + ( + 1.54E-006 + 6.15E-008 + -1.81E-011 + 0 + 0 + 0 + 0 + 0 + ) + kappaPolynomial + ( + 3.15E-003 + 8.49E-005 + -1.25E-008 + 0 + 0 + 0 + 0 + 0 + ) +O2 O2 1 31.9988 + rhoPolynomial + ( + 4.43E+000 + -1.87E-002 + 3.64E-005 + -3.30E-008 + 1.13E-011 + 0 + 0 + 0 + ) + 0.0 // Heat of formation + 0.0 // Standard entropy + cpPolynomial + ( + 2.67E+004 + 9.93E+000 + -7.09E-003 + 1.45E-005 + -9.13E-009 + 0 + 0 + 0 + ) + muPolynomial + ( + 1.54E-006 + 6.15E-008 + -1.81E-011 + 0 + 0 + 0 + 0 + 0 + ) + kappaPolynomial + ( + 2.09E-004 + 8.52E-005 + -1.49E-008 + 0 + 0 + 0 + 0 + 0 + ) +H2O H2O 1 18.0153 + rhoPolynomial + ( + 2.49E+000 + -1.05E-002 + 2.03E-005 + -1.84E-008 + 6.28E-012 + 0 + 0 + 0 + ) + -241.8 // Heat of formation + 0.0 // Standard entropy + cpPolynomial + ( + 2.85E+004 + 2.63E+001 + -4.63E-002 + 5.11E-005 + -1.83E-008 + 0 + 0 + 0 + ) + muPolynomial + ( + 1.54E-006 + 6.15E-008 + -1.81E-011 + 0 + 0 + 0 + 0 + 0 + ) + kappaPolynomial + ( + 3.79E-003 + 1.53E-004 + -1.22E-008 + 0 + 0 + 0 + 0 + 0 + ) +) diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/thermophysicalProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/thermophysicalProperties similarity index 79% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/thermophysicalProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/thermophysicalProperties index 04b13b12cf071d823be29a6c41dc37ec5ab58875..5d9a0970357d20d0fb878d33332f41fba1f83d8a 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/thermophysicalProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/thermophysicalProperties @@ -15,21 +15,26 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hMixtureThermo<reactingMixture>; +thermoType hRhoMixtureThermo<reactingMixture<icoPoly8ThermoPhysics>>; chemistryReader foamChemistryReader; -foamChemistryFile "$FOAM_CASE/chemkin/foam.inp"; +foamChemistryFile "$FOAM_CASE/constant/reactions"; -foamChemistryThermoFile "$FOAM_CASE/chemkin/foam.dat"; +foamChemistryThermoFile "$FOAM_CASE/constant/thermo.incompressiblePoly"; -liquidComponents ( H2O ); +liquidComponents +( + H2O +); +H2O H2O defaultCoeffs; -solidFuelComponents ( ); +solidFuelComponents +( +); inertSpecie N2; -H2O H2O defaultCoeffs; // ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/spray b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/turbulenceProperties similarity index 83% rename from tutorials/combustion/dieselFoam/aachenBomb/0/spray rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/turbulenceProperties index c5f9cb2f59b6a48c85af4caac770e05dca1f3c3e..47c046d714367bdde68f84c32fdf37498961915b 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/spray +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/turbulenceProperties @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | +| \\ / O peration | Version: 1.5.x | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -10,11 +10,11 @@ FoamFile version 2.0; format ascii; class dictionary; - object spray; + object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -( -) +simulationType RASModel; + // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/cellSetDict b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/cellSetDict similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/system/cellSetDict rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/cellSetDict diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/controlDict b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/controlDict similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/system/controlDict rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/controlDict diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/decomposeParDict b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/decomposeParDict similarity index 96% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/system/decomposeParDict rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/decomposeParDict index e9784a98d78f4c2d7f0435a759a78ad3f30a0226..152e9d052812c485fd4e5ac6a036bf52c7472f6f 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/decomposeParDict +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/decomposeParDict @@ -19,6 +19,12 @@ numberOfSubdomains 4; method metis; +preservePatches +( + cycLeft + cycRight +); + simpleCoeffs { n ( 2 2 1 ); @@ -42,9 +48,5 @@ manualCoeffs dataFile ""; } -distributed no; - -roots ( ); - // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSchemes b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSchemes similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSchemes rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSchemes diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSolution b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution similarity index 77% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSolution rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution index 007553788aabe5cba859f93b043fc622f55414fb..1f65036d6404ad5570b5430c0e2de26b84d95544 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSolution +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution @@ -23,18 +23,33 @@ solvers preconditioner DIC; tolerance 1e-05; relTol 0; - } + }; U { solver PBiCG; preconditioner DILU; tolerance 1e-05; relTol 0; - } + }; p { - solver GAMG; + solver GAMG; + tolerance 0; + relTol 0.1; + + smoother GaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + cacheAgglomeration true; + + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + }; + pFinal + { + solver GAMG; tolerance 1e-6; relTol 0; @@ -54,101 +69,78 @@ solvers preconditioner DIC; tolerance 1e-05; relTol 0; - } + }; Yi { solver PBiCG; preconditioner DILU; tolerance 1e-06; relTol 0; - } - CO2 - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-06; - relTol 0; - } + }; O2 { solver PBiCG; preconditioner DILU; tolerance 1e-06; relTol 0; - } + }; N2 { solver PBiCG; preconditioner DILU; tolerance 1e-06; relTol 0; - } - CH4 - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-06; - relTol 0; - } - H2 - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-06; - relTol 0; - } + }; H2O { solver PBiCG; preconditioner DILU; tolerance 1e-06; relTol 0; - } - CO - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-06; - relTol 0; - } + }; h { solver PBiCG; preconditioner DILU; tolerance 1e-05; relTol 0; - } - R - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-05; - relTol 0; - } + }; k { solver PBiCG; preconditioner DILU; tolerance 1e-05; relTol 0; - } + }; epsilon { solver PBiCG; preconditioner DILU; tolerance 1e-05; relTol 0; - } + }; } PISO { transonic no; - nOuterCorrectors 2; + nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; momentumPredictor yes; +// nUCorrectors 2; } +relaxationFactors +{ +/* + U 1; + k 1; + kepsilon 1; + h 1; + rho 1; + p 1; +*/ +} // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/sets.setSet b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/sets.setSet similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/system/sets.setSet rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/sets.setSet diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties index 53a5860d33ad658f415a68c944c3a89007fe22d3..cbffc12e84975d2b2e7be95277458e5042f53ea7 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties @@ -15,11 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +psiChemistryModel ODEChemistryModel<gasThermoPhysics>; + chemistry off; turbulentReaction off; -chemistrySolver ODE; +chemistrySolver ode; initialChemicalTimeStep 1e-07; @@ -34,7 +36,7 @@ EulerImplicitCoeffs equilibriumRateLimiter off; } -ODECoeffs +odeCoeffs { ODESolver RK; eps 0.05; diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties index 59468cd924256aa242b4f679efcef467ddf95b20..ca03722b1cc634848a57607c2583bbf86f60461a 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties @@ -17,7 +17,7 @@ FoamFile radiation off; -radiationModel P1; +radiationModel none; solverFreq 10; diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties index be03e91343092bf58fa5b353f4fa76a49d3d05d7..a669b9451b705d096ce6446f143b251ebba37fb9 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties @@ -81,7 +81,7 @@ particleForces ManualInjectionCoeffs { - massTotal massTotal [ 1 0 0 0 0 ] 1e-7; + massTotal massTotal [ 1 0 0 0 0 ] 1e-8; parcelBasisType mass; SOI 0; positionsFile "reactingCloud1Positions"; diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties index 04b13b12cf071d823be29a6c41dc37ec5ab58875..8b80f059a3230223aa3de5ae7ffb3c76ead945e0 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hMixtureThermo<reactingMixture>; +thermoType hPsiMixtureThermo<reactingMixture<gasThermoPhysics>>; chemistryReader foamChemistryReader; diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options index cffe6f344a148d8b60b35ccb42990542b8c1cfcc..2f17d01ffb408994955aba9bdbc6836635eec207 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options @@ -4,9 +4,10 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/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)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -llagrangian \ @@ -15,7 +16,7 @@ EXE_LIBS = \ -lmeshTools \ -lthermophysicalFunctions \ -lbasicThermophysicalModels \ - -lcombustionThermophysicalModels \ + -lreactionThermophysicalModels \ -lspecie \ -lradiation \ -lcompressibleRASModels \ diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H index 4d58a14da89574c12d4162e343f98eba5cf7085f..5f2e597a152ef5c08f811d1f374326db15a7ed2a 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H @@ -4,8 +4,8 @@ + fvm::div(phi, U) + turbulence->divDevRhoReff(U) == - thermoCloud1.SU1() - + kinematicCloud1.SU1() + thermoCloud1.SU() + + kinematicCloud1.SU() + rho.dimensionedInternalField()*g ); diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H index bdf17e19efcdb715b5f7da5c01e96052ae41645f..ff41634a4ef48e45c45841861a35d08dd35a0f9e 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H @@ -5,7 +5,7 @@ rho, U, g, - thermo() + thermo ); Info<< "Constructing kinematicCloud1" << endl; @@ -14,7 +14,7 @@ "kinematicCloud1", rho, U, - thermo().mu(), + thermo.mu(), g ); diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H index b07398a0314073ca5d677d4e7fc25362463dc03b..cebd44cfd4041042584f6706484083b3a4dad9b0 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H @@ -1,13 +1,14 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr<basicThermo> thermo + autoPtr<basicPsiThermo> pThermo ( - basicThermo::New(mesh) + basicPsiThermo::New(mesh) ); + basicPsiThermo& thermo = pThermo(); - volScalarField& p = thermo->p(); - volScalarField& h = thermo->h(); - const volScalarField& psi = thermo->psi(); + volScalarField& p = thermo.p(); + volScalarField& h = thermo.h(); + const volScalarField& psi = thermo.psi(); volScalarField rho ( @@ -19,7 +20,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - thermo->rho() + thermo.rho() ); Info<< "\nReading field U\n" << endl; @@ -48,7 +49,7 @@ rho, U, phi, - thermo() + thermo ) ); diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H index 5359c9c2cecae01b52923ff14943cc4a1373d598..2b3b60ce980cd23324343c7647de47caba0658cf 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H @@ -6,12 +6,12 @@ - fvm::laplacian(turbulence->alphaEff(), h) == DpDt - + thermoCloud1.Sh1() + + thermoCloud1.Sh() ); hEqn.relax(); hEqn.solve(); - thermo->correct(); + thermo.correct(); } diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H index b506245034010d76f0ad0fb87dd22c8b559f5597..9443f909a356699185bfbc8497cf46e26fd1ed3b 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/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) @@ -35,8 +35,8 @@ if (transonic) else { phi = - fvc::interpolate(rho)* - ( + fvc::interpolate(rho) + *( (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) ); diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C index 1082636303c6891d00c76806b9d085de7b097980..77715fd48c1905eb01642ddefb02aaac1338e0db 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "basicThermo.H" +#include "basicPsiThermo.H" #include "turbulenceModel.H" #include "basicThermoCloud.H" @@ -41,62 +41,59 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "createClouds.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setInitialDeltaT.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "createFields.H" -# include "createClouds.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" + #include "readTimeControls.H" + #include "readPISOControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; - Info<< "Evolving thermoCloud1" << endl; thermoCloud1.evolve(); thermoCloud1.info(); - Info<< "Evolving kinematicCloud1" << endl; kinematicCloud1.evolve(); kinematicCloud1.info(); -# include "rhoEqn.H" + #include "rhoEqn.H" // --- PIMPLE loop for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) { -# 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(); - rho = thermo->rho(); + rho = thermo.rho(); runTime.write(); diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon index ec63ed16726be65c6d5561d1b31ab88fd3ef8581..9fcf588c0c292537815ea7ef2c72563a85a14851 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -22,28 +23,28 @@ boundaryField { top { - type zeroGradient; + type compressible::epsilonWallFunction; + value uniform 5390.5; } - bottom { - type zeroGradient; + type compressible::epsilonWallFunction; + value uniform 5390.5; } - walls { - type zeroGradient; + type compressible::epsilonWallFunction; + value uniform 5390.5; } - symmetry { type symmetryPlane; } - frontAndBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k index b2e4f58aab813ed1f1ba9667db76c30d0ad49f1c..9abb57fdb013a1d9dd1ac7859f9554dc0c642b71 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -22,28 +23,28 @@ boundaryField { top { - type zeroGradient; + type compressible::kQRWallFunction; + value uniform 37.5; } - bottom { - type zeroGradient; + type compressible::kQRWallFunction; + value uniform 37.5; } - walls { - type zeroGradient; + type compressible::kQRWallFunction; + value uniform 37.5; } - symmetry { type symmetryPlane; } - frontAndBack { type empty; } } + // ************************************************************************* // diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties index 4a7f8b7b2b5d0f5f7c8e979a07185eb634c9a8c5..8c69fb42b5812561e5fc746eceec85ae1481a22b 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties @@ -21,20 +21,27 @@ DragModel SphereDrag; DispersionModel StochasticDispersionRAS; -WallInteractionModel StandardWallInteraction; +PatchInteractionModel StandardWallInteraction; -minParticleMass minParticleMass [ 1 0 0 0 0 ] 1e-15; - -rho0 rho0 [ 1 -3 0 0 0 ] 5000; +PostProcessingModel none; coupled true; +cellValueSourceCorrection on; + parcelTypeId 2; +constantProperties +{ + rhoMin rhoMin [ 1 -3 0 0 0 ] 1e-15; + minParticleMass minParticleMass [ 1 0 0 0 0 ] 1e-15; + rho0 rho0 [ 1 -3 0 0 0 ] 5000; +} + interpolationSchemes { rho cell; - U cellPointFace; + U cellPoint; mu cell; } @@ -43,12 +50,21 @@ integrationSchemes U Euler; } +particleForces +{ + gravity on; + virtualMass off; + Cvm 0.5; + pressureGradient off; + gradU gradU; +} + ManualInjectionCoeffs { - parcelBasisType mass; massTotal massTotal [ 1 0 0 0 0 ] 0.0002; + parcelBasisType mass; SOI 0; - positionsFile kinematicCloud1Positions; + positionsFile "kinematicCloud1Positions"; U0 ( 0 0 0 ); parcelPDF { @@ -70,29 +86,10 @@ ConeInjectionCoeffs position ( 0.25 0.25 0.05 ); direction ( 0 -1 0 ); parcelsPerSecond 10000; - volumeFlowRate Constant; - volumeFlowRateCoeffs - { - value 0.01; - } - - Umag Constant; - UmagCoeffs - { - value 50; - } - - thetaInner Constant; - thetaInnerCoeffs - { - value 0; - } - - thetaOuter Constant; - thetaOuterCoeffs - { - value 30; - } + volumeFlowRate Constant 0.01; + Umag Constant 50; + thetaInner Constant 0; + thetaOuter Constant 30; parcelPDF { diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary index b8848e2d9cd3e1dbe2fa2a9aabe159a7108753f7..b130d7bc0aa5e48e9a785745d71564a71ac9a626 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class polyBoundaryMesh; + location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties index fd752a082c9d60ef27277908ec50e7bf425a3970..a7c19443e21a00f8964ab6b167621c7cd8090d33 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties @@ -21,33 +21,37 @@ DragModel SphereDrag; DispersionModel StochasticDispersionRAS; -WallInteractionModel StandardWallInteraction; +PatchInteractionModel StandardWallInteraction; HeatTransferModel RanzMarshall; -radiation off; - -minParticleMass minParticleMass [ 1 0 0 0 0 ] 1e-15; - -rho0 rho0 [ 1 -3 0 0 0 ] 2500; - -T0 T0 [ 0 0 0 1 0 ] 300; +PostProcessingModel none; -cp0 cp0 [ 0 2 -2 -1 0 ] 900; - -epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; - -f0 f0 [ 0 0 0 0 0 ] 0.5; +radiation off; coupled true; +cellValueSourceCorrection on; + parcelTypeId 1; +constantProperties +{ + rhoMin rhoMin [ 1 -3 0 0 0 ] 1e-15; + TMin TMin [ 0 0 0 1 0 ] 200; + minParticleMass minParticleMass [ 1 0 0 0 0 ] 1e-15; + rho0 rho0 [ 1 -3 0 0 0 ] 2500; + T0 T0 [ 0 0 0 1 0 ] 300; + cp0 cp0 [ 0 2 -2 -1 0 ] 900; + epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; + f0 f0 [ 0 0 0 0 0 ] 0.5; +} + interpolationSchemes { rho cell; - U cellPointFace; mu cell; + U cellPoint; T cell; Cp cell; } @@ -58,12 +62,21 @@ integrationSchemes T Analytical; } +particleForces +{ + gravity on; + virtualMass off; + Cvm 0.5; + pressureGradient off; + gradU gradU; +} + ManualInjectionCoeffs { massTotal massTotal [ 1 0 0 0 0 ] 0.0001; parcelBasisType mass; SOI 0; - positionsFile thermoCloud1Positions; + positionsFile "thermoCloud1Positions"; U0 ( 0 0 0 ); parcelPDF { diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties index d02b85fec4397d8da50129dd6d2374b56619abe6..f7638810ff7a4d465637cea0b9f7caca2680d98f 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; +thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1007 0 1.84e-05 0.7; diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/turbulenceProperties similarity index 100% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/turbulenceProperties diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.dat b/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.dat deleted file mode 100644 index 36ef32431218784d9c10aa1609870debbbbb5924..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.dat +++ /dev/null @@ -1,17 +0,0 @@ -( -O2 O2 1 31.9988 - 200 5000 1000 - 3.69758 0.00061352 -1.25884e-07 1.77528e-11 -1.13644e-15 -1233.93 3.18917 - 3.21294 0.00112749 -5.75615e-07 1.31388e-09 -8.76855e-13 -1005.25 6.03474 - 1.67212e-06 170.672 -H2O H2O 1 18.0153 - 200 5000 1000 - 2.67215 0.00305629 -8.73026e-07 1.201e-10 -6.39162e-15 -29899.2 6.86282 - 3.38684 0.00347498 -6.3547e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 - 1.67212e-06 170.672 -N2 N2 1 28.0134 - 200 5000 1000 - 2.92664 0.00148798 -5.68476e-07 1.0097e-10 -6.75335e-15 -922.798 5.98053 - 3.29868 0.00140824 -3.96322e-06 5.64152e-09 -2.44486e-12 -1020.9 3.95037 - 1.67212e-06 170.672 -) diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft_old b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft_old deleted file mode 100644 index c2d3df10a3d0dd05db43dbb11e3e30fd4bac28a4..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft_old +++ /dev/null @@ -1,893 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class topoSet; - location "constant/polyMesh/sets"; - object cycLeft_old; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -870 -( -6144 -6145 -6146 -6147 -6148 -6149 -6150 -6151 -6152 -6153 -6154 -6155 -6156 -6157 -6158 -6159 -6160 -6161 -6162 -6163 -6164 -6165 -4246 -4247 -4248 -4249 -4250 -4251 -4252 -4253 -4254 -4255 -4256 -4257 -4258 -4259 -4260 -4261 -4262 -4263 -4264 -4265 -4266 -4267 -4268 -4269 -4270 -4271 -4272 -4273 -4274 -4275 -4276 -4277 -4278 -4279 -4280 -4281 -4282 -4283 -4284 -4285 -4286 -4287 -4288 -4289 -4290 -4291 -4292 -4293 -4294 -4295 -4296 -4297 -4298 -4299 -4300 -4301 -4302 -4303 -4304 -4305 -4306 -4307 -4308 -4309 -4310 -4311 -4312 -4313 -4314 -4315 -4316 -4317 -4318 -4319 -4320 -4321 -4322 -4323 -4324 -4325 -4326 -4327 -4328 -4329 -4330 -4331 -4332 -4333 -4334 -4335 -4336 -4337 -4338 -4339 -4340 -4341 -4342 -4343 -4344 -4345 -4346 -4347 -4348 -4349 -4350 -4351 -4352 -4353 -4354 -4355 -4356 -4357 -4358 -4359 -4360 -4361 -4362 -4363 -4364 -4365 -4366 -4367 -4368 -4369 -4370 -4371 -4372 -4373 -4374 -4375 -4376 -4377 -4378 -4379 -4380 -4381 -4382 -4383 -4384 -4385 -4386 -4387 -4388 -4389 -4390 -4391 -4392 -4393 -4394 -4395 -4396 -4397 -4398 -4399 -4400 -4401 -4402 -4403 -4404 -4405 -4406 -4407 -4408 -4409 -4410 -4411 -4412 -4413 -4414 -4415 -4416 -4417 -4418 -4419 -4420 -4421 -4422 -4423 -4424 -4425 -4426 -4427 -4428 -4429 -4430 -4431 -4432 -4433 -4434 -4435 -4436 -4437 -4438 -4439 -4440 -4441 -4442 -4443 -4444 -4445 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -3327 -3328 -3329 -3330 -3331 -3332 -3333 -3334 -3335 -3336 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -3423 -1376 -3424 -1377 -3425 -1378 -3426 -1379 -3427 -1380 -3428 -1381 -3429 -1382 -3430 -3431 -1383 -3432 -1384 -1385 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -3506 -1458 -3507 -1459 -3508 -1460 -3509 -1461 -3510 -3511 -3512 -3513 -3514 -3515 -3516 -3517 -3518 -3519 -3520 -3521 -3522 -3523 -3524 -3525 -3526 -3527 -3528 -3529 -1481 -3530 -1482 -3531 -1483 -3532 -1484 -3533 -1485 -3534 -1486 -3535 -1487 -3536 -1488 -1489 -3537 -1490 -3538 -1491 -3539 -1492 -3540 -1493 -3541 -1494 -3542 -1495 -3543 -1496 -3544 -1497 -3545 -3546 -1498 -3547 -1499 -3548 -3549 -3550 -3551 -3552 -3553 -3554 -3555 -3556 -3557 -3558 -3559 -3560 -3561 -3562 -3563 -3564 -3565 -3566 -3567 -1519 -3568 -1520 -3569 -1521 -3570 -1522 -3571 -1523 -3572 -1524 -3573 -1525 -3574 -1526 -3575 -1527 -3576 -1528 -3577 -1529 -3578 -1530 -3579 -1531 -3580 -1532 -3581 -1533 -3582 -1534 -3583 -1535 -3584 -1536 -3585 -1537 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -1720 -1721 -1722 -1723 -1724 -1725 -1726 -1727 -1747 -1748 -1749 -1750 -1751 -1752 -1753 -1754 -1755 -1756 -1757 -1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1785 -1786 -1787 -1788 -1789 -1790 -1791 -1792 -1793 -1794 -1795 -1796 -1797 -1798 -1799 -1800 -1801 -1802 -1803 -1818 -1819 -1820 -1821 -1822 -1823 -1824 -1825 -1826 -5966 -5967 -5968 -5969 -5970 -5971 -5972 -5973 -5974 -5975 -5976 -5977 -5978 -5979 -5980 -5981 -5982 -5983 -5984 -5985 -5986 -5987 -5988 -5989 -5990 -5991 -5992 -5993 -5994 -5995 -5996 -5997 -5998 -5999 -6000 -6001 -6002 -6003 -6004 -6005 -6006 -6007 -6008 -6009 -6010 -6011 -6012 -6013 -6014 -6015 -6016 -6017 -6018 -6019 -6020 -6021 -6022 -6023 -6024 -6025 -6026 -6027 -6028 -6029 -6030 -6031 -6032 -6033 -6034 -6035 -6036 -6037 -6038 -6039 -6040 -6041 -6042 -6043 -6044 -6045 -6046 -6047 -6048 -6049 -6050 -6051 -6052 -6053 -6054 -6055 -6056 -6057 -6058 -6059 -6060 -6061 -6062 -6063 -6064 -6065 -6066 -6067 -6068 -6069 -6070 -6071 -6072 -6073 -6074 -6075 -6076 -6077 -6078 -6079 -6080 -6081 -6082 -6083 -6084 -6085 -6086 -6087 -6088 -6089 -6090 -6091 -6092 -6093 -6094 -6095 -6096 -6097 -6098 -6099 -6100 -6101 -6102 -6103 -6104 -6105 -6106 -6107 -6108 -6109 -6110 -6111 -6112 -6113 -6114 -6115 -6116 -6117 -6118 -6119 -6120 -6121 -6122 -6123 -6124 -6125 -6126 -6127 -6128 -6129 -6130 -6131 -6132 -6133 -6134 -6135 -6136 -6137 -6138 -6139 -6140 -6141 -6142 -6143 -) - -// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight_old b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight_old deleted file mode 100644 index f0f4e98da521c1704c76e9c2dfc65df9a1d4534b..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight_old +++ /dev/null @@ -1,893 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class topoSet; - location "constant/polyMesh/sets"; - object cycRight_old; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -870 -( -6144 -6145 -6146 -6147 -6148 -6149 -6150 -6151 -6152 -6153 -6154 -6155 -6156 -6157 -6158 -6159 -6160 -6161 -6162 -6163 -6164 -6165 -4246 -4247 -4248 -4249 -4250 -4251 -4252 -4253 -4254 -4255 -4256 -4257 -4258 -4259 -4260 -4261 -4262 -4263 -4264 -4265 -4266 -4267 -4268 -4269 -4270 -4271 -4272 -4273 -4274 -4275 -4276 -4277 -4278 -4279 -4280 -4281 -4282 -4283 -4284 -4285 -4286 -4287 -4288 -4289 -4290 -4291 -4292 -4293 -4294 -4295 -4296 -4297 -4298 -4299 -4300 -4301 -4302 -4303 -4304 -4305 -4306 -4307 -4308 -4309 -4310 -4311 -4312 -4313 -4314 -4315 -4316 -4317 -4318 -4319 -4320 -4321 -4322 -4323 -4324 -4325 -4326 -4327 -4328 -4329 -4330 -4331 -4332 -4333 -4334 -4335 -4336 -4337 -4338 -4339 -4340 -4341 -4342 -4343 -4344 -4345 -4346 -4347 -4348 -4349 -4350 -4351 -4352 -4353 -4354 -4355 -4356 -4357 -4358 -4359 -4360 -4361 -4362 -4363 -4364 -4365 -4366 -4367 -4368 -4369 -4370 -4371 -4372 -4373 -4374 -4375 -4376 -4377 -4378 -4379 -4380 -4381 -4382 -4383 -4384 -4385 -4386 -4387 -4388 -4389 -4390 -4391 -4392 -4393 -4394 -4395 -4396 -4397 -4398 -4399 -4400 -4401 -4402 -4403 -4404 -4405 -4406 -4407 -4408 -4409 -4410 -4411 -4412 -4413 -4414 -4415 -4416 -4417 -4418 -4419 -4420 -4421 -4422 -4423 -4424 -4425 -4426 -4427 -4428 -4429 -4430 -4431 -4432 -4433 -4434 -4435 -4436 -4437 -4438 -4439 -4440 -4441 -4442 -4443 -4444 -4445 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -3327 -3328 -3329 -3330 -3331 -3332 -3333 -3334 -3335 -3336 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -3423 -1376 -3424 -1377 -3425 -1378 -3426 -1379 -3427 -1380 -3428 -1381 -3429 -1382 -3430 -3431 -1383 -3432 -1384 -1385 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -3506 -1458 -3507 -1459 -3508 -1460 -3509 -1461 -3510 -3511 -3512 -3513 -3514 -3515 -3516 -3517 -3518 -3519 -3520 -3521 -3522 -3523 -3524 -3525 -3526 -3527 -3528 -3529 -1481 -3530 -1482 -3531 -1483 -3532 -1484 -3533 -1485 -3534 -1486 -3535 -1487 -3536 -1488 -1489 -3537 -1490 -3538 -1491 -3539 -1492 -3540 -1493 -3541 -1494 -3542 -1495 -3543 -1496 -3544 -1497 -3545 -3546 -1498 -3547 -1499 -3548 -3549 -3550 -3551 -3552 -3553 -3554 -3555 -3556 -3557 -3558 -3559 -3560 -3561 -3562 -3563 -3564 -3565 -3566 -3567 -1519 -3568 -1520 -3569 -1521 -3570 -1522 -3571 -1523 -3572 -1524 -3573 -1525 -3574 -1526 -3575 -1527 -3576 -1528 -3577 -1529 -3578 -1530 -3579 -1531 -3580 -1532 -3581 -1533 -3582 -1534 -3583 -1535 -3584 -1536 -3585 -1537 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -1720 -1721 -1722 -1723 -1724 -1725 -1726 -1727 -1747 -1748 -1749 -1750 -1751 -1752 -1753 -1754 -1755 -1756 -1757 -1758 -1759 -1760 -1761 -1762 -1763 -1764 -1765 -1785 -1786 -1787 -1788 -1789 -1790 -1791 -1792 -1793 -1794 -1795 -1796 -1797 -1798 -1799 -1800 -1801 -1802 -1803 -1818 -1819 -1820 -1821 -1822 -1823 -1824 -1825 -1826 -5966 -5967 -5968 -5969 -5970 -5971 -5972 -5973 -5974 -5975 -5976 -5977 -5978 -5979 -5980 -5981 -5982 -5983 -5984 -5985 -5986 -5987 -5988 -5989 -5990 -5991 -5992 -5993 -5994 -5995 -5996 -5997 -5998 -5999 -6000 -6001 -6002 -6003 -6004 -6005 -6006 -6007 -6008 -6009 -6010 -6011 -6012 -6013 -6014 -6015 -6016 -6017 -6018 -6019 -6020 -6021 -6022 -6023 -6024 -6025 -6026 -6027 -6028 -6029 -6030 -6031 -6032 -6033 -6034 -6035 -6036 -6037 -6038 -6039 -6040 -6041 -6042 -6043 -6044 -6045 -6046 -6047 -6048 -6049 -6050 -6051 -6052 -6053 -6054 -6055 -6056 -6057 -6058 -6059 -6060 -6061 -6062 -6063 -6064 -6065 -6066 -6067 -6068 -6069 -6070 -6071 -6072 -6073 -6074 -6075 -6076 -6077 -6078 -6079 -6080 -6081 -6082 -6083 -6084 -6085 -6086 -6087 -6088 -6089 -6090 -6091 -6092 -6093 -6094 -6095 -6096 -6097 -6098 -6099 -6100 -6101 -6102 -6103 -6104 -6105 -6106 -6107 -6108 -6109 -6110 -6111 -6112 -6113 -6114 -6115 -6116 -6117 -6118 -6119 -6120 -6121 -6122 -6123 -6124 -6125 -6126 -6127 -6128 -6129 -6130 -6131 -6132 -6133 -6134 -6135 -6136 -6137 -6138 -6139 -6140 -6141 -6142 -6143 -) - -// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter deleted file mode 100644 index 69a220b27d6b5c8fdf9e6cd5e72e964fb2c6bffa..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter +++ /dev/null @@ -1,223 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class cellSet; - location "constant/polyMesh/sets"; - object filter; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -200 -( -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -) - -// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/leftFluid b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/leftFluid deleted file mode 100644 index f2907ad0b5a2f7e89636e423e6ab482b98f8fb6c..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/leftFluid +++ /dev/null @@ -1,683 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class cellSet; - location "constant/polyMesh/sets"; - object leftFluid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -660 -( -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -580 -581 -582 -583 -584 -600 -601 -602 -603 -604 -620 -621 -622 -623 -624 -640 -641 -642 -643 -644 -660 -661 -662 -663 -664 -680 -681 -682 -683 -684 -700 -701 -702 -703 -704 -720 -721 -722 -723 -724 -740 -741 -742 -743 -744 -760 -761 -762 -763 -764 -780 -781 -782 -783 -784 -800 -801 -802 -803 -804 -820 -821 -822 -823 -824 -840 -841 -842 -843 -844 -860 -861 -862 -863 -864 -880 -881 -882 -883 -884 -900 -901 -902 -903 -904 -920 -921 -922 -923 -924 -940 -941 -942 -943 -944 -) - -// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/rightFluid b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/rightFluid deleted file mode 100644 index d1d4226be6df5334e86deba685cf2acbe2b74ce0..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/rightFluid +++ /dev/null @@ -1,883 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class cellSet; - location "constant/polyMesh/sets"; - object rightFluid; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -860 -( -575 -576 -577 -578 -579 -595 -596 -597 -598 -599 -615 -616 -617 -618 -619 -635 -636 -637 -638 -639 -655 -656 -657 -658 -659 -675 -676 -677 -678 -679 -695 -696 -697 -698 -699 -715 -716 -717 -718 -719 -735 -736 -737 -738 -739 -755 -756 -757 -758 -759 -775 -776 -777 -778 -779 -795 -796 -797 -798 -799 -815 -816 -817 -818 -819 -835 -836 -837 -838 -839 -855 -856 -857 -858 -859 -875 -876 -877 -878 -879 -895 -896 -897 -898 -899 -915 -916 -917 -918 -919 -935 -936 -937 -938 -939 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244 -1245 -1246 -1247 -1248 -1249 -1250 -1251 -1252 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283 -1284 -1285 -1286 -1287 -1288 -1289 -1290 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1310 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354 -1355 -1356 -1357 -1358 -1359 -1360 -1361 -1362 -1363 -1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1431 -1432 -1433 -1434 -1435 -1436 -1437 -1438 -1439 -1440 -1441 -1442 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461 -1462 -1463 -1464 -1465 -1466 -1467 -1468 -1469 -1470 -1471 -1472 -1473 -1474 -1475 -1476 -1477 -1478 -1479 -1480 -1481 -1482 -1483 -1484 -1485 -1486 -1487 -1488 -1489 -1490 -1491 -1492 -1493 -1494 -1495 -1496 -1497 -1498 -1499 -1500 -1501 -1502 -1503 -1504 -1505 -1506 -1507 -1508 -1509 -1510 -1511 -1512 -1513 -1514 -1515 -1516 -1517 -1518 -1519 -1520 -1521 -1522 -1523 -1524 -1525 -1526 -1527 -1528 -1529 -1530 -1531 -1532 -1533 -1534 -1535 -1536 -1537 -1538 -1539 -1540 -1541 -1542 -1543 -1544 -1545 -1546 -1547 -1548 -1549 -1550 -1551 -1552 -1553 -1554 -1555 -1556 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1576 -1577 -1578 -1579 -1580 -1581 -1582 -1583 -1584 -1585 -1586 -1587 -1588 -1589 -1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1614 -1615 -1616 -1617 -1618 -1619 -1620 -1621 -1622 -1623 -1624 -1625 -1626 -1627 -1628 -1629 -1630 -1631 -1632 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650 -1651 -1652 -1653 -1654 -1655 -1656 -1657 -1658 -1659 -1660 -1661 -1662 -1663 -1664 -1665 -1666 -1667 -1668 -1669 -1670 -1671 -1672 -1673 -1674 -1675 -1676 -1677 -1678 -1679 -1680 -1681 -1682 -1683 -1684 -1685 -1686 -1687 -1688 -1689 -1690 -1691 -1692 -1693 -1694 -1695 -1696 -1697 -1698 -1699 -1700 -1701 -1702 -1703 -1704 -1705 -1706 -1707 -1708 -1709 -1710 -1711 -1712 -1713 -1714 -1715 -1716 -1717 -1718 -1719 -) - -// ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.1 b/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.1 index a7c7e625e5403387aa3b92c464b9d8c5615c7ba4..bfa0d6ac4f2b2b07aa49ade99f366371db345123 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.1 +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.1 @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object cellSetDict.1; @@ -19,7 +19,13 @@ name c0; action new; -topoSetSources ( boxToCell { box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ; } ); +topoSetSources +( + boxToCell + { + box (0.004 -0.001 -1) (0.012 0.001 1); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.2 b/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.2 index 470258895d1a503d39431f85dc16d207019b0cc0..d9684898c824a0cf4cd22ad94cdc21297fc9d39d 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.2 +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.2 @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object cellSetDict.2; @@ -19,7 +19,13 @@ name c0; action new; -topoSetSources ( boxToCell { box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ; } ); +topoSetSources +( + boxToCell + { + box (0.0045 -0.00075 -1) (0.0095 0.00075 1); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.3 b/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.3 index 530c710e1f0e6bae3655c4127e4bca08ecd7a049..10f2c880a56a0fd7ce1d75798a91bb082c68f865 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.3 +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/cellSetDict.3 @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object cellSetDict.3; @@ -19,7 +19,13 @@ name c0; action new; -topoSetSources ( boxToCell { box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ; } ); +topoSetSources +( + boxToCell + { + box (0.00475 -0.000375 -1) (0.009 0.000375 1); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.1 b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.1 index a7c7e625e5403387aa3b92c464b9d8c5615c7ba4..88755b22992e891570617b7aef7353ab23845086 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.1 +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.1 @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object cellSetDict.1; @@ -19,7 +19,13 @@ name c0; action new; -topoSetSources ( boxToCell { box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ) ; } ); +topoSetSources +( + boxToCell + { + box ( 0.004 -0.001 -1 ) ( 0.012 0.001 1 ); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.2 b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.2 index 470258895d1a503d39431f85dc16d207019b0cc0..a29931d08f4c220bf54882641c2ac334e4bc3dd4 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.2 +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.2 @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object cellSetDict.2; @@ -19,7 +19,13 @@ name c0; action new; -topoSetSources ( boxToCell { box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ) ; } ); +topoSetSources +( + boxToCell + { + box ( 0.0045 -0.00075 -1 ) ( 0.0095 0.00075 1 ); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.3 b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.3 index 530c710e1f0e6bae3655c4127e4bca08ecd7a049..8ff387dd87d81b0ef5435ec79df5d8fc34d21371 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.3 +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/cellSetDict.3 @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "system"; object cellSetDict.3; @@ -19,7 +19,13 @@ name c0; action new; -topoSetSources ( boxToCell { box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ) ; } ); +topoSetSources +( + boxToCell + { + box ( 0.00475 -0.000375 -1 ) ( 0.009 0.000375 1 ); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/pd.org b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.org similarity index 98% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/pd.org rename to tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.org index 5f5f977f4311ab2cad0ebf9602845f7a3a48cf50..72b59f9e90996a5e37de42dfe70687f6855fbf13 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/pd.org +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/0/p.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun index f4e775f4baa016ca5056f6c9dea078382d060095..f2a0345d68b030bcac62302fb71d10da0a137384 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/Allrun @@ -7,6 +7,6 @@ application="compressibleInterFoam" runApplication blockMesh cp 0/alpha1.org 0/alpha1 -cp 0/pd.org 0/pd +cp 0/p.org 0/p runApplication setFields runApplication $application diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes index 373e1ca67d95f93b6f87c25f206a931c6c14ba76..0233a5951ab53946c3f3452772a78c5f93d0174c 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression 1; - div(phi,pd) Gauss upwind; + div(phi,p) Gauss upwind; div(phi,k) Gauss vanLeer; div((nuEff*dev(grad(U).T()))) Gauss linear; } @@ -53,9 +53,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - gamma ; + p; + pcorr; + gamma; } diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution index 3416674d0782e6a26af8e5de6eb075c7b792a6cf..f93b56c204b46b986ec5bb2d32ce87645e071874 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSolution @@ -45,7 +45,7 @@ solvers solver diagonal; } - pd + p { solver GAMG; tolerance 1e-07; @@ -60,7 +60,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict index d1992643325e54bb632fa934b57dc0c257580c08..00e706b1e518efe1caece07029b5924ce9c8d75b 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/setFieldsDict @@ -15,9 +15,33 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defaultFieldValues ( volScalarFieldValue alpha1 1 volScalarFieldValue pd 100000 ); +defaultFieldValues +( + volScalarFieldValue alpha1 1 + volScalarFieldValue p 100000 +); -regions ( sphereToCell { centre ( 0.5 0.5 0 ) ; radius 0.1 ; fieldValues ( volScalarFieldValue alpha1 0 volScalarFieldValue pd 1000000 ) ; } boxToCell { box ( -10 1 -1 ) ( 10 10 1 ) ; fieldValues ( volScalarFieldValue alpha1 0 ) ; } ); +regions +( + sphereToCell + { + centre ( 0.5 0.5 0 ); + radius 0.1; + fieldValues + ( + volScalarFieldValue alpha1 0 + volScalarFieldValue p 1000000 + ); + } + boxToCell + { + box ( -10 1 -1 ) ( 10 10 1 ); + fieldValues + ( + volScalarFieldValue alpha1 0 + ); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/pd.org b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p.org similarity index 97% rename from tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/pd.org rename to tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p.org index efe6f4ca9c57592011bedf77d0c8ff218a2eea5c..3377670aaf545dacf540dac89e8f447059c57d4a 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/pd.org +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/0/p.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd.org; + object p.org; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean index c422ce058e162967e4924ab9cd8404a7ca807133..99cd62d9236e42bc0e1303987403265889e6fb6b 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allclean @@ -2,4 +2,4 @@ foamCleanTutorials cases rm -rf processor* -rm -rf 0/pd.gz 0/alpha1.gz +rm -rf 0/p.gz 0/alpha1.gz diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun index 3302513ed6e1d1fc3595aad7260bc8e4299e6efb..7b9b11445e018536c908fa896212a19c7c92eef3 100755 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/Allrun @@ -7,7 +7,7 @@ application="compressibleInterFoam" runApplication blockMesh cp 0/alpha1.org 0/alpha1 -cp 0/pd.org 0/pd +cp 0/p.org 0/p runApplication setFields runApplication decomposePar hostname > system/machines diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes index 373e1ca67d95f93b6f87c25f206a931c6c14ba76..0233a5951ab53946c3f3452772a78c5f93d0174c 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression 1; - div(phi,pd) Gauss upwind; + div(phi,p) Gauss upwind; div(phi,k) Gauss vanLeer; div((nuEff*dev(grad(U).T()))) Gauss linear; } @@ -53,9 +53,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - gamma ; + p; + pcorr; + gamma; } diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution index 3416674d0782e6a26af8e5de6eb075c7b792a6cf..f93b56c204b46b986ec5bb2d32ce87645e071874 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSolution @@ -45,7 +45,7 @@ solvers solver diagonal; } - pd + p { solver GAMG; tolerance 1e-07; @@ -60,7 +60,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict index fb686e791c29a4621e44bf2cab9b086005d62bc0..3b3c397cb925ab34bb2ab7528cb67d3545196ee0 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/setFieldsDict @@ -15,9 +15,33 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defaultFieldValues ( volScalarFieldValue alpha1 1 volScalarFieldValue pd 100000 ); +defaultFieldValues +( + volScalarFieldValue alpha1 1 + volScalarFieldValue p 100000 +); -regions ( sphereToCell { centre ( 0.5 0.5 0.5 ) ; radius 0.1 ; fieldValues ( volScalarFieldValue alpha1 0 volScalarFieldValue pd 1000000 ) ; } boxToCell { box ( -10 1 -1 ) ( 10 10 1 ) ; fieldValues ( volScalarFieldValue alpha1 0 ) ; } ); +regions +( + sphereToCell + { + centre ( 0.5 0.5 0.5 ); + radius 0.1; + fieldValues + ( + volScalarFieldValue alpha1 0 + volScalarFieldValue p 1000000 + ); + } + boxToCell + { + box ( -10 1 -1 ) ( 10 10 1 ); + fieldValues + ( + volScalarFieldValue alpha1 0 + ); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/pd b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/p similarity index 98% rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/pd rename to tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/p index 01361099097a2f6c771cf634ff96a3466c7b49b3..b3a944b216d11d7644902b0a094403caa9507154 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/pd +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0-orig/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/pd b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/p similarity index 98% rename from tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/pd rename to tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/p index 01361099097a2f6c771cf634ff96a3466c7b49b3..b3a944b216d11d7644902b0a094403caa9507154 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/pd +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes index c563a4cd8fe840a8bbabf755739cbf83ae20fff5..a6ed1d41742c9330925f532a0f080cce8bdbe21e 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution index 2ca306273d2f9178a190c71b10c6f37cbc5ac67a..fe7b6a88515a806090e82ac24cc50f10c9ea01df 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-08; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner @@ -122,9 +122,8 @@ PISO nAlphaSubCycles 3; cAlpha 1; - pdRefPoint (0.51 0.51 0.51); - pdRefValue 0; - pRefValue 0; + pRefPoint (0.51 0.51 0.51); + pRefValue 0; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/pd b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p similarity index 98% rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/pd rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p index 020ff7cc00a27e6b27aed9640ba406c34958cb98..c69b424dc75602864a806fc737b9f17d4017de74 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/pd +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict index e4a69588f6ea514229a8f1616348508e27a1bc41..35735bacbbe1f9b409860731920c58c2bb23e935 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/controlDict @@ -54,7 +54,7 @@ functions probes { type probes; - name probes; + functionObjectLibs ( "libsampling.so" ); outputControl timeStep; outputInterval 1; probeLocations diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes index 3a940dbe40590b8a3661aaa877dc5c159edb986e..2f7da16bb6cae840274d0344b5c92de2fc959ed3 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution index c9dccc239e4610d982bc3f6e8a70b36aad0e9d79..77e4ff75cfbdbc79a7a241312acdab31fb65a954 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-08; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner @@ -99,8 +99,7 @@ PISO cAlpha 1.5; correctPhi no; - pdRefPoint (0 0 0.15); - pdRefValue 0; + pRefPoint (0 0 0.15); pRefValue 1e5; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/setFieldsDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/setFieldsDict index 7ff571c6d130cf0424493bcc96a52251eedc746a..ec8d1717d50aba095d49655c4509cd75692a659b 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/setFieldsDict +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/setFieldsDict @@ -25,7 +25,10 @@ regions boxToCell { box ( -100 -100 -100 ) ( 100 100 0 ); - fieldValues ( volScalarFieldValue alpha1 1 ); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); } ); diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/pd b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p similarity index 98% rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/pd rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p index 020ff7cc00a27e6b27aed9640ba406c34958cb98..c69b424dc75602864a806fc737b9f17d4017de74 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/pd +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes index d4eb5a19662e68864722f579d30296c6d4fbfd87..b5c55ba3d740f3873f7f59512cfcb73893801262 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution index c9dccc239e4610d982bc3f6e8a70b36aad0e9d79..77e4ff75cfbdbc79a7a241312acdab31fb65a954 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-08; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner @@ -99,8 +99,7 @@ PISO cAlpha 1.5; correctPhi no; - pdRefPoint (0 0 0.15); - pdRefValue 0; + pRefPoint (0 0 0.15); pRefValue 1e5; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/setFieldsDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/setFieldsDict index 7ff571c6d130cf0424493bcc96a52251eedc746a..ec8d1717d50aba095d49655c4509cd75692a659b 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/setFieldsDict +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/setFieldsDict @@ -25,7 +25,10 @@ regions boxToCell { box ( -100 -100 -100 ) ( 100 100 0 ); - fieldValues ( volScalarFieldValue alpha1 1 ); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); } ); diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/pd b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p similarity index 97% rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/pd rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p index ac7e49da81a5ead98e613c5891faccae05ef2629..d27ad70eb9ed4cdf91ec9cf25222554b271898e7 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/pd +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes index d4eb5a19662e68864722f579d30296c6d4fbfd87..b5c55ba3d740f3873f7f59512cfcb73893801262 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution index c9dccc239e4610d982bc3f6e8a70b36aad0e9d79..77e4ff75cfbdbc79a7a241312acdab31fb65a954 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-08; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner @@ -99,8 +99,7 @@ PISO cAlpha 1.5; correctPhi no; - pdRefPoint (0 0 0.15); - pdRefValue 0; + pRefPoint (0 0 0.15); pRefValue 1e5; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/setFieldsDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/setFieldsDict index 2f947e62416f71a3ff19b87376388cab9269939a..bceaad67cefa6f8fed8a77df0e41275a7d0dc295 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/setFieldsDict +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/setFieldsDict @@ -25,7 +25,10 @@ regions boxToCell { box ( -100 -100 -100 ) ( 100 100 0 ); - fieldValues ( volScalarFieldValue alpha1 1 ); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); } ); diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/pd b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p similarity index 97% rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/pd rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p index ac7e49da81a5ead98e613c5891faccae05ef2629..d27ad70eb9ed4cdf91ec9cf25222554b271898e7 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/pd +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes index d4eb5a19662e68864722f579d30296c6d4fbfd87..b5c55ba3d740f3873f7f59512cfcb73893801262 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution index c9dccc239e4610d982bc3f6e8a70b36aad0e9d79..77e4ff75cfbdbc79a7a241312acdab31fb65a954 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-08; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner @@ -99,8 +99,7 @@ PISO cAlpha 1.5; correctPhi no; - pdRefPoint (0 0 0.15); - pdRefValue 0; + pRefPoint (0 0 0.15); pRefValue 1e5; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/setFieldsDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/setFieldsDict index 7ff571c6d130cf0424493bcc96a52251eedc746a..ec8d1717d50aba095d49655c4509cd75692a659b 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/setFieldsDict +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/setFieldsDict @@ -25,7 +25,10 @@ regions boxToCell { box ( -100 -100 -100 ) ( 100 100 0 ); - fieldValues ( volScalarFieldValue alpha1 1 ); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); } ); diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/pd b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p similarity index 97% rename from tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/pd rename to tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p index ac7e49da81a5ead98e613c5891faccae05ef2629..d27ad70eb9ed4cdf91ec9cf25222554b271898e7 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/pd +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes index d4eb5a19662e68864722f579d30296c6d4fbfd87..b5c55ba3d740f3873f7f59512cfcb73893801262 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution index c9dccc239e4610d982bc3f6e8a70b36aad0e9d79..77e4ff75cfbdbc79a7a241312acdab31fb65a954 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-08; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner @@ -99,8 +99,7 @@ PISO cAlpha 1.5; correctPhi no; - pdRefPoint (0 0 0.15); - pdRefValue 0; + pRefPoint (0 0 0.15); pRefValue 1e5; } diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/0/pd b/tutorials/multiphase/interFoam/laminar/damBreak/0/p similarity index 98% rename from tutorials/multiphase/interFoam/laminar/damBreak/0/pd rename to tutorials/multiphase/interFoam/laminar/damBreak/0/p index 520a3e9b0b291a7913c871b614d8fe9845e8ab08..15ab9897a899264f52a2cfb792b0fc6c39324dc4 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/0/pd +++ b/tutorials/multiphase/interFoam/laminar/damBreak/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes index d242b76b754914e7115105855ad61600253674b9..0b17c289c20ba9a27c48d9ddec20f44f1c47f8f3 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes @@ -52,9 +52,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha1 ; + p; + pcorr; + alpha1; } diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution index b1b00223fcd0bbe688671476a0173185fb0313f5..6c3a8c5da3dd2e83b7454a5ed945bc9684310a0f 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution +++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSolution @@ -25,7 +25,7 @@ solvers relTol 0; } - pd + p { solver PCG; preconditioner DIC; @@ -33,7 +33,7 @@ solvers relTol 0.05; } - pdFinal + pFinal { solver PCG; preconditioner DIC; diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/pd b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p similarity index 98% rename from tutorials/multiphase/interFoam/les/nozzleFlow2D/0/pd rename to tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p index b533fbc016f7cc5b593988af8555c43a371cd0a1..8f01f473bbda69c4823f35737c47695029173338 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/pd +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes index 2a273c5e51cb5bcdaf8b079c33459db6568e75a2..153a1ea73a20a1f11684eee3085622aa9375be87 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes @@ -56,9 +56,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - alpha1 ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution index 660482ad377d9745a5a8fd4b6fc67486640c3726..4642da139683a71541d7b045c40507ee0b02627f 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-07; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner diff --git a/tutorials/multiphase/interFoam/ras/Allrun b/tutorials/multiphase/interFoam/ras/Allrun index c01b35fcbd4aa6d8576f8c96ef86fd924006b8dc..e222cf7e15d05f8a2f8d11bb3e86ba15491bffd2 100755 --- a/tutorials/multiphase/interFoam/ras/Allrun +++ b/tutorials/multiphase/interFoam/ras/Allrun @@ -32,7 +32,7 @@ cloneCase damBreak damBreakFine cd damBreakFine # Modify case setDamBreakFine - cp ../damBreak/0/gamma.org 0/gamma + cp ../damBreak/0/alpha1.org 0/alpha1 # And execute runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/U b/tutorials/multiphase/interFoam/ras/damBreak/0/U index d4cc4c65a67476de08b56cbb2efd682e88a46db6..7ea3a0c32328d93fd01ba3c580c7d73b54473d22 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/U +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/U @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class volVectorField; + location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -38,7 +39,6 @@ boundaryField atmosphere { type pressureInletOutletVelocity; - phi phi; value uniform (0 0 0); } defaultFaces @@ -47,4 +47,5 @@ boundaryField } } + // ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/gamma b/tutorials/multiphase/interFoam/ras/damBreak/0/alpha1 similarity index 98% rename from tutorials/multiphase/interFoam/ras/damBreak/0/gamma rename to tutorials/multiphase/interFoam/ras/damBreak/0/alpha1 index 742f2974431e8ab23664341603ef199480f49c68..36d4d31dcdd7caa199ad6f5be76cff952156cb96 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/gamma +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/alpha1 @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object gamma; + object alpha1; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/gamma.org b/tutorials/multiphase/interFoam/ras/damBreak/0/alpha1.org similarity index 98% rename from tutorials/multiphase/interFoam/ras/damBreak/0/gamma.org rename to tutorials/multiphase/interFoam/ras/damBreak/0/alpha1.org index 742f2974431e8ab23664341603ef199480f49c68..36d4d31dcdd7caa199ad6f5be76cff952156cb96 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/gamma.org +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/alpha1.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object gamma; + object alpha1; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/epsilon b/tutorials/multiphase/interFoam/ras/damBreak/0/epsilon index 92ed8a7d75e228fe370ae2c54f67161b484f4973..b49a80428493c25ee922fb2501e11cd749b3ddf7 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/epsilon +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/epsilon @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 0 2 -3 0 0 0 0 ]; +dimensions [0 2 -3 0 0 0 0]; internalField uniform 0.1; @@ -24,28 +24,24 @@ boundaryField leftWall { type epsilonWallFunction; - value uniform 0; + value uniform 0.1; } - rightWall { type epsilonWallFunction; - value uniform 0; + value uniform 0.1; } - lowerWall { type epsilonWallFunction; - value uniform 0; + value uniform 0.1; } - atmosphere { type inletOutlet; inletValue uniform 0.1; value uniform 0.1; } - defaultFaces { type empty; diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/k b/tutorials/multiphase/interFoam/ras/damBreak/0/k index c8071de03ba06ce1292fe0b5ebb3e018c88efc6d..897224d725f3bd8e0f02800a735dae854a9b03e9 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/k +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/k @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 0 2 -2 0 0 0 0 ]; +dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.1; @@ -24,28 +24,24 @@ boundaryField leftWall { type kQRWallFunction; - value uniform 0; + value uniform 0.1; } - rightWall { type kQRWallFunction; - value uniform 0; + value uniform 0.1; } - lowerWall { type kQRWallFunction; - value uniform 0; + value uniform 0.1; } - atmosphere { type inletOutlet; inletValue uniform 0.1; value uniform 0.1; } - defaultFaces { type empty; diff --git a/tutorials/multiphase/interFoam/ras/damBreak/0/pd b/tutorials/multiphase/interFoam/ras/damBreak/0/p similarity index 98% rename from tutorials/multiphase/interFoam/ras/damBreak/0/pd rename to tutorials/multiphase/interFoam/ras/damBreak/0/p index 520a3e9b0b291a7913c871b614d8fe9845e8ab08..15ab9897a899264f52a2cfb792b0fc6c39324dc4 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/0/pd +++ b/tutorials/multiphase/interFoam/ras/damBreak/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes index 499ad01e5c625d5e9cb16c5f3693f73f17a84206..81f8e2c48bd5283e46a085104826d809ae7169be 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes @@ -28,8 +28,8 @@ gradSchemes divSchemes { div(rho*phi,U) Gauss linear; - div(phi,gamma) Gauss vanLeer; - div(phirb,gamma) Gauss interfaceCompression; + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; @@ -57,9 +57,9 @@ snGradSchemes fluxRequired { default no; - pd ; - pcorr ; - gamma ; + p; + pcorr; + alpha; } diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution index ea7bd97c27c3f83f3dd9ab1b2c0da77625af3bd2..6af3dad37e44b40c8d5a8f4d48d2b5f1207423ec 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution +++ b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSolution @@ -25,7 +25,7 @@ solvers relTol 0; } - pd + p { solver PCG; preconditioner DIC; @@ -33,7 +33,7 @@ solvers relTol 0.05; } - pdFinal + pFinal { solver PCG; preconditioner DIC; @@ -87,9 +87,9 @@ PISO momentumPredictor no; nCorrectors 3; nNonOrthogonalCorrectors 0; - nGammaCorr 1; - nGammaSubCycles 4; - cGamma 2; + nAlphaCorr 1; + nAlphaSubCycles 4; + cAlpha 2; } diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/pd b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p similarity index 98% rename from tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/pd rename to tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p index 520a3e9b0b291a7913c871b614d8fe9845e8ab08..15ab9897a899264f52a2cfb792b0fc6c39324dc4 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/pd +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution index 8c303f95402ad22e64766b3e454753746a7c68cf..47957b22b37e777ec21a079ffcb3b6dc1399d7a0 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-07; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/pd b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p similarity index 98% rename from tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/pd rename to tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p index 520a3e9b0b291a7913c871b614d8fe9845e8ab08..15ab9897a899264f52a2cfb792b0fc6c39324dc4 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/0/pd +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution index 8c303f95402ad22e64766b3e454753746a7c68cf..47957b22b37e777ec21a079ffcb3b6dc1399d7a0 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSolution @@ -40,7 +40,7 @@ solvers maxIter 100; } - pd + p { solver GAMG; tolerance 1e-07; @@ -55,7 +55,7 @@ solvers mergeLevels 1; } - pdFinal + pFinal { solver PCG; preconditioner diff --git a/wmake/rules/General/cint b/wmake/rules/General/cint deleted file mode 100644 index f09d622977cbfe33bf69eaeb2cb118442fbc92d2..0000000000000000000000000000000000000000 --- a/wmake/rules/General/cint +++ /dev/null @@ -1,12 +0,0 @@ -.SUFFIXES: .ldf - -ifeq ($(origin WM_SCHEDULER), undefined) - EVAL_LDF = eval -else - EVAL_LDF = $(WM_SCHEDULER) -endif - -ldftoo = $(EVAL_LDF) m4 $$SOURCE \> $*.H \; cint -n$*.C -N$(*F) -p -c-1 -A -I${CINTSYSDIR}/inc -I${WM_PROJECT_DIR}/src/OpenFOAM/lnInclude -D__MAKECINT__ -DG__MAKECINT -DG__SHAREDLIB -DG__OSFDLL -DG__ANSI -DG__ERRORCALLBACK -DG__SIGNEDCHAR -DG__NEWSTDHEADER -DG__CINT_VER6 -DG__NATIVELONGLONG -DG__P2FCAST -DG__STD_EXCEPTION -DG__HAVE_CONFIG -DG__NOMAKEINFO -DDP -D__restrict__= -Y0 -DNoInline $*.H \; $(CC) $(c++FLAGS) -c $*.C -o $@ - -.ldf.dep: - $(MAKE_DEP) diff --git a/wmake/rules/SiCortex64Gcc/general b/wmake/rules/SiCortex64Gcc/general index 11b48acc3fc0c67c177b464c70de18248881c12d..d70a77cdb037212e12f9b54cd0c80005dcae4ccb 100644 --- a/wmake/rules/SiCortex64Gcc/general +++ b/wmake/rules/SiCortex64Gcc/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/SunOS64Gcc/general b/wmake/rules/SunOS64Gcc/general index 70ee588d82de5943cd89d28acc2703bf3476940b..f9b563219850dada6751ec3cf50b17291f212d0f 100644 --- a/wmake/rules/SunOS64Gcc/general +++ b/wmake/rules/SunOS64Gcc/general @@ -1,11 +1,10 @@ CPP = /lib/cpp $(GFLAGS) LD = ld -64 -PROJECT_LIBS = -l$(WM_PROJECT) -liberty -lnsl -lsocket -L$(FOAM_LIBBIN)/dummy -lPstream +PROJECT_LIBS = -l$(WM_PROJECT) -liberty -lnsl -lsocket -L$(FOAM_LIBBIN)/dummy -lPstream include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++ index 36b5c29b20b6297dcc3d42dcc5b46342cd34a116..9d074e2715ef9cacfdc2f29e0a6c06bf13ed2413 100644 --- a/wmake/rules/linux64Gcc/c++ +++ b/wmake/rules/linux64Gcc/c++ @@ -1,6 +1,6 @@ .SUFFIXES: .C .cxx .cc .cpp -c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast +c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor CC = g++ -m64 diff --git a/wmake/rules/linux64Gcc/c++Opt b/wmake/rules/linux64Gcc/c++Opt index 8ac07d2124e4b49b9bda82d3ea0c4380b9c6b8e6..3446f7f58cbeb23e1753e982a9734bbf1a180b43 100644 --- a/wmake/rules/linux64Gcc/c++Opt +++ b/wmake/rules/linux64Gcc/c++Opt @@ -1,4 +1,4 @@ -c++DBUG = +c++DBUG = c++OPT = -O3 #c++OPT = -march=nocona -O3 # -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/linux64Gcc/general b/wmake/rules/linux64Gcc/general index 3c2e4db2ee31ca84bfb6adcd135f9b3651195c0a..10237bd1b67211d2d008b2e9fe5c52248e359ab6 100644 --- a/wmake/rules/linux64Gcc/general +++ b/wmake/rules/linux64Gcc/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linux64Gcc42/general b/wmake/rules/linux64Gcc42/general index 11b48acc3fc0c67c177b464c70de18248881c12d..d70a77cdb037212e12f9b54cd0c80005dcae4ccb 100644 --- a/wmake/rules/linux64Gcc42/general +++ b/wmake/rules/linux64Gcc42/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general index 3c2e4db2ee31ca84bfb6adcd135f9b3651195c0a..10237bd1b67211d2d008b2e9fe5c52248e359ab6 100644 --- a/wmake/rules/linux64Gcc43/general +++ b/wmake/rules/linux64Gcc43/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linuxGcc/general b/wmake/rules/linuxGcc/general index d009001a6e3a18369eb608cede9eed6bdc600606..02ad6973ff3f0dd9498c091f427642d23c867508 100644 --- a/wmake/rules/linuxGcc/general +++ b/wmake/rules/linuxGcc/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linuxGcc43/general b/wmake/rules/linuxGcc43/general index d009001a6e3a18369eb608cede9eed6bdc600606..02ad6973ff3f0dd9498c091f427642d23c867508 100644 --- a/wmake/rules/linuxGcc43/general +++ b/wmake/rules/linuxGcc43/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linuxPPC64Gcc/general b/wmake/rules/linuxPPC64Gcc/general index 2626ab65d12cbba1680848fdc93cfb2b05f3920b..76d507634a936cc0b01185048dfdd9bbb7da4ec6 100644 --- a/wmake/rules/linuxPPC64Gcc/general +++ b/wmake/rules/linuxPPC64Gcc/general @@ -8,4 +8,3 @@ include $(GENERAL_RULES)/standard include $(RULES)/X include $(RULES)/c include $(RULES)/c++ -include $(GENERAL_RULES)/cint