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/createFields.H b/applications/solvers/compressible/sonicFoam/createFields.H index eb45a7c23af7826cd0843adead9e5a3ea74ccfbf..bbb5d105269512474d7753bb93ef97affda1e8cc 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& 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/sonicFoam/hEqn.H b/applications/solvers/compressible/sonicFoam/hEqn.H index 5cb4c48c0883e6fce99b9e9a2e76b277e9cbfef7..baa2dab34334e1d942f17c29e8e3675747def570 100644 --- a/applications/solvers/compressible/sonicFoam/hEqn.H +++ b/applications/solvers/compressible/sonicFoam/hEqn.H @@ -8,5 +8,5 @@ DpDt ); - thermo->correct(); + thermo.correct(); } diff --git a/applications/solvers/compressible/sonicFoam/sonicFoam.C b/applications/solvers/compressible/sonicFoam/sonicFoam.C index 6ff79607986802a024e450042be2ad286d6d5b12..c9eda00fa34e1736a677d0d36aa4092a1a3b79a6 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" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) 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/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/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C index cb068960e8e459dc3c3fc7db1d45e458f649c552..7a4d8ce8b92c7e14a9dfa14eb67a790e7533c3cb 100644 --- a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C +++ b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.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 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..b5c84e435e3b2a95ad2cb8b67e215559d49758a0 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,9 @@ 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..0862d20bb2ce9fe649be9b286df8b149ae3e024f 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" @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) # include "readSIMPLEControls.H" # include "initConvergenceCheck.H" - pd.storePrevIter(); + p.storePrevIter(); rho.storePrevIter(); // Pressure-velocity SIMPLE corrector 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/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/ptrList/Make/files b/applications/test/ptrList/Make/files deleted file mode 100644 index 2a4e0ad01b0034628d241506a8a8919e9b30b214..0000000000000000000000000000000000000000 --- a/applications/test/ptrList/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -ptrListTest.C - -EXE = $(FOAM_USER_APPBIN)/ptrListTest diff --git a/applications/test/ptrList/Make/options b/applications/test/ptrList/Make/options deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 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/utilities/mesh/conversion/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C index ad7affddaeec4ed9d1ba8dbb4ea1a09fca6e0643..dfc1fbb20e651bb85c0ea2edee738d3e111234ae 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C @@ -1077,7 +1077,7 @@ void Foam::meshDualiser::setRefinement { label pointI = multiCellFeaturePoints[i]; - if (pointToDualCells_[pointI].size()) + if (pointToDualCells_[pointI].size() > 0) { FatalErrorIn ( diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index e2bf673ce26375af9422b21a9e5ca3451988c247..a410c1d8922b14000fedc606a662eb82e5b07bb4 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -25,22 +25,34 @@ License Description Calculate the dual of a polyMesh. Adheres to all the feature&patch edges. - Feature angle: - convex features : point becomes single boundary cell with multiple - boundary faces. - concave features: point becomes multiple boundary cells. - -splitAllFaces: +Usage + + - polyDualMesh featureAngle + + Detects any boundary edge > angle and creates multiple boundary faces + for it. Normal behaviour is to have each point become a cell + (1.5 behaviour) + + @param -concaveMultiCells + Creates multiple cells for each point on a concave edge. Might limit + the amount of distortion on some meshes. + + @param -splitAllFaces Normally only constructs a single face between two cells. This single face might be too distorted. splitAllFaces will create a single face for every original cell the face passes through. The mesh will thus have multiple faces inbetween two cells! (so is not strictly upper-triangular anymore - checkMesh will complain) - -doNotPreserveFaceZones: + + @param -doNotPreserveFaceZones: By default all faceZones are preserved by marking all faces, edges and points on them as features. The -doNotPreserveFaceZones disables this behaviour. + Note: is just a driver for meshDualiser. Substitute your own + simpleMarkFeatures to have different behaviour. + \*---------------------------------------------------------------------------*/ #include "argList.H" @@ -70,6 +82,7 @@ void simpleMarkFeatures const polyMesh& mesh, const PackedBoolList& isBoundaryEdge, const scalar featureAngle, + const bool concaveMultiCells, const bool doNotPreserveFaceZones, labelList& featureFaces, @@ -182,7 +195,7 @@ void simpleMarkFeatures - allBoundary[f0].centre(allBoundary.points()) ); - if ((c1c0 & n0) > SMALL) + if (concaveMultiCells && (c1c0 & n0) > SMALL) { // Found concave edge. Make into multiCell features Info<< "Detected concave feature edge:" << edgeI @@ -230,7 +243,7 @@ void simpleMarkFeatures if (doNotPreserveFaceZones) { - if (faceZones.size()) + if (faceZones.size() > 0) { WarningIn("simpleMarkFeatures(..)") << "Detected " << faceZones.size() @@ -240,7 +253,7 @@ void simpleMarkFeatures } else { - if (faceZones.size()) + if (faceZones.size() > 0) { Info<< "Detected " << faceZones.size() << " faceZones. Preserving these by marking their" @@ -345,6 +358,7 @@ int main(int argc, char *argv[]) argList::validArgs.append("feature angle[0-180]"); argList::validOptions.insert("splitAllFaces", ""); + argList::validOptions.insert("concaveMultiCells", ""); argList::validOptions.insert("doNotPreserveFaceZones", ""); argList::validOptions.insert("overwrite", ""); @@ -381,11 +395,25 @@ int main(int argc, char *argv[]) const bool splitAllFaces = args.optionFound("splitAllFaces"); + if (splitAllFaces) + { + Info<< "Splitting all internal faces to create multiple faces" + << " between two cells." << nl + << endl; + } + const bool overwrite = args.optionFound("overwrite"); const bool doNotPreserveFaceZones = args.optionFound ( "doNotPreserveFaceZones" ); + const bool concaveMultiCells = args.optionFound("concaveMultiCells"); + if (concaveMultiCells) + { + Info<< "Generating multiple cells for points on concave feature edges." + << nl << endl; + } + // Face(centre)s that need inclusion in the dual mesh labelList featureFaces; @@ -393,7 +421,7 @@ int main(int argc, char *argv[]) labelList featureEdges; // Points (that become a single cell) that need inclusion in the dual mesh labelList singleCellFeaturePoints; - // Points (that become a mulitple cells) ,, + // Points (that become a multiple cells) ,, labelList multiCellFeaturePoints; // Sample implementation of feature detection. @@ -402,6 +430,7 @@ int main(int argc, char *argv[]) mesh, isBoundaryEdge, featureAngle, + concaveMultiCells, doNotPreserveFaceZones, featureFaces, diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index 1bcee69984d1f8b32fed33fc9be7b434e78f2954..1d034714efe91a489d0f6a90b5f8c2d67988ea6c 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -243,14 +243,7 @@ int main(int argc, char *argv[]) meshDict.lookup("mergePatchPairs") ); - if (mergePatchPairs.size()) - { - FatalErrorIn(args.executable()) - << "mergePatchPairs not currently supported." - << exit(FatalError); - } - - //// #include "mergePatchPairs.H" +# include "mergePatchPairs.H" } else { diff --git a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H similarity index 100% rename from applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C rename to applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index 95ec6c5b8ae8e12a02dd5df4b63cbefc9537eac2..74e505394d0572af18ab603d20e73f31b414b327 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -23,7 +23,8 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Extrude mesh from existing patch or from patch read from file. + Extrude mesh from existing patch (flipped so has inwards pointing + normals) or from patch read from file. Note: Merges close points so be careful. Type of extrusion prescribed by run-time selectable model. @@ -52,43 +53,34 @@ using namespace Foam; int main(int argc, char *argv[]) { - #include "setRoots.H" + #include "setRootCase.H" #include "createTimeExtruded.H" - if (args.optionFound("sourceCase") == args.optionFound("surface")) - { - FatalErrorIn(args.executable()) - << "Specify either -sourceCase and -sourcePatch" - " or -surface options\n" - " to specify the source of the patch to extrude" - << exit(FatalError); - } - autoPtr<extrudedMesh> meshPtr(NULL); - autoPtr<extrudeModel> model + IOdictionary dict ( - extrudeModel::New + IOobject ( - IOdictionary - ( - IOobject - ( - "extrudeProperties", - runTimeExtruded.constant(), - runTimeExtruded, - IOobject::MUST_READ - ) - ) + "extrudeProperties", + runTimeExtruded.constant(), + runTimeExtruded, + IOobject::MUST_READ ) ); - if (args.optionFound("sourceCase")) + autoPtr<extrudeModel> model(extrudeModel::New(dict)); + + const word sourceType(dict.lookup("constructFrom")); + + autoPtr<faceMesh> fMesh; + + if (sourceType == "patch") { - fileName sourceCasePath(args.option("sourceCase")); + fileName sourceCasePath(dict.lookup("sourceCase")); fileName sourceRootDir = sourceCasePath.path(); fileName sourceCaseDir = sourceCasePath.name(); - word patchName(args.option("sourcePatch")); + word patchName(dict.lookup("sourcePatch")); Info<< "Extruding patch " << patchName << " on mesh " << sourceCasePath << nl @@ -114,75 +106,69 @@ int main(int argc, char *argv[]) } const polyPatch& pp = mesh.boundaryMesh()[patchID]; + fMesh.reset(new faceMesh(pp.localFaces(), pp.localPoints())); + fMesh().flip(); { fileName surfName(patchName + ".sMesh"); - Info<< "Writing patch as surfaceMesh to " << surfName << nl << endl; - - faceMesh fMesh(pp.localFaces(), pp.localPoints()); + Info<< "Writing (flipped) patch as surfaceMesh to " + << surfName << nl << endl; OFstream os(surfName); - os << fMesh << nl; + os << fMesh() << nl; } - - meshPtr.reset - ( - new extrudedMesh - ( - IOobject - ( - extrudedMesh::defaultRegion, - runTimeExtruded.constant(), - runTimeExtruded - ), - pp, - model() - ) - ); } - else + else if (sourceType == "surface") { // Read from surface - fileName surfName(args.option("surface")); + fileName surfName(dict.lookup("surface")); Info<< "Extruding surfaceMesh read from file " << surfName << nl << endl; IFstream is(surfName); - faceMesh fMesh(is); + fMesh.reset(new faceMesh(is)); - Info<< "Read patch from file " << surfName << ':' << nl - << " points : " << fMesh.points().size() << nl - << " faces : " << fMesh.size() << nl + Info<< "Read patch from file " << surfName << nl << endl; + } + else + { + FatalErrorIn(args.executable()) + << "Illegal 'constructFrom' specification. Should either be " + << "patch or surface." << exit(FatalError); + } - meshPtr.reset + + Info<< "Extruding patch with :" << nl + << " points : " << fMesh().points().size() << nl + << " faces : " << fMesh().size() << nl + << " normals[0] : " << fMesh().faceNormals()[0] + << nl + << endl; + + extrudedMesh mesh + ( + IOobject ( - new extrudedMesh - ( - IOobject - ( - extrudedMesh::defaultRegion, - runTimeExtruded.constant(), - runTimeExtruded - ), - fMesh, - model() - ) - ); - } - extrudedMesh& mesh = meshPtr(); + extrudedMesh::defaultRegion, + runTimeExtruded.constant(), + runTimeExtruded + ), + fMesh(), + model() + ); const boundBox& bb = mesh.globalData().bb(); const vector span = bb.span(); const scalar mergeDim = 1E-4 * bb.minDim(); - Info<< "Mesh bounding box:" << bb << nl - << " with span:" << span << nl - << "Merge distance :" << mergeDim << nl + Info<< "Mesh bounding box : " << bb << nl + << " with span : " << span << nl + << "Merge distance : " << mergeDim << nl << endl; const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -250,7 +236,8 @@ int main(int argc, char *argv[]) // Merging front and back patch faces // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if (args.optionFound("mergeFaces")) + Switch mergeFaces(dict.lookup("mergeFaces")); + if (mergeFaces) { Info<< "Assuming full 360 degree axisymmetric case;" << " stitching faces on patches " diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C index 6da971a1bf0e2d048976c808abbaa0dea944908c..3d2c883ea1901edb740f8afdd7de3c9b634858a2 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C @@ -88,7 +88,8 @@ point wedge::operator() } else { - sliceAngle = angle_*(layer + 1)/nLayers_; + //sliceAngle = angle_*(layer + 1)/nLayers_; + sliceAngle = angle_*layer/nLayers_; } // Find projection onto axis (or rather decompose surfacePoint diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties index ecbe160a150ab5f1b16ecad4e5fd423a64edc278..20de7b21524b083cf6cc37a684a971bcda890059 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties @@ -14,23 +14,41 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -extrudeModel wedge; +// Where to get surface from: either from surface ('surface') or +// from (flipped) patch of existing case ('patch') +constructFrom patch; //surface; + +// If construct from (flipped) patch +sourceCase "../cavity"; +sourcePatch movingWall; + +// If construct from surface +surface "movingWall.sMesh"; + + +// Do front and back need to be merged? +mergeFaces false; + +//- Linear extrusion in point-normal direction //extrudeModel linearNormal; +//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane. +extrudeModel wedge; +//- Extrudes into sphere around (0 0 0) //extrudeModel linearRadial; //extrudeModel sigmaRadial; -nLayers 1; +nLayers 6; wedgeCoeffs { - axisPt (0 0 0); - axis (0 -1 0); - angle 2.0; + axisPt (0 0.1 0); + axis (1 0 0); + angle 90.0; // For nLayers=1 assume symmetry so angle/2 on each side } linearNormalCoeffs { - thickness 0.1; + thickness 0.05; } linearRadialCoeffs @@ -47,3 +65,4 @@ sigmaRadialCoeffs // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C index bcbcb3ddb78c20a6ee0ca35055a13d5488945310..b258c594451332958c13cdda37c9bbfeb28dd459 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C @@ -117,7 +117,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces quad[2] = surfaceEdges[i][0] + nextLayerOffset; quad[3] = surfaceEdges[i][1] + nextLayerOffset; - eFaces[facei++] = face(quad); + eFaces[facei++] = face(quad).reverseFace(); } // Faces between layer and layer+1 @@ -130,7 +130,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces ( surfaceFaces[i].reverseFace() + nextLayerOffset - ); + ).reverseFace(); } } } @@ -152,7 +152,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces label ownerFace = extrudePatch.edgeFaces()[i][0]; - if (!sameOrder(surfaceFaces[ownerFace], e)) + if (sameOrder(surfaceFaces[ownerFace], e)) { reverse(quad); } @@ -164,7 +164,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces // Top faces forAll(surfaceFaces, i) { - eFaces[facei++] = face(surfaceFaces[i]); + eFaces[facei++] = face(surfaceFaces[i]).reverseFace(); } // Bottom faces @@ -175,7 +175,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces ( surfaceFaces[i].reverseFace() + nLayers*surfacePoints.size() - ); + ).reverseFace(); } // return points for transferring diff --git a/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H b/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H index 818ce58f00e80a363432e08f19bc919e5e1042cf..c8e1075f52e5f31ceba4f8930ad6be4dbab9158e 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H +++ b/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H @@ -78,6 +78,18 @@ public: {} + // Member Functions + + void flip() + { + forAll(*this, i) + { + face& f = operator[](i); + f = f.reverseFace(); + } + clearOut(); + } + // IOstream Operators friend Ostream& operator<<(Ostream& os, const faceMesh& fm) @@ -85,7 +97,8 @@ public: return os << fm.points() << token::NL - << static_cast<PrimitivePatch<face, Foam::List, pointField> >(fm); + << static_cast<PrimitivePatch<face, Foam::List, pointField> > + (fm); } }; diff --git a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C index e3536a5ad05862bd0370cf9e000992673797d944..859ddf20a277f137d522f75bc779f6bd98f7623d 100644 --- a/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C +++ b/applications/utilities/mesh/manipulation/stitchMesh/stitchMesh.C @@ -63,6 +63,7 @@ Description #include "slidingInterface.H" #include "perfectInterface.H" #include "IOobjectList.H" +#include "ReadFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -90,34 +91,6 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name) } -// Read field -template<class GeoField> -void readFields -( - const fvMesh& mesh, - const IOobjectList& objects, - PtrList<GeoField>& fields -) -{ - // Search list of objects for volScalarFields - IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName)); - - // Construct the vol scalar fields - fields.setSize(fieldObjects.size()); - - label fieldi = 0; - for - ( - IOobjectList::iterator iter = fieldObjects.begin(); - iter != fieldObjects.end(); - ++iter - ) - { - fields.set(fieldi++, new GeoField(*iter(), mesh)); - } -} - - // Main program: int main(int argc, char *argv[]) @@ -343,7 +316,8 @@ int main(int argc, char *argv[]) cutZoneName, masterPatchName, slavePatchName, - tom // integral or partial + tom, // integral or partial + true // couple/decouple mode ) ); } @@ -355,30 +329,30 @@ int main(int argc, char *argv[]) // Read all current fvFields so they will get mapped Info<< "Reading all current volfields" << endl; PtrList<volScalarField> volScalarFields; - readFields(mesh, objects, volScalarFields); + ReadFields(mesh, objects, volScalarFields); PtrList<volVectorField> volVectorFields; - readFields(mesh, objects, volVectorFields); + ReadFields(mesh, objects, volVectorFields); PtrList<volSphericalTensorField> volSphericalTensorFields; - readFields(mesh, objects, volSphericalTensorFields); + ReadFields(mesh, objects, volSphericalTensorFields); PtrList<volSymmTensorField> volSymmTensorFields; - readFields(mesh, objects, volSymmTensorFields); + ReadFields(mesh, objects, volSymmTensorFields); PtrList<volTensorField> volTensorFields; - readFields(mesh, objects, volTensorFields); + ReadFields(mesh, objects, volTensorFields); //- uncomment if you want to interpolate surface fields (usually bad idea) //Info<< "Reading all current surfaceFields" << endl; //PtrList<surfaceScalarField> surfaceScalarFields; - //readFields(mesh, objects, surfaceScalarFields); + //ReadFields(mesh, objects, surfaceScalarFields); // //PtrList<surfaceVectorField> surfaceVectorFields; - //readFields(mesh, objects, surfaceVectorFields); + //ReadFields(mesh, objects, surfaceVectorFields); // //PtrList<surfaceTensorField> surfaceTensorFields; - //readFields(mesh, objects, surfaceTensorFields); + //ReadFields(mesh, objects, surfaceTensorFields); if (!overwrite) { @@ -394,11 +368,22 @@ int main(int argc, char *argv[]) if (overwrite) { mesh.setInstance(oldInstance); + stitcher.instance() = oldInstance; } Info << nl << "Writing polyMesh to time " << runTime.timeName() << endl; IOstream::defaultPrecision(10); - if (!mesh.write()) + + // Bypass runTime write (since only writes at outputTime) + if + ( + !runTime.objectRegistry::writeObject + ( + runTime.writeFormat(), + IOstream::currentVersion, + runTime.writeCompression() + ) + ) { FatalErrorIn(args.executable()) << "Failed writing polyMesh." 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/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index c8dd69c4428c67f13d95915f2016c7ad29b6186b..0140ba4e232affb451fc499b1ba2048fa7361ab0 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -41,6 +41,7 @@ Description #include "pointFields.H" #include "cellIOList.H" #include "IOobjectList.H" +#include "IOPtrList.H" #include "writeMeshObject.H" #include "fieldDictionary.H" @@ -49,6 +50,14 @@ using namespace Foam; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam +{ + defineTemplateTypeNameAndDebug(IOPtrList<entry>, 0); +} + + +// Main program: + int main(int argc, char *argv[]) { timeSelector::addOptions(); @@ -67,6 +76,9 @@ int main(int argc, char *argv[]) writeMeshObject<labelIOList>("neighbour", runTime); writeMeshObject<faceIOList>("faces", runTime); writeMeshObject<pointIOField>("points", runTime); + writeMeshObject<IOPtrList<entry> >("cellZones", runTime); + writeMeshObject<IOPtrList<entry> >("faceZones", runTime); + writeMeshObject<IOPtrList<entry> >("pointZones", runTime); // Get list of objects from the database IOobjectList objects(runTime, runTime.timeName()); diff --git a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H index 383154223eb76b9c83d32565efa97f86a2fbfd66..10b6d83d90e18e9e2ae8816db78f679b19c0c8f7 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H +++ b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H @@ -61,8 +61,17 @@ inline bool writeMeshObject(const word& name, Time& runTime) Info<< " Reading " << io.headerClassName() << " : " << name << endl; + // Switch off type checking (for reading e.g. faceZones as + // generic list of dictionaries). + const word oldTypeName = T::typeName; + const_cast<word&>(T::typeName) = word::null; + T meshObject(io); + const_cast<word&>(T::typeName) = oldTypeName; + // Fake type back to what was in field + const_cast<word&>(meshObject.type()) = io.headerClassName(); + Info<< " Writing " << name << endl; writeOk = meshObject.regIOobject::write(); } diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C index 0555309348f58078907baaa15c99b606ae7e8861..0c88172f7c9c36824bdd7d04619cc5498cf89e56 100644 --- a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C @@ -46,14 +46,17 @@ using namespace Foam; int main(int argc, char *argv[]) { -# include "setRootCase.H" + #include "setRootCase.H" -# include "createTime.H" + #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMesh.H" -# include "createFields.H" + #include "createMesh.H" + #include "createFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + fileName vtkPath(runTime.path()/"VTK"); + mkDir(vtkPath); Info<< "Scanning times to determine track data" << nl << endl; @@ -63,29 +66,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 +126,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 +166,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 +193,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/dsmcFieldsCalc/dsmcFieldsCalc.C b/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C index 15c1153db5b17dec5191b50311c85937d588e88b..95077df225fbae93d2ac8db5d3584c81dbe68a60 100644 --- a/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.C +++ b/applications/utilities/postProcessing/miscellaneous/dsmcFieldsCalc/dsmcFieldsCalc.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 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/preProcessing/dsmcInitialise/dsmcInitialise.C b/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C index c2f797c17e0d027bcdfc6ccd86770f03c6a4ae4d..f8b831001df83cdafbfb6998a79312ed03176049 100644 --- a/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.C +++ b/applications/utilities/preProcessing/dsmcInitialise/dsmcInitialise.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 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/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index 813364d366779395a04efd49558e37cefd227ba0..bdcc1d08bdd99785ae0ca761a8671b6ad23244e9 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -177,7 +177,7 @@ Foam::sigFpe::~sigFpe() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigFpe::set() +void Foam::sigFpe::set(const bool verbose) { if (oldAction_.sa_handler) { @@ -190,6 +190,12 @@ void Foam::sigFpe::set() if (env("FOAM_SIGFPE")) { + if (verbose) + { + Info<< "SigFpe : Enabling floating point exception trapping" + << " (FOAM_SIGFPE)." << endl; + } + # ifdef LINUX_GNUC feenableexcept @@ -240,6 +246,12 @@ void Foam::sigFpe::set() if (env("FOAM_SETNAN")) { + if (verbose) + { + Info<< "SetNaN : Initialising allocated memory to NaN" + << " (FOAM_SETNAN)." << endl; + } + # ifdef LINUX_GNUC // Set our malloc diff --git a/src/OSspecific/POSIX/signals/sigFpe.H b/src/OSspecific/POSIX/signals/sigFpe.H index 6d9fe7623ccf7d6aa2520efe3938e3ebafb641d6..46755873de60d020e70ff50eea209addc167dcf7 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.H +++ b/src/OSspecific/POSIX/signals/sigFpe.H @@ -107,7 +107,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C index 922374fa7347e81b812cf10fe2f25b3337a1b25e..1f3555ec8746d86f7fc06a09ed0823185c006969 100644 --- a/src/OSspecific/POSIX/signals/sigInt.C +++ b/src/OSspecific/POSIX/signals/sigInt.C @@ -81,7 +81,7 @@ Foam::sigInt::~sigInt() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigInt::set() +void Foam::sigInt::set(const bool verbose) { if (oldAction_.sa_handler) { diff --git a/src/OSspecific/POSIX/signals/sigInt.H b/src/OSspecific/POSIX/signals/sigInt.H index 49cf7ea41e354c8a6c89ad28b1dbe5c31272fefe..1f89c47f97ea6dcb28741af7922b3146570aa901 100644 --- a/src/OSspecific/POSIX/signals/sigInt.H +++ b/src/OSspecific/POSIX/signals/sigInt.H @@ -78,7 +78,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C index 890d4d3430e3ad9eafcf8a3c15a16b7f08ff2aa2..7c67c903bc98772df9726a8c7bda5b491781b27d 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.C +++ b/src/OSspecific/POSIX/signals/sigQuit.C @@ -83,7 +83,7 @@ Foam::sigQuit::~sigQuit() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigQuit::set() +void Foam::sigQuit::set(const bool verbose) { if (oldAction_.sa_handler) { diff --git a/src/OSspecific/POSIX/signals/sigQuit.H b/src/OSspecific/POSIX/signals/sigQuit.H index c130416a687a76f477b88d8df708c7f7da512dc5..23890cc6dbae3d24f352a87b420118bd04c52cc5 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.H +++ b/src/OSspecific/POSIX/signals/sigQuit.H @@ -78,7 +78,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C index 270a21461979d4232b3df8f5586f67ff094fb119..14ab77ffe326c878e7cf1507c3d0cebb3e8b328f 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.C +++ b/src/OSspecific/POSIX/signals/sigSegv.C @@ -83,7 +83,7 @@ Foam::sigSegv::~sigSegv() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigSegv::set() +void Foam::sigSegv::set(const bool verbose) { if (oldAction_.sa_handler) { diff --git a/src/OSspecific/POSIX/signals/sigSegv.H b/src/OSspecific/POSIX/signals/sigSegv.H index 2c405c9565bd665c303c76c60957a6a39e18be6e..5aae61de7d3319b1f9f5dbc950d13cf290671fd6 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.H +++ b/src/OSspecific/POSIX/signals/sigSegv.H @@ -78,7 +78,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index c3902bc9c5ea2215ee7d4d58d3f7a3870d35a573..a68d045d208e8a46a6cbc80fb2970a3ea42867fa 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -60,6 +60,10 @@ $(sha1)/SHA1Digest.C primitives/random/Random.C +functions = primitives/functions +$(functions)/Polynomial/makePolynomialsOrder7.C + + containers/HashTables/HashTable/HashTableName.C containers/HashTables/StaticHashTable/StaticHashTableName.C containers/Lists/SortableList/ParSortableListName.C diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H index 7de9239d04deed112a68f7ddf745c5d1d933133c..1504fb4d78363167fd2f4e934270702728afc71d 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H @@ -73,7 +73,7 @@ void inplaceReorder(const UList<label>& oldToNew, ListType&); template<class Container> void inplaceMapValue(const UList<label>& oldToNew, Container&); -//- Recreate with mapped keys. Remove elements with negative key. +//- Recreate with mapped keys. Do not map elements with negative key. template<class Container> void inplaceMapKey(const UList<label>& oldToNew, Container&); diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C index f2178ee38df53e583476328496325f068ef8fc34..dd8536eec9b9f1466c518e2069c4a96b489cdc80 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C @@ -147,7 +147,7 @@ void Foam::inplaceMapKey Container& lst ) { - Container newLst(lst); + Container newLst(lst.size()); for ( 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/fields/Fields/DynamicField/DynamicField.C b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C new file mode 100644 index 0000000000000000000000000000000000000000..783581f5c5727429db49881491c64a4978a6ad15 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "DynamicField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * Static Members * * * * * * * * * * * * * * // + +template<class Type> +const char* const DynamicField<Type>::typeName("DynamicField"); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +DynamicField<Type>::DynamicField(Istream& is) +: + Field<Type>(is), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +tmp<DynamicField<Type> > DynamicField<Type>::clone() const +{ + return tmp<DynamicField<Type> >(new DynamicField<Type>(*this)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void DynamicField<Type>::setSize(const label nElem) +{ + // allocate more capacity? + if (nElem > capacity_) + { + capacity_ = max(nElem, label(1 + capacity_*2)); + + Field<Type>::setSize(capacity_); + } + + // adjust addressed size + Field<Type>::size(nElem); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * IOstream Operator * * * * * * * * * * * * * // + +template<class Type> +Ostream& operator<<(Ostream& os, const DynamicField<Type>& f) +{ + os << static_cast<const Field<Type>&>(f); + return os; +} + + +template<class Type> +Ostream& operator<<(Ostream& os, const tmp<DynamicField<Type> >& tf) +{ + os << tf(); + tf.clear(); + return os; +} + + +template<class Type> +Istream& operator>>(Istream& is, DynamicField<Type>& lst) +{ + is >> static_cast<Field<Type>&>(lst); + lst.capacity_ = lst.Field<Type>::size(); + + return is; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H new file mode 100644 index 0000000000000000000000000000000000000000..79c9cd4bae2f48d2273199ce81afc4a7aa2e06c2 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H @@ -0,0 +1,227 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::DynamicField + +Description + Dynamically sized Field. WIP. + +SourceFiles + DynamicField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef DynamicField_H +#define DynamicField_H + +#include "Field.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<class Type> +class DynamicField; + +template<class Type> +Ostream& operator<<(Ostream&, const DynamicField<Type>&); + +template<class Type> +Ostream& operator<<(Ostream&, const tmp<DynamicField<Type> >&); + +template<class Type> +Istream& operator>>(Istream&, DynamicField<Type>&); + + +/*---------------------------------------------------------------------------*\ + Class DynamicField Declaration +\*---------------------------------------------------------------------------*/ + +#include "CintDefs.H" + +template<class Type> +class DynamicField +: + public Field<Type> //private Field<Type> +{ + + // Private data + + //- The capacity (allocated size) of the underlying field. + label capacity_; + + + //- Construct given size and initial value + DynamicField(const label, const Type&); + + //- Construct as copy of tmp<DynamicField> +# ifdef ConstructFromTmp + DynamicField(const tmp<DynamicField<Type> >&); +# endif + + //- Construct from a dictionary entry + DynamicField(const word&, const dictionary&, const label); + +public: + + // Static data members + + static const char* const typeName; + + + // Static Member Functions + + //- Return a null field + inline static const DynamicField<Type>& null() + { + return *reinterpret_cast< DynamicField<Type>* >(0); + } + + + // Constructors + + //- Construct null + // Used for temporary fields which are initialised after construction + DynamicField(); + + //- Construct given size + // Used for temporary fields which are initialised after construction + explicit inline DynamicField(const label); + + //- Construct as copy of a UList\<Type\> + explicit inline DynamicField(const UList<Type>&); + + //- Construct by transferring the List contents + explicit inline DynamicField(const Xfer<List<Type> >&); + + //- Construct by 1 to 1 mapping from the given field + inline DynamicField + ( + const UList<Type>& mapF, + const labelList& mapAddressing + ); + + //- Construct by interpolative mapping from the given field + inline DynamicField + ( + const UList<Type>& mapF, + const labelListList& mapAddressing, + const scalarListList& weights + ); + + //- Construct by mapping from the given field + inline DynamicField + ( + const UList<Type>& mapF, + const FieldMapper& map + ); + + //- Construct as copy + inline DynamicField(const DynamicField<Type>&); + + //- Construct as copy or re-use as specified. + inline DynamicField(DynamicField<Type>&, bool reUse); + + //- Construct by transferring the Field contents + inline DynamicField(const Xfer<DynamicField<Type> >&); + + //- Construct from Istream + inline DynamicField(Istream&); + + //- Clone + tmp<DynamicField<Type> > clone() const; + + + // Member Functions + + //- Size of the underlying storage. + inline label capacity() const; + + //- Append an element at the end of the list + inline void append(const Type&); + + //- Alter the addressed list size. + // New space will be allocated if required. + // Use this to resize the list prior to using the operator[] for + // setting values (as per List usage). + void setSize(const label nElem); + + // Member operators + + inline void operator=(const DynamicField<Type>&); + inline void operator=(const UList<Type>&); + inline void operator=(const tmp<DynamicField<Type> >&); + + //- Return element of Field. + inline Type& operator[](const label i); + + //- Return element of constant Field. + inline const Type& operator[](const label) const; + + // IOstream operators + + friend Ostream& operator<< + #ifndef __CINT__ + <Type> + #endif + (Ostream&, const DynamicField<Type>&); + + friend Ostream& operator<< + #ifndef __CINT__ + <Type> + #endif + (Ostream&, const tmp<DynamicField<Type> >&); + + friend Istream& operator>> + #ifndef __CINT__ + <Type> + #endif + (Istream&, DynamicField<Type>&); +}; + +#include "CintUndefs.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "DynamicFieldI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "DynamicField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H new file mode 100644 index 0000000000000000000000000000000000000000..8680fbff25a1a81c3562d44f3944cb3f429a95d0 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H @@ -0,0 +1,221 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "DynamicField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +DynamicField<Type>::DynamicField() +: + Field<Type>(), + capacity_(0) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(const label size) +: + Field<Type>(size), + capacity_(Field<Type>::size()) +{ + Field<Type>::size(0); +} + + +template<class Type> +inline Foam::DynamicField<Type>::DynamicField +( + const UList<Type>& lst +) +: + Field<Type>(lst), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +inline Foam::DynamicField<Type>::DynamicField +( + const Xfer<List<Type> >& lst +) +: + Field<Type>(lst), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField +( + const UList<Type>& mapF, + const labelList& mapAddressing +) +: + Field<Type>(mapF, mapAddressing), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField +( + const UList<Type>& mapF, + const labelListList& mapAddressing, + const scalarListList& weights +) +: + Field<Type>(mapF, mapAddressing, weights), + capacity_(Field<Type>::size()) +{} + + +//- Construct by mapping from the given field +template<class Type> +DynamicField<Type>::DynamicField +( + const UList<Type>& mapF, + const FieldMapper& map +) +: + DynamicField<Type>(mapF, map), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(const DynamicField<Type>& f) +: + Field<Type>(f), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(DynamicField<Type>& f, bool reUse) +: + Field<Type>(f, reUse), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(const Xfer<DynamicField<Type> >& f) +: + Field<Type>(f), + capacity_(Field<Type>::size()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::label DynamicField<Type>::capacity() const +{ + return capacity_; +} + + +template<class Type> +void DynamicField<Type>::append(const Type& t) +{ + label elemI = Field<Type>::size(); + setSize(elemI + 1); + + this->operator[](elemI) = t; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class Type> +void DynamicField<Type>::operator=(const DynamicField<Type>& rhs) +{ + if (this == &rhs) + { + FatalErrorIn("DynamicField<Type>::operator=(const DynamicField<Type>&)") + << "attempted assignment to self" + << abort(FatalError); + } + + Field<Type>::operator=(rhs); + capacity_ = Field<Type>::size(); +} + + +template<class Type> +void DynamicField<Type>::operator=(const UList<Type>& rhs) +{ + Field<Type>::operator=(rhs); + capacity_ = Field<Type>::size(); +} + + +template<class Type> +void DynamicField<Type>::operator=(const tmp<DynamicField>& rhs) +{ + if (this == &(rhs())) + { + FatalErrorIn("DynamicField<Type>::operator=(const tmp<DynamicField>&)") + << "attempted assignment to self" + << abort(FatalError); + } + + // This is dodgy stuff, don't try it at home. + DynamicField* fieldPtr = rhs.ptr(); + List<Type>::transfer(*fieldPtr); + delete fieldPtr; + capacity_ = Field<Type>::size(); +} + + +template<class Type> +Type& DynamicField<Type>::operator[](const label i) +{ + return Field<Type>::operator[](i); +} + + +template<class Type> +const Type& DynamicField<Type>::operator[](const label i) const +{ + return Field<Type>::operator[](i); +} + + +// * * * * * * * * * * * * * * * IOstream Operator * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // 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 4a45b56f4516358e835530e8d81ae4c60ac22f6f..df698693940e49279bbc3078941af1090a0c232c 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -526,10 +526,10 @@ Foam::argList::argList // Switch on signal trapping. We have to wait until after Pstream::init // since this sets up its own ones. - sigFpe_.set(); - sigInt_.set(); - sigQuit_.set(); - sigSegv_.set(); + sigFpe_.set(bannerEnabled); + sigInt_.set(bannerEnabled); + sigQuit_.set(bannerEnabled); + sigSegv_.set(bannerEnabled); if (Pstream::master() && bannerEnabled) { diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C new file mode 100644 index 0000000000000000000000000000000000000000..b842493eef9a0c21df169f9277999254762ed718 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -0,0 +1,225 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 Polynomial<PolySize>& poly) +: + VectorSpace<Polynomial<PolySize>, scalar, PolySize>(poly), + name_(poly.name_), + logActive_(poly.logActive_), + logCoeff_(poly.logCoeff_) +{} + + +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_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<int PolySize> +Foam::Polynomial<PolySize>::~Polynomial() +{} + + +// * * * * * * * * * * * * * * * 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; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<int PolySize> +void Foam::Polynomial<PolySize>::operator=(const Polynomial<PolySize>& poly) +{ + name_ = poly.name_; + VectorSpace<Polynomial<PolySize>, scalar, PolySize>::operator=(poly); + logActive_ = poly.logActive_; + logCoeff_ = poly.logCoeff_; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H new file mode 100644 index 0000000000000000000000000000000000000000..89ecb9c1840ed77874335b6a02730d48b54fbe4c --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.H @@ -0,0 +1,198 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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" +#include "Vector.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: + + // 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; + + //- Run-time type information + TypeName("Polynomial") + + + // Constructors + + //- Construct null + Polynomial(); + + //- Construct from name and Istream + Polynomial(const word& name, Istream& is); + + //- Copy constructor + Polynomial(const Polynomial& poly); + + //- Copy constructor with name + Polynomial(const word& name, const Polynomial& poly); + + + //- Destructor + ~Polynomial(); + + + // 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; + + + // Member operators + + void operator=(const Polynomial& poly); + + + //- Ostream Operator + friend Ostream& operator<< <PolySize> + ( + Ostream&, + const Polynomial& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makePolynomial(PolySize) \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + Polynomial<PolySize>, \ + "Polynomial<"#PolySize">", \ + 0 \ +) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "Polynomial.C" +# include "PolynomialIO.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C new file mode 100644 index 0000000000000000000000000000000000000000..2a0d2187aa79c1df3d7051527598263216d4c76e --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Polynomial/PolynomialIO.C @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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" + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template<int PolySize> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const Polynomial<PolySize>& poly +) +{ + 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>&)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C b/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C similarity index 78% rename from src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C rename to src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C index b41cb31df9454bcd2e03ccb799cf146b26fd5a32..ae8f43fb5ccb41c0db645fa020884b2f308b8b05 100644 --- a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/makePolynomialsOrder7.C @@ -24,24 +24,28 @@ License \*---------------------------------------------------------------------------*/ -#include "TrackedReactingParcel.H" +#include "Polynomial.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template <class ParcelType> -Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel -( - const TrackedReactingParcel<ParcelType>& p -) -: - ReactingParcel<ParcelType>(p), - ParticleTrackingData<ParcelType>(p) -{} +namespace Foam +{ + makePolynomial(2); + makePolynomial(3); + makePolynomial(4); + makePolynomial(5); + makePolynomial(6); + makePolynomial(7); + makePolynomial(8); + + // explicitly define max order + 1 to define the integrated form + defineTemplateTypeNameAndDebugWithName + ( + Polynomial<9>, + "Polynomial<9>", + 0 + ); +} -// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // - -#include "TrackedReactingParcelIO.C" - // ************************************************************************* // - diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index d2728f8b9d634d40aa563b009502d909d9c493fe..5e7a0b010bec6621e7340df8853e3f516f9add28 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -383,6 +383,35 @@ void Foam::polyTopoChange::checkFace << " own:" << own << " nei:" << nei << " patchI:" << patchI << abort(FatalError); } + if (faceI >= 0 && faceI < faces_.size() && faceRemoved(faceI)) + { + FatalErrorIn + ( + "polyTopoChange::checkFace(const face&, const label" + ", const label, const label, const label)" + ) << "Face already marked for removal" + << nl + << "f:" << f + << " faceI(-1 if added face):" << faceI + << " own:" << own << " nei:" << nei + << " patchI:" << patchI << abort(FatalError); + } + forAll(f, fp) + { + if (f[fp] < points_.size() && pointRemoved(f[fp])) + { + FatalErrorIn + ( + "polyTopoChange::checkFace(const face&, const label" + ", const label, const label, const label)" + ) << "Face uses removed vertices" + << nl + << "f:" << f + << " faceI(-1 if added face):" << faceI + << " own:" << own << " nei:" << nei + << " patchI:" << patchI << abort(FatalError); + } + } } diff --git a/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C b/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C index 82e77d76740542a500cfe0be5ccfbd7302bde215..18d1170c0073161c32dd6d9023aa0aef7fbc2d45 100644 --- a/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C +++ b/src/dynamicMesh/slidingInterface/coupleSlidingInterface.C @@ -35,9 +35,11 @@ License #include "plane.H" #include "polyTopoChanger.H" #include "polyAddPoint.H" +#include "polyRemovePoint.H" #include "polyAddFace.H" #include "polyModifyPoint.H" #include "polyModifyFace.H" +#include "polyRemoveFace.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -765,6 +767,9 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const projectedSlavePoints ); + // Demand driven calculate the cut faces. Apart from the + // cutFaces/cutFaceMaster/cutFaceSlave no information from the cutPatch + // is used anymore! const faceList& cutFaces = cutPatch.cutFaces(); const labelList& cutFaceMaster = cutPatch.cutFaceMaster(); const labelList& cutFaceSlave = cutPatch.cutFaceSlave(); @@ -1109,22 +1114,26 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const { nOrphanedMasters++; - // Recover original orientation - ref.setAction - ( - polyModifyFace - ( - masterPatch[faceI], // new face - masterPatchAddr[faceI], // master face index - -1, // owner - -1, // neighbour - false, // flux flip - -1, // patch ID - false, // remove from zone - masterFaceZoneID_.index(), // zone ID - false // zone flip - ) - ); + //// Recover original orientation + //ref.setAction + //( + // polyModifyFace + // ( + // masterPatch[faceI], // new face + // masterPatchAddr[faceI], // master face index + // -1, // owner + // -1, // neighbour + // false, // flux flip + // -1, // patch ID + // false, // remove from zone + // masterFaceZoneID_.index(), // zone ID + // false // zone flip + // ) + //); + + //Pout<< "**MJ:deleting master face " << masterPatchAddr[faceI] + // << " old verts:" << masterPatch[faceI] << endl; + ref.setAction(polyRemoveFace(masterPatchAddr[faceI])); } } @@ -1136,22 +1145,26 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const { nOrphanedSlaves++; - // Recover original orientation - ref.setAction - ( - polyModifyFace - ( - slavePatch[faceI], // new face - slavePatchAddr[faceI], // slave face index - -1, // owner - -1, // neighbour - false, // flux flip - -1, // patch ID - false, // remove from zone - slaveFaceZoneID_.index(), // zone ID - false // zone flip - ) - ); + //// Recover original orientation + //ref.setAction + //( + // polyModifyFace + // ( + // slavePatch[faceI], // new face + // slavePatchAddr[faceI], // slave face index + // -1, // owner + // -1, // neighbour + // false, // flux flip + // -1, // patch ID + // false, // remove from zone + // slaveFaceZoneID_.index(), // zone ID + // false // zone flip + // ) + //); + + //Pout<< "**MJ:deleting slave face " << slavePatchAddr[faceI] + // << " old verts:" << slavePatch[faceI] << endl; + ref.setAction(polyRemoveFace(slavePatchAddr[faceI])); } } @@ -1400,24 +1413,46 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const face newFace; newFace.transfer(newFaceLabels); -// Pout << "Modifying master stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl; + //Pout << "Modifying master stick-out face " << curFaceID + // << " old face: " << oldFace << " new face: " << newFace << endl; // Modify the face - ref.setAction - ( - polyModifyFace + if (mesh.isInternalFace(curFaceID)) + { + ref.setAction ( - newFace, // modified face - curFaceID, // label of face being modified - own[curFaceID], // owner - nei[curFaceID], // neighbour - false, // face flip - mesh.boundaryMesh().whichPatch(curFaceID), // patch for face - false, // remove from zone - modifiedFaceZone, // zone for face - modifiedFaceZoneFlip // face flip in zone - ) - ); + polyModifyFace + ( + newFace, // modified face + curFaceID, // label of face being modified + own[curFaceID], // owner + nei[curFaceID], // neighbour + false, // face flip + -1, // patch for face + false, // remove from zone + modifiedFaceZone, // zone for face + modifiedFaceZoneFlip // face flip in zone + ) + ); + } + else + { + ref.setAction + ( + polyModifyFace + ( + newFace, // modified face + curFaceID, // label of face being modified + own[curFaceID], // owner + -1, // neighbour + false, // face flip + mesh.boundaryMesh().whichPatch(curFaceID), // patch for face + false, // remove from zone + modifiedFaceZone, // zone for face + modifiedFaceZoneFlip // face flip in zone + ) + ); + } } } @@ -1688,21 +1723,42 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const // Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl; // Modify the face - ref.setAction - ( - polyModifyFace + if (mesh.isInternalFace(curFaceID)) + { + ref.setAction ( - newFace, // modified face - curFaceID, // label of face being modified - own[curFaceID], // owner - nei[curFaceID], // neighbour - false, // face flip - mesh.boundaryMesh().whichPatch(curFaceID), // patch for face - false, // remove from zone - modifiedFaceZone, // zone for face - modifiedFaceZoneFlip // face flip in zone - ) - ); + polyModifyFace + ( + newFace, // modified face + curFaceID, // label of face being modified + own[curFaceID], // owner + nei[curFaceID], // neighbour + false, // face flip + -1, // patch for face + false, // remove from zone + modifiedFaceZone, // zone for face + modifiedFaceZoneFlip // face flip in zone + ) + ); + } + else + { + ref.setAction + ( + polyModifyFace + ( + newFace, // modified face + curFaceID, // label of face being modified + own[curFaceID], // owner + -1, // neighbour + false, // face flip + mesh.boundaryMesh().whichPatch(curFaceID), // patch for face + false, // remove from zone + modifiedFaceZone, // zone for face + modifiedFaceZoneFlip // face flip in zone + ) + ); + } } } @@ -1735,15 +1791,25 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const // slave patch nRetiredPoints++; + //ref.setAction + //( + // polyModifyPoint + // ( + // slaveMeshPoints[pointI], // point ID + // points[slaveMeshPoints[pointI]], // point + // false, // remove from zone + // mesh.pointZones().whichZone(slaveMeshPoints[pointI]),// zone + // false // in a cell + // ) + //); + //Pout<< "MJ retire slave point " << slaveMeshPoints[pointI] + // << " coord " << points[slaveMeshPoints[pointI]] + // << endl; ref.setAction ( - polyModifyPoint + polyRemovePoint ( - slaveMeshPoints[pointI], // point ID - points[slaveMeshPoints[pointI]], // point - false, // remove from zone - mesh.pointZones().whichZone(slaveMeshPoints[pointI]),// zone - false // in a cell + slaveMeshPoints[pointI] ) ); diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C index 11c401027d3f92e3780991ad3b3c036798543e5b..eb191b3f0f124bfd971fa91d9e6e3bcb5fb6bf4a 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.C @@ -28,6 +28,8 @@ Description #include "enrichedPatch.H" #include "demandDrivenData.H" +#include "OFstream.H" +#include "meshTools.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -249,6 +251,33 @@ bool Foam::enrichedPatch::checkSupport() const } +void Foam::enrichedPatch::writeOBJ(const fileName& fName) const +{ + OFstream str(fName); + + const pointField& lp = localPoints(); + + forAll(lp, pointI) + { + meshTools::writeOBJ(str, lp[pointI]); + } + + const faceList& faces = localFaces(); + + forAll(faces, faceI) + { + const face& f = faces[faceI]; + + str << 'f'; + forAll(f, fp) + { + str << ' ' << f[fp]+1; + } + str << nl; + } +} + + // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // diff --git a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H index 0bf22c513cb7df9510b7ed9bfa3c7d53728f1ba5..f8f7e8f5e9812f399669891852f5204f830e45d8 100644 --- a/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H +++ b/src/dynamicMesh/slidingInterface/enrichedPatch/enrichedPatch.H @@ -199,9 +199,9 @@ public: ( const primitiveFacePatch& masterPatch, const primitiveFacePatch& slavePatch, - const labelList& slavePointPointHits, - const labelList& slavePointEdgeHits, - const List<objectHit>& slavePointFaceHits + const labelList& slavePointPointHits,// -1 or common point snapped to + const labelList& slavePointEdgeHits, // -1 or common edge snapped to + const List<objectHit>& slavePointFaceHits // master face snapped to ); @@ -276,6 +276,10 @@ public: //- Check if the patch is fully supported bool checkSupport() const; + + + //- Debugging: dump graphical representation to obj format file + void writeOBJ(const fileName&) const; }; diff --git a/src/dynamicMesh/slidingInterface/slidingInterface.C b/src/dynamicMesh/slidingInterface/slidingInterface.C index 0f8dd3603af39d6de31a581a915de396546a7d93..80d68749e84ae89a39ec3d900c418fd34457126a 100644 --- a/src/dynamicMesh/slidingInterface/slidingInterface.C +++ b/src/dynamicMesh/slidingInterface/slidingInterface.C @@ -664,14 +664,15 @@ void Foam::slidingInterface::updateMesh(const mapPolyMesh& m) masterPatchID_.update(mesh.boundaryMesh()); slavePatchID_.update(mesh.boundaryMesh()); - if (!attached()) - { - calcAttachedAddressing(); - } - else - { - renumberAttachedAddressing(m); - } +//MJ:Disabled updating +// if (!attached()) +// { +// calcAttachedAddressing(); +// } +// else +// { +// renumberAttachedAddressing(m); +// } } 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/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/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index f0ca222d91021d7e69846ed0cb9e05ff92bfa3af..e298affe7d2ce5651ce34015672c8f45688d858e 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -78,6 +78,9 @@ class Cloud const unallocLabelList& owner_; const unallocLabelList& neighbour_; + //- Temporary storage for addressing. Used in findFaces. + mutable DynamicList<label> labels_; + // Private member functions 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 ea53ec3ee4d92165ee03861a86dfb96a4b65e4e7..4b51b88a4514d97d5d21b8c6b648a880ab3624be 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -33,19 +33,26 @@ 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> -Foam::labelList Foam::Particle<ParticleType>::findFaces +void Foam::Particle<ParticleType>::findFaces ( - const vector& position + const vector& position, + DynamicList<label>& faceList ) const { const polyMesh& mesh = cloud_.polyMesh_; const labelList& faces = mesh.cells()[celli_]; const vector& C = mesh.cellCentres()[celli_]; - DynamicList<label> faceList(10); + faceList.clear(); forAll(faces, i) { label facei = faces[i]; @@ -56,26 +63,23 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces faceList.append(facei); } } - - faceList.shrink(); - - return faceList; } template<class ParticleType> -Foam::labelList Foam::Particle<ParticleType>::findFaces +void Foam::Particle<ParticleType>::findFaces ( const vector& position, const label celli, - const scalar stepFraction + const scalar stepFraction, + 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]; - DynamicList<label> faceList(10); + faceList.clear(); forAll(faces, i) { label facei = faces[i]; @@ -86,10 +90,6 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces faceList.append(facei); } } - - faceList.shrink(); - - return faceList; } @@ -182,7 +182,9 @@ Foam::Particle<ParticleType>::Particle position_(position), celli_(celli), facei_(-1), - stepFraction_(0.0) + stepFraction_(0.0), + origProc_(Pstream::myProcNo()), + origId_(particleCount++) {} @@ -193,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_) {} @@ -237,7 +241,8 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace { const polyMesh& mesh = cloud_.polyMesh_; - labelList faces = findFaces(endPosition); + DynamicList<label>& faces = cloud_.labels_; + findFaces(endPosition, faces); facei_ = -1; scalar trackFraction = 0.0; diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H index 4d1a8b9be839f7e92cd31ce2dc6ca7acf227b81a..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 @@ -151,18 +157,20 @@ protected: const label facei ) const; - //- Return the faces between position and cell centre - labelList findFaces + //- Find the faces between position and cell centre + void findFaces ( - const vector& position + const vector& position, + DynamicList<label>& faceList ) const; - //- Return the faces between position and cell centre - labelList findFaces + //- Find the faces between position and cell centre + void findFaces ( const vector& position, const label celli, - const scalar stepFraction + const scalar stepFraction, + DynamicList<label>& faceList ) const; @@ -265,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 @@ -394,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 ce790d67c11258c29290dbaa14f31d8669a6a6e7..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,23 +229,25 @@ inline scalar Particle<ParticleType>::lambda template<class ParticleType> -inline bool Particle<ParticleType>::inCell() const +inline bool Foam::Particle<ParticleType>::inCell() const { - labelList faces = findFaces(position_); + DynamicList<label>& faces = cloud_.labels_; + findFaces(position_, faces); return (!faces.size()); } template<class ParticleType> -inline bool Particle<ParticleType>::inCell +inline bool Foam::Particle<ParticleType>::inCell ( const vector& position, const label celli, const scalar stepFraction ) const { - labelList faces = findFaces(position, celli, stepFraction); + DynamicList<label>& faces = cloud_.labels_; + findFaces(position, celli, stepFraction, faces); return (!faces.size()); } @@ -259,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 ) @@ -267,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_; } @@ -277,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() @@ -355,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 @@ -373,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/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/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 30d7671fdbcf8e4b42295f67334c5fa178f534b9..10cec60dd27e5fc331d97c7c49428e6399bad2a9 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.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 @@ -34,9 +34,6 @@ License template<class ParcelType> Foam::scalar Foam::DsmcCloud<ParcelType>::kb = 1.380650277e-23; -template<class ParcelType> -Foam::scalar Foam::DsmcCloud<ParcelType>::Tref = 273; - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index 46634e6dd903ece27ed83fec3975bc0156dfe7e1..fc5cf53d683be6ed9ec879578887f59c70d53718 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.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 @@ -172,9 +172,6 @@ public: //- Boltzmann constant static scalar kb; - //- Reference temperature for all models - static scalar Tref; - // Constructors diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index abc4b1d4c69a89cc828d2134652433a45802c7fe..449650c0a8345d1fc3f14289eb39b4a27eb84521 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.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 diff --git a/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.C b/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.C index 1e0c395ca19f24709a1c3c43b4c0c802969dc846..55554eee39c76bb8e301c55e549651318cd09790 100644 --- a/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.C +++ b/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.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 diff --git a/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.H b/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.H index df49f8e148bc2dfaa47924eff697821b59dbb8cf..b409f3612edffc0534a1d8d8d07b090559b81ec4 100644 --- a/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.H +++ b/src/lagrangian/dsmc/clouds/baseClasses/DsmcBaseCloud/DsmcBaseCloud.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 diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C index d501dbf3d5d87d7a79b7d56512ddad465a838ca5..425e47a70581d9c062d591209e8dc066ddd7b6ca 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.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 diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H index 027ad2afec41d2a41f7ef11cc25667dbf6cccc25..d5302056816419ee1deca073f94c13024bc52e8c 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.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 diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index 0c43cf1534952eba6fd5b5a79bd43b3ab6ef56d7..fae05b0f2ffc2543046d449aef0dd2bcb7352de7 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.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 diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H index 17b2877b448c37ebcbf63051b153238048e60454..af8e350e7fd8ec756ba9957eb74c4f00b9152157 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.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 diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H index ff86419186fee680205fe2b70e0d0d2a6c705e61..239571ceaef99cb46f15003212de45ba09cbeb88 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelI.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 diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelIO.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelIO.C index b8bc688c09640bfd462f754fc87175a46334c9ff..6677591009bd879cf23747f964a81a9e8dcb7911 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelIO.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcelIO.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 diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C index d3b71359da80c68830d37927e499e44441758ae7..d5691241363954d6b766123bd81548356c51d763 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.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 diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C index 8f52fcdabf62a8dbd9e7cba06295a3ea41cbbfba..e09afe9a5dcb14d5fb48f307e84a261f0798dc96 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.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 diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H index 24d9c9ada4f4654f8911c151e78b806d782807eb..f2676c5ed9c7aa5b3abf25fcb3fc6bea09b88fab 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.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 diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C index de2444687b785586345a50d8eaf922bd63073b10..487cedad29b3d1d7314e1c7a5517b1089a6860bd 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.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 diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C index c3ee121ff02fedac07f42ff28e5169fe4a7b9f33..ef9191104500f41013e774b0f9b2caf7f4103d11 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.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 diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C index 874c787d6a75c4be73c84b26c0032938d7f4b802..f15d0bdadd6090c6a39f4403abb97d69015ce91e 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.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 diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C index 0118014f9c62b6ecec5a2d93bef0b9425db04cc9..cdd10231225037881f87a90d62f79bb2fce9e350 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.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 diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H index 771115c98428b86253f8d4920b9ad577067b7bd5..4b422bdd3176e4ac3320ec6e32a8f9956e3fe699 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.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 diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C index 8878164cdbf1425fcf9838a369ca9b855fcb60d4..12c74f6697e7044396331aec3a95bc9326594ee4 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/NewBinaryCollisionModel.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 diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C index b6deaf1f0064cb65ed6c3e3b7d93cee12587b624..69af3a855b3f2f60a81d80b1441a4028e7ac079b 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.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 @@ -97,6 +97,7 @@ Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::LarsenBorgnakkeVariableHardS ) : BinaryCollisionModel<CloudType>(dict, cloud, typeName), + Tref_(readScalar(this->coeffDict().lookup("Tref"))), relaxationCollisionNumber_ ( readScalar(this->coeffDict().lookup("relaxationCollisionNumber")) @@ -156,7 +157,7 @@ Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::sigmaTcR // calculating cross section = pi*dPQ^2, where dPQ is from Bird, eq. 4.79 scalar sigmaTPQ = mathematicalConstant::pi*dPQ*dPQ - *pow(2.0*CloudType::kb*CloudType::Tref/(mR*cR*cR), omegaPQ - 0.5) + *pow(2.0*CloudType::kb*Tref_/(mR*cR*cR), omegaPQ - 0.5) /exp(Foam::lgamma(2.5 - omegaPQ)); return sigmaTPQ*cR; diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H index c95d70f24c1f4ad0cfa394728258594664c3f89a..0b95c9fb4e0966b64afae0fbaeeaf03db662416a 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.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 @@ -50,6 +50,9 @@ class LarsenBorgnakkeVariableHardSphere { // Private data + //- Reference temperature + const scalar Tref_; + //- Relaxation collision number const scalar relaxationCollisionNumber_; diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C index de47f1550dc9c66018d5fc3a4e3d60da8f64c0c2..29b389a65ae197b866edb2019069e3667be96c07 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.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 @@ -35,7 +35,8 @@ Foam::VariableHardSphere<CloudType>::VariableHardSphere CloudType& cloud ) : - BinaryCollisionModel<CloudType>(dict, cloud, typeName) + BinaryCollisionModel<CloudType>(dict, cloud, typeName), + Tref_(readScalar(this->coeffDict().lookup("Tref"))) {} @@ -90,7 +91,7 @@ Foam::scalar Foam::VariableHardSphere<CloudType>::sigmaTcR // calculating cross section = pi*dPQ^2, where dPQ is from Bird, eq. 4.79 scalar sigmaTPQ = mathematicalConstant::pi*dPQ*dPQ - *pow(2.0*CloudType::kb*CloudType::Tref/(mR*cR*cR), omegaPQ - 0.5) + *pow(2.0*CloudType::kb*Tref_/(mR*cR*cR), omegaPQ - 0.5) /exp(Foam::lgamma(2.5 - omegaPQ)); return sigmaTPQ*cR; diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H index a1dbdb9a270c0e7c8dcb3021601fc88355e035c2..ee58d08d6a3295ca42b75714bb3e4e73577c081c 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.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 @@ -47,6 +47,12 @@ class VariableHardSphere : public BinaryCollisionModel<CloudType> { + // Private data + + //- Reference temperature + const scalar Tref_; + + public: //- Runtime type information diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C index 9d791a1ed3421049f77fd6d4fa6fcc4cf29be9c8..c2040070e9b530719a49a8cef3427939d03e24c5 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.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 diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.H b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.H index 03c2fe2abb72fe657ef9905162585099c445693d..5ecf6ed33c4bc3dc24786c5c2465aa63d5e789df 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.H +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/FreeStream/FreeStream.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 diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C index 8e99e3f43f8191a69c57f9855d702d607dcf50d5..bcbc21d4103668c8a71ebd30c7a546703d324a28 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.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 diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H index 6b01a82f40f1233dadbf1ad27434e0659c540a84..a86f857946e56252cb70693a54db3befb7cf95b5 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.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 diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C index 3abc5b29368d1af2c13fb65f30775d57ecfc461c..bc1005bdaf58e60923fdfdf7a95f9a79c895b279 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/NewInflowBoundaryModel.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 diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C index d04db500daa1fa762ada76543d72bb045a606da0..9711ab5a3ced1d7fa8c3f8c485748bb1c3186512 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.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 diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H index e3f46622e93c87519220169803ba5cdbd6c509ac..747d5595efeb20b619f77a49cf30e83075e9f283 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C index c2c12ce5ca7d835941c812b6920a09ddc694355f..e7213561c0d2a2f2dacd103daeee8a74676c7aaf 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H index 2b71beaba006c224e5c41dea13a6a79aa6b68dcc..8978723bacd5a345a79844e8cbe0ed228f8349a2 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.H +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C index 4de5507bf00f07b9df5d646cefb4f889e029d265..1fb5ab3208404f235f264a54035c27263edac463 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H index d2208bd3503d29b6ca40a4805718a9f655882134..c1d6d50e33da8af9054cd01f08b39451afa846ce 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.H +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C index 85652f2379327af4db6aa9c9a6e8e3bcff873dfc..97197cd669ec6316ab43c8f1b10d927a68cd0025 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C index 060d5dd76d9c59f1a2c4e896550c0fb1ee88f1df..a0874d9913d1660333c1cfb2fffa599084e3877f 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.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 diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H index 582bf2b1065ce26ec0113398357fed1a75d92a69..e9c7ffd33f001d555b9567a198554091745f683b 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.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 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/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..022263ecc3423f0fc52668c747e8aa79fe987afa 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 \*---------------------------------------------------------------------------*/ diff --git a/applications/test/ptrList/ptrListTest.C b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C similarity index 76% rename from applications/test/ptrList/ptrListTest.C rename to src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C index 7b2f6722bcc637a1c63d4ae42834a8075062f077..6464e9e71b04e93fb050293f8caa2d5ae2ba3a1f 100644 --- a/applications/test/ptrList/ptrListTest.C +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.C @@ -24,37 +24,29 @@ License \*---------------------------------------------------------------------------*/ -#include "PtrList.H" -#include "scalar.H" - -using namespace Foam; +#include "basicPsiThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: -int main(int argc, char *argv[]) +namespace Foam { - PtrList<scalar> list(10); - - forAll(list, i) - { - list.set(i, new scalar(i)); - } - - for - ( - PtrList<scalar>::iterator iter = list.begin(); - iter != list.end(); - ++iter - ) - { - Info<< *iter << endl; - } - - Info<< list << endl; - - return 0; + defineTypeNameAndDebug(basicPsiThermo, 0); + defineRunTimeSelectionTable(basicPsiThermo, fvMesh); } +// * * * * * * * * * * * * * * * * 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 86% rename from src/thermophysicalModels/basic/basicThermo/basicThermos.C rename to src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C index 7a837bcc9baf6ffe7a5c9bca0162ecb6e2cbe9e8..2849a29ea7fe3523acd2bf710958126da1bb926a 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.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 "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, perfectGas ); -makeBasicThermo +makeBasicPsiThermo ( - hThermo, + ePsiThermo, pureMixture, sutherlandTransport, hConstThermo, 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/basic/ParticleTrackingData/ParticleTrackingDataI.H b/src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H similarity index 73% rename from src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H rename to src/thermophysicalModels/chemistryModel/chemistryModel/psiChemistryModel/psiChemistryModelI.H index da195d56274e4ac02cd87bd051539c1f1de517eb..a6122b8b6840fbcf94afb92a5b99227000719d01 100644 --- a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H +++ 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) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,25 +24,17 @@ License \*---------------------------------------------------------------------------*/ -template<class ParcelType> -inline const Foam::Cloud<ParcelType>& -Foam::ParticleTrackingData<ParcelType>::cloud() const -{ - return cloud_; -} - +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -inline Foam::label Foam::ParticleTrackingData<ParcelType>::origProc() const +inline Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() { - return origProc_; + return thermo_(); } -template<class ParcelType> -inline Foam::label Foam::ParticleTrackingData<ParcelType>::id() const +inline const Foam::hCombustionThermo& Foam::psiChemistryModel::thermo() const { - return id_; + 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/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C b/src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H similarity index 79% rename from src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C rename to src/thermophysicalModels/chemistryModel/chemistryModel/rhoChemistryModel/rhoChemistryModelI.H index 5c946ca09cb63f6391327416104bc11f4cb3406b..d96171001b694bb6fdd721b835a358c52eaef13f 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.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,15 +24,18 @@ License \*---------------------------------------------------------------------------*/ -#include "createReactingCloudTypes.H" -#include "BasicTrackedReactingCloud.H" +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() +{ + return thermo_(); +} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +inline const Foam::hReactionThermo& Foam::rhoChemistryModel::thermo() const { - createReactingCloudType(BasicTrackedReactingCloud); -}; + 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/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C new file mode 100644 index 0000000000000000000000000000000000000000..35ab18220b048c0777b8cca86b613dd85d2ce15b --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "makeReactionThermo.H" +#include "thermoPhysicsTypes.H" + +#include "chemistryReader.H" +#include "foamChemistryReader.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeChemistryReader(gasThermoPhysics); +makeChemistryReader(icoPoly8ThermoPhysics); + +makeChemistryReaderType(foamChemistryReader, gasThermoPhysics); +makeChemistryReaderType(foamChemistryReader, icoPoly8ThermoPhysics); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // 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..d5ea8847973fadfcb12614e086bf17866da20c3c 100644 --- a/src/thermophysicalModels/specie/Make/files +++ b/src/thermophysicalModels/specie/Make/files @@ -1,14 +1,16 @@ 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 +$(equationOfState)/icoPolynomial/makeIcoPolynomials.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..b23de491d1b3fcc066d8c806cf82effc6ed667f6 --- /dev/null +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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: + + TypeName("icoPolynomial") + + // 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/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C similarity index 86% rename from src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C rename to src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C index 239ebccb3b451a6178984693820f21a66687fac1..e4136284c00b991a82ba3abb27bea0f969eb75e3 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/makeIcoPolynomials.C @@ -24,14 +24,20 @@ License \*---------------------------------------------------------------------------*/ -#include "createTrackedReactingParcelTypes.H" -#include "BasicTrackedReactingParcel.H" +#include "icoPolynomial.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createTrackedReactingParcelType(BasicTrackedReactingParcel); + makeIcoPolynomial(1) + makeIcoPolynomial(2) + makeIcoPolynomial(3) + makeIcoPolynomial(4) + makeIcoPolynomial(5) + makeIcoPolynomial(6) + makeIcoPolynomial(7) + makeIcoPolynomial(8) } 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/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/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/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/ras/nacaAirfoil/constant/thermophysicalProperties b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/thermophysicalProperties index 8e15891e509cc2f3819180595b2f41133983d22c..97425177af7947579a6656cf4e079a95f47f0387 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/constant/thermophysicalProperties +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/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 2.544e+06 1.8e-05 0.7; diff --git a/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties b/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties index 754163e2a972e3860710533ee809e51d9c3a99d7..39b28b36815c84a120d9da22b489a21026269c29 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/constant/thermophysicalProperties +++ b/tutorials/compressible/sonicFoam/ras/prism/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 1300 2.544e+06 1.84e-05 0.7; diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/boundaryT b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/boundaryT new file mode 100644 index 0000000000000000000000000000000000000000..9afc247827516321ce0b5e52eb795aacee4423ca --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/boundaryT @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 boundaryT; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/boundaryU b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/boundaryU new file mode 100644 index 0000000000000000000000000000000000000000..b7117eafbc88a45b32ee2caf91af18ae22182dc7 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/boundaryU @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 boundaryU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/dsmcRhoN b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/dsmcRhoN new file mode 100644 index 0000000000000000000000000000000000000000..e9eae893d481e09bfa8bd9c14da29e2a9d783d7d --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/dsmcRhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 dsmcRhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/fD b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/fD new file mode 100644 index 0000000000000000000000000000000000000000..0ec2aa7410f25dbefe5ffe80efad7750657881f5 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/fD @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 fD; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/iDof b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/iDof new file mode 100644 index 0000000000000000000000000000000000000000..626a947a110e1337a002592b4c1e83e80ac63e07 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/iDof @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 iDof; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/internalE b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/internalE new file mode 100644 index 0000000000000000000000000000000000000000..3dc30a0f2ec2d9c335764c66826d4e2863827da2 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/internalE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 internalE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/linearKE b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/linearKE new file mode 100644 index 0000000000000000000000000000000000000000..1d8b022dc9afe7adf9d56a39e09cded1901e6bf8 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/linearKE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 linearKE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/momentum b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/momentum new file mode 100644 index 0000000000000000000000000000000000000000..e35350692e7c33af9407f229a876a9006366b8cc --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/momentum @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 momentum; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -2 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/q b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/q new file mode 100644 index 0000000000000000000000000000000000000000..aae46273e982bd3c3495abaffc24ea89303b135d --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/q @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 q; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/rhoM b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/rhoM new file mode 100644 index 0000000000000000000000000000000000000000..8dc0b17f55699f616773087006ecc874b4acbc26 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/rhoM @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoM; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/rhoN b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/rhoN new file mode 100644 index 0000000000000000000000000000000000000000..038fd26de386704949e026bc29e577e24696f74e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/0/rhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + xPeriodic + { + type cyclic; + } + + yPeriodic + { + type cyclic; + } + + zPeriodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/Allclean b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..1cc972be26a9fa8c309f14c3c0d52659e62d236c --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0/lagrangian 0/dsmcSigmaTcRMax diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/Allrun b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..3c61ac798ec54d2bf1f7f6c8799de3e396ab53c9 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/Allrun @@ -0,0 +1,7 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication dsmcInitialise +runApplication dsmcFoam diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/dsmcProperties b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/dsmcProperties new file mode 100644 index 0000000000000000000000000000000000000000..395e69cbaa421127d0c60e7dd8bf126b94c60e4e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/dsmcProperties @@ -0,0 +1,77 @@ +/*--------------------------------*- 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 dsmcProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// General Properties +// ~~~~~~~~~~~~~~~~~~ + +nEquivalentParticles 1e12; + + +// Wall Interaction Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +WallInteractionModel SpecularReflection; + +SpecularReflectionCoeffs {} + +// Binary Collision Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +BinaryCollisionModel LarsenBorgnakkeVariableHardSphere; + +LarsenBorgnakkeVariableHardSphereCoeffs +{ + Tref 273; + relaxationCollisionNumber 5.0; +} + + +// Inflow Boundary Model +// ~~~~~~~~~~~~~~~~~~~~~ +InflowBoundaryModel NoInflow; + +NoInflowCoeffs {} + +// Molecular species +// ~~~~~~~~~~~~~~~~~ + +typeIdList (N2 O2); + +moleculeProperties +{ + N2 + { + mass 46.5e-27; + diameter 4.17e-10; + internalDegreesOfFreedom 2; + viscosityCoefficient 1.656e-5; + omega 0.74; + } + + O2 + { + mass 53.12e-27; + diameter 4.07e-10; + internalDegreesOfFreedom 2; + viscosityCoefficient 1.919e-5; + omega 0.77; + } +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/polyMesh/blockMeshDict b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..fc32e203da6c40ae08ff6677eaf6318988a1b364 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/polyMesh/blockMeshDict @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.3 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.01; + +vertices +( + (-5 -4 -4) + (5 -4 -4) + (5 4 -4) + (-5 4 -4) + (-5 -4 4) + (5 -4 4) + (5 4 4) + (-5 4 4) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 16 16) simpleGrading (1 1 1) +); + +patches +( + cyclic + xPeriodic + ( + (1 2 6 5) + (0 4 7 3) + ) + + cyclic + yPeriodic + ( + (2 3 7 6) + (0 1 5 4) + ) + + cyclic + zPeriodic + ( + (4 5 6 7) + (0 3 2 1) + ) +) + +mergePatchPairs +( +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/polyMesh/boundary b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..1a6e0ae58a917c86ccc62d907ad966c4ff8cecdc --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/constant/polyMesh/boundary @@ -0,0 +1,43 @@ +/*--------------------------------*- 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 polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +3 +( + xPeriodic + { + type cyclic; + nFaces 512; + startFace 14464; + featureCos 0.9; + } + yPeriodic + { + type cyclic; + nFaces 640; + startFace 14976; + featureCos 0.9; + } + zPeriodic + { + type cyclic; + nFaces 640; + startFace 15616; + featureCos 0.9; + } +) + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/controlDict b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..2a3172775adfe838f4cd3fa5c1200a5ac2b23fdd --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/controlDict @@ -0,0 +1,124 @@ +/*--------------------------------*- 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 1e-3; + +deltaT 1e-6; + +writeControl runTime; + +writeInterval 1e-4; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +functions +( + dsmcFields1 + { + type dsmcFields; + enabled on; + functionObjectLibs ( "libutilityFunctionObjects.so" ); + outputControl outputTime; + } + fieldAverage1 + { + type fieldAverage; + functionObjectLibs ( "libfieldFunctionObjects.so" ); + outputControl outputTime; + resetOnOutput off; + fields + ( + rhoN + { + mean on; + prime2Mean off; + base time; + } + rhoM + { + mean on; + prime2Mean off; + base time; + } + dsmcRhoN + { + mean on; + prime2Mean off; + base time; + } + momentum + { + mean on; + prime2Mean off; + base time; + } + linearKE + { + mean on; + prime2Mean off; + base time; + } + internalE + { + mean on; + prime2Mean off; + base time; + } + iDof + { + mean on; + prime2Mean off; + base time; + } + q + { + mean on; + prime2Mean off; + base time; + } + fD + { + mean on; + prime2Mean off; + base time; + } + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/decomposeParDict b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..77c30529ecfb004319a85c5dc2d05bbfe32dff38 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/decomposeParDict @@ -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 decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 1 2 2 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 1 1 1 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/dsmcInitialiseDict similarity index 63% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft rename to tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/dsmcInitialiseDict index 637d83fb4b41e5bbe9495fc5d1f3383a49045f61..c8ec236aa69ea5d841b4f00f73246960c6916ea4 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/dsmcInitialiseDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | +| \\ / O peration | Version: 1.5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -9,55 +9,21 @@ FoamFile { version 2.0; format ascii; - class faceSet; - location "constant/polyMesh/sets"; - object cycLeft; + class dictionary; + location "system"; + object dsmcInitialiseDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +numberDensities +{ + N2 0.777e20; + O2 0.223e20; +}; + +temperature 300; + +velocity (1950 0 0); -40 -( -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 -) // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/fvSchemes similarity index 60% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight rename to tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/fvSchemes index 37cdc37250e049cea02c4c9272fc7629bfe4e90e..42fda7921ca0a70a5b1f415666f49d4d07befb7b 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/fvSchemes @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | +| \\ / O peration | Version: 1.5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -9,55 +9,46 @@ FoamFile { version 2.0; format ascii; - class faceSet; - location "constant/polyMesh/sets"; - object cycRight; + class dictionary; + location "system"; + object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +ddtSchemes +{ + default none; +} + +gradSchemes +{ + default none; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; +} + +interpolationSchemes +{ + default none; +} + +snGradSchemes +{ + default none; +} + +fluxRequired +{ + default no; +} -40 -( -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 -) // ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/fvSolution similarity index 81% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old rename to tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/fvSolution index 23213bdb87781ea3f3191ce47a8397401db7f408..1e39435250fcc6c21b5ca292d31d085533ce9716 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old +++ b/tutorials/discreteMethods/dsmc/freeSpacePeriodic/system/fvSolution @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev.FT | +| \\ / O peration | Version: 1.5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -9,15 +9,14 @@ FoamFile { version 2.0; format ascii; - class topoSet; - location "constant/polyMesh/sets"; - object filter_old; + class dictionary; + location "system"; + object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -0 -( -) +solvers +{ +} // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/boundaryT b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/boundaryT new file mode 100644 index 0000000000000000000000000000000000000000..6bc3a516f0d2f1aa48d409cbbf8395422c840b64 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/boundaryT @@ -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; + object boundaryT; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type fixedValue; + value uniform 300; + } + + inlet + { + type fixedValue; + value uniform 300; + } + + sides + { + type fixedValue; + value uniform 300; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/boundaryU b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/boundaryU new file mode 100644 index 0000000000000000000000000000000000000000..6da36fb365e6c59359906b491672040021b098f2 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/boundaryU @@ -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 boundaryU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + outlet + { + type fixedValue; + value uniform (1325 -352 823); + } + + inlet + { + type fixedValue; + value uniform (1325 -352 823); + } + + sides + { + type fixedValue; + value uniform (1325 -352 823); + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/dsmcRhoN b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/dsmcRhoN new file mode 100644 index 0000000000000000000000000000000000000000..022a5f973f6fbf7720f1aae69f889c7fd3a8b3f3 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/dsmcRhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 dsmcRhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/fD b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/fD new file mode 100644 index 0000000000000000000000000000000000000000..e2da50d9a45e5de9309a2ab4e5aefda91f48ec0e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/fD @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 fD; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/iDof b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/iDof new file mode 100644 index 0000000000000000000000000000000000000000..00ba74788aca028e4a424fa1f60a183e4fb7922a --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/iDof @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 iDof; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/internalE b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/internalE new file mode 100644 index 0000000000000000000000000000000000000000..4408c91430ae071b500cfdcd489c4c950b74ae2e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/internalE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 internalE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/interpolaterhoN b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/interpolaterhoN new file mode 100644 index 0000000000000000000000000000000000000000..a9fe596c4337a79927b0a77ef635a72b11a79173 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/interpolaterhoN @@ -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 surfaceScalarField; + location "0"; + object interpolaterhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type calculated; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + sides + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/linearKE b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/linearKE new file mode 100644 index 0000000000000000000000000000000000000000..691ab915aeee75db15d2e7eb5c8b546aa2983bed --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/linearKE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 linearKE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/momentum b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/momentum new file mode 100644 index 0000000000000000000000000000000000000000..a3e4a449ae32749d72ad412447dc2d5c0226fdea --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/momentum @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 momentum; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -2 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/q b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/q new file mode 100644 index 0000000000000000000000000000000000000000..5b4fcc23bf75d0e65697c6f3db845ec42d411051 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/q @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 q; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/rhoM b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/rhoM new file mode 100644 index 0000000000000000000000000000000000000000..9f2443cdbb2b856fbdece7a849f5e29fb1e3c714 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/rhoM @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoM; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/0/rhoN b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/rhoN new file mode 100644 index 0000000000000000000000000000000000000000..e99d2742a3098a506fbe4fcda5f7e18c271f629e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/0/rhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + outlet + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/Allclean b/tutorials/discreteMethods/dsmc/freeSpaceStream/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..1cc972be26a9fa8c309f14c3c0d52659e62d236c --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0/lagrangian 0/dsmcSigmaTcRMax diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/Allrun b/tutorials/discreteMethods/dsmc/freeSpaceStream/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..3c61ac798ec54d2bf1f7f6c8799de3e396ab53c9 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/Allrun @@ -0,0 +1,7 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication dsmcInitialise +runApplication dsmcFoam diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/dsmcProperties b/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/dsmcProperties new file mode 100644 index 0000000000000000000000000000000000000000..d4d67559c117cf4a092f48a2ecd424509a0d0914 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/dsmcProperties @@ -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 "constant"; + object dsmcProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// General Properties +// ~~~~~~~~~~~~~~~~~~ + +nEquivalentParticles 1e12; + + +// Wall Interaction Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +WallInteractionModel MaxwellianThermal; + +MaxwellianThermalCoeffs {} + + +// Binary Collision Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +BinaryCollisionModel LarsenBorgnakkeVariableHardSphere; + +LarsenBorgnakkeVariableHardSphereCoeffs +{ + Tref 273; + relaxationCollisionNumber 5.0; +} + + +// Inflow Boundary Model +// ~~~~~~~~~~~~~~~~~~~~~ + +InflowBoundaryModel FreeStream; + +FreeStreamCoeffs +{ + numberDensities + { + N2 0.777e20; + O2 0.223e20; + }; +} + + +// Molecular species +// ~~~~~~~~~~~~~~~~~ + +typeIdList (N2 O2); + +moleculeProperties +{ + N2 + { + mass 46.5e-27; + diameter 4.17e-10; + internalDegreesOfFreedom 2; + viscosityCoefficient 1.656e-5; + omega 0.74; + } + + O2 + { + mass 53.12e-27; + diameter 4.07e-10; + internalDegreesOfFreedom 2; + viscosityCoefficient 1.919e-5; + omega 0.77; + } +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/polyMesh/blockMeshDict b/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..9343042c3890e0751d912f76edea446f84d70c30 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/polyMesh/blockMeshDict @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.3 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.01; + +vertices +( + (-5 -4 -4) + (5 -4 -4) + (5 4 -4) + (-5 4 -4) + (-5 -4 4) + (5 -4 4) + (5 4 4) + (-5 4 4) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 16 16) simpleGrading (1 1 1) +); + +patches +( + patch + outlet + ( + (1 2 6 5) + ) + + patch + inlet + ( + (0 4 7 3) + ) + + patch + sides + ( + (2 3 7 6) + (0 1 5 4) + (4 5 6 7) + (0 3 2 1) + ) +) + +mergePatchPairs +( +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/polyMesh/boundary b/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..502b052a7ffd8630ceb3b449f005aecee7c05edc --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/constant/polyMesh/boundary @@ -0,0 +1,40 @@ +/*--------------------------------*- 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 polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +3 +( + outlet + { + type patch; + nFaces 256; + startFace 14464; + } + inlet + { + type patch; + nFaces 256; + startFace 14720; + } + sides + { + type patch; + nFaces 1280; + startFace 14976; + } +) + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/system/controlDict b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..f123a030860f2fd7374e5e6f19af066031e68cc5 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/controlDict @@ -0,0 +1,124 @@ +/*--------------------------------*- 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 2e-2; + +deltaT 1e-6; + +writeControl runTime; + +writeInterval 1e-3; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +functions +( + dsmcFields1 + { + type dsmcFields; + enabled on; + functionObjectLibs ( "libutilityFunctionObjects.so" ); + outputControl outputTime; + } + fieldAverage1 + { + type fieldAverage; + functionObjectLibs ( "libfieldFunctionObjects.so" ); + outputControl outputTime; + resetOnOutput off; + fields + ( + rhoN + { + mean on; + prime2Mean off; + base time; + } + rhoM + { + mean on; + prime2Mean off; + base time; + } + dsmcRhoN + { + mean on; + prime2Mean off; + base time; + } + momentum + { + mean on; + prime2Mean off; + base time; + } + linearKE + { + mean on; + prime2Mean off; + base time; + } + internalE + { + mean on; + prime2Mean off; + base time; + } + iDof + { + mean on; + prime2Mean off; + base time; + } + q + { + mean on; + prime2Mean off; + base time; + } + fD + { + mean on; + prime2Mean off; + base time; + } + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/system/decomposeParDict b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..77c30529ecfb004319a85c5dc2d05bbfe32dff38 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/decomposeParDict @@ -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 decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 1 2 2 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 1 1 1 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/system/dsmcInitialiseDict b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/dsmcInitialiseDict new file mode 100644 index 0000000000000000000000000000000000000000..b5cc93423253ea73ac94aaedd58c300082a08d71 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/dsmcInitialiseDict @@ -0,0 +1,29 @@ +/*--------------------------------*- 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 dsmcInitialiseDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberDensities +{ + N2 0.777e20; + O2 0.223e20; +}; + +temperature 300; + +velocity (1325 -352 823); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/system/fvSchemes b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..42fda7921ca0a70a5b1f415666f49d4d07befb7b --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/fvSchemes @@ -0,0 +1,54 @@ +/*--------------------------------*- 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 none; +} + +gradSchemes +{ + default none; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; +} + +interpolationSchemes +{ + default none; +} + +snGradSchemes +{ + default none; +} + +fluxRequired +{ + default no; +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/freeSpaceStream/system/fvSolution b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..1e39435250fcc6c21b5ca292d31d085533ce9716 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/freeSpaceStream/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 +{ +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/boundaryT b/tutorials/discreteMethods/dsmc/supersonicCorner/0/boundaryT new file mode 100644 index 0000000000000000000000000000000000000000..7b7fbd9188e6f8cd4052203c687de78be8ece6f1 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/boundaryT @@ -0,0 +1,41 @@ +/*--------------------------------*- 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 boundaryT; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type fixedValue; + value uniform 300; + } + + entrance + { + type symmetryPlane; + } + + walls + { + type fixedValue; + value uniform 1000; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/boundaryU b/tutorials/discreteMethods/dsmc/supersonicCorner/0/boundaryU new file mode 100644 index 0000000000000000000000000000000000000000..1c21f7372c5f4c4b1312995046cd9aa9cf1aa419 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/boundaryU @@ -0,0 +1,41 @@ +/*--------------------------------*- 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 boundaryU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + flow + { + type fixedValue; + value uniform (1936 0 0); + } + + entrance + { + type symmetryPlane; + } + + walls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k b/tutorials/discreteMethods/dsmc/supersonicCorner/0/dsmcRhoN similarity index 66% rename from tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k rename to tutorials/discreteMethods/dsmc/supersonicCorner/0/dsmcRhoN index 26fcff0babb808a41223f7d9d5732248b4ea2aec..21d83f0b9f634e8cd24cb80fb1978327759087bb 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/dsmcRhoN @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,27 +10,30 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; - object k; + object dsmcRhoN; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0 0 0]; +dimensions [0 -3 0 0 0 0 0]; -internalField uniform 37.5; +internalField uniform 0; boundaryField { - walls + flow { - type compressible::kQRWallFunction; - value uniform 37.5; + type zeroGradient; } - frontAndBack + + entrance { - type empty; + type symmetryPlane; } -} + walls + { + type zeroGradient; + } +} // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/fD b/tutorials/discreteMethods/dsmc/supersonicCorner/0/fD new file mode 100644 index 0000000000000000000000000000000000000000..ae1df5d0114e5e2e3639632a9f3d220c660c9b76 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/fD @@ -0,0 +1,41 @@ +/*--------------------------------*- 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 fD; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + flow + { + type calculated; + value uniform (0 0 0); + } + + entrance + { + type symmetryPlane; + } + + walls + { + type calculated; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon b/tutorials/discreteMethods/dsmc/supersonicCorner/0/iDof similarity index 65% rename from tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon rename to tutorials/discreteMethods/dsmc/supersonicCorner/0/iDof index 50b54646b3d3d5ab88f13d0619c6e4afbcdba413..50c9624edd4051c04e53a804ba33d1b93865c261 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/iDof @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,27 +10,31 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; - object epsilon; + object iDof; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -3 0 0 0 0]; +dimensions [0 -3 0 0 0 0 0]; -internalField uniform 5390.5; +internalField uniform 0; boundaryField { - walls + flow { - type compressible::epsilonWallFunction; - value uniform 5390.5; + type zeroGradient; } - frontAndBack + + entrance { - type empty; + type symmetryPlane; + } + + walls + { + type zeroGradient; } -} +} // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/internalE b/tutorials/discreteMethods/dsmc/supersonicCorner/0/internalE new file mode 100644 index 0000000000000000000000000000000000000000..51f1e04d8b3755fbbd6fc067b8420bf7034304ef --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/internalE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 internalE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + entrance + { + type symmetryPlane; + } + + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/linearKE b/tutorials/discreteMethods/dsmc/supersonicCorner/0/linearKE new file mode 100644 index 0000000000000000000000000000000000000000..765956b135c36edd515b971b9967569b27ddfc14 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/linearKE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 linearKE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + entrance + { + type symmetryPlane; + } + + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/momentum b/tutorials/discreteMethods/dsmc/supersonicCorner/0/momentum new file mode 100644 index 0000000000000000000000000000000000000000..1899e2e7c665f50bdf5694b385a34b439df38da3 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/momentum @@ -0,0 +1,40 @@ +/*--------------------------------*- 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 momentum; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -2 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + flow + { + type zeroGradient; + } + + entrance + { + type symmetryPlane; + } + + walls + { + type zeroGradient; + } + +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/q b/tutorials/discreteMethods/dsmc/supersonicCorner/0/q new file mode 100644 index 0000000000000000000000000000000000000000..51c1b8cdec3797bdbb05cae3b736935810cc240c --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/q @@ -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; + object q; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type calculated; + value uniform 0; + + } + + entrance + { + type symmetryPlane; + } + + walls + { + type calculated; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/rhoM b/tutorials/discreteMethods/dsmc/supersonicCorner/0/rhoM new file mode 100644 index 0000000000000000000000000000000000000000..7f2d427a479cecad93dfb5de554c0a83c1b1d6d5 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/rhoM @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoM; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + entrance + { + type symmetryPlane; + } + + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/0/rhoN b/tutorials/discreteMethods/dsmc/supersonicCorner/0/rhoN new file mode 100644 index 0000000000000000000000000000000000000000..98ffe8ca1e723aa85a7f493d783fa1b2b0bb8d1e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/0/rhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + entrance + { + type symmetryPlane; + } + + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/Allclean b/tutorials/discreteMethods/dsmc/supersonicCorner/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..5622060c8ee23c89d8743d2217de1c3b7381e6b0 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/Allclean @@ -0,0 +1,9 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0/lagrangian 0/dsmcSigmaTcRMax +rm -rf processor* +rm -f system/machines \ No newline at end of file diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/Allrun b/tutorials/discreteMethods/dsmc/supersonicCorner/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..402135df749b6f380b1c870897e27c053918afb4 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/Allrun @@ -0,0 +1,11 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication decomposePar +runParallel dsmcInitialise 4 system/machines +hostname > system/machines +runParallel dsmcFoam 4 system/machines +runApplication reconstructPar -noLagrangian + diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/constant/dsmcProperties b/tutorials/discreteMethods/dsmc/supersonicCorner/constant/dsmcProperties new file mode 100644 index 0000000000000000000000000000000000000000..2d950a4814d564bd56c7afc883ae2e1d1f652c75 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/constant/dsmcProperties @@ -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 "constant"; + object dsmcProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// General Properties +// ~~~~~~~~~~~~~~~~~~ + +nEquivalentParticles 1.2e12; + + +// Wall Interaction Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +//WallInteractionModel SpecularReflection; +WallInteractionModel MaxwellianThermal; + +SpecularReflectionCoeffs {} + +MaxwellianThermalCoeffs {} + + +// Binary Collision Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +//BinaryCollisionModel VariableHardSphere; +BinaryCollisionModel LarsenBorgnakkeVariableHardSphere; + +VariableHardSphereCoeffs +{ + Tref 273; +} + +LarsenBorgnakkeVariableHardSphereCoeffs +{ + Tref 273; + relaxationCollisionNumber 5.0; +} + + +// Inflow Boundary Model +// ~~~~~~~~~~~~~~~~~~~~~ + +InflowBoundaryModel FreeStream; +//InflowBoundaryModel NoInflow; + +NoInflowCoeffs {} + +FreeStreamCoeffs +{ + numberDensities + { + Ar 1.0e20; + }; +} + + +// Molecular species +// ~~~~~~~~~~~~~~~~~ + +typeIdList (Ar); + +moleculeProperties +{ + Ar + { + mass 66.3e-27; + diameter 4.17e-10; + internalDegreesOfFreedom 0; + viscosityCoefficient 2.117e-5; + omega 0.81; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/constant/polyMesh/blockMeshDict b/tutorials/discreteMethods/dsmc/supersonicCorner/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..6b9aa389277a491baea403d7ee5e16a4a3add664 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/constant/polyMesh/blockMeshDict @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.3 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.01; + +vertices +( + (0 0 0) + (5 0 0) + (5 18 0) + (0 18 0) + (0 0 18) + (5 0 18) + (5 18 18) + (0 18 18) + (30 0 0) + (30 18 0) + (30 0 18) + (30 18 18) + +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (10 36 36) simpleGrading (1 1 1) + hex (1 8 9 2 5 10 11 6) (50 36 36) simpleGrading (1 1 1) +); + +patches +( + patch + flow + ( + (8 9 11 10) + (0 4 7 3) + (2 3 7 6) + (2 6 11 9) + (4 5 6 7) + (5 10 11 6) + ) + + symmetryPlane + entrance + ( + (0 1 5 4) + (0 3 2 1) + ) + + wall + walls + ( + (1 8 10 5) + (1 2 9 8) + ) +) + +mergePatchPairs +( +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/constant/polyMesh/boundary b/tutorials/discreteMethods/dsmc/supersonicCorner/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..87ffe1fea34bf9faaf2139d0208b367378d4cb50 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/constant/polyMesh/boundary @@ -0,0 +1,40 @@ +/*--------------------------------*- 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 polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +3 +( + flow + { + type patch; + nFaces 6912; + startFace 227664; + } + entrance + { + type symmetryPlane; + nFaces 720; + startFace 234576; + } + walls + { + type wall; + nFaces 3600; + startFace 235296; + } +) + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/system/controlDict b/tutorials/discreteMethods/dsmc/supersonicCorner/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..2e92a436f3be2f2352abd09dc95034e42ea55867 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/system/controlDict @@ -0,0 +1,124 @@ +/*--------------------------------*- 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 0.025; + +deltaT 1e-6; + +writeControl runTime; + +writeInterval 1e-3; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +functions +( + dsmcFields1 + { + type dsmcFields; + enabled on; + functionObjectLibs ( "libutilityFunctionObjects.so" ); + outputControl outputTime; + } + fieldAverage1 + { + type fieldAverage; + functionObjectLibs ( "libfieldFunctionObjects.so" ); + outputControl outputTime; + resetOnOutput off; + fields + ( + rhoN + { + mean on; + prime2Mean off; + base time; + } + rhoM + { + mean on; + prime2Mean off; + base time; + } + dsmcRhoN + { + mean on; + prime2Mean off; + base time; + } + momentum + { + mean on; + prime2Mean off; + base time; + } + linearKE + { + mean on; + prime2Mean off; + base time; + } + internalE + { + mean on; + prime2Mean off; + base time; + } + iDof + { + mean on; + prime2Mean off; + base time; + } + q + { + mean on; + prime2Mean off; + base time; + } + fD + { + mean on; + prime2Mean off; + base time; + } + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/system/decomposeParDict b/tutorials/discreteMethods/dsmc/supersonicCorner/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..bf8dffb737c91db0646cde4bd56a4fd0629c82b9 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/system/decomposeParDict @@ -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 decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 2 2 1 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 1 1 1 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/system/dsmcInitialiseDict b/tutorials/discreteMethods/dsmc/supersonicCorner/system/dsmcInitialiseDict new file mode 100644 index 0000000000000000000000000000000000000000..54774bfb88a21b624a707ea455139fa86b4d834a --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/system/dsmcInitialiseDict @@ -0,0 +1,28 @@ +/*--------------------------------*- 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 dsmcInitialiseDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberDensities +{ + Ar 1.0e20; +}; + +temperature 300; + +velocity (1936 0 0); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/system/fvSchemes b/tutorials/discreteMethods/dsmc/supersonicCorner/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..42fda7921ca0a70a5b1f415666f49d4d07befb7b --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/system/fvSchemes @@ -0,0 +1,54 @@ +/*--------------------------------*- 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 none; +} + +gradSchemes +{ + default none; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; +} + +interpolationSchemes +{ + default none; +} + +snGradSchemes +{ + default none; +} + +fluxRequired +{ + default no; +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/supersonicCorner/system/fvSolution b/tutorials/discreteMethods/dsmc/supersonicCorner/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..1e39435250fcc6c21b5ca292d31d085533ce9716 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/supersonicCorner/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 +{ +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/boundaryT b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/boundaryT new file mode 100644 index 0000000000000000000000000000000000000000..7aa7905710a606e8e72678e02d59887826ff8690 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/boundaryT @@ -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; + object boundaryT; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type fixedValue; + value uniform 300; + } + + obstacle + { + type fixedValue; + value uniform 550; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // + diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/boundaryU b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/boundaryU new file mode 100644 index 0000000000000000000000000000000000000000..dfa4801d7000be60ae30e5df7eae230669c6c674 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/boundaryU @@ -0,0 +1,41 @@ +/*--------------------------------*- 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 boundaryU; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + flow + { + type fixedValue; + value uniform (1736 0 0); + } + + obstacle + { + type fixedValue; + value uniform (0 0 0); + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/dsmcRhoN b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/dsmcRhoN new file mode 100644 index 0000000000000000000000000000000000000000..aa3f432f46e752d9fa2c5dfb6fa48acae998d595 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/dsmcRhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 dsmcRhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/fD b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/fD new file mode 100644 index 0000000000000000000000000000000000000000..85d8c061d08d0fcb845b785396bc62df0d9ef1eb --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/fD @@ -0,0 +1,40 @@ +/*--------------------------------*- 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 fD; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type calculated; + value uniform (0 0 0); + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/iDof b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/iDof new file mode 100644 index 0000000000000000000000000000000000000000..542b42e13ad3ccab8803ed830c00a5a20eb98433 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/iDof @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 iDof; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/internalE b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/internalE new file mode 100644 index 0000000000000000000000000000000000000000..496e5afd331f009db8322ad39797d198181ff3d4 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/internalE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 internalE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/linearKE b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/linearKE new file mode 100644 index 0000000000000000000000000000000000000000..c52708ab4d2410adf5713f509dba421d66384afc --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/linearKE @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 linearKE; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/momentum b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/momentum new file mode 100644 index 0000000000000000000000000000000000000000..338ace9965dcaa4a102273cafa2d7efa1417978f --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/momentum @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 momentum; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -2 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/q b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/q new file mode 100644 index 0000000000000000000000000000000000000000..6e2a7fd4511edcf27b0d919741eebcd79d6798e8 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/q @@ -0,0 +1,40 @@ +/*--------------------------------*- 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 q; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type calculated; + value uniform 0; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/rhoM b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/rhoM new file mode 100644 index 0000000000000000000000000000000000000000..2ab4a148b1b27cf318081d080f622353c4e1967c --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/rhoM @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoM; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/0/rhoN b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/rhoN new file mode 100644 index 0000000000000000000000000000000000000000..fa576a150c96e545742e6196b0eac499584fbd96 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/0/rhoN @@ -0,0 +1,39 @@ +/*--------------------------------*- 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 rhoN; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -3 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + flow + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + periodic + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/Allclean b/tutorials/discreteMethods/dsmc/wedge15Ma5/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..a81bd945995ae2476d7d49837ef74e909c5053c9 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0/lagrangian 0/dsmcSigmaTcRMax +rm -rf processor* +rm -rf forces1 +rm -f system/machines \ No newline at end of file diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/Allrun b/tutorials/discreteMethods/dsmc/wedge15Ma5/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..402135df749b6f380b1c870897e27c053918afb4 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/Allrun @@ -0,0 +1,11 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication decomposePar +runParallel dsmcInitialise 4 system/machines +hostname > system/machines +runParallel dsmcFoam 4 system/machines +runApplication reconstructPar -noLagrangian + diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/dsmcProperties b/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/dsmcProperties new file mode 100644 index 0000000000000000000000000000000000000000..bd07689d19a53dcc80bd34dc6b13499797c5378b --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/dsmcProperties @@ -0,0 +1,89 @@ +/*--------------------------------*- 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 dsmcProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// General Properties +// ~~~~~~~~~~~~~~~~~~ + +nEquivalentParticles 5e12; + + +// Wall Interaction Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +WallInteractionModel MaxwellianThermal; + +MaxwellianThermalCoeffs {} + + +// Binary Collision Model +// ~~~~~~~~~~~~~~~~~~~~~~ + +BinaryCollisionModel LarsenBorgnakkeVariableHardSphere; + +LarsenBorgnakkeVariableHardSphereCoeffs +{ + Tref 273; + relaxationCollisionNumber 5.0; +} + + +// Inflow Boundary Model +// ~~~~~~~~~~~~~~~~~~~~~ + +InflowBoundaryModel FreeStream; + +NoInflowCoeffs {} + +FreeStreamCoeffs +{ + numberDensities + { + N2 0.777e20; + O2 0.223e20; + }; +} + + +// Molecular species +// ~~~~~~~~~~~~~~~~~ + +typeIdList (N2 O2); + +moleculeProperties +{ + N2 + { + mass 46.5e-27; + diameter 4.17e-10; + internalDegreesOfFreedom 2; + viscosityCoefficient 1.656e-5; + omega 0.74; + } + + O2 + { + mass 53.12e-27; + diameter 4.07e-10; + internalDegreesOfFreedom 2; + viscosityCoefficient 1.919e-5; + omega 0.77; + } +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/polyMesh/blockMeshDict b/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..858a5357faec9992f7284e4e55ee3a8fd874d742 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/polyMesh/blockMeshDict @@ -0,0 +1,74 @@ +/*--------------------------------*- 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.15242 0 -0.05) + ( 0 0 -0.05) + ( 0.3048 0.081670913853 -0.05) + (-0.15242 0.3 -0.05) + ( 0 0.3 -0.05) + ( 0.3048 0.3 -0.05) + + (-0.15242 0 0.05) + ( 0 0 0.05) + ( 0.3048 0.081670913853 0.05) + (-0.15242 0.3 0.05) + ( 0 0.3 0.05) + ( 0.3048 0.3 0.05) + +); + +blocks +( + hex (0 1 4 3 6 7 10 9 ) (20 40 12) simpleGrading (1 1 1) + hex (1 2 5 4 7 8 11 10) (40 40 12) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch flow + ( + (0 6 9 3) + (2 5 11 8) + (0 1 7 6) + (3 9 10 4) + (4 10 11 5) + ) + wall obstacle + ( + (1 2 8 7) + ) + cyclic periodic + ( + (0 3 4 1) + (1 4 5 2) + (6 7 10 9) + (7 8 11 10) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/polyMesh/boundary b/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..5c089fb5b2b5fc9bf41e975d323a588a8c50291d --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/constant/polyMesh/boundary @@ -0,0 +1,41 @@ +/*--------------------------------*- 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 polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +3 +( + flow + { + type patch; + nFaces 1920; + startFace 82800; + } + obstacle + { + type wall; + nFaces 480; + startFace 84720; + } + periodic + { + type cyclic; + nFaces 4800; + startFace 85200; + featureCos 0.9; + } +) + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/system/controlDict b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..b069a968567e38b9d2b079d3a33ee3621256362e --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/controlDict @@ -0,0 +1,139 @@ +/*--------------------------------*- 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 0.00125; +// endTime 0.01; + +deltaT 2e-6; + +writeControl runTime; + +writeInterval 1e-4; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +functions +( + dsmcFields1 + { + type dsmcFields; + enabled on; + functionObjectLibs ( "libutilityFunctionObjects.so" ); + outputControl outputTime; + } + + fieldAverage1 + { + type fieldAverage; + functionObjectLibs ( "libfieldFunctionObjects.so" ); + outputControl outputTime; + resetOnOutput off; + fields + ( + rhoN + { + mean on; + prime2Mean off; + base time; + } + rhoM + { + mean on; + prime2Mean off; + base time; + } + dsmcRhoN + { + mean on; + prime2Mean off; + base time; + } + momentum + { + mean on; + prime2Mean off; + base time; + } + linearKE + { + mean on; + prime2Mean off; + base time; + } + internalE + { + mean on; + prime2Mean off; + base time; + } + iDof + { + mean on; + prime2Mean off; + base time; + } + q + { + mean on; + prime2Mean off; + base time; + } + fD + { + mean on; + prime2Mean off; + base time; + } + ); + } + + forces1 + { + type forces; + enabled on; + functionObjectLibs ( "libforces.so" ); + outputControl outputTime; + patches ( obstacle ); + directForceDensity true; + fDName fDMean; + CofR ( 0 0 0 ); + log on; + } +); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/system/decomposeParDict b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..a533085b04aff6c998b4ad26efe83d5d65920e43 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/decomposeParDict @@ -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 decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 1 1 4 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 1 1 1 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/system/dsmcInitialiseDict b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/dsmcInitialiseDict new file mode 100644 index 0000000000000000000000000000000000000000..118c809b6f1cc8122ed391a2808a4eb984b4d836 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/dsmcInitialiseDict @@ -0,0 +1,29 @@ +/*--------------------------------*- 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 dsmcInitialiseDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberDensities +{ + N2 0.777e20; + O2 0.223e20; +}; + +temperature 300; + +velocity (1736 0 0); + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/system/fvSchemes b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..42fda7921ca0a70a5b1f415666f49d4d07befb7b --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/fvSchemes @@ -0,0 +1,54 @@ +/*--------------------------------*- 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 none; +} + +gradSchemes +{ + default none; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; +} + +interpolationSchemes +{ + default none; +} + +snGradSchemes +{ + default none; +} + +fluxRequired +{ + default no; +} + + +// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmc/wedge15Ma5/system/fvSolution b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..1e39435250fcc6c21b5ca292d31d085533ce9716 --- /dev/null +++ b/tutorials/discreteMethods/dsmc/wedge15Ma5/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 +{ +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T index 6009ab2e41fce778c6727190423c93de7cf226ab..5784dfae929e92896e6c4c76f76f76d44e143ce5 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/T @@ -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 T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -20,22 +21,425 @@ internalField uniform 300; boundaryField { - floor + floor { type fixedValue; - value uniform 300; + 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 + ceiling { type fixedValue; value uniform 300; } - - fixedWalls + fixedWalls { type zeroGradient; } } + // ************************************************************************* // 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/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/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/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/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/pimpleDyMFoam/movingCone/system/fvSolution b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution index 486f7ad5fb2836444d68502c50b37e8c4e55b62a..ca87cfa23b842b53e1d7e75478f7e809c12c2083 100644 --- a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution @@ -58,9 +58,10 @@ solvers } } -PISO +PIMPLE { - nCorrectors 2; + nOuterCorrectors 2; + nCorrectors 1; nNonOrthogonalCorrectors 0; } 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/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/turbulenceProperties similarity index 88% rename from tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/turbulenceProperties index 78f28eca604be4d8fc94d38d23ae0cbb679b18fb..47c046d714367bdde68f84c32fdf37498961915b 100644 --- a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/turbulenceProperties @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,7 +10,6 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 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..82b67c9f1fe0ea568fae92698b8891391df51b10 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 noRadiation; 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/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/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 -) - -// ************************************************************************* //