diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 3f4f485cf6b7e0abe4e43577558952568598e786..22c3f0139ad5f9801d7f3f00fb1d173d90c51d35 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -4,6 +4,9 @@ volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn.H(); +phi.boundaryField() = + fvc::interpolate(rho.boundaryField()*U.boundaryField()) + & mesh.Sf().boundaryField(); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); diff --git a/applications/solvers/multiphase/bubbleFoam/pEqn.H b/applications/solvers/multiphase/bubbleFoam/pEqn.H index 631c9cbba64c9040ca890d33a95f757bc3e90062..d438b1124f66cbfda30c906124b295c52eac6220 100644 --- a/applications/solvers/multiphase/bubbleFoam/pEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/pEqn.H @@ -38,16 +38,18 @@ ( (fvc::interpolate(HbyA1) & mesh.Sf()) + fvc::ddtPhiCorr(rAU1, U1, phi1) - + phiDrag1 ); surfaceScalarField phiHbyA2 ( (fvc::interpolate(HbyA2) & mesh.Sf()) + fvc::ddtPhiCorr(rAU2, U2, phi2) - + phiDrag2 ); + phi = alpha1f*phiHbyA1 + alpha2f*phiHbyA2; + + phiHbyA1 += phiDrag1; + phiHbyA2 += phiDrag2; surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2); surfaceScalarField Dp diff --git a/applications/solvers/multiphase/cavitatingFoam/UEqn.H b/applications/solvers/multiphase/cavitatingFoam/UEqn.H index 9a5761b59f3af176c34fde4f0b366573cf510cfe..1ca0b9f0a5ffd09df362b53148b291968f9ea4f3 100644 --- a/applications/solvers/multiphase/cavitatingFoam/UEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/UEqn.H @@ -1,17 +1,8 @@ - surfaceScalarField muEff - ( - "muEff", - twoPhaseProperties.muf() - + fvc::interpolate(rho*turbulence->nut()) - ); - fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) - - fvm::laplacian(muEff, U) - //- (fvc::grad(U) & fvc::grad(muf)) - - fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + + turbulence->divDevRhoReff(rho, U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H index 257f6d48b53176b612a8732887d32a4f1f767905..7cc250a66a2ab15a22680ab352f321e731b17c17 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -1,17 +1,8 @@ - surfaceScalarField muEff - ( - "muEff", - twoPhaseProperties.muf() - + fvc::interpolate(rho*turbulence->nut()) - ); - fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - - fvm::laplacian(muEff, U) - - (fvc::grad(U) & fvc::grad(muEff)) - //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + + turbulence->divDevRhoReff(rho, U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 9e67a47c4f006bbe357049531d5855034c0d0d8b..80011d1ab593f367c75f6f0e31b37e9deeea9901 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -36,6 +36,7 @@ (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phi) ); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H index 67717b07383af9ea70236a02140a8f7e62411556..926abe2a0937f57a421893b002038c127ad3a3b5 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H @@ -2,11 +2,6 @@ rho1 = rho10 + psi1*p; rho2 = rho20 + psi2*p; - mrfZones.absoluteFlux(phi1.oldTime()); - mrfZones.absoluteFlux(phi1); - mrfZones.absoluteFlux(phi2.oldTime()); - mrfZones.absoluteFlux(phi2); - surfaceScalarField alpha1f(fvc::interpolate(alpha1)); surfaceScalarField alpha2f(scalar(1) - alpha1f); @@ -22,35 +17,53 @@ volVectorField HbyA2("HbyA2", U2); HbyA2 = rAU2*U2Eqn.H(); - surfaceScalarField phiHbyA1 - ( - "phiHbyA1", - (fvc::interpolate(HbyA1) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU1, alpha1, U1, phi1) - + fvc::interpolate((1.0/rho1)*rAU1*dragCoeff)*phi2 - + rAlphaAU1f*(g & mesh.Sf()) - ); + mrfZones.absoluteFlux(phi1.oldTime()); + mrfZones.absoluteFlux(phi1); + mrfZones.absoluteFlux(phi2.oldTime()); + mrfZones.absoluteFlux(phi2); + + surfaceScalarField ppDrag("ppDrag", 0.0*phi1); if (g0.value() > 0.0) { - phiHbyA1 -= ppMagf*fvc::snGrad(alpha1)*mesh.magSf(); + ppDrag -= ppMagf*fvc::snGrad(alpha1)*mesh.magSf(); } if (kineticTheory.on()) { - phiHbyA1 -= - fvc::interpolate((1.0/rho1)*rAU1) + ppDrag -= + fvc::interpolate(1.0/rho1)*rAlphaAU1f *fvc::snGrad(kineticTheory.pa())*mesh.magSf(); } - mrfZones.relativeFlux(phiHbyA1); + surfaceScalarField phiHbyA1 + ( + "phiHbyA1", + (fvc::interpolate(HbyA1) & mesh.Sf()) + + fvc::ddtPhiCorr(rAU1, alpha1, U1, phi1) + ); surfaceScalarField phiHbyA2 ( "phiHbyA2", (fvc::interpolate(HbyA2) & mesh.Sf()) + fvc::ddtPhiCorr(rAU2, alpha2, U2, phi2) - + fvc::interpolate((1.0/rho2)*rAU2*dragCoeff)*phi1 + ); + + phi = alpha1f*phiHbyA1 + alpha2f*phiHbyA2; + mrfZones.relativeFlux(phi); + + phiHbyA1 += + ( + fvc::interpolate((1.0/rho1)*rAU1*dragCoeff)*phi2 + + ppDrag + + rAlphaAU1f*(g & mesh.Sf()) + ); + mrfZones.relativeFlux(phiHbyA1); + + phiHbyA2 += + ( + fvc::interpolate((1.0/rho2)*rAU2*dragCoeff)*phi1 + rAlphaAU2f*(g & mesh.Sf()) ); mrfZones.relativeFlux(phiHbyA2); @@ -135,7 +148,8 @@ U1 = HbyA1 + fvc::reconstruct ( - rAlphaAU1f + ppDrag + + rAlphaAU1f *( (g & mesh.Sf()) + mSfGradp/fvc::interpolate(rho1) diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H index 9c56c4d26f3e9d975d931647734b4f0d94e26ef0..1f4f0bbbebc4998d21a8b713f5d54147ce3bcceb 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H @@ -11,9 +11,9 @@ (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - mrfZones.relativeFlux(phiHbyA); - adjustPhi(phiHbyA, U, p_rgh); + mrfZones.relativeFlux(phiHbyA); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/interFoam/UEqn.H b/applications/solvers/multiphase/interFoam/UEqn.H index 257f6d48b53176b612a8732887d32a4f1f767905..7cc250a66a2ab15a22680ab352f321e731b17c17 100644 --- a/applications/solvers/multiphase/interFoam/UEqn.H +++ b/applications/solvers/multiphase/interFoam/UEqn.H @@ -1,17 +1,8 @@ - surfaceScalarField muEff - ( - "muEff", - twoPhaseProperties.muf() - + fvc::interpolate(rho*turbulence->nut()) - ); - fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - - fvm::laplacian(muEff, U) - - (fvc::grad(U) & fvc::grad(muEff)) - //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + + turbulence->divDevRhoReff(rho, U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H index d942f2c5012634b2639e206b3e7a64aad7e6f375..5b089550c56d488461757556102f0812350a809e 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H @@ -19,6 +19,8 @@ fvc::makeAbsolute(phiHbyA, U); } + phiAbs = phiHbyA; + surfaceScalarField phig ( ( diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index d1bc7bf1edc008f2ca359b63bc60e0cc878bef36..53c2161f97897aaf8c6562e906c735b7e6725b54 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -13,6 +13,7 @@ ); adjustPhi(phiHbyA, U, p_rgh); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H index b8fe82ff1423ed793c82bdcb0a5d43d226be0bc4..062c5523c9d4c94a469e49e202b65e25ad1b285d 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H @@ -1,18 +1,9 @@ - surfaceScalarField muEff - ( - "muEff", - twoPhaseProperties->muf() - + fvc::interpolate(rho*turbulence->nut()) - ); - fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U) - - fvm::laplacian(muEff, U) - - (fvc::grad(U) & fvc::grad(muEff)) - //- fvc::div(muEff*(fvc::interpolate(dev2(fvc::grad(U))) & mesh.Sf())) + + turbulence->divDevRhoReff(rho, U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index e3ef0dc9efb43c0bc48016b29401c2a31d75b668..7ff971ed7f7d36b31df61896e47146acdbdaeeca 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -11,8 +11,8 @@ (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - adjustPhi(phiHbyA, U, p_rgh); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 9ed3fecce9c41af14c013fe65390d0b795703f9c..07d867b1e78b89c9809fa4ed781ab97d04413949 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -58,6 +58,8 @@ dimensionedScalar("phiHbyA", dimArea*dimVelocity, 0) ); + phi = dimensionedScalar("phi", phi.dimensions(), 0); + phasei = 0; forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) { @@ -74,14 +76,17 @@ ( (fvc::interpolate(HbyAs[phasei]) & mesh.Sf()) + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) - + rAlphaAUfs[phasei] + ); + mrfZones.relativeFlux(phiHbyAs[phasei]); + + phi += alphafs[phasei]*phiHbyAs[phasei]; + + phiHbyAs[phasei] += + rAlphaAUfs[phasei] *( fluid.surfaceTension(phase)*mesh.magSf()/phase.rho() + (g & mesh.Sf()) - ) - ); - - mrfZones.relativeFlux(phiHbyAs[phasei]); + ); multiphaseSystem::dragModelTable::const_iterator dmIter = fluid.dragModels().begin(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H index 7bc1eeb12cd6765cfd76bf229f3c69a8c2964f0e..823216897c886ac5a3a15490bd2215d524aa8605 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H @@ -11,9 +11,9 @@ (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - mrfZones.relativeFlux(phiHbyA); - adjustPhi(phiHbyA, U, p_rgh); + mrfZones.relativeFlux(phiHbyA); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H index 43ee1e3eb9452061200f3908241358d3f3215a24..fbcba7db72d751ac5b48d8055789b54eb8877b73 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H @@ -1,17 +1,8 @@ - surfaceScalarField muEff - ( - "muEff", - mixture.muf() - + fvc::interpolate(rho*turbulence->nut()) - ); - fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(mixture.rhoPhi(), U) - - fvm::laplacian(muEff, U) - - (fvc::grad(U) & fvc::grad(muEff)) - //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + + turbulence->divDevRhoReff(rho, U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H index c1e346ce43b26e945a9a270fd34d270737e59e86..82bf3dbd59a4dc399e59714fecc95596fc0120a2 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H @@ -11,8 +11,8 @@ (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - adjustPhi(phiHbyA, U, p_rgh); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/settlingFoam/UEqn.H b/applications/solvers/multiphase/settlingFoam/UEqn.H index d6232da309d69b324c0eb327ac7f11287df7fb57..ff6323bca2776b6e06cef19d4ad56209f022c015 100644 --- a/applications/solvers/multiphase/settlingFoam/UEqn.H +++ b/applications/solvers/multiphase/settlingFoam/UEqn.H @@ -11,7 +11,6 @@ ) - fvm::laplacian(muEff, U, "laplacian(muEff,U)") - (fvc::grad(U) & fvc::grad(muEff)) - //- fvc::div(muEff*dev2(T(fvc::grad(U)))) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index 9f27e992a89188859d93458a2ec2c444afa0be1c..6d61ec8730f8ef7d2f3c6b975e842a7fa69da26b 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -15,6 +15,7 @@ + fvc::ddtPhiCorr(rAU, rho, U, phi) ) ); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H index 3dbb3747743536d11d95ce2021c81cab1641ea3f..7afd323dd0d0b373d36b96a1ecc20df73920401b 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H @@ -1,17 +1,8 @@ - surfaceScalarField muEff - ( - "muEff", - twoPhaseProperties.muf() - + fvc::interpolate(rho*turbulence->nut()) - ); - fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - - fvm::laplacian(muEff, U) - - (fvc::grad(U) & fvc::grad(muEff)) - //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + + turbulence->divDevRhoReff(rho, U) ); UEqn.relax(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index ddfca4e3ea85924615cbebd652a343e4496b1115..e090522de6a69c7bb0429a5f9d7ac32fa5fc5984 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -11,8 +11,8 @@ (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phi) ); - adjustPhi(phiHbyA, U, p_rgh); + phi = phiHbyA; surfaceScalarField phig ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index 9b543bcd25409b5168cbfbfc852f8d44b260fadf..546e1a3e41f20ca419bc147ec3572a244ea879e5 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -36,18 +36,29 @@ "phiHbyA1", (fvc::interpolate(HbyA1) & mesh.Sf()) + fvc::ddtPhiCorr(rAU1, U1, phi1) - + fvc::interpolate(alpha2/rho1*K*rAU1)*phi2 - + ppDrag - + rAU1f*(g & mesh.Sf()) ); - mrfZones.relativeFlux(phiHbyA1); surfaceScalarField phiHbyA2 ( "phiHbyA2", (fvc::interpolate(HbyA2) & mesh.Sf()) + fvc::ddtPhiCorr(rAU2, U2, phi2) - + fvc::interpolate(alpha1/rho2*K*rAU2)*phi1 + ); + + phi = alpha1f*phiHbyA1 + alpha2f*phiHbyA2; + mrfZones.relativeFlux(phi); + + phiHbyA1 += + ( + fvc::interpolate(alpha2/rho1*K*rAU1)*phi2 + + ppDrag + + rAU1f*(g & mesh.Sf()) + ); + mrfZones.relativeFlux(phiHbyA1); + + phiHbyA2 += + ( + fvc::interpolate(alpha1/rho2*K*rAU2)*phi1 + rAU2f*(g & mesh.Sf()) ); mrfZones.relativeFlux(phiHbyA2); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H.old b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H.old deleted file mode 100644 index 348cc847d71411e7e4c2c4ada254244c01ef59c6..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H.old +++ /dev/null @@ -1,118 +0,0 @@ -{ - surfaceScalarField alpha1f(fvc::interpolate(alpha1)); - surfaceScalarField alpha2f(scalar(1) - alpha1f); - - volScalarField rAU1(1.0/U1Eqn.A()); - volScalarField rAU2(1.0/U2Eqn.A()); - - rAU1f = fvc::interpolate(rAU1); - surfaceScalarField rAU2f(fvc::interpolate(rAU2)); - - volVectorField HbyA1("HbyA1", U1); - HbyA1 = rAU1*U1Eqn.H(); - - volVectorField HbyA2("HbyA2", U2); - HbyA2 = rAU2*U2Eqn.H(); - - mrfZones.absoluteFlux(phi1.oldTime()); - mrfZones.absoluteFlux(phi1); - - mrfZones.absoluteFlux(phi2.oldTime()); - mrfZones.absoluteFlux(phi2); - - surfaceScalarField phiDrag1 - ( - fvc::interpolate(alpha2/rho1*K*rAU1)*phi2 + rAU1f*(g & mesh.Sf()) - ); - - if (g0.value() > 0.0) - { - phiDrag1 -= ppMagf*fvc::snGrad(alpha1)*mesh.magSf(); - } - - if (kineticTheory.on()) - { - phiDrag1 -= rAU1f*fvc::snGrad(kineticTheory.pa()/rho1)*mesh.magSf(); - } - - - surfaceScalarField phiDrag2 - ( - fvc::interpolate(alpha1/rho2*K*rAU2)*phi1 + rAU2f*(g & mesh.Sf()) - ); - - // Fix for gravity on outlet boundary. - forAll(p.boundaryField(), patchi) - { - if (isA<zeroGradientFvPatchScalarField>(p.boundaryField()[patchi])) - { - phiDrag1.boundaryField()[patchi] = 0.0; - phiDrag2.boundaryField()[patchi] = 0.0; - } - } - - surfaceScalarField phiHbyA1 - ( - "phiHbyA1", - (fvc::interpolate(HbyA1) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU1, U1, phi1) - + phiDrag1 - ); - mrfZones.relativeFlux(phiHbyA1); - - surfaceScalarField phiHbyA2 - ( - "phiHbyA2", - (fvc::interpolate(HbyA2) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU2, U2, phi2) - + phiDrag2 - ); - mrfZones.relativeFlux(phiHbyA2); - - mrfZones.relativeFlux(phi1.oldTime()); - mrfZones.relativeFlux(phi1); - mrfZones.relativeFlux(phi2.oldTime()); - mrfZones.relativeFlux(phi2); - - surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2); - - surfaceScalarField Dp - ( - "Dp", - alpha1f*rAU1f/rho1 + alpha2f*rAU2f/rho2 - ); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::laplacian(Dp, p) == fvc::div(phiHbyA) - ); - - pEqn.setReference(pRefCell, pRefValue); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - surfaceScalarField SfGradp(pEqn.flux()/Dp); - - phi1 = phiHbyA1 - rAU1f*SfGradp/rho1; - phi2 = phiHbyA2 - rAU2f*SfGradp/rho2; - phi = alpha1f*phi1 + alpha2f*phi2; - - p.relax(); - SfGradp = pEqn.flux()/Dp; - - U1 = HbyA1 + fvc::reconstruct(phiDrag1 - rAU1f*SfGradp/rho1); - U1.correctBoundaryConditions(); - - U2 = HbyA2 + fvc::reconstruct(phiDrag2 - rAU2f*SfGradp/rho2); - U2.correctBoundaryConditions(); - - U = alpha1*U1 + alpha2*U2; - } - } -} - -#include "continuityErrs.H" diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H index 97891ad63929aeeaa37e6f2b50c6cd2c9c4773ae..4f85d6dad8c6b03a0e62c09df58b26d73bd7e354 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H @@ -161,7 +161,7 @@ ) ); } - else if(nuType == "field") + else if (nuType == "field") { nuIO.readOpt() = IOobject::MUST_READ; nuPtr.reset diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H index c8817c597511ee8ca0a7fc342a6c9b0044ff2ac7..afcff762e4d0e6859c38f3533558be3afee30dfd 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H @@ -81,7 +81,7 @@ if (thermalStress) ); } - else if(CType == "field") + else if (CType == "field") { CIO.readOpt() = IOobject::MUST_READ; @@ -214,7 +214,7 @@ if (thermalStress) { FatalErrorIn ( - "readThermalProperties.H" + "readThermalProperties.H" ) << "Valid type entries are uniform or field for alpha" << abort(FatalError); } @@ -228,5 +228,4 @@ if (thermalStress) threeKalpha = threeK*alpha; DT = k/C; - } diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatchDict b/applications/utilities/mesh/manipulation/createPatch/createPatchDict index 35e0b869260322ae8281672cb495b1dfdf93e70a..f731f78df975d825fb55384d244234cb00156f37 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatchDict +++ b/applications/utilities/mesh/manipulation/createPatch/createPatchDict @@ -20,6 +20,7 @@ FoamFile // - always: order faces on coupled patches such that they are opposite. This // is done for all coupled faces, not just for any patches created. // - optional: synchronise points on coupled patches. +// - always: remove zero-sized (non-coupled) patches (that were not added) // 1. Create cyclic: // - specify where the faces should come from diff --git a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C index 2518dc045023706c4e28c8ca2dce6d9fa0b68554..0969b1e5603517bf326af6d797dffd96eb470598 100644 --- a/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/manipulation/polyDualMesh/polyDualMeshApp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,6 @@ Usage #include "argList.H" #include "Time.H" -#include "timeSelector.H" #include "fvMesh.H" #include "unitConversion.H" #include "polyTopoChange.H" @@ -354,7 +353,6 @@ int main(int argc, char *argv[]) { # include "addOverwriteOption.H" argList::noParallel(); - timeSelector::addOptions(true, false); argList::validArgs.append("featureAngle [0-180]"); argList::addBoolOption @@ -376,9 +374,6 @@ int main(int argc, char *argv[]) # include "setRootCase.H" # include "createTime.H" - - instantList timeDirs = timeSelector::select0(runTime, args); - # include "createMesh.H" const word oldInstance = mesh.pointsInstance(); diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index be90a8fb80eb85a7dc22cbdfced7592b08c761d8..7a2049c6869ddb64dd82de507d1beac4ba6a5e86 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -171,13 +171,13 @@ FoamFile // insidePoint (1 2 3); // point inside region to select // } // -// // Cells underneath plane such that volume is reached. Can be used -// // in setFields. +// // Cells underneath plane such that volume is reached. E.g. for use +// // in setFields to set the level given a wanted volume. // source targetVolumeToCell; // sourceInfo // { // volume 2e-05; -// normal (1 1 1); +// normal (0 1 0); // usually in direction of gravity // } // // diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H index 123036f63afe9d1a30c205fce0efc311125d6785..8657a9cc21df4c94148e937284fb824720bd6f3c 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkMeshMoving.H @@ -1,21 +1,27 @@ -// check for "points" in all of the result directories +// check for "points" in any of the result directories -bool meshMoving = true; -if (Times.size() > 2) +bool meshMoving = false; +if (Times.size() > 1) { - for (label n1=2; n1<Times.size() && meshMoving; ++n1) + // We already loaded a mesh (usually from constant). See if any other + // points files + forAll(Times, timeI) { - meshMoving = IOobject - ( - "points", - Times[n1].name(), - polyMesh::meshSubDir, - mesh, - IOobject::NO_READ - ).headerOk(); + if (Times[timeI].name() != mesh.pointsInstance()) + { + IOobject io + ( + "points", + Times[timeI].name(), + polyMesh::meshSubDir, + mesh, + IOobject::NO_READ + ); + if (io.headerOk()) + { + meshMoving = true; + break; + } + } } } -else -{ - meshMoving = false; -} diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index b8fe91fcfe3ec8ce87e75deaa578d02b245fd4ee..8a44c5411b3fe81208f7e336163ff8814d6fa4db 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1014,6 +1014,7 @@ void Foam::ensightMesh::write const fileName& postProcPath, const word& prepend, const label timeIndex, + const bool meshMoving, Ostream& ensightCaseFile ) const { @@ -1027,7 +1028,7 @@ void Foam::ensightMesh::write { timeFile += "000."; } - else if (mesh_.moving()) + else if (meshMoving) { timeFile += itoa(timeIndex) + '.'; } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H index 6d860dfc9176b741a2bab844db5bb375cc046953..ffcbf61d660e1e9dd6c2a740462f1fbaa716136b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -380,6 +380,7 @@ public: const fileName& postProcPath, const word& prepend, const label timeIndex, + const bool meshMoving, Ostream& ensightCaseFile ) const; diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index e9a942f38a24b47796a74d9e9db4d94a304cf314..05db6c0d05b47bffad3db9925a501190a7645e94 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -228,6 +228,13 @@ int main(int argc, char *argv[]) # include "checkMeshMoving.H" + if (meshMoving) + { + Info<< "Detected a moving mesh (multiple polyMesh/points files)." + << " Writing meshes for every timestep." << endl; + } + + wordHashSet allCloudNames; if (Pstream::master()) { @@ -346,13 +353,14 @@ int main(int argc, char *argv[]) eMesh.correct(); } - if (timeIndex == 0 || (meshState != polyMesh::UNCHANGED)) + if (timeIndex == 0 || meshMoving) { eMesh.write ( ensightDir, prepend, timeIndex, + meshMoving, ensightCaseFile ); } diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index 41c09b6053c7cb08aaa4c62f13fea1ad772dbb74..ebc43d84f23e2dbf09c01ac2536c5f6f993e1ae2 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -27,7 +27,6 @@ Description \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "timeSelector.H" #include "Time.H" #include "fvMesh.H" #include "topoSetSource.H" @@ -360,14 +359,8 @@ public: int main(int argc, char *argv[]) { - timeSelector::addOptions(); - # include "setRootCase.H" # include "createTime.H" - - // Get times list - instantList timeDirs = timeSelector::select0(runTime, args); - # include "createMesh.H" Info<< "Reading setFieldsDict\n" << endl; diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C index 357b2bd19832777f7f534bfb8bf51c1156c6b364..305786f963dbc8fd30ecac409b5e451bcc396ac8 100644 --- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C +++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,6 @@ Note \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "timeSelector.H" #include "Time.H" #include "MeshedSurfaces.H" diff --git a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C index 92f0ffbd3d6e88a72e9e668550da082ced839f83..cbc5059f10b0e8d6e5f8a310025c3aef55309a24 100644 --- a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C +++ b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,7 +52,6 @@ Note \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "timeSelector.H" #include "Time.H" #include "polyMesh.H" #include "triSurface.H" diff --git a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C index c9b7d621135dfa2e51837934ebff6bd444166a39..7c9b3be904d7989160b98d77602da3c2564efb9b 100644 --- a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C +++ b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,7 +59,6 @@ Note \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "timeSelector.H" #include "Time.H" #include "MeshedSurfaces.H" diff --git a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C index e9f7f63710449af212343a475141fad58475d1e0..3a14ac63c42371d6e4dd20c69cfaa570b57596d3 100644 --- a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C +++ b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,7 +59,6 @@ Note \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "timeSelector.H" #include "Time.H" #include "MeshedSurfaces.H" diff --git a/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C b/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C index 08e6a99b38ee7f3069e350130fe4f671ee0136b2..80638bf4dbdc79fbab0024a32c0c2faa8c5c6ed6 100644 --- a/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C +++ b/applications/utilities/surface/surfaceMeshInfo/surfaceMeshInfo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,6 @@ Note \*---------------------------------------------------------------------------*/ #include "argList.H" -#include "timeSelector.H" #include "Time.H" #include "UnsortedMeshedSurfaces.H" diff --git a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C index 8585392e27dc752bec57205c6d79aede16da8a56..e620b3b9423c4bc20f55793e1a27a59b300ed511 100644 --- a/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C +++ b/src/OpenFOAM/db/IOobjects/IOdictionary/IOdictionaryIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -95,7 +95,9 @@ void Foam::IOdictionary::readFile(const bool masterOnly) } // Note: use ASCII for now - binary IO of dictionaries is - // not currently supported + // not currently supported or rather the primitiveEntries of + // the dictionary think they are in binary form whereas they are + // not. Could reset all the ITstreams to ascii? IPstream fromAbove ( Pstream::scheduled, diff --git a/src/OpenFOAM/db/Time/timeSelector.C b/src/OpenFOAM/db/Time/timeSelector.C index 865f3ee9116584243a91bfa8782611b87baf1d44..60b589a347478408fc08fbb026f468da0e6db971 100644 --- a/src/OpenFOAM/db/Time/timeSelector.C +++ b/src/OpenFOAM/db/Time/timeSelector.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -147,7 +147,7 @@ void Foam::timeSelector::addOptions ( "time", "ranges", - "comma-separated time ranges - eg, ':10,20,40-70,1000:'" + "comma-separated time ranges - eg, ':10,20,40:70,1000:'" ); } diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C index 03ce2b76a7f4df417d74029d2ffd1f7959f32dbb..aa1321d9147a4361e270007e5d18e463744a7e84 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,6 +80,12 @@ Foam::autoPtr<Foam::dictionary> Foam::dictionary::New(Istream& is) bool Foam::dictionary::read(Istream& is, const bool keepHeader) { + // Check for empty dictionary + if (is.eof()) + { + return true; + } + if (!is.good()) { FatalIOErrorIn("dictionary::read(Istream&, bool)", is) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H index 3a3c234821556864222c212cb55c8eab8beacc9d..1f9c51ac9f6a8398f913193faa6cd53e61c961d8 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.H @@ -323,8 +323,6 @@ class globalMeshData // its own master. Maybe store as well? void calcGlobalCoPointSlaves() const; - const labelListList& globalCoPointSlaves() const; - const mapDistribute& globalCoPointSlavesMap() const; //- Disallow default bitwise copy construct @@ -547,6 +545,11 @@ public: //- Is my edge same orientation as master edge const PackedBoolList& globalEdgeOrientation() const; + // Collocated point to collocated point + + const labelListList& globalCoPointSlaves() const; + const mapDistribute& globalCoPointSlavesMap() const; + // Coupled point to boundary faces. These are uncoupled boundary // faces only but include empty patches. diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index 7ecd1b84a13f924311e71813cd5239e9410de66b..b4333fc3a78f5bd236c11ac86e322772d86c3385 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -339,6 +339,31 @@ bool Foam::globalPoints::storeInitialInfo } +void Foam::globalPoints::printProcPoint +( + const labelList& patchToMeshPoint, + const labelPair& pointInfo +) const +{ + label procI = globalIndexAndTransform::processor(pointInfo); + label index = globalIndexAndTransform::index(pointInfo); + label trafoI = globalIndexAndTransform::transformIndex(pointInfo); + + Pout<< " proc:" << procI; + Pout<< " localpoint:"; + Pout<< index; + Pout<< " through transform:" + << trafoI << " bits:" + << globalTransforms_.decodeTransformIndex(trafoI); + + if (procI == Pstream::myProcNo()) + { + label meshPointI = localToMeshPoint(patchToMeshPoint, index); + Pout<< " at:" << mesh_.points()[meshPointI]; + } +} + + void Foam::globalPoints::printProcPoints ( const labelList& patchToMeshPoint, @@ -347,23 +372,7 @@ void Foam::globalPoints::printProcPoints { forAll(pointInfo, i) { - label procI = globalIndexAndTransform::processor(pointInfo[i]); - label index = globalIndexAndTransform::index(pointInfo[i]); - label trafoI = globalIndexAndTransform::transformIndex(pointInfo[i]); - - Pout<< " proc:" << procI; - Pout<< " localpoint:"; - Pout<< index; - Pout<< " through transform:" - << trafoI << " bits:" - << globalTransforms_.decodeTransformIndex(trafoI); - - if (procI == Pstream::myProcNo()) - { - label meshPointI = localToMeshPoint(patchToMeshPoint, index); - Pout<< " at:" << mesh_.points()[meshPointI]; - } - + printProcPoint(patchToMeshPoint, pointInfo[i]); Pout<< endl; } } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H index daef012fe70d5b3b31349488ebfe3a5493ff43e9..de7a6b88d0f8b358f47c61761d640314ac410fae 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -206,6 +206,12 @@ class globalPoints ); //- Debug printing + void printProcPoint + ( + const labelList& patchToMeshPoint, + const labelPair& pointInfo + ) const; + void printProcPoints ( const labelList& patchToMeshPoint, diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C index 9a9830545e8fb638473bf4b8ad8f42fc4eb5347f..d765e9f60b7742b2b0846f3b08bec092a36e6d32 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C @@ -97,6 +97,16 @@ void Foam::polyMesh::clearAddressing() geometricD_ = Vector<label>::zero; solutionD_ = Vector<label>::zero; + // Update zones + pointZones_.clearAddressing(); + faceZones_.clearAddressing(); + cellZones_.clearAddressing(); + + // Remove the stored tet base points + tetBasePtIsPtr_.clear(); + // Remove the cell tree + cellTreePtr_.clear(); + pointMesh::Delete(*this); } diff --git a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryFwd.H b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..326a2a425902c5c4ee7ae126d8960b69c41cd7c7 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryFwd.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef DataEntryFws_H +#define DataEntryFws_H + +#include "DataEntry.H" +#include "vector.H" +#include "symmTensor.H" +#include "sphericalTensor.H" +#include "tensor.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef DataEntry<label> labelDataEntry; + typedef DataEntry<scalar> scalarDataEntry; + typedef DataEntry<vector> vectorDataEntry; + typedef DataEntry<symmTensor> symmTensorDataEntry; + typedef DataEntry<sphericalTensor> sphericalTensorDataEntry; + typedef DataEntry<tensor> tensorDataEntry; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C index d015aede93834a61923714029fbce6341e66944a..cfbaec7424778795dc2e62167bb2c8c223d3f05b 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.C @@ -25,14 +25,14 @@ License #include "polynomial.H" #include "Time.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(polynomial, 0); - DataEntry<scalar>::adddictionaryConstructorToTable<polynomial> - addpolynomialConstructorToTable_; + addToRunTimeSelectionTable(scalarDataEntry, polynomial, dictionary); } @@ -40,7 +40,7 @@ namespace Foam Foam::polynomial::polynomial(const word& entryName, const dictionary& dict) : - DataEntry<scalar>(entryName), + scalarDataEntry(entryName), coeffs_(), canIntegrate_(true), dimensions_(dimless) @@ -52,15 +52,17 @@ Foam::polynomial::polynomial(const word& entryName, const dictionary& dict) is.putBack(firstToken); if (firstToken == token::BEGIN_SQR) { - is >> this->dimensions_; + is >> this->dimensions_; } is >> coeffs_; if (!coeffs_.size()) { - FatalErrorIn("Foam::polynomial::polynomial(const word&, dictionary&)") - << "polynomial coefficients for entry " << this->name_ + FatalErrorIn + ( + "Foam::polynomial::polynomial(const word&, const dictionary&)" + ) << "polynomial coefficients for entry " << this->name_ << " are invalid (empty)" << nl << exit(FatalError); } @@ -77,8 +79,10 @@ Foam::polynomial::polynomial(const word& entryName, const dictionary& dict) { if (!canIntegrate_) { - WarningIn("Foam::polynomial::polynomial(const word&, dictionary&)") - << "Polynomial " << this->name_ << " cannot be integrated" + WarningIn + ( + "Foam::polynomial::polynomial(const word&, const dictionary&)" + ) << "Polynomial " << this->name_ << " cannot be integrated" << endl; } } @@ -91,7 +95,7 @@ Foam::polynomial::polynomial const List<Tuple2<scalar, scalar> >& coeffs ) : - DataEntry<scalar>(entryName), + scalarDataEntry(entryName), coeffs_(coeffs), canIntegrate_(true), dimensions_(dimless) @@ -101,7 +105,7 @@ Foam::polynomial::polynomial FatalErrorIn ( "Foam::polynomial::polynomial" - "(const word&, const List<Tuple2<scalar, scalar> >&&)" + "(const word&, const List<Tuple2<scalar, scalar> >&)" ) << "polynomial coefficients for entry " << this->name_ << " are invalid (empty)" << nl << exit(FatalError); } @@ -122,7 +126,7 @@ Foam::polynomial::polynomial WarningIn ( "Foam::polynomial::polynomial" - "(const word&, const List<Tuple2<scalar, scalar> >&&)" + "(const word&, const List<Tuple2<scalar, scalar> >&)" ) << "Polynomial " << this->name_ << " cannot be integrated" << endl; } @@ -132,7 +136,7 @@ Foam::polynomial::polynomial Foam::polynomial::polynomial(const polynomial& poly) : - DataEntry<scalar>(poly), + scalarDataEntry(poly), coeffs_(poly.coeffs_), canIntegrate_(poly.canIntegrate_), dimensions_(poly.dimensions_) @@ -201,7 +205,8 @@ Foam::dimensioned<Foam::scalar> Foam::polynomial::dimValue Foam::dimensioned<Foam::scalar> Foam::polynomial::dimIntegrate ( - const scalar x1, const scalar x2 + const scalar x1, + const scalar x2 ) const { return dimensioned<scalar> @@ -212,4 +217,5 @@ Foam::dimensioned<Foam::scalar> Foam::polynomial::dimIntegrate ); } + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H index dc4fc7986b59fcb12220b16daa62d8673eff923b..3e181c078755cc1178afcaa5218d2b6321e19b44 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/polynomial/polynomial.H @@ -48,6 +48,7 @@ SourceFiles #include "DataEntry.H" #include "Tuple2.H" #include "dimensionSet.H" +#include "DataEntryFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,7 +71,7 @@ Ostream& operator<< class polynomial : - public DataEntry<scalar> + public scalarDataEntry { // Private data @@ -107,9 +108,9 @@ public: polynomial(const polynomial& poly); //- Construct and return a clone - virtual tmp<DataEntry<scalar> > clone() const + virtual tmp<scalarDataEntry> clone() const { - return tmp<DataEntry<scalar> >(new polynomial(*this)); + return tmp<scalarDataEntry>(new polynomial(*this)); } diff --git a/src/Pstream/mpi/UIPread.C b/src/Pstream/mpi/UIPread.C index bcc6f4c41286d1cdbf34734d05a923424bee025e..19d6b161122d2f85b84fbbcc2ba4f48af85d4df8 100644 --- a/src/Pstream/mpi/UIPread.C +++ b/src/Pstream/mpi/UIPread.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,12 +107,7 @@ Foam::UIPstream::UIPstream if (!messageSize_) { - FatalErrorIn - ( - "UIPstream::UIPstream(const commsTypes, const int, " - "DynamicList<char>&, streamFormat, versionNumber)" - ) << "read failed" - << Foam::abort(FatalError); + setEof(); } } } @@ -199,11 +194,7 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers) if (!messageSize_) { - FatalErrorIn - ( - "UIPstream::UIPstream(const int, PstreamBuffers&)" - ) << "read failed" - << Foam::abort(FatalError); + setEof(); } } } diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index 26f58505a7e60cf39920e6f68f990128291f3608..9d86d1038488b0fe878d7bbbfc7b502088f6d5f4 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -272,7 +272,7 @@ void FSD<CombThermoType, ThermoType>::calculateSourceNorm() forAll(ft_, cellI) { - if(ft_[cellI] < ftStoich) + if (ft_[cellI] < ftStoich) { pc[cellI] = ft_[cellI]*(YprodTotal/ftStoich); } diff --git a/src/combustionModels/Make/files b/src/combustionModels/Make/files index 20de91ecc6ff731a1adc6a14a1ce782ddc5bfbba..88e81afe8bc55174ae2d5a686b5f298781ecded3 100644 --- a/src/combustionModels/Make/files +++ b/src/combustionModels/Make/files @@ -10,6 +10,7 @@ rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C rhoCombustionModel/rhoThermoCombustion/rhoThermoCombustion.C rhoCombustionModel/rhoChemistryCombustion/rhoChemistryCombustion.C +diffusion/diffusions.C infinitelyFastChemistry/infinitelyFastChemistrys.C PaSR/PaSRs.C diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index cd12d896e0dc8bf29841b843595c53761c3d1e6d..d90eb6835770540d11cf8483614e596a43c085f0 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -138,7 +138,7 @@ void Foam::combustionModels::PaSR<Type>::correct() template<class Type> Foam::tmp<Foam::fvScalarMatrix> -Foam::combustionModels::PaSR<Type>::R(const volScalarField& Y) const +Foam::combustionModels::PaSR<Type>::R(volScalarField& Y) const { tmp<fvScalarMatrix> tSu(new fvScalarMatrix(Y, dimMass/dimTime)); diff --git a/src/combustionModels/PaSR/PaSR.H b/src/combustionModels/PaSR/PaSR.H index 4c4c3347e5e31fec3c7aab3fab66f32cea01e84f..fba886f8ac3027c3c628d6a1b4ee48289c39beef 100644 --- a/src/combustionModels/PaSR/PaSR.H +++ b/src/combustionModels/PaSR/PaSR.H @@ -103,7 +103,7 @@ public: virtual void correct(); //- Fuel consumption rate matrix. - virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const; + virtual tmp<fvScalarMatrix> R(volScalarField& Y) const; //- Heat release rate calculated from fuel consumption rate matrix virtual tmp<volScalarField> dQ() const; diff --git a/src/combustionModels/combustionModel/combustionModel.H b/src/combustionModels/combustionModel/combustionModel.H index 36322adf843947cbb4e81a118c084dc81d07042b..46077de9e4c417609b53b386cd4c7515bbf3a5ba 100644 --- a/src/combustionModels/combustionModel/combustionModel.H +++ b/src/combustionModels/combustionModel/combustionModel.H @@ -135,7 +135,7 @@ public: virtual void correct() = 0; //- Fuel consumption rate matrix, i.e. source term for fuel equation - virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const = 0; + virtual tmp<fvScalarMatrix> R(volScalarField& Y) const = 0; //- Heat release rate calculated from fuel consumption rate matrix virtual tmp<volScalarField> dQ() const = 0; diff --git a/src/combustionModels/diffusion/diffusion.C b/src/combustionModels/diffusion/diffusion.C new file mode 100644 index 0000000000000000000000000000000000000000..44e413dfc0fc9c18e71bfc715820df210a76fc93 --- /dev/null +++ b/src/combustionModels/diffusion/diffusion.C @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + + 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "diffusion.H" +#include "fvcGrad.H" + +namespace Foam +{ +namespace combustionModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CombThermoType, class ThermoType> +diffusion<CombThermoType, ThermoType>::diffusion +( + const word& modelType, const fvMesh& mesh +) +: + singleStepCombustion<CombThermoType, ThermoType>(modelType, mesh), + C_(readScalar(this->coeffs().lookup("C"))), + oxidantName_(this->coeffs().template lookupOrDefault<word>("oxidant", "O2")) +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // + +template<class CombThermoType, class ThermoType> +diffusion<CombThermoType, ThermoType>::~diffusion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class CombThermoType, class ThermoType> +void diffusion<CombThermoType, ThermoType>::correct() +{ + this->wFuel_ == + dimensionedScalar("zero", dimMass/pow3(dimLength)/dimTime, 0.0); + + if (this->active()) + { + this->singleMixturePtr_->fresCorrect(); + + const label fuelI = this->singleMixturePtr_->fuelIndex(); + + const volScalarField& YFuel = + this->thermoPtr_->composition().Y()[fuelI]; + + if (this->thermoPtr_->composition().contains(oxidantName_)) + { + const volScalarField& YO2 = + this->thermoPtr_->composition().Y(oxidantName_); + + this->wFuel_ == + C_*this->turbulence().muEff() + *mag(fvc::grad(YFuel) & fvc::grad(YO2)) + *pos(YFuel)*pos(YO2); + } + } +} + + +template<class CombThermoType, class ThermoType> +bool diffusion<CombThermoType, ThermoType>::read() +{ + if (singleStepCombustion<CombThermoType, ThermoType>::read()) + { + this->coeffs().lookup("C") >> C_ ; + this->coeffs().readIfPresent("oxidant", oxidantName_); + return true; + } + else + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/diffusion/diffusion.H b/src/combustionModels/diffusion/diffusion.H new file mode 100644 index 0000000000000000000000000000000000000000..c3002a894f790ce4689214e46d58b108a4c9ad5b --- /dev/null +++ b/src/combustionModels/diffusion/diffusion.H @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + + 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 3 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, see <http://www.gnu.org/licenses/>. + +Class + Foam::combustionModels::diffusion + +Description + Simple diffusion-based combustion model based on the principle mixed is + burnt. Additional parameter C is used to distribute the heat release rate + in time. + +SourceFiles + diffusion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef diffusion_H +#define diffusion_H + +#include "singleStepCombustion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + +/*---------------------------------------------------------------------------*\ + Class diffusion Declaration +\*---------------------------------------------------------------------------*/ + +template<class CombThermoType, class ThermoType> +class diffusion +: + public singleStepCombustion<CombThermoType, ThermoType> +{ + // Private data + + //- Model constant + scalar C_; + + //- Name of oxidant - default is "O2" + word oxidantName_; + + + // Private Member Functions + + //- Disallow copy construct + diffusion(const diffusion&); + + //- Disallow default bitwise assignment + void operator=(const diffusion&); + + +public: + + //- Runtime type information + TypeName("diffusion"); + + + // Constructors + + //- Construct from components + diffusion(const word& modelType, const fvMesh& mesh); + + + //- Destructor + virtual ~diffusion(); + + + // Member Functions + + // Evolution + + //- Correct combustion rate + virtual void correct(); + + + // I-O + + //- Update properties + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace combustionModels +} // End namespace Foam + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "diffusion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/combustionModels/diffusion/diffusions.C b/src/combustionModels/diffusion/diffusions.C new file mode 100644 index 0000000000000000000000000000000000000000..73c201f0fcc483897c74dba408c4c68ee2bf6156 --- /dev/null +++ b/src/combustionModels/diffusion/diffusions.C @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "makeCombustionTypes.H" + +#include "thermoPhysicsTypes.H" +#include "psiThermoCombustion.H" +#include "rhoThermoCombustion.H" +#include "diffusion.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace combustionModels +{ + makeCombustionTypesThermo + ( + diffusion, + psiThermoCombustion, + gasThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + psiThermoCombustion, + constGasThermoPhysics, + psiCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + rhoThermoCombustion, + gasThermoPhysics, + rhoCombustionModel + ); + + makeCombustionTypesThermo + ( + diffusion, + rhoThermoCombustion, + constGasThermoPhysics, + rhoCombustionModel + ); +} +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/combustionModels/noCombustion/noCombustion.C b/src/combustionModels/noCombustion/noCombustion.C index 3abdedaf29757a6c8d8ce388d6f35cde970b2918..aa38aad70fc50814a7189d59e8cdc5231717e4aa 100644 --- a/src/combustionModels/noCombustion/noCombustion.C +++ b/src/combustionModels/noCombustion/noCombustion.C @@ -59,7 +59,7 @@ template<class CombThermoType> Foam::tmp<Foam::fvScalarMatrix> Foam::combustionModels::noCombustion<CombThermoType>::R ( - const volScalarField& Y + volScalarField& Y ) const { tmp<fvScalarMatrix> tSu diff --git a/src/combustionModels/noCombustion/noCombustion.H b/src/combustionModels/noCombustion/noCombustion.H index 8e845d43f140b179f62efbf28a5b796aded5a360..d8f8f39912d4fee0fd5c1d22c4dd1e1a53d1cc25 100644 --- a/src/combustionModels/noCombustion/noCombustion.H +++ b/src/combustionModels/noCombustion/noCombustion.H @@ -84,8 +84,8 @@ public: //- Correct combustion rate virtual void correct(); - //- Fuel consumption rate matrix. - virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const; + //- Fuel consumption rate matrix + virtual tmp<fvScalarMatrix> R(volScalarField& Y) const; //- Heat release rate calculated from fuel consumption rate matrix virtual tmp<volScalarField> dQ() const; diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.C b/src/combustionModels/singleStepCombustion/singleStepCombustion.C index fcbf4249d98d6330c01d45d36d530c80410be79e..1acc4bcf013d2832879c2c3d665a375d19b9fa99 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.C +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.C @@ -53,7 +53,8 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion ), this->mesh(), dimensionedScalar("zero", dimMass/dimVolume/dimTime, 0.0) - ) + ), + semiImplicit_(readBool(this->coeffs_.lookup("semiImplicit"))) { if (isA<singleStepReactingMixture<ThermoType> >(this->thermo())) { @@ -79,6 +80,15 @@ singleStepCombustion<CombThermoType, ThermoType>::singleStepCombustion << "Please select a thermo package based on " << "singleStepReactingMixture" << exit(FatalError); } + + if (semiImplicit_) + { + Info<< "Combustion mode: semi-implicit" << endl; + } + else + { + Info<< "Combustion mode: explicit" << endl; + } } @@ -94,17 +104,28 @@ singleStepCombustion<CombThermoType, ThermoType>::~singleStepCombustion() template<class CombThermoType, class ThermoType> tmp<fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R ( - const volScalarField& Y + volScalarField& Y ) const { const label specieI = this->thermoPtr_->composition().species()[Y.name()]; - const volScalarField wSpecie + volScalarField wSpecie ( wFuel_*singleMixturePtr_->specieStoichCoeffs()[specieI] ); - return wSpecie + fvm::Sp(0.0*wSpecie, Y); + if (semiImplicit_) + { + const label fNorm = singleMixturePtr_->specieProd()[specieI]; + const volScalarField fres(singleMixturePtr_->fres(specieI)); + wSpecie /= max(fNorm*(Y - fres), 1e-2); + + return -fNorm*wSpecie*fres + fNorm*fvm::Sp(wSpecie, Y); + } + else + { + return wSpecie + fvm::Sp(0.0*wSpecie, Y); + } } @@ -113,7 +134,8 @@ tmp<volScalarField> singleStepCombustion<CombThermoType, ThermoType>::Sh() const { const label fuelI = singleMixturePtr_->fuelIndex(); - const volScalarField& YFuel = this->thermoPtr_->composition().Y(fuelI); + volScalarField& YFuel = + const_cast<volScalarField&>(this->thermoPtr_->composition().Y(fuelI)); return -singleMixturePtr_->qFuel()*(R(YFuel) & YFuel); } diff --git a/src/combustionModels/singleStepCombustion/singleStepCombustion.H b/src/combustionModels/singleStepCombustion/singleStepCombustion.H index fd743247b3f3efd763acd76b94a5246e9a76f82f..7d691396ae803e76e045715caf82587bf582dd33 100644 --- a/src/combustionModels/singleStepCombustion/singleStepCombustion.H +++ b/src/combustionModels/singleStepCombustion/singleStepCombustion.H @@ -71,6 +71,9 @@ protected: //- Fuel consumption rate volScalarField wFuel_; + //- Semi-implicit (true) or explicit (false) treatment + bool semiImplicit_; + public: @@ -89,7 +92,7 @@ public: // Evolution //- Fuel consumption rate matrix - virtual tmp<fvScalarMatrix> R(const volScalarField& Y) const; + virtual tmp<fvScalarMatrix> R(volScalarField& Y) const; //- Heat release rate calculated from fuel consumption rate matrix virtual tmp<volScalarField> dQ() const; diff --git a/src/fieldSources/basicSource/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C b/src/fieldSources/basicSource/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C index f9ffec2938f01b52d310387ae2a24ad6f7673811..3135f89124baa16e325371c253841c6affa2ebf9 100644 --- a/src/fieldSources/basicSource/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C +++ b/src/fieldSources/basicSource/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C @@ -68,17 +68,11 @@ void Foam::interRegionHeatTransferModel::check() } } - if(!secSourceFound) + if (!secSourceFound) { FatalErrorIn ( - "constantHeatTransfer::interRegionHeatTransferModel" - "(" - " const word& name," - " const word& modelType," - " const dictionary& dict," - " const fvMesh& mesh" - ")" + "constantHeatTransfer::interRegionHeatTransferModel::check()" ) << "Secondary source name not found" << secondarySourceName_ << " in region " << secondaryMesh.name() << nl @@ -125,9 +119,12 @@ Foam::interRegionHeatTransferModel::interRegionHeatTransferModel } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + Foam::interRegionHeatTransferModel::~interRegionHeatTransferModel() {} + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -222,7 +219,7 @@ void Foam::interRegionHeatTransferModel::addSup << endl; } } - else if(h.dimensions() == dimTemperature) + else if (h.dimensions() == dimTemperature) { eEqn += htc_*Tmapped - fvm::Sp(htc_, h); @@ -269,4 +266,6 @@ bool Foam::interRegionHeatTransferModel::read(const dictionary& dict) return false; } } + + // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C index 444a3ea86a54c600f4894f8ceb1eeff96f85e900..9f25a143e2e7595e5c0e15aa410a7f49feec5533 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C @@ -96,21 +96,20 @@ Foam::calculatedFvPatchField<Type>::calculatedFvPatchField template<class Type> -template<class Type2> Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::NewCalculatedType ( - const fvPatchField<Type2>& pf + const fvPatch& p ) { typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(pf.patch().type()); + patchConstructorTablePtr_->find(p.type()); if (patchTypeCstrIter != patchConstructorTablePtr_->end()) { return patchTypeCstrIter() ( - pf.patch(), + p, DimensionedField<Type, volMesh>::null() ); } @@ -120,7 +119,7 @@ Foam::fvPatchField<Type>::NewCalculatedType ( new calculatedFvPatchField<Type> ( - pf.patch(), + p, DimensionedField<Type, volMesh>::null() ) ); @@ -128,6 +127,17 @@ Foam::fvPatchField<Type>::NewCalculatedType } +template<class Type> +template<class Type2> +Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::NewCalculatedType +( + const fvPatchField<Type2>& pf +) +{ + return NewCalculatedType(pf.patch()); +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> @@ -177,6 +187,7 @@ Foam::calculatedFvPatchField<Type>::valueBoundaryCoeffs return *this; } + template<class Type> Foam::tmp<Foam::Field<Type> > Foam::calculatedFvPatchField<Type>::gradientInternalCoeffs() const @@ -198,6 +209,7 @@ Foam::calculatedFvPatchField<Type>::gradientInternalCoeffs() const return *this; } + template<class Type> Foam::tmp<Foam::Field<Type> > Foam::calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const diff --git a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H index 7c475c1111e0dfeaa645c21c391ddd5f887df11f..77dba4ada89c626699bbf8d1605e517d40adb75d 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/mixed/mixedFvPatchField.H @@ -57,7 +57,7 @@ Description refGrad | patch normal gradient | yes | \endtable - \note +Note This condition is not usually applied directly; instead, use a derived mixed condition such as \c inletOutlet diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H index 85a03380f018106dbec88867fc750c5ce928d51e..ded4696854e3520dd9938dd934c97444f4117b01 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H @@ -31,11 +31,6 @@ Description This boundary condition enforces a cyclic condition between a pair of boundaries. - \note - The patches must be topologically similar, i.e. if the owner patch is - transformed to the neighbour patch, the patches should be identical (or - very similar). - \heading Patch usage Example of the boundary condition specification: @@ -46,6 +41,11 @@ Description } \endverbatim +Note + The patches must be topologically similar, i.e. if the owner patch is + transformed to the neighbour patch, the patches should be identical (or + very similar). + SourceFiles cyclicFvPatchField.C diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H index cef14ae106f08781acf037e3837acbbfd18ecd96..c9ad16c6c951b83c3013715a0dd494626b90ac1f 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H @@ -32,11 +32,6 @@ Description boundaries, whereby communication between the patches is performed using an arbitrary mesh interface (AMI) interpolation. - \note - The outer boundary of the patch pairs must be similar, i.e. if the owner - patch is transformed to the neighbour patch, the outer perimiter of each - patch should be identical (or very similar). - \heading Patch usage Example of the boundary condition specification: @@ -47,6 +42,11 @@ Description } \endverbatim +Note + The outer boundary of the patch pairs must be similar, i.e. if the owner + patch is transformed to the neighbour patch, the outer perimiter of each + patch should be identical (or very similar). + SeeAlso Foam::AMIInterpolation diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H index 305beeaced89a4d07e055cdaf71adc67442c425c..5c62df1049fee116021c0d744b2751ab70533425 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H @@ -58,22 +58,19 @@ Description lInf | distance beyond patch for \c fieldInf | no | \endtable - \note - If \c lInf is specified, \c fieldInf will be required; \c rho is only - required in the case of a mass-based flux. - Example of the boundary condition specification: \verbatim myPatch { type advective; phi phi; - // rho rho; // Not needed for volumetric-based flux - // fieldInf 1e5; // Optional - // lInf 0.1; // Optional } \endverbatim +Note + If \c lInf is specified, \c fieldInf will be required; \c rho is only + required in the case of a mass-based flux. + SourceFiles advectiveFvPatchField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H index 482b365f2a94ea6b731850b24f3a0f88e62930bc..4e3db2fdfffd9905329be552615d50986c8a7e90 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.H @@ -56,7 +56,7 @@ Description } \endverbatim - \note +Note The \c axialVelocity, \c radialVelocity and \c rpm entries are DataEntry types, able to describe time varying functions. The example above gives the usage for supplying constant values. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 9306796d799c61f073f56c93a0fcf49bb6da7a4e..3eea1382f39400ec5f98a6b1ed4e3109459d87df 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -66,7 +66,7 @@ Description The above example shows the use of a comma separated (CSV) file to specify the jump condition. - \note +Note The underlying \c patchType should be set to \c cyclic SeeAlso diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H index 2fdd5f71b4eac55e81c1fffbb100270f25ea6fa5..75a9742240f757ddefce2e4f1b64e4ecf6b1e1f7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedInternalValueFvPatchField/fixedInternalValueFvPatchField.H @@ -43,7 +43,7 @@ Description } \endverbatim - \note +Note This is used as a base for conditions such as the turbulence \c epsilon wall function, which applies a near-wall constraint for high Reynolds number flows. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index 983edbfa92eb512401158ff262be22a6122d93c1..30ec57fc54eb35c11df20a7f18fcfdde72f659be 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -30,7 +30,7 @@ Group Description Base class for "jump" of a field<type> - \note +Note not used directly SeeAlso diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index f15d4e666a5cfd40bd5880b274e0e03b5b4bf4b3..0b78dddc225797cc74508f6495510e9acab1e46d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -64,7 +64,7 @@ Description The \c flowRate entry is a \c DataEntry type, meaning that it can be specified as constant, a polynomial fuction of time, and ... - \note +Note - the value is positive into the domain (as an inlet) - may not work correctly for transonic inlets - strange behaviour with potentialFoam since the U equation is not solved diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H index 059c3addfd6c7844a0e48f205d24a2581d5b6af7..4519a5ed9d2f1063ff3466a52b83a28375536620 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.H @@ -64,7 +64,7 @@ Description } \endverbatim - \note +Note If reverse flow is possible or expected use the pressureInletOutletVelocity condition instead. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H index ae082c5da33b1d302159cb115fbcae3b6f36357d..fa5233308c8ac7c3e4f24c3f85c29a5e680a9c0e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.H @@ -42,7 +42,7 @@ Description } \endverbatim - \note +Note This condition is designed to operate with a freestream velocity condition SeeAlso diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H index d97e6eb8173880c22bd580ab0cd1e68e5e74d79d..21aea3aa9137b8da785676805c0239fa03d92478 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.H @@ -53,7 +53,7 @@ Description The mode of operation is determined by the sign of the flux across the patch faces. - \note +Note Sign conventions: - positive flux (out of domain): apply zero-gradient condition - negative flux (into of domain): apply the user-specified fixed value diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H index bb413a141c228ab3d9a3c3521349e924ef6ac531..6dd9f3efb5c8579b8c9c966394d4aa34a5e8685a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.H @@ -53,7 +53,7 @@ Description } \endverbatim - \note +Note Since this condition can be applied on a per-field and per-patch basis, it is possible to duplicate the mapping information. If possible, employ the \c mapped condition in preference to avoid this situation, and only diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H index dbf659587948622ffc013934d3105831bd35fe99..a4b48fce8faa69d99c7087d5a11b2562aac6d9a7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.H @@ -51,7 +51,7 @@ Description } \endverbatim - \note +Note This boundary condition can only be applied to patches that are of the \c mappedPolyPatch type. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H index 04ec0c4ef7e7731f60ff22d6583e81ba23fd4785..2f9ecedd66db14332ef11e55141232c91a9d9bfd 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchField.H @@ -52,7 +52,7 @@ Description } \endverbatim - \note +Note This boundary condition can only be applied to patches that are of the \c mappedPolyPatch type. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H index 672889d3256b238b609ead36bdb72b370c37c76e..dd52f2a2b635b725368edc81cf7654ccdeab7485 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.H @@ -65,7 +65,7 @@ Description boundary faces and both faces sample into the cell, both faces will get the same value. - \note +Note It is not possible to sample internal faces since volume fields are not defined on faces. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H index 8dac3f6f56d35b55786211418cd0c4279e5e6c01..409154eaffd5d0b68a1858c27cc63f7dbcd9a04d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.H @@ -51,7 +51,7 @@ Description The underlying sample mode should be set to \c nearestPatchFace or \c nearestFace - \note +Note This boundary condition can only be applied to patches that are of the \c mappedPolyPatch type. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H index af8ac75a74ed16a544acdb55a8c51f1471404b9f..c4d906669633525af6f63fc64c833d4ea6a1c592 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H @@ -68,7 +68,7 @@ Description } \endverbatim - \note +Note The amplitude and frequency entries are DataEntry types, able to describe time varying functions. The example above gives the usage for supplying constant values. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H index 53d47a3592f3a773d18409056e14f61c8d13fa6f..d843815a5f44e2530b4694272f782ca515c4d2c4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.H @@ -53,7 +53,7 @@ Description The mode of operation is determined by the sign of the flux across the patch faces. - \note +Note Sign conventions: - positive flux (out of domain): apply the user-specified fixed value - negative flux (into of domain): apply zero-gradient condition diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H index d12d390ea1c56e08160aa40062c58a085e660c71..b6e24c73c7ba1bf0c607a493878a0c443ea370b4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.H @@ -54,7 +54,7 @@ Description } \endverbatim - \note +Note Sign conventions: - positive flux (out of domain): apply zero-gradient condition - negative flux (into of domain): derive from the flux with specified diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H index a7ea670a9bbe7e8f64d40bf2f5c5160f34c89f47..c98ad304dad165baa2474d07606af357849222b9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.H @@ -53,7 +53,7 @@ Description } \endverbatim - \note +Note If reverse flow is possible or expected use the pressureDirectedInletOutletVelocityFvPatchVectorField condition instead. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H index 7fbb307d0471a390e48b71930c404733b04f76c4..f1f2f3a9d3325ad0bf989a056ec46999a0660756 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H @@ -54,7 +54,7 @@ Description } \endverbatim - \note +Note Sign conventions: - positive flux (out of domain): apply zero-gradient condition - negative flux (into of domain): derive from the flux with specified diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H index 36680dd7d8668c4cbb3d776295348a39fa41dba2..1ed301b191ea185db943a58de71215682d509370 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.H @@ -54,7 +54,7 @@ Description } \endverbatim - \note +Note Sign conventions: - positive flux (out of domain): apply zero-gradient condition - negative flux (into of domain): derive from the flux in the patch-normal diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H index 2ea77ceeffaccfb365cbd4e7b391931466db15d2..12b7d8bec538d6baac09b14317e9d7c9f508bc80 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.H @@ -45,7 +45,7 @@ Description } \endverbatim - \note +Note If reverse flow is possible or expected use the pressureInletOutletVelocityFvPatchVectorField condition instead. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H index 3df7b5ed9a4f3fbcf5083660613b87e9fe9c6560..c138b18f6959352e53be8b471aef6294a09317a2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.H @@ -52,7 +52,7 @@ Description } \endverbatim - \note +Note Sign conventions: - positive flux (out of domain): apply zero-gradient condition - negative flux (into of domain): derive from the flux and patch-normal diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H index 5a95fa75bf7a4a474c7bf4849a7b72fef92e856e..cc114d7c6b8110adc0eed599ae2abc17bc646b65 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.H @@ -56,7 +56,7 @@ Description The \c omega entry is a DataEntry type, able to describe time varying functions. - \note +Note Sign conventions: - positive flux (out of domain): apply zero-gradient condition - negative flux (into of domain): derive from the flux in the patch-normal diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H index ca013bb04c226b6e99aa925b97d3f9c5bd3c5b1b..402fc365f34fd746309db74c192931938c140603 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H @@ -58,7 +58,7 @@ Description } \endverbatim - \note +Note This boundary condition is ill-posed if the free-stream flow is normal to the boundary. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H index 2b6242a42d384411f3f893230c4ecf17e15ab9c6..e0068654fd04922c54584f6127e7b2730bd9ea59 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H @@ -47,7 +47,7 @@ Description } \endverbatim - \note +Note Sign conventions: - the value is positive for outward-pointing vectors diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H index 307d9486a6ec1a329073b817225509e0a19aaa82..a53dd0ca12b4213ef72f37f7798e9766279b7b44 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.H @@ -57,7 +57,7 @@ Description } \endverbatim - \note +Note - the \c flowRate and \c rpm entries are DataEntry types, able to describe time varying functions. The example above gives the usage for supplying constant values. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H index d788f543beead60c270bae45b604b652a94a4735..0663a1cb86745144c31881f95d2629d0f130c169 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H @@ -56,7 +56,7 @@ Description The above example shows the use of a constant jump condition. - \note +Note The underlying \c patchType should be set to \c cyclic SeeAlso diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H index 86a8029cdf16d706dfe7d8964895dfde928ea8c5..61228fe07c4b06db225843de425bcda10710335a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.H @@ -61,7 +61,7 @@ Description } /endverbatim - \note +Note Switch on debug flag to have it dump the triangulation (in transformed space) and transform face centres. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H index dd49014a3226e8a9cdfbb8a3709f26db792459e4..05bd6b180045533d77f4109d60599fa18a56021d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H @@ -101,9 +101,6 @@ Description p0 | static pressure reference | yes | \endtable - \note - The default boundary behaviour is for subsonic, incompressible flow. - Example of the boundary condition specification: \verbatim myPatch @@ -118,6 +115,9 @@ Description } \endverbatim +Note + The default boundary behaviour is for subsonic, incompressible flow. + SeeAlso Foam::fixedValueFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H index 3b09b75a4ccab16d4ddef8ec0884584bb2a5baca..072d02f1b6d94024a54ad85618a1c241cb059e6b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformFixedValue/uniformFixedValueFvPatchField.H @@ -46,7 +46,7 @@ Description } \endverbatim - \note +Note The uniformValue entry is a DataEntry type, able to describe time varying functions. The example above gives the usage for supplying a constant value. diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H index 46f81be514370e0aaed46f401ff089f9e54f5398..0dca30f8ff271161200f23de11b4e22fd5ffa87e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.H @@ -44,9 +44,6 @@ Description pressure | total pressure as a function of time | yes | \endtable - \note - The default boundary behaviour is for subsonic, incompressible flow. - Example of the boundary condition specification: \verbatim myPatch @@ -62,10 +59,13 @@ Description } \endverbatim - The \c pressure entry is specified as a DataEntry type, able to describe time varying functions. +Note + The default boundary behaviour is for subsonic, incompressible flow. + + SeeAlso Foam::DataEntry Foam::uniformFixedValueFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H index c4322d6a5705e05e57eda4d653d966f9166d1287..10e6a2c88993741da7567025b845de155dcc2247 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.H @@ -51,7 +51,7 @@ Description } \endverbatim - \note +Note - the value is positive into the domain - may not work correctly for transonic inlets - strange behaviour with potentialFoam since the momentum equation is diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 4dc1041ffcba443bd3539f7b5e238217c5f76b6d..ecace2a0519d3e28c1da600c08aecb38bacce0b6 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -257,6 +257,13 @@ public: const dictionary& ); + //- Return a pointer to a new calculatedFvPatchField created on + // freestore without setting patchField values + static tmp<fvPatchField<Type> > NewCalculatedType + ( + const fvPatch& + ); + //- Return a pointer to a new calculatedFvPatchField created on // freestore without setting patchField values template<class Type2> diff --git a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C index a22514c857099df46efd4312b973c71900a0b3ff..efe80d2f73644a5b57de6cc79887d3e1ca52eec3 100644 --- a/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C +++ b/src/finiteVolume/fields/fvsPatchFields/basic/calculated/calculatedFvsPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,21 +97,20 @@ calculatedFvsPatchField<Type>::calculatedFvsPatchField template<class Type> -template<class Type2> tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType ( - const fvsPatchField<Type2>& pf + const fvPatch& p ) { typename patchConstructorTable::iterator patchTypeCstrIter = - patchConstructorTablePtr_->find(pf.patch().type()); + patchConstructorTablePtr_->find(p.type()); if (patchTypeCstrIter != patchConstructorTablePtr_->end()) { return patchTypeCstrIter() ( - pf.patch(), - Field<Type>::null() + p, + DimensionedField<Type, surfaceMesh>::null() ); } else @@ -120,14 +119,25 @@ tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType ( new calculatedFvsPatchField<Type> ( - pf.patch(), - Field<Type>::null() + p, + DimensionedField<Type, surfaceMesh>::null() ) ); } } +template<class Type> +template<class Type2> +tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType +( + const fvsPatchField<Type2>& pf +) +{ + return NewCalculatedType(pf.patch()); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index 7da763f09fd4c84f80f65502c30308e510aaa24c..88fb9a7d58d40dce40824467729e4ac13f6d0254 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -247,6 +247,13 @@ public: const dictionary& ); + //- Return a pointer to a new calculatedFvsPatchField created on + // freestore without setting patchField values + static tmp<fvsPatchField<Type> > NewCalculatedType + ( + const fvPatch& + ); + //- Return a pointer to a new calculatedFvsPatchField created on // freestore without setting patchField values template<class Type2> diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.C index 84f04e3a94d1833d61063aa0d7f12f5d1ef6e6b1..1cb9326e32ac25746c86a38cea94a154c3719d54 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -302,6 +302,43 @@ interpolate } +template<class Type> +tmp<FieldField<fvsPatchField, Type> > interpolate +( + const FieldField<fvPatchField, Type>& fvpff +) +{ + FieldField<fvsPatchField, Type>* fvspffPtr + ( + new FieldField<fvsPatchField, Type>(fvpff.size()) + ); + + forAll(*fvspffPtr, patchi) + { + fvspffPtr->set + ( + patchi, + fvsPatchField<Type>::NewCalculatedType(fvpff[patchi].patch()).ptr() + ); + (*fvspffPtr)[patchi] = fvpff[patchi]; + } + + return tmp<FieldField<fvsPatchField, Type> >(fvspffPtr); +} + + +template<class Type> +tmp<FieldField<fvsPatchField, Type> > interpolate +( + const tmp<FieldField<fvPatchField, Type> >& tfvpff +) +{ + tmp<FieldField<fvsPatchField, Type> > tfvspff = interpolate(tfvpff()); + tfvpff.clear(); + return tfvspff; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fvc diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H index 00c0da4f65b05c486f4d59b1e63c7639e75781e2..f6f0cf04b6d09a1a61a83f8395d6619b416d6f33 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,12 +163,26 @@ namespace fvc const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf ); - //- Interpolate tmp field onto faces using 'interpolate(\<name\>)' + //- Interpolate field onto faces using 'interpolate(\<name\>)' template<class Type> static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate ( const GeometricField<Type, fvPatchField, volMesh>& tvf ); + + //- Interpolate boundary field onto faces (simply a type conversion) + template<class Type> + static tmp<FieldField<fvsPatchField, Type> > interpolate + ( + const FieldField<fvPatchField, Type>& fvpff + ); + + //- Interpolate boundary field onto faces (simply a type conversion) + template<class Type> + static tmp<FieldField<fvsPatchField, Type> > interpolate + ( + const tmp<FieldField<fvPatchField, Type> >& tfvpff + ); } diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C index 1e0aa90e4109ca4437d1703eed90973a84fd3380..0f2b751bbdcd86d46b43873dcf3e45dbc72d36a8 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,8 +51,8 @@ void volPointInterpolation::syncUntransformedData const indirectPrimitivePatch& cpp = gmd.coupledPatch(); const labelList& meshPoints = cpp.meshPoints(); - const mapDistribute& slavesMap = gmd.globalPointSlavesMap(); - const labelListList& slaves = gmd.globalPointSlaves(); + const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap(); + const labelListList& slaves = gmd.globalCoPointSlaves(); List<Type> elems(slavesMap.constructSize()); forAll(meshPoints, i) @@ -105,8 +105,8 @@ void volPointInterpolation::pushUntransformedData const indirectPrimitivePatch& cpp = gmd.coupledPatch(); const labelList& meshPoints = cpp.meshPoints(); - const mapDistribute& slavesMap = gmd.globalPointSlavesMap(); - const labelListList& slaves = gmd.globalPointSlaves(); + const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap(); + const labelListList& slaves = gmd.globalCoPointSlaves(); List<Type> elems(slavesMap.constructSize()); forAll(meshPoints, i) @@ -155,14 +155,14 @@ void volPointInterpolation::addSeparated refCast<coupledPointPatchField<Type> > (pf.boundaryField()[patchI]).initSwapAddSeparated ( - Pstream::blocking, //Pstream::nonBlocking, + Pstream::nonBlocking, pf.internalField() ); } } // Block for any outstanding requests - //Pstream::waitRequests(); + Pstream::waitRequests(); forAll(pf.boundaryField(), patchI) { @@ -171,7 +171,7 @@ void volPointInterpolation::addSeparated refCast<coupledPointPatchField<Type> > (pf.boundaryField()[patchI]).swapAddSeparated ( - Pstream::blocking, //Pstream::nonBlocking, + Pstream::nonBlocking, pf.internalField() ); } @@ -306,7 +306,6 @@ void volPointInterpolation::interpolateBoundaryField } // Sum collocated contributions - //mesh().globalData().syncPointData(pfi, plusEqOp<Type>()); syncUntransformedData(pfi, plusEqOp<Type>()); // And add separated contributions @@ -314,9 +313,7 @@ void volPointInterpolation::interpolateBoundaryField // Push master data to slaves. It is possible (not sure how often) for // a coupled point to have its master on a different patch so - // to make sure just push master data to slaves. Reuse the syncPointData - // structure. - //mesh().globalData().syncPointData(pfi, nopEqOp<Type>()); + // to make sure just push master data to slaves. pushUntransformedData(pfi); diff --git a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C index cb47e0a101c8dd554968c4e9ec5875776dcdfd5c..87305f2fa80f2fa5b6a210d2bef08f1137f76f7e 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/volPointInterpolation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,10 +113,8 @@ void volPointInterpolation::calcBoundaryAddressing() { boolList oldData(isPatchPoint_); - //mesh().globalData().syncPointData(isPatchPoint_, orEqOp<bool>()); syncUntransformedData(isPatchPoint_, orEqOp<bool>()); - forAll(isPatchPoint_, pointI) { if (isPatchPoint_[pointI] != oldData[pointI]) @@ -272,7 +270,7 @@ void volPointInterpolation::makeWeights() makeInternalWeights(sumWeights); - // Create boundary weights; add to sumWeights + // Create boundary weights; override sumWeights makeBoundaryWeights(sumWeights); @@ -292,7 +290,6 @@ void volPointInterpolation::makeWeights() // Sum collocated contributions - //mesh().globalData().syncPointData(sumWeights, plusEqOp<scalar>()); syncUntransformedData(sumWeights, plusEqOp<scalar>()); // And add separated contributions @@ -302,7 +299,6 @@ void volPointInterpolation::makeWeights() // a coupled point to have its master on a different patch so // to make sure just push master data to slaves. Reuse the syncPointData // structure. - //mesh().globalData().syncPointData(sumWeights, nopEqOp<scalar>()); pushUntransformedData(sumWeights); diff --git a/src/lagrangian/coalCombustion/Make/files b/src/lagrangian/coalCombustion/Make/files index 019781420d30dd52a422e00707506911da7b7683..f3d07eaa1fd4dbbfb102f8c905d7a82e5c8f2b1a 100644 --- a/src/lagrangian/coalCombustion/Make/files +++ b/src/lagrangian/coalCombustion/Make/files @@ -1,4 +1,5 @@ /* Coal parcel and sub-models */ coalParcel/makeCoalParcelSubmodels.C +coalCloudList/coalCloudList.C LIB = $(FOAM_LIBBIN)/libcoalCombustion diff --git a/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.C b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.C new file mode 100644 index 0000000000000000000000000000000000000000..548e81d2169106a706a65ced78c77f7ce5b44d46 --- /dev/null +++ b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "coalCloudList.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::coalCloudList::coalCloudList +( + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& slgThermo +) +: + PtrList<coalCloud>(), + mesh_(rho.mesh()) +{ + IOdictionary props + ( + IOobject + ( + "coalCloudList", + mesh_.time().constant(), + mesh_, + IOobject::MUST_READ + ) + ); + + const wordHashSet cloudNames(wordList(props.lookup("clouds"))); + + setSize(cloudNames.size()); + + label i = 0; + forAllConstIter(wordHashSet, cloudNames, iter) + { + const word& name = iter.key(); + + Info<< "creating cloud: " << name << endl; + + set + ( + i++, + new coalCloud + ( + name, + rho, + U, + g, + slgThermo + ) + ); + + Info<< endl; + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::coalCloudList::evolve() +{ + forAll(*this, i) + { + operator[](i).evolve(); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.H b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.H new file mode 100644 index 0000000000000000000000000000000000000000..1a023e27ba0771113f3f2298fcc6cd0035ddbca1 --- /dev/null +++ b/src/lagrangian/coalCombustion/coalCloudList/coalCloudList.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef coalCloudList_H +#define coalCloudList_H + +#include "coalCloud.H" +#include "volFieldsFwd.H" +#include "fvMatricesFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class coalCloudList Declaration +\*---------------------------------------------------------------------------*/ + +class coalCloudList +: + public PtrList<coalCloud> +{ +private: + + //- Reference to the mesh + const fvMesh& mesh_; + + +public: + + // Constructor + + coalCloudList + ( + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& slgThermo + ); + + + // Member Functions + + // Evolution + + //- Evolve the cloud collection + void evolve(); + + + // Source terms + + //- Return const reference to momentum source + inline tmp<DimensionedField<vector, volMesh> > UTrans() const; + + //- Return tmp momentum source term + inline tmp<fvVectorMatrix> SU(volVectorField& U) const; + + //- Sensible enthalpy transfer [J/kg] + inline tmp<DimensionedField<scalar, volMesh> > hsTrans() const; + + //- Return sensible enthalpy source term [J/kg/m3/s] + inline tmp<fvScalarMatrix> Sh(volScalarField& hs) const; + + + //- Return mass source term for specie i - specie eqn + inline tmp<fvScalarMatrix> SYi + ( + const label i, + volScalarField& Yi + ) const; + + //- Return total mass transfer [kg/m3] + inline tmp<DimensionedField<scalar, volMesh> > rhoTrans() const; + + //- Return tmp total mass source for carrier phase + // - fully explicit + inline tmp<DimensionedField<scalar, volMesh> > Srho() const; + + //- Return tmp total mass source for carrier phase specie i + // - fully explicit + inline tmp<DimensionedField<scalar, volMesh> > Srho + ( + const label i + ) const; + + //- Return total mass source term [kg/m3/s] + inline tmp<fvScalarMatrix> Srho(volScalarField& rho) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "coalCloudListI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalCloudList/coalCloudListI.H b/src/lagrangian/coalCombustion/coalCloudList/coalCloudListI.H new file mode 100644 index 0000000000000000000000000000000000000000..005d9ef604e0d114a2f5dca2b3fe361fd939cb77 --- /dev/null +++ b/src/lagrangian/coalCombustion/coalCloudList/coalCloudListI.H @@ -0,0 +1,262 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "fvMatrices.H" +#include "volFields.H" +#include "DimensionedField.H" + +Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> > +Foam::coalCloudList::UTrans() const +{ + tmp<DimensionedField<vector, volMesh> > tfld + ( + new DimensionedField<vector, volMesh> + ( + IOobject + ( + "UTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedVector("zero", dimMass*dimVelocity, vector::zero) + ) + ); + + DimensionedField<vector, volMesh>& fld = tfld(); + + forAll(*this, i) + { + fld += operator[](i).UTrans(); + } + + return tfld; +} + + +Foam::tmp<Foam::fvVectorMatrix> Foam::coalCloudList::SU +( + volVectorField& U +) const +{ + tmp<fvVectorMatrix> tfvm(new fvVectorMatrix(U, dimForce)); + fvVectorMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).SU(U); + } + + return tfvm; +} + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::coalCloudList::hsTrans() const +{ + tmp<DimensionedField<scalar, volMesh> > tfld + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + "hsTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimEnergy, 0.0) + ) + ); + + DimensionedField<scalar, volMesh>& fld = tfld(); + + forAll(*this, i) + { + fld += operator[](i).hsTrans(); + } + + return tfld; +} + + +Foam::tmp<Foam::fvScalarMatrix> Foam::coalCloudList::Sh +( + volScalarField& hs +) const +{ + tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(hs, dimEnergy/dimTime)); + fvScalarMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).Sh(hs); + } + + return tfvm; +} + + +Foam::tmp<Foam::fvScalarMatrix> Foam::coalCloudList::SYi +( + const label ii, + volScalarField& Yi +) const +{ + tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime)); + fvScalarMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).SYi(ii, Yi); + } + + return tfvm; +} + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::coalCloudList::rhoTrans() const +{ + tmp<DimensionedField<scalar, volMesh> > tfld + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + "rhoTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimMass, 0.0) + ) + ); + + DimensionedField<scalar, volMesh>& fld = tfld(); + + forAll(*this, i) + { + forAll(operator[](i).rhoTrans(), j) + { + fld += operator[](i).rhoTrans()[j]; + } + } + + return tfld; +} + + + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::coalCloudList::Srho() const +{ + tmp<DimensionedField<scalar, volMesh> > tfld + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + "rhoTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimDensity/dimTime, 0.0) + ) + ); + + DimensionedField<scalar, volMesh>& fld = tfld(); + + forAll(*this, i) + { + fld += operator[](i).Srho(); + } + + return tfld; +} + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::coalCloudList::Srho +( + const label i +) const +{ + tmp<DimensionedField<scalar, volMesh> > tfld + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + "rhoTransEff", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimDensity/dimTime, 0.0) + ) + ); + + DimensionedField<scalar, volMesh>& fld = tfld(); + + forAll(*this, j) + { + fld += operator[](j).Srho(i); + } + + return tfld; +} + + +Foam::tmp<Foam::fvScalarMatrix> Foam::coalCloudList::Srho +( + volScalarField& rho +) const +{ + tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(rho, dimMass/dimTime)); + fvScalarMatrix& fvm = tfvm(); + + forAll(*this, i) + { + fvm += operator[](i).Srho(rho); + } + + return tfvm; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H index 37627758fff76cc5cb3b662fe17baeeed9a0a244..2df26d9a3cd901125a207e864a12dfe4fc37633a 100644 --- a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H +++ b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,7 @@ License #include "NoSurfaceReaction.H" #include "COxidationDiffusionLimitedRate.H" #include "COxidationKineticDiffusionLimitedRate.H" +#include "COxidationHurtMitchell.H" #include "COxidationMurphyShaddix.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,6 +44,7 @@ License COxidationKineticDiffusionLimitedRate, \ CloudType \ ); \ + makeSurfaceReactionModelType(COxidationHurtMitchell, CloudType); \ makeSurfaceReactionModelType(COxidationMurphyShaddix, CloudType); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C new file mode 100644 index 0000000000000000000000000000000000000000..c3ecbbffafa8a41cfb21292e51b6db3fba667450 --- /dev/null +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C @@ -0,0 +1,206 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "COxidationHurtMitchell.H" +#include "mathematicalConstants.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::COxidationHurtMitchell<CloudType>::COxidationHurtMitchell +( + const dictionary& dict, + CloudType& owner +) +: + SurfaceReactionModel<CloudType>(dict, owner, typeName), + Sb_(readScalar(this->coeffDict().lookup("Sb"))), + CsLocalId_(-1), + ashLocalId_(-1), + O2GlobalId_(owner.composition().globalCarrierId("O2")), + CO2GlobalId_(owner.composition().globalCarrierId("CO2")), + WC_(0.0), + WO2_(0.0), + HcCO2_(0.0), + heatOfReaction_(-1.0) +{ + // Determine Cs and ash ids + label idSolid = owner.composition().idSolid(); + CsLocalId_ = owner.composition().localId(idSolid, "C"); + ashLocalId_ = owner.composition().localId(idSolid, "ash", true); + + // Set local copies of thermo properties + WO2_ = owner.thermo().carrier().W(O2GlobalId_); + const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); + WC_ = WCO2 - WO2_; + + HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_); + + const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; + const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; + Info<< " C(s): particle mass fraction = " << YCloc*YSolidTot << endl; + + if (this->coeffDict().readIfPresent("heatOfReaction", heatOfReaction_)) + { + Info<< " Using user specified heat of reaction: " + << heatOfReaction_ << " [J/kg]" << endl; + } +} + + +template<class CloudType> +Foam::COxidationHurtMitchell<CloudType>::COxidationHurtMitchell +( + const COxidationHurtMitchell<CloudType>& srm +) +: + SurfaceReactionModel<CloudType>(srm), + Sb_(srm.Sb_), + CsLocalId_(srm.CsLocalId_), + ashLocalId_(srm.ashLocalId_), + O2GlobalId_(srm.O2GlobalId_), + CO2GlobalId_(srm.CO2GlobalId_), + WC_(srm.WC_), + WO2_(srm.WO2_), + HcCO2_(srm.HcCO2_), + heatOfReaction_(srm.heatOfReaction_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::COxidationHurtMitchell<CloudType>::~COxidationHurtMitchell() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +Foam::scalar Foam::COxidationHurtMitchell<CloudType>::calculate +( + const scalar dt, + const label cellI, + const scalar d, + const scalar T, + const scalar Tc, + const scalar pc, + const scalar rhoc, + const scalar mass, + const scalarField& YGas, + const scalarField& YLiquid, + const scalarField& YSolid, + const scalarField& YMixture, + const scalar N, + scalarField& dMassGas, + scalarField& dMassLiquid, + scalarField& dMassSolid, + scalarField& dMassSRCarrier +) const +{ + const label idGas = CloudType::parcelType::GAS; + const label idSolid = CloudType::parcelType::SLD; + const scalar Ychar = YMixture[idSolid]*YSolid[CsLocalId_]; + + // Surface combustion until combustible fraction is consumed + if (Ychar < SMALL) + { + return 0.0; + } + + const SLGThermo& thermo = this->owner().thermo(); + + // Local mass fraction of O2 in the carrier phase + const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[cellI]; + + // No combustion if no oxygen present + if (YO2 < SMALL) + { + return 0.0; + } + + // Conversion from [g/cm^2) to [kg/m^2] + const scalar convSI = 1000.0/10000.0; + + // Universal gas constant in [kcal/mol/K] + const scalar RRcal = 1985.877534; + + // Dry mass fraction + scalar Ydaf = YMixture[idGas] + YMixture[idSolid]; + if (ashLocalId_ != -1) + { + Ydaf -= YMixture[idSolid]*YSolid[ashLocalId_]; + } + + // Char percentage + const scalar charPrc = Ychar/Ydaf*100.0; + + // Particle surface area + const scalar Ap = constant::mathematical::pi*sqr(d); + + // Far field partial pressure O2 [Pa] + // Note: Should really use the surface partial pressure + const scalar ppO2 = max(0.0, rhoc*YO2/WO2_*specie::RR*Tc); + + // Activation energy [kcal/mol] + const scalar E = -5.94 + 0.355*charPrc; + + // Pre-exponential factor [g/(cm^2.s.atm^0.5)] + const scalar lnK1750 = 2.8 - 0.0758*charPrc; + const scalar A = exp(lnK1750 + E/RRcal/1750.0); + + // Kinetic rate of char oxidation [g/(cm^2.s.atm^0.5)] + const scalar Rk = A*exp(-E/(RRcal*T)); + + // Molar reaction rate per unit surface area [kmol/(m^2.s)] + const scalar qCsLim = mass*Ychar/(WC_*Ap*dt); + const scalar qCs = min(convSI*Rk*Foam::sqrt(ppO2/101325.0), qCsLim); + + // Calculate the number of molar units reacted [kmol] + const scalar dOmega = qCs*Ap*dt; + + // Add to carrier phase mass transfer + dMassSRCarrier[O2GlobalId_] += -dOmega*Sb_*WO2_; + dMassSRCarrier[CO2GlobalId_] += dOmega*(WC_ + Sb_*WO2_); + + // Add to particle mass transfer + dMassSolid[CsLocalId_] += dOmega*WC_; + + + // Return the heat of reaction [J] + // note: carrier sensible enthalpy exchange handled via change in mass + if (heatOfReaction_ < 0) + { + const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); + return dOmega*(WC_*HsC - (WC_ + Sb_*WO2_)*HcCO2_); + } + else + { + return dOmega*WC_*heatOfReaction_; + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.H new file mode 100644 index 0000000000000000000000000000000000000000..cd7800328fe91c6a65d6b1fb6865d445cb3f5b8f --- /dev/null +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.H @@ -0,0 +1,184 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +Class + COxidationHurtMitchell + +Description + Char oxidation model given by Hurt and Mitchell: + + Based on the reference: + Hurt R. and Mitchell R., "Unified high-temperature char combustion + kinetics for a suite of coals of various rank", 24th Symposium in + Combustion, The Combustion Institute, 1992, p 1243-1250 + + Model specifies the rate of char combustion. + + C(s) + Sb*O2 -> CO2 + + where Sb is the stoichiometry of the reaction + + Model validity: + Gas temperature: Tc > 1500 K + Particle sizes: 75 um -> 200 um + Pox > 0.3 atm + +\*---------------------------------------------------------------------------*/ + +#ifndef COxidationHurtMitchell_H +#define COxidationHurtMitchell_H + +#include "SurfaceReactionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward class declarations +template<class CloudType> +class COxidationHurtMitchell; + +/*---------------------------------------------------------------------------*\ + Class COxidationHurtMitchell Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class COxidationHurtMitchell +: + public SurfaceReactionModel<CloudType> +{ + // Private data + + // Model constants + + //- Stoichiometry of reaction + const scalar Sb_; + + + // Addressing + + //- Cs position in global/local lists + label CsLocalId_; + + //- Ash position in global/local lists + label ashLocalId_; + + //- O2 position in global list + label O2GlobalId_; + + //- CO2 positions in global list + label CO2GlobalId_; + + + // Local copies of thermo properties + + //- Molecular weight of C [kg/kmol] + scalar WC_; + + //- Molecular weight of O2 [kg/kmol] + scalar WO2_; + + //- Formation enthalpy for CO2 [J/kg] + scalar HcCO2_; + + //- Heat of reaction [J/kg] (optional) + scalar heatOfReaction_; + + +public: + + //- Runtime type information + TypeName("COxidationHurtMitchell"); + + + // Constructors + + //- Construct from dictionary + COxidationHurtMitchell + ( + const dictionary& dict, + CloudType& owner + ); + + //- Construct copy + COxidationHurtMitchell + ( + const COxidationHurtMitchell<CloudType>& srm + ); + + //- Construct and return a clone + virtual autoPtr<SurfaceReactionModel<CloudType> > clone() const + { + return autoPtr<SurfaceReactionModel<CloudType> > + ( + new COxidationHurtMitchell<CloudType>(*this) + ); + } + + + //- Destructor + virtual ~COxidationHurtMitchell(); + + + // Member Functions + + //- Update surface reactions + virtual scalar calculate + ( + const scalar dt, + const label cellI, + const scalar d, + const scalar T, + const scalar Tc, + const scalar pc, + const scalar rhoc, + const scalar mass, + const scalarField& YGas, + const scalarField& YLiquid, + const scalarField& YSolid, + const scalarField& YMixture, + const scalar N, + scalarField& dMassGas, + scalarField& dMassLiquid, + scalarField& dMassSolid, + scalarField& dMassSRCarrier + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "COxidationHurtMitchell.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C index 867518e11becfaaeb5e16b2b60159eeb79421242..f5fc9ec0384d6accfd6e78d41fdbf05ef668cf8c 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,15 +68,13 @@ Foam::scalar Foam::NoBinaryCollision<CloudType>::sigmaTcR ( "Foam::scalar Foam::NoBinaryCollision<CloudType>::sigmaTcR" "(" - "label typeIdP," - "label typeIdQ," - "const vector& UP," - "const vector& UQ" + "const typename CloudType::parcelType&, " + "const typename CloudType::parcelType" ") const" ) << "sigmaTcR called on NoBinaryCollision model, this should " << "not happen, this is not an actual model." << nl - << "Enclose calls to sigmaTcR within a if(binaryCollision().active()) " + << "Enclose calls to sigmaTcR within a if (binaryCollision().active()) " << " check." << abort(FatalError); diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index b43c3fc6901987d335c11d9d4cfaad44d5073a5b..3ca019fa4e15286e02c46ebfcf2c6e1a4fc67633 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -661,7 +661,7 @@ void Foam::KinematicCloud<CloudType>::evolve() template<class CloudType> template<class TrackData> -void Foam::KinematicCloud<CloudType>::motion(TrackData& td) +void Foam::KinematicCloud<CloudType>::motion(TrackData& td) { td.part() = TrackData::tpLinearTrack; CloudType::move(td, solution_.trackTime()); @@ -670,6 +670,159 @@ void Foam::KinematicCloud<CloudType>::motion(TrackData& td) } +template<class CloudType> +void Foam::KinematicCloud<CloudType>::patchData +( + const parcelType& p, + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs, + vector& nw, + vector& Up +) const +{ + label patchI = pp.index(); + label patchFaceI = pp.whichFace(p.face()); + + vector n = tetIs.faceTri(mesh_).normal(); + n /= mag(n); + + vector U = U_.boundaryField()[patchI][patchFaceI]; + + // Unless the face is rotating, the required normal is n; + nw = n; + + if (!mesh_.moving()) + { + // Only wall patches may have a non-zero wall velocity from + // the velocity field when the mesh is not moving. + + if (isA<wallPolyPatch>(pp)) + { + Up = U; + } + else + { + Up = vector::zero; + } + } + else + { + vector U00 = U_.oldTime().boundaryField()[patchI][patchFaceI]; + + vector n00 = tetIs.oldFaceTri(mesh_).normal(); + + // Difference in normal over timestep + vector dn = vector::zero; + + if (mag(n00) > SMALL) + { + // If the old normal is zero (for example in layer + // addition) then use the current normal, meaning that the + // motion can only be translational, and dn remains zero, + // otherwise, calculate dn: + + n00 /= mag(n00); + + dn = n - n00; + } + + // Total fraction through the timestep of the motion, + // including stepFraction before the current tracking step + // and the current trackFraction + // i.e. + // let s = stepFraction, t = trackFraction + // Motion of x in time: + // |-----------------|---------|---------| + // x00 x0 xi x + // + // where xi is the correct value of x at the required + // tracking instant. + // + // x0 = x00 + s*(x - x00) = s*x + (1 - s)*x00 + // + // i.e. the motion covered by previous tracking portions + // within this timestep, and + // + // xi = x0 + t*(x - x0) + // = t*x + (1 - t)*x0 + // = t*x + (1 - t)*(s*x + (1 - s)*x00) + // = (s + t - s*t)*x + (1 - (s + t - s*t))*x00 + // + // let m = (s + t - s*t) + // + // xi = m*x + (1 - m)*x00 = x00 + m*(x - x00); + // + // In the same form as before. + + scalar m = + p.stepFraction() + + trackFraction + - (p.stepFraction()*trackFraction); + + // When the mesh is moving, the velocity field on wall patches + // will contain the velocity associated with the motion of the + // mesh, in which case it is interpolated in time using m. + // For other patches the face velocity will need to be + // reconstructed from the face centre motion. + + const vector& Cf = mesh_.faceCentres()[p.face()]; + + vector Cf00 = mesh_.faces()[p.face()].centre(mesh_.oldPoints()); + + if (isA<wallPolyPatch>(pp)) + { + Up = U00 + m*(U - U00); + } + else + { + Up = (Cf - Cf00)/mesh_.time().deltaTValue(); + } + + if (mag(dn) > SMALL) + { + // Rotational motion, nw requires interpolation and a + // rotational velocity around face centre correction to Up + // is required. + + nw = n00 + m*dn; + + // Cf at tracking instant + vector Cfi = Cf00 + m*(Cf - Cf00); + + // Normal vector cross product + vector omega = (n00 ^ n); + + scalar magOmega = mag(omega); + + // magOmega = sin(angle between unit normals) + // Normalise omega vector by magOmega, then multiply by + // angle/dt to give the correct angular velocity vector. + omega *= Foam::asin(magOmega)/(magOmega*mesh_.time().deltaTValue()); + + // Project position onto face and calculate this position + // relative to the face centre. + vector facePos = + p.position() + - ((p.position() - Cfi) & nw)*nw + - Cfi; + + Up += (omega ^ facePos); + } + + // No further action is required if the motion is + // translational only, nw and Up have already been set. + } +} + + +template<class CloudType> +void Foam::KinematicCloud<CloudType>::updateMesh() +{ + injectors_.updateMesh(); +} + + template<class CloudType> void Foam::KinematicCloud<CloudType>::autoMap(const mapPolyMesh& mapper) { @@ -678,6 +831,8 @@ void Foam::KinematicCloud<CloudType>::autoMap(const mapPolyMesh& mapper) tdType td(*this); Cloud<parcelType>::template autoMap<tdType>(td, mapper); + + updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 4cd80923da96adad875c42b6e6cd8986167a293d..321fba33ad63dd0c4dc09975a6ea8f097f7e9bdd 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -554,9 +554,24 @@ public: template<class TrackData> void motion(TrackData& td); + //- Calculate the patch normal and velocity to interact with, + // accounting for patch motion if required. + void patchData + ( + const parcelType& p, + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs, + vector& normal, + vector& Up + ) const; + // Mapping + //- Update mesh + void updateMesh(); + //- Remap the cells of particles corresponding to the // mesh topology change with a default tracking data object virtual void autoMap(const mapPolyMesh&); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index 4a83808fa2f2e73f9113dcc9e376a79c119b3f24..0f98e8b935ac00be354dda8050369c66d827faac 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -87,8 +87,6 @@ void Foam::ReactingCloud<CloudType>::cloudReset(ReactingCloud<CloudType>& c) compositionModel_.reset(c.compositionModel_.ptr()); phaseChangeModel_.reset(c.phaseChangeModel_.ptr()); - - dMassPhaseChange_ = c.dMassPhaseChange_; } @@ -111,8 +109,7 @@ Foam::ReactingCloud<CloudType>::ReactingCloud constProps_(this->particleProperties(), this->solution().active()), compositionModel_(NULL), phaseChangeModel_(NULL), - rhoTrans_(thermo.carrier().species().size()), - dMassPhaseChange_(0.0) + rhoTrans_(thermo.carrier().species().size()) { if (this->solution().active()) { @@ -167,8 +164,7 @@ Foam::ReactingCloud<CloudType>::ReactingCloud constProps_(c.constProps_), compositionModel_(c.compositionModel_->clone()), phaseChangeModel_(c.phaseChangeModel_->clone()), - rhoTrans_(c.rhoTrans_.size()), - dMassPhaseChange_(c.dMassPhaseChange_) + rhoTrans_(c.rhoTrans_.size()) { forAll(c.rhoTrans_, i) { @@ -209,8 +205,7 @@ Foam::ReactingCloud<CloudType>::ReactingCloud compositionModel_(c.compositionModel_->clone()), // compositionModel_(NULL), phaseChangeModel_(NULL), - rhoTrans_(0), - dMassPhaseChange_(0.0) + rhoTrans_(0) {} @@ -350,6 +345,8 @@ void Foam::ReactingCloud<CloudType>::autoMap(const mapPolyMesh& mapper) tdType td(*this); Cloud<parcelType>::template autoMap<tdType>(td, mapper); + + this->updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index a16f1255af7d94800ba51903a97f7242f198bf6f..2797250cc3368769908e61a503e3bcd6c7c0f9a5 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -121,12 +121,6 @@ protected: PtrList<DimensionedField<scalar, volMesh> > rhoTrans_; - // Check - - //- Total mass transferred to continuous phase via phase change - scalar dMassPhaseChange_; - - // Protected Member Functions // New parcel helper functions diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index 8cab7d3f8500cf9797aa9fd13942d5bc28f84c32..31bc4c3222016cd1c13c21e9e52f8d4fe1973c6e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -264,6 +264,8 @@ void Foam::ReactingMultiphaseCloud<CloudType>::autoMap tdType td(*this); Cloud<parcelType>::template autoMap<tdType>(td, mapper); + + this->updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 9eaa87705785e31ed8ed815322f510218e659f09..c7e5c9814d1d06b46be46c467707c7101108f2c2 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -51,7 +51,69 @@ void Foam::ThermoCloud<CloudType>::setModels() ).ptr() ); - this->subModelProperties().lookup("radiation") >> radiation_; + if (this->solution().coupled()) + { + this->subModelProperties().lookup("radiation") >> radiation_; + } + + if (radiation_) + { + radAreaP_.reset + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + this->name() + "::radAreaP", + this->db().time().timeName(), + this->db(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar("zero", dimArea, 0.0) + ) + ); + + radT4_.reset + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + this->name() + "::radT4", + this->db().time().timeName(), + this->db(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar("zero", pow4(dimTemperature), 0.0) + ) + ); + + radAreaPT4_.reset + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + this->name() + "::radAreaPT4", + this->db().time().timeName(), + this->db(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->mesh(), + dimensionedScalar + ( + "zero", + sqr(dimLength)*pow4(dimTemperature), + 0.0 + ) + ) + ); + } } @@ -98,13 +160,16 @@ Foam::ThermoCloud<CloudType>::ThermoCloud heatTransferModel_(NULL), TIntegrator_(NULL), radiation_(false), + radAreaP_(NULL), + radT4_(NULL), + radAreaPT4_(NULL), hsTrans_ ( new DimensionedField<scalar, volMesh> ( IOobject ( - this->name() + "hsTrans", + this->name() + "::hsTrans", this->db().time().timeName(), this->db(), IOobject::READ_IF_PRESENT, @@ -120,7 +185,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud ( IOobject ( - this->name() + "hsCoeff", + this->name() + "::hsCoeff", this->db().time().timeName(), this->db(), IOobject::READ_IF_PRESENT, @@ -165,13 +230,16 @@ Foam::ThermoCloud<CloudType>::ThermoCloud heatTransferModel_(c.heatTransferModel_->clone()), TIntegrator_(c.TIntegrator_->clone()), radiation_(c.radiation_), + radAreaP_(NULL), + radT4_(NULL), + radAreaPT4_(NULL), hsTrans_ ( new DimensionedField<scalar, volMesh> ( IOobject ( - this->name() + "hsTrans", + this->name() + "::hsTrans", this->db().time().timeName(), this->db(), IOobject::NO_READ, @@ -187,7 +255,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud ( IOobject ( - this->name() + "hsCoeff", + this->name() + "::hsCoeff", this->db().time().timeName(), this->db(), IOobject::NO_READ, @@ -197,7 +265,61 @@ Foam::ThermoCloud<CloudType>::ThermoCloud c.hsCoeff() ) ) -{} +{ + if (radiation_) + { + radAreaP_.reset + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + this->name() + "::radAreaP", + this->db().time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + c.radAreaP() + ) + ); + + radT4_.reset + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + this->name() + "::radT4", + this->db().time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + c.radT4() + ) + ); + + radAreaPT4_.reset + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + this->name() + "::radAreaPT4", + this->db().time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + c.radAreaPT4() + ) + ); + } +} template<class CloudType> @@ -218,6 +340,9 @@ Foam::ThermoCloud<CloudType>::ThermoCloud heatTransferModel_(NULL), TIntegrator_(NULL), radiation_(false), + radAreaP_(NULL), + radT4_(NULL), + radAreaPT4_(NULL), hsTrans_(NULL), hsCoeff_(NULL) {} @@ -285,6 +410,13 @@ void Foam::ThermoCloud<CloudType>::resetSourceTerms() CloudType::resetSourceTerms(); hsTrans_->field() = 0.0; hsCoeff_->field() = 0.0; + + if (radiation_) + { + radAreaP_->field() = 0.0; + radT4_->field() = 0.0; + radAreaPT4_->field() = 0.0; + } } @@ -298,6 +430,13 @@ void Foam::ThermoCloud<CloudType>::relaxSources this->relax(hsTrans_(), cloudOldTime.hsTrans(), "h"); this->relax(hsCoeff_(), cloudOldTime.hsCoeff(), "h"); + + if (radiation_) + { + this->relax(radAreaP_(), cloudOldTime.radAreaP(), "radiation"); + this->relax(radT4_(), cloudOldTime.radT4(), "radiation"); + this->relax(radAreaPT4_(), cloudOldTime.radAreaPT4(), "radiation"); + } } @@ -308,6 +447,13 @@ void Foam::ThermoCloud<CloudType>::scaleSources() this->scale(hsTrans_(), "h"); this->scale(hsCoeff_(), "h"); + + if (radiation_) + { + this->scale(radAreaP_(), "radiation"); + this->scale(radT4_(), "radiation"); + this->scale(radAreaPT4_(), "radiation"); + } } @@ -341,6 +487,8 @@ void Foam::ThermoCloud<CloudType>::autoMap(const mapPolyMesh& mapper) tdType td(*this); Cloud<parcelType>::template autoMap<tdType>(td, mapper); + + this->updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 4acd25162143807abd25e4964a8c8d32f0777b56..88cfde3172903b22046c59c09caed5bb283cf6bc 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -132,6 +132,15 @@ protected: //- Include radiation Switch radiation_; + //- Radiation sum of parcel projected areas + autoPtr<DimensionedField<scalar, volMesh> > radAreaP_; + + //- Radiation sum of parcel temperature^4 + autoPtr<DimensionedField<scalar, volMesh> > radT4_; + + //- Radiation sum of parcel projected areas * temperature^4 + autoPtr<DimensionedField<scalar, volMesh> > radAreaPT4_; + // Sources @@ -244,6 +253,26 @@ public: //- Radiation flag inline bool radiation() const; + //- Radiation sum of parcel projected areas [m2] + inline DimensionedField<scalar, volMesh>& radAreaP(); + + //- Radiation sum of parcel projected areas [m2] + inline const DimensionedField<scalar, volMesh>& + radAreaP() const; + + //- Radiation sum of parcel temperature^4 [K4] + inline DimensionedField<scalar, volMesh>& radT4(); + + //- Radiation sum of parcel temperature^4 [K4] + inline const DimensionedField<scalar, volMesh>& radT4() const; + + //- Radiation sum of parcel projected area*temperature^4 [m2K4] + inline DimensionedField<scalar, volMesh>& radAreaPT4(); + + //- Radiation sum of parcel temperature^4 [m2K4] + inline const DimensionedField<scalar, volMesh>& + radAreaPT4() const; + // Sources diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index bac95e49d5f98ae93fb5a12b4fcf297fb12a7d86..764595fece7cc5be685010174f74ac0217bfe5f5 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -89,6 +89,114 @@ inline bool Foam::ThermoCloud<CloudType>::radiation() const } +template<class CloudType> +inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& +Foam::ThermoCloud<CloudType>::radAreaP() +{ + if (!radiation_) + { + FatalErrorIn + ( + "inline Foam::DimensionedField<Foam::scalar, Foam::volMesh> " + "Foam::ThermoCloud<CloudType>::radAreaP()" + ) << "Radiation field requested, but radiation model not active" + << abort(FatalError); + } + + return radAreaP_(); +} + + +template<class CloudType> +inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>& +Foam::ThermoCloud<CloudType>::radAreaP() const +{ + if (!radiation_) + { + FatalErrorIn + ( + "inline Foam::DimensionedField<Foam::scalar, Foam::volMesh> " + "Foam::ThermoCloud<CloudType>::radAreaP()" + ) << "Radiation field requested, but radiation model not active" + << abort(FatalError); + } + + return radAreaP_(); +} + + +template<class CloudType> +inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& +Foam::ThermoCloud<CloudType>::radT4() +{ + if (!radiation_) + { + FatalErrorIn + ( + "inline Foam::DimensionedField<Foam::scalar, Foam::volMesh> " + "Foam::ThermoCloud<CloudType>::radT4()" + ) << "Radiation field requested, but radiation model not active" + << abort(FatalError); + } + + return radT4_(); +} + + +template<class CloudType> +inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>& +Foam::ThermoCloud<CloudType>::radT4() const +{ + if (!radiation_) + { + FatalErrorIn + ( + "inline Foam::DimensionedField<Foam::scalar, Foam::volMesh> " + "Foam::ThermoCloud<CloudType>::radT4()" + ) << "Radiation field requested, but radiation model not active" + << abort(FatalError); + } + + return radT4_(); +} + + +template<class CloudType> +inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& +Foam::ThermoCloud<CloudType>::radAreaPT4() +{ + if (!radiation_) + { + FatalErrorIn + ( + "inline Foam::DimensionedField<Foam::scalar, Foam::volMesh> " + "Foam::ThermoCloud<CloudType>::radAreaPT4()" + ) << "Radiation field requested, but radiation model not active" + << abort(FatalError); + } + + return radAreaPT4_(); +} + + +template<class CloudType> +inline const Foam::DimensionedField<Foam::scalar, Foam::volMesh>& +Foam::ThermoCloud<CloudType>::radAreaPT4() const +{ + if (!radiation_) + { + FatalErrorIn + ( + "inline Foam::DimensionedField<Foam::scalar, Foam::volMesh> " + "Foam::ThermoCloud<CloudType>::radAreaPT4()" + ) << "Radiation field requested, but radiation model not active" + << abort(FatalError); + } + + return radAreaPT4_(); +} + + template<class CloudType> inline Foam::DimensionedField<Foam::scalar, Foam::volMesh>& Foam::ThermoCloud<CloudType>::hsTrans() @@ -182,21 +290,15 @@ inline Foam::tmp<Foam::volScalarField> Foam::ThermoCloud<CloudType>::Ep() const ) ); - // Need to check if coupled as field is created on-the-fly - if (radiation_ && this->solution().coupled()) + if (radiation_) { scalarField& Ep = tEp().internalField(); + const scalar dt = this->db().time().deltaTValue(); const scalarField& V = this->mesh().V(); const scalar epsilon = constProps_.epsilon0(); + const scalarField& sumAreaPT4 = radAreaPT4_->field(); - forAllConstIter(typename ThermoCloud<CloudType>, *this, iter) - { - const parcelType& p = iter(); - const label cellI = p.cell(); - Ep[cellI] += p.nParticle()*p.areaP()*pow4(p.T()); - } - - Ep *= epsilon*physicoChemical::sigma.value()/V; + Ep = sumAreaPT4*epsilon*physicoChemical::sigma.value()/V/dt; } return tEp; @@ -224,21 +326,15 @@ inline Foam::tmp<Foam::volScalarField> Foam::ThermoCloud<CloudType>::ap() const ) ); - // Need to check if coupled as field is created on-the-fly - if (radiation_ && this->solution().coupled()) + if (radiation_) { scalarField& ap = tap().internalField(); + const scalar dt = this->db().time().deltaTValue(); const scalarField& V = this->mesh().V(); const scalar epsilon = constProps_.epsilon0(); + const scalarField& sumAreaP = radAreaP_->field(); - forAllConstIter(typename ThermoCloud<CloudType>, *this, iter) - { - const parcelType& p = iter(); - const label cellI = p.cell(); - ap[cellI] += p.nParticle()*p.areaP(); - } - - ap *= epsilon/V; + ap = sumAreaP*epsilon/V/dt; } return tap; @@ -267,23 +363,16 @@ Foam::ThermoCloud<CloudType>::sigmap() const ) ); - // Need to check if coupled as field is created on-the-fly - if (radiation_ && this->solution().coupled()) + if (radiation_) { scalarField& sigmap = tsigmap().internalField(); - + const scalar dt = this->db().time().deltaTValue(); const scalarField& V = this->mesh().V(); const scalar epsilon = constProps_.epsilon0(); const scalar f = constProps_.f0(); + const scalarField& sumAreaP = radAreaP_->field(); - forAllConstIter(typename ThermoCloud<CloudType>, *this, iter) - { - const parcelType& p = iter(); - const label cellI = p.cell(); - sigmap[cellI] += p.nParticle()*p.areaP(); - } - - sigmap *= (1.0 - f)*(1.0 - epsilon)/V; + sigmap *= sumAreaP*(1.0 - f)*(1.0 - epsilon)/V/dt; } return tsigmap; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index 9ae6b2f5b9169c265bd60577384b97f0d58c9b64..8fa42ac0eccd36ac1b1ac4b8b2cd710e479150ae 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -363,7 +363,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch static_cast<typename TrackData::cloudType::parcelType&>(*this); // Invoke post-processing model - td.cloud().functions().postPatch(p, patchI, pp.whichFace(p.face())); + td.cloud().functions().postPatch(p, pp, trackFraction, tetIs); // Invoke surface film model if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle)) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 4be1fcdd123cf5b91a97e77df71efd87514de8a0..84942b034932601a40b18b1899c71203422c5fc6 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -268,12 +268,15 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc ( td, dt, + this->age_, Ts, d0, T0, mass0, this->mass0_, YMix[GAS]*YGas_, + YMix[LIQ]*YLiquid_, + YMix[SLD]*YSolid_, canCombust_, dMassDV, Sh, @@ -466,6 +469,16 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Update sensible enthalpy transfer td.cloud().hsTrans()[cellI] += np0*dhsTrans; td.cloud().hsCoeff()[cellI] += np0*Sph; + + // Update radiation fields + if (td.cloud().radiation()) + { + const scalar ap = this->areaP(); + const scalar T4 = pow4(this->T_); + td.cloud().radAreaP()[cellI] += dt*np0*ap; + td.cloud().radT4()[cellI] += dt*np0*T4; + td.cloud().radAreaP()[cellI] += dt*np0*ap*T4; + } } } @@ -476,12 +489,15 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation ( TrackData& td, const scalar dt, + const scalar age, const scalar Ts, const scalar d, const scalar T, const scalar mass, const scalar mass0, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV, scalar& Sh, @@ -510,10 +526,13 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation td.cloud().devolatilisation().calculate ( dt, + age, mass0, mass, T, YGasEff, + YLiquidEff, + YSolidEff, canCombust, dMassDV ); @@ -638,7 +657,8 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ParcelType(p), YGas_(p.YGas_), YLiquid_(p.YLiquid_), - YSolid_(p.YSolid_) + YSolid_(p.YSolid_), + canCombust_(p.canCombust_) {} @@ -652,7 +672,8 @@ Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ParcelType(p, mesh), YGas_(p.YGas_), YLiquid_(p.YLiquid_), - YSolid_(p.YSolid_) + YSolid_(p.YSolid_), + canCombust_(p.canCombust_) {} diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index 6707b2a52da0f8fe3d4c8a7f2a9ede82ad996f13..db20b8d9c744607339a264404195c73b58e0a081 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -196,12 +196,15 @@ protected: ( TrackData& td, const scalar dt, // timestep - const scalar Ts, // Surface temperature + const scalar age, // age + const scalar Ts, // surface temperature const scalar d, // diameter const scalar T, // temperature const scalar mass, // mass const scalar mass0, // mass (initial on injection) - const scalarField& YGasEff,// Gas component mass fractions + const scalarField& YGasEff,// gas component mass fractions + const scalarField& YLiquidEff,// liquid component mass fractions + const scalarField& YSolidEff,// solid component mass fractions bool& canCombust, // 'can combust' flag scalarField& dMassDV, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index cfd21ceed0121e0de4ce49fcaad8aac0c7389d81..e9bc8153045af85ad40f565aed04d670821859f2 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -458,6 +458,16 @@ void Foam::ReactingParcel<ParcelType>::calc // Update sensible enthalpy transfer td.cloud().hsTrans()[cellI] += np0*dhsTrans; td.cloud().hsCoeff()[cellI] += np0*Sph; + + // Update radiation fields + if (td.cloud().radiation()) + { + const scalar ap = this->areaP(); + const scalar T4 = pow4(this->T_); + td.cloud().radAreaP()[cellI] += dt*np0*ap; + td.cloud().radT4()[cellI] += dt*np0*T4; + td.cloud().radAreaP()[cellI] += dt*np0*ap*T4; + } } } diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index b64b1e8f99df6cac42c2b3304c100d99930c75ff..cb9b7142049128d0051f804829ae4ca372bfd1d9 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -144,7 +144,7 @@ void Foam::ThermoParcel<ParcelType>::calcSurfaceValues Ts = td.cloud().constProps().TMin(); } - // Assuming thermo props vary linearly with T for small dT + // Assuming thermo props vary linearly with T for small d(T) const scalar TRatio = Tc_/Ts; rhos = this->rhoc_*TRatio; @@ -252,6 +252,16 @@ void Foam::ThermoParcel<ParcelType>::calc // Update sensible enthalpy coefficient td.cloud().hsCoeff()[cellI] += np0*Sph; + + // Update radiation fields + if (td.cloud().radiation()) + { + const scalar ap = this->areaP(); + const scalar T4 = pow4(this->T_); + td.cloud().radAreaP()[cellI] += dt*np0*ap; + td.cloud().radT4()[cellI] += dt*np0*T4; + td.cloud().radAreaP()[cellI] += dt*np0*ap*T4; + } } } diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H index cd5a78f81c2ac20848e4970a07048a06c7279907..07b00f8d936c04a828635fd23917f7042b0a9731 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,7 @@ License #include "ManualInjection.H" #include "NoInjection.H" #include "PatchInjection.H" - +#include "PatchFlowRateInjection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,7 +53,8 @@ License makeInjectionModelType(KinematicLookupTableInjection, CloudType); \ makeInjectionModelType(ManualInjection, CloudType); \ makeInjectionModelType(NoInjection, CloudType); \ - makeInjectionModelType(PatchInjection, CloudType); + makeInjectionModelType(PatchInjection, CloudType); \ + makeInjectionModelType(PatchFlowRateInjection, CloudType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H index 126f8a851253e30f5a593754415c8d820498dfca..711f88459feea3eb262b39b10c7b80bea111b368 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ License #include "ManualInjection.H" #include "NoInjection.H" #include "PatchInjection.H" +#include "PatchFlowRateInjection.H" #include "ReactingMultiphaseLookupTableInjection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,6 +50,7 @@ License makeInjectionModelType(ManualInjection, CloudType); \ makeInjectionModelType(NoInjection, CloudType); \ makeInjectionModelType(PatchInjection, CloudType); \ + makeInjectionModelType(PatchFlowRateInjection, CloudType); \ makeInjectionModelType(ReactingMultiphaseLookupTableInjection, CloudType); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H index 34fddbb50d5c9907fa84b4dece8320ffaf5f2cc7..5fb4c6d56258f246e3a08eee1b17adc732bf5045 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,6 +35,7 @@ License #include "ManualInjection.H" #include "NoInjection.H" #include "PatchInjection.H" +#include "PatchFlowRateInjection.H" #include "ReactingLookupTableInjection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,6 +50,7 @@ License makeInjectionModelType(ManualInjection, CloudType); \ makeInjectionModelType(NoInjection, CloudType); \ makeInjectionModelType(PatchInjection, CloudType); \ + makeInjectionModelType(PatchFlowRateInjection, CloudType); \ makeInjectionModelType(ReactingLookupTableInjection, CloudType); diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C index b8409231fff14c2317f9d069876fa54a5c7ea8d4..dbc359ae9a582ddee6d43be0c4efb5ad1f46431e 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,8 +107,9 @@ template<class CloudType> void Foam::CloudFunctionObject<CloudType>::postPatch ( const typename CloudType::parcelType&, - const label, - const label + const polyPatch&, + const scalar, + const tetIndices& ) { // do nothing diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H index b0818aa7084d8d6bbb65049b0fa5a37ca7535591..5baf0f7ae95fd82cfcc635db6c84e47633c162b1 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,8 +141,9 @@ public: virtual void postPatch ( const typename CloudType::parcelType& p, - const label patchI, - const label patchFaceI + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& testIs ); //- Post-face hook diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C index 556c72908cb2ef46b5b2c03b0bd9bd0abd4bc78f..2f97468e36c15e6e191228c9b288b711049915f9 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,13 +146,14 @@ template<class CloudType> void Foam::CloudFunctionObjectList<CloudType>::postPatch ( const typename CloudType::parcelType& p, - const label patchI, - const label patchFaceI + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs ) { forAll(*this, i) { - this->operator[](i).postPatch(p, patchI, patchFaceI); + this->operator[](i).postPatch(p, pp, trackFraction, tetIs); } } diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H index b8b296fe2117000acdf9dee7e1491add68554cd0..5daeab9f297249b120877c75594c01555c659725 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -121,8 +121,9 @@ public: virtual void postPatch ( const typename CloudType::parcelType& p, - const label patchI, - const label patchFaceI + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs ); //- Post-face hook diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C index 87d03eade785c3ce62699a5681415138416c7a8e..81772debfe22e2bf8722a5b9cbf465901ee383d3 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C @@ -166,29 +166,32 @@ template<class CloudType> void Foam::ParticleErosion<CloudType>::postPatch ( const parcelType& p, - const label patchI, - const label patchFaceI + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs ) { + const label patchI = pp.index(); + const label localPatchI = applyToPatch(patchI); if (localPatchI != -1) { - const fvMesh& mesh = this->owner().mesh(); + vector nw; + vector Up; // patch-normal direction - vector nw = p.currentTetIndices().faceTri(mesh).normal(); + this->owner().patchData(p, pp, trackFraction, tetIs, nw, Up); - // particle direction of travel - const vector& U = p.U(); + // particle velocity reletive to patch + const vector& U = p.U() - Up; // quick reject if particle travelling away from the patch - if ((-nw & U) < 0) + if ((nw & U) < 0) { return; } - nw /= mag(nw); const scalar magU = mag(U); const vector Udir = U/magU; @@ -197,6 +200,7 @@ void Foam::ParticleErosion<CloudType>::postPatch const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_); + const label patchFaceI = pp.whichFace(p.face()); scalar& Q = QPtr_->boundaryField()[patchI][patchFaceI]; if (tan(alpha) < K_/6.0) { diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H index c23dfc4c402d70b182e9b4708ede0a8bf0dccae6..c741bd40044b8df1a7a42537984b8ae321eb4f6c 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,8 +126,9 @@ public: virtual void postPatch ( const parcelType& p, - const label patchI, - const label patchFaceI + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C index afbd9bfbd9d6f337e8b1b01534093872401e9d07..f66a872cfcf5d6ee735ba6a24cbf4b987f7af0a9 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -218,11 +218,14 @@ template<class CloudType> void Foam::PatchPostProcessing<CloudType>::postPatch ( const parcelType& p, - const label patchI, - const label + const polyPatch& pp, + const scalar, + const tetIndices& tetIs ) { + const label patchI = pp.index(); const label localPatchI = applyToPatch(patchI); + if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_) { times_[localPatchI].append(this->owner().time().value()); diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H index 9945d24b587f23840c4483e45696d761435a45c6..f7d618e6ce8b1a448c22f502ceee137a2257f845 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,8 +127,9 @@ public: virtual void postPatch ( const parcelType& p, - const label patchI, - const label patchFaceI + const polyPatch& pp, + const scalar trackFraction, + const tetIndices& tetIs ); }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C index 5319b75b27a92af2b44f51e5981071f8abe0b221..6315eac8278c977f6a4a8f16e79f6f169929c137 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C @@ -306,8 +306,9 @@ void Foam::PairCollision<CloudType>::wallInteraction() this->owner().functions().postPatch ( p, - patchI, - patchFaceI + mesh.boundaryMesh()[patchI], + 1.0, + p.currentTetIndices() ); } } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C index 8ae15bab76d52342f696f6e58d28fd36ed81e1d9..ec9f1c0139807fb1b410f3dbfb1116c518813085 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C @@ -77,7 +77,7 @@ void Foam::CellZoneInjection<CloudType>::setPositions for (label tetI = 1; tetI < cellTetIs.size() - 1; tetI++) { cTetVFrac[tetI] = - (cTetVFrac[tetI-1] + cellTetIs[tetI].tet(mesh).mag())/V[cellI]; + cTetVFrac[tetI-1] + cellTetIs[tetI].tet(mesh).mag()/V[cellI]; } cTetVFrac.last() = 1.0; @@ -185,19 +185,49 @@ Foam::CellZoneInjection<CloudType>::CellZoneInjection ) ) { - const fvMesh& mesh = owner.mesh(); + updateMesh(); +} + + +template<class CloudType> +Foam::CellZoneInjection<CloudType>::CellZoneInjection +( + const CellZoneInjection<CloudType>& im +) +: + InjectionModel<CloudType>(im), + cellZoneName_(im.cellZoneName_), + numberDensity_(im.numberDensity_), + positions_(im.positions_), + injectorCells_(im.injectorCells_), + injectorTetFaces_(im.injectorTetFaces_), + injectorTetPts_(im.injectorTetPts_), + diameters_(im.diameters_), + U0_(im.U0_), + sizeDistribution_(im.sizeDistribution_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::CellZoneInjection<CloudType>::~CellZoneInjection() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +void Foam::CellZoneInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + const fvMesh& mesh = this->owner().mesh(); const label zoneI = mesh.cellZones().findZoneID(cellZoneName_); if (zoneI < 0) { - FatalErrorIn - ( - "Foam::CellZoneInjection<CloudType>::CellZoneInjection" - "(" - "const dictionary&, " - "CloudType&" - ")" - ) << "Unknown cell zone name: " << cellZoneName_ + FatalErrorIn("Foam::CellZoneInjection<CloudType>::updateMesh()") + << "Unknown cell zone name: " << cellZoneName_ << ". Valid cell zones are: " << mesh.cellZones().names() << nl << exit(FatalError); } @@ -212,14 +242,8 @@ Foam::CellZoneInjection<CloudType>::CellZoneInjection if ((nCells == 0) || (VCellsTotal*numberDensity_ < 1)) { - WarningIn - ( - "Foam::CellZoneInjection<CloudType>::CellZoneInjection" - "(" - "const dictionary&, " - "CloudType&" - ")" - ) << "Number of particles to be added to cellZone " << cellZoneName_ + WarningIn("Foam::CellZoneInjection<CloudType>::updateMesh()") + << "Number of particles to be added to cellZone " << cellZoneName_ << " is zero" << endl; } else @@ -242,34 +266,6 @@ Foam::CellZoneInjection<CloudType>::CellZoneInjection } -template<class CloudType> -Foam::CellZoneInjection<CloudType>::CellZoneInjection -( - const CellZoneInjection<CloudType>& im -) -: - InjectionModel<CloudType>(im), - cellZoneName_(im.cellZoneName_), - numberDensity_(im.numberDensity_), - positions_(im.positions_), - injectorCells_(im.injectorCells_), - injectorTetFaces_(im.injectorTetFaces_), - injectorTetPts_(im.injectorTetPts_), - diameters_(im.diameters_), - U0_(im.U0_), - sizeDistribution_(im.sizeDistribution_().clone().ptr()) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template<class CloudType> -Foam::CellZoneInjection<CloudType>::~CellZoneInjection() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - template<class CloudType> Foam::scalar Foam::CellZoneInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.H index 85bb877cf55f0147cf4aeeaa6d23d4e748f5d031..9edd88736e7cbc8ea9d390173d3ca3bc92fb6aa4 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.H @@ -130,6 +130,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index 6ccdd586f776004a20043551bd291a405371302b..d71e1b070eb8f89a70206b040814c6e671fa677d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -126,17 +126,7 @@ Foam::ConeInjection<CloudType>::ConeInjection // Set total volume to inject this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_); - // Set/cache the injector cells - forAll(positionAxis_, i) - { - this->findCellAtPosition - ( - injectorCells_[i], - injectorTetFaces_[i], - injectorTetPts_[i], - positionAxis_[i].first() - ); - } + updateMesh(); } @@ -173,6 +163,23 @@ Foam::ConeInjection<CloudType>::~ConeInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::ConeInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + forAll(positionAxis_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + injectorTetFaces_[i], + injectorTetPts_[i], + positionAxis_[i].first() + ); + } +} + + template<class CloudType> Foam::scalar Foam::ConeInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H index 24af84cd9d7c60f278b9c2be606ca1cc63d56c1b..0e72be57c480d743ddee9672e5de1952098ef38a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H @@ -144,6 +144,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C index 06222a2914a1afb139869d9021a496d9c3f8fec5..cebed76580d9df8b0e399bcefcb9a55681804ddf 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.C @@ -201,6 +201,8 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection // Set total volume to inject this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_); + + updateMesh(); } @@ -244,6 +246,30 @@ Foam::ConeNozzleInjection<CloudType>::~ConeNozzleInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::ConeNozzleInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + switch (injectionMethod_) + { + case imPoint: + { + this->findCellAtPosition + ( + injectorCell_, + tetFaceI_, + tetPtI_, + position_ + ); + } + default: + { + // do nothing + } + } +} + + template<class CloudType> Foam::scalar Foam::ConeNozzleInjection<CloudType>::timeEnd() const { @@ -342,6 +368,7 @@ void Foam::ConeNozzleInjection<CloudType>::setPositionAndCell "const label, " "const scalar, " "vector&, " + "label&, " "label&" ")" )<< "Unknown injectionMethod type" << nl diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H index e536fbd4d9287d3b05d87a309354c4ff9eae2486..87ca3fc8c1854226daba9d3fb18c8069556680bf 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeNozzleInjection/ConeNozzleInjection.H @@ -212,6 +212,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index 39c9c5f77cf79653716e4f09b89bdda22967d4fc..d6b59b9043c26727faf6e27b89198da3373b5e7d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -96,17 +96,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection this->volumeTotal_ = nParcelsPerInjector_*sum(pow3(diameters_))*pi/6.0; - // Set/cache the injector cells - forAll(positions_, i) - { - this->findCellAtPosition - ( - injectorCells_[i], - injectorTetFaces_[i], - injectorTetPts_[i], - positions_[i] - ); - } + updateMesh(); } @@ -142,6 +132,23 @@ Foam::FieldActivatedInjection<CloudType>::~FieldActivatedInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::FieldActivatedInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + forAll(positions_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + injectorTetFaces_[i], + injectorTetPts_[i], + positions_[i] + ); + } +} + + template<class CloudType> Foam::scalar Foam::FieldActivatedInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H index 548403d234768ecffeec9c2be6d12f0ebf2deb23..704345d8f536b3740f308de30f6079cc1387486d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H @@ -150,6 +150,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C index a8f3741fa20382033e6a5f47be8c8695afe1dc8d..3b732df8fd827d87a4a38d49a45ae2cccc05cdeb 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.C @@ -153,6 +153,13 @@ Foam::InflationInjection<CloudType>::~InflationInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::InflationInjection<CloudType>::updateMesh() +{ + // do nothing +} + + template<class CloudType> Foam::scalar Foam::InflationInjection<CloudType>::timeEnd() const { @@ -234,8 +241,8 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject "Foam::label " "Foam::InflationInjection<CloudType>::parcelsToInject" "(" - "const scalar time0, " - "const scalar time1" + "const scalar, " + "const scalar" ")" ) << "Maximum particle split iterations (" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H index 8d017780319ee0932890de6bf094039b5744fc83..8d3dd8dcc7b5501de0f1fd5b4ccc2f9164d2e53b 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InflationInjection/InflationInjection.H @@ -146,6 +146,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 1c10870726cea9e0ee62b5878fceb94ff7ed0433..a16de448b3a2a06a85930faa06e45c30c5b7a703 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -45,7 +45,7 @@ bool Foam::InjectionModel<CloudType>::validInjection(const label parcelI) template<class CloudType> -void Foam::InjectionModel<CloudType>::prepareForNextTimeStep +bool Foam::InjectionModel<CloudType>::prepareForNextTimeStep ( const scalar time, label& newParcels, @@ -55,12 +55,13 @@ void Foam::InjectionModel<CloudType>::prepareForNextTimeStep // Initialise values newParcels = 0; newVolume = 0.0; + bool validInjection = false; // Return if not started injection event if (time < SOI_) { timeStep0_ = time; - return; + return validInjection; } // Make times relative to SOI @@ -73,16 +74,27 @@ void Foam::InjectionModel<CloudType>::prepareForNextTimeStep // Volume of parcels to inject newVolume = this->volumeToInject(t0, t1); - // Hold previous time if no parcels, but non-zero volume fraction - if ((newParcels == 0) && (newVolume > 0.0)) + if (newVolume > 0) { - // hold value of timeStep0_ + if (newParcels > 0) + { + timeStep0_ = time; + validInjection = true; + } + else + { + // injection should have started, but not sufficient volume to + // produce (at least) 1 parcel - hold value of timeStep0_ + validInjection = false; + } } else { - // advance value of timeStep0_ timeStep0_ = time; + validInjection = false; } + + return validInjection; } @@ -272,6 +284,7 @@ Foam::InjectionModel<CloudType>::InjectionModel(CloudType& owner) SOI_(0.0), volumeTotal_(0.0), massTotal_(0.0), + massFlowRate_(owner.db().time(), "massFlowRate"), massInjected_(this->template getModelProperty<scalar>("massInjected")), nInjections_(this->template getModelProperty<label>("nInjections")), parcelsAddedTotal_ @@ -298,6 +311,7 @@ Foam::InjectionModel<CloudType>::InjectionModel SOI_(0.0), volumeTotal_(0.0), massTotal_(0.0), + massFlowRate_(owner.db().time(), "massFlowRate"), massInjected_(this->template getModelProperty<scalar>("massInjected")), nInjections_(this->template getModelProperty<scalar>("nInjections")), parcelsAddedTotal_ @@ -323,7 +337,8 @@ Foam::InjectionModel<CloudType>::InjectionModel } else { - this->coeffDict().lookup("massFlowRate") >> massTotal_; + massFlowRate_.reset(this->coeffDict()); + massTotal_ = massFlowRate_.value(owner.db().time().value()); } const word parcelBasisType = this->coeffDict().lookup("parcelBasisType"); @@ -372,6 +387,7 @@ Foam::InjectionModel<CloudType>::InjectionModel SOI_(im.SOI_), volumeTotal_(im.volumeTotal_), massTotal_(im.massTotal_), + massFlowRate_(im.massFlowRate_), massInjected_(im.massInjected_), nInjections_(im.nInjections_), parcelsAddedTotal_(im.parcelsAddedTotal_), @@ -391,6 +407,13 @@ Foam::InjectionModel<CloudType>::~InjectionModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::InjectionModel<CloudType>::updateMesh() +{ + // do nothing +} + + template<class CloudType> Foam::scalar Foam::InjectionModel<CloudType>::timeEnd() const { @@ -416,7 +439,7 @@ Foam::label Foam::InjectionModel<CloudType>::parcelsToInject "(" "const scalar, " "const scalar" - ") const" + ")" ); return 0; @@ -436,7 +459,7 @@ Foam::scalar Foam::InjectionModel<CloudType>::volumeToInject "(" "const scalar, " "const scalar" - ") const" + ")" ); return 0.0; @@ -446,7 +469,16 @@ Foam::scalar Foam::InjectionModel<CloudType>::volumeToInject template<class CloudType> Foam::scalar Foam::InjectionModel<CloudType>::averageParcelMass() { - label nTotal = parcelsToInject(0.0, timeEnd() - timeStart()); + label nTotal = 0.0; + if (this->owner().solution().transient()) + { + nTotal = parcelsToInject(0.0, timeEnd() - timeStart()); + } + else + { + nTotal = parcelsToInject(0.0, 1.0); + } + return massTotal_/nTotal; } @@ -461,9 +493,6 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) } const scalar time = this->owner().db().time().value(); - const scalar trackTime = this->owner().solution().trackTime(); - const polyMesh& mesh = this->owner().mesh(); - typename TrackData::cloudType& cloud = td.cloud(); // Prepare for next time step label parcelsAdded = 0; @@ -471,96 +500,95 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) label newParcels = 0; scalar newVolume = 0.0; - prepareForNextTimeStep(time, newParcels, newVolume); - - // Duration of injection period during this timestep - const scalar deltaT = - max(0.0, min(trackTime, min(time - SOI_, timeEnd() - time0_))); - - // Pad injection time if injection starts during this timestep - const scalar padTime = max(0.0, SOI_ - time0_); - - // Introduce new parcels linearly across carrier phase timestep - for (label parcelI = 0; parcelI < newParcels; parcelI++) + if (prepareForNextTimeStep(time, newParcels, newVolume)) { - if (validInjection(parcelI)) - { - // Calculate the pseudo time of injection for parcel 'parcelI' - scalar timeInj = time0_ + padTime + deltaT*parcelI/newParcels; + const scalar trackTime = this->owner().solution().trackTime(); + const polyMesh& mesh = this->owner().mesh(); + typename TrackData::cloudType& cloud = td.cloud(); - // Determine the injection position and owner cell, - // tetFace and tetPt - label cellI = -1; - label tetFaceI = -1; - label tetPtI = -1; + // Duration of injection period during this timestep + const scalar deltaT = + max(0.0, min(trackTime, min(time - SOI_, timeEnd() - time0_))); - vector pos = vector::zero; + // Pad injection time if injection starts during this timestep + const scalar padTime = max(0.0, SOI_ - time0_); - setPositionAndCell - ( - parcelI, - newParcels, - timeInj, - pos, - cellI, - tetFaceI, - tetPtI - ); - - if (cellI > -1) + // Introduce new parcels linearly across carrier phase timestep + for (label parcelI = 0; parcelI < newParcels; parcelI++) + { + if (validInjection(parcelI)) { - // Lagrangian timestep - scalar dt = time - timeInj; + // Calculate the pseudo time of injection for parcel 'parcelI' + scalar timeInj = time0_ + padTime + deltaT*parcelI/newParcels; - // Apply corrections to position for 2-D cases - meshTools::constrainToMeshCentre(mesh, pos); + // Determine the injection position and owner cell, + // tetFace and tetPt + label cellI = -1; + label tetFaceI = -1; + label tetPtI = -1; - // Create a new parcel - parcelType* pPtr = new parcelType + vector pos = vector::zero; + + setPositionAndCell ( - td.cloud().pMesh(), + parcelI, + newParcels, + timeInj, pos, cellI, tetFaceI, tetPtI ); - // Check/set new parcel thermo properties - cloud.setParcelThermoProperties(*pPtr, dt); + if (cellI > -1) + { + // Lagrangian timestep + scalar dt = time - timeInj; + + // Apply corrections to position for 2-D cases + meshTools::constrainToMeshCentre(mesh, pos); - // Assign new parcel properties in injection model - setProperties(parcelI, newParcels, timeInj, *pPtr); + // Create a new parcel + parcelType* pPtr = + new parcelType(mesh, pos, cellI, tetFaceI, tetPtI); - // Check/set new parcel injection properties - cloud.checkParcelProperties(*pPtr, dt, fullyDescribed()); + // Check/set new parcel thermo properties + cloud.setParcelThermoProperties(*pPtr, dt); - // Apply correction to velocity for 2-D cases - meshTools::constrainDirection - ( - mesh, - mesh.solutionD(), - pPtr->U() - ); + // Assign new parcel properties in injection model + setProperties(parcelI, newParcels, timeInj, *pPtr); - // Number of particles per parcel - pPtr->nParticle() = - setNumberOfParticles + // Check/set new parcel injection properties + cloud.checkParcelProperties(*pPtr, dt, fullyDescribed()); + + // Apply correction to velocity for 2-D cases + meshTools::constrainDirection ( - newParcels, - newVolume, - pPtr->d(), - pPtr->rho() + mesh, + mesh.solutionD(), + pPtr->U() ); - if (pPtr->move(td, dt)) - { - td.cloud().addParticle(pPtr); - massAdded += pPtr->nParticle()*pPtr->mass(); - parcelsAdded++; - } - else - { - delete pPtr; + // Number of particles per parcel + pPtr->nParticle() = + setNumberOfParticles + ( + newParcels, + newVolume, + pPtr->d(), + pPtr->rho() + ); + + if (pPtr->move(td, dt)) + { + td.cloud().addParticle(pPtr); + massAdded += pPtr->nParticle()*pPtr->mass(); + parcelsAdded++; + } + else + { + delete pPtr; + } } } } @@ -586,6 +614,8 @@ void Foam::InjectionModel<CloudType>::injectSteadyState const polyMesh& mesh = this->owner().mesh(); typename TrackData::cloudType& cloud = td.cloud(); + massTotal_ = massFlowRate_.value(mesh.time().value()); + // Reset counters time0_ = 0.0; label parcelsAdded = 0; @@ -625,14 +655,8 @@ void Foam::InjectionModel<CloudType>::injectSteadyState meshTools::constrainToMeshCentre(mesh, pos); // Create a new parcel - parcelType* pPtr = new parcelType - ( - td.cloud().pMesh(), - pos, - cellI, - tetFaceI, - tetPtI - ); + parcelType* pPtr = + new parcelType(mesh, pos, cellI, tetFaceI, tetPtI); // Check/set new parcel thermo properties cloud.setParcelThermoProperties(*pPtr, 0.0); @@ -644,12 +668,7 @@ void Foam::InjectionModel<CloudType>::injectSteadyState cloud.checkParcelProperties(*pPtr, 0.0, fullyDescribed()); // Apply correction to velocity for 2-D cases - meshTools::constrainDirection - ( - mesh, - mesh.solutionD(), - pPtr->U() - ); + meshTools::constrainDirection(mesh, mesh.solutionD(), pPtr->U()); // Number of particles per parcel pPtr->nParticle() = diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H index 30a2c97b16cb1e51947e7acd23ce95d938411d89..37e590924558d2f5e1bca629ebee9606ab4e6cf1 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H @@ -53,6 +53,7 @@ SourceFiles #include "runTimeSelectionTables.H" #include "SubModelBase.H" #include "vector.H" +#include "TimeDataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -102,6 +103,9 @@ protected: //- Total mass to inject [kg] scalar massTotal_; + //- Mass flow rate profile for steady calculations + TimeDataEntry<scalar> massFlowRate_; + //- Total mass injected to date [kg] scalar massInjected_; @@ -138,7 +142,7 @@ protected: virtual bool validInjection(const label parcelI); //- Determine properties for next time step/injection interval - virtual void prepareForNextTimeStep + virtual bool prepareForNextTimeStep ( const scalar time, label& newParcels, @@ -246,6 +250,12 @@ public: // Member Functions + // Mapping + + //- Update mesh + virtual void updateMesh(); + + // Global information //- Return the start-of-injection time diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.C index 072addac223b359eec2934ea0895268edc3b802a..ff7f3bdec396f852c397d4b7d2f2592fcb2e48ee 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.C @@ -168,6 +168,16 @@ Foam::scalar Foam::InjectionModelList<CloudType>::averageParcelMass() } +template<class CloudType> +void Foam::InjectionModelList<CloudType>::updateMesh() +{ + forAll(*this, i) + { + this->operator[](i).updateMesh(); + } +} + + template<class CloudType> template<class TrackData> void Foam::InjectionModelList<CloudType>::inject(TrackData& td) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.H index 1d67801e7dbde7848ea8f476c7b6d284cf8d7ed3..22213e20901561cc098dc6cbbe4ead2fbb0c3830 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModelList.H @@ -97,6 +97,12 @@ public: scalar averageParcelMass(); + // Edit + + //- Set injector locations when mesh is updated + void updateMesh(); + + // Per-injection event functions //- Main injection loop diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C index 8d971e80a71058cfc7e177041ab9a3f23c7a155b..c40a95fbaceed0370bc01540a19126eeea63be59 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C @@ -65,16 +65,7 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection injectorTetFaces_.setSize(injectors_.size()); injectorTetPts_.setSize(injectors_.size()); - forAll(injectors_, i) - { - this->findCellAtPosition - ( - injectorCells_[i], - injectorTetFaces_[i], - injectorTetPts_[i], - injectors_[i].x() - ); - } + updateMesh(); // Determine volume of particles to inject this->volumeTotal_ = 0.0; @@ -112,6 +103,23 @@ Foam::KinematicLookupTableInjection<CloudType>::~KinematicLookupTableInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::KinematicLookupTableInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + forAll(injectors_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + injectorTetFaces_[i], + injectorTetPts_[i], + injectors_[i].x() + ); + } +} + + template<class CloudType> Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H index 334a9b5bf0255d0768497303216855947c11bbb6..d156f4793a0fa7d5e7a5d86f1b7e963cc86c091b 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H @@ -129,6 +129,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C index 59a2a7d0663a1fb734f5c76d0b03e28be7cdf72f..5317d032045a75fba5b581e46a4fb85e2ad1b5ea 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C @@ -26,7 +26,6 @@ License #include "ManualInjection.H" #include "mathematicalConstants.H" #include "PackedBoolList.H" -#include "Switch.H" using namespace Foam::constant::mathematical; @@ -65,48 +64,13 @@ Foam::ManualInjection<CloudType>::ManualInjection this->coeffDict().subDict("sizeDistribution"), owner.rndGen() ) - ) -{ - Switch ignoreOutOfBounds + ), + ignoreOutOfBounds_ ( this->coeffDict().lookupOrDefault("ignoreOutOfBounds", false) - ); - - label nRejected = 0; - - PackedBoolList keep(positions_.size(), true); - - forAll(positions_, pI) - { - if - ( - !this->findCellAtPosition - ( - injectorCells_[pI], - injectorTetFaces_[pI], - injectorTetPts_[pI], - positions_[pI], - !ignoreOutOfBounds - ) - ) - { - keep[pI] = false; - - nRejected++; - } - } - - if (nRejected > 0) - { - inplaceSubset(keep, positions_); - inplaceSubset(keep, diameters_); - inplaceSubset(keep, injectorCells_); - inplaceSubset(keep, injectorTetFaces_); - inplaceSubset(keep, injectorTetPts_); - - Info<< " " << nRejected - << " particles ignored, out of bounds." << endl; - } + ) +{ + updateMesh(); // Construct parcel diameters forAll(diameters_, i) @@ -133,7 +97,8 @@ Foam::ManualInjection<CloudType>::ManualInjection injectorTetFaces_(im.injectorTetFaces_), injectorTetPts_(im.injectorTetPts_), U0_(im.U0_), - sizeDistribution_(im.sizeDistribution_().clone().ptr()) + sizeDistribution_(im.sizeDistribution_().clone().ptr()), + ignoreOutOfBounds_(im.ignoreOutOfBounds_) {} @@ -146,6 +111,46 @@ Foam::ManualInjection<CloudType>::~ManualInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::ManualInjection<CloudType>::updateMesh() +{ + label nRejected = 0; + + PackedBoolList keep(positions_.size(), true); + + forAll(positions_, pI) + { + if + ( + !this->findCellAtPosition + ( + injectorCells_[pI], + injectorTetFaces_[pI], + injectorTetPts_[pI], + positions_[pI], + !ignoreOutOfBounds_ + ) + ) + { + keep[pI] = false; + nRejected++; + } + } + + if (nRejected > 0) + { + inplaceSubset(keep, positions_); + inplaceSubset(keep, diameters_); + inplaceSubset(keep, injectorCells_); + inplaceSubset(keep, injectorTetFaces_); + inplaceSubset(keep, injectorTetPts_); + + Info<< " " << nRejected + << " particles ignored, out of bounds" << endl; + } +} + + template<class CloudType> Foam::scalar Foam::ManualInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H index 47e6c64a1270f28555cc762669bcd01db548055c..bbadab5409cf4c059298a9cc0a0cfd1cf25cc4f0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H @@ -43,6 +43,7 @@ SourceFiles #include "InjectionModel.H" #include "distributionModel.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +51,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class ManualInjection Declaration + Class ManualInjection Declaration \*---------------------------------------------------------------------------*/ template<class CloudType> @@ -84,6 +85,9 @@ class ManualInjection //- Parcel size distribution model const autoPtr<distributionModels::distributionModel> sizeDistribution_; + //- Flag to suppress errors if particle injection site is out-of-bounds + Switch ignoreOutOfBounds_; + public: @@ -120,6 +124,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C new file mode 100644 index 0000000000000000000000000000000000000000..af9fd37d036507852cc2892731deb26ba1ed9e90 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C @@ -0,0 +1,325 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "PatchFlowRateInjection.H" +#include "TimeDataEntry.H" +#include "distributionModel.H" +#include "mathematicalConstants.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection +( + const dictionary& dict, + CloudType& owner, + const word& modelName +) +: + InjectionModel<CloudType>(dict, owner, modelName,typeName), + patchName_(this->coeffDict().lookup("patchName")), + patchId_(owner.mesh().boundaryMesh().findPatchID(patchName_)), + patchArea_(0.0), + patchNormal_(vector::zero), + phiName_(this->coeffDict().template lookupOrDefault<word>("phi", "phi")), + rhoName_(this->coeffDict().template lookupOrDefault<word>("rho", "rho")), + duration_(readScalar(this->coeffDict().lookup("duration"))), + concentration_(readScalar(this->coeffDict().lookup("concentration"))), + parcelsPerSecond_ + ( + readScalar(this->coeffDict().lookup("parcelsPerSecond")) + ), + U0_(vector::zero), + sizeDistribution_ + ( + distributionModels::distributionModel::New + ( + this->coeffDict().subDict("sizeDistribution"), + owner.rndGen() + ) + ), + cellOwners_(), + fraction_(1.0), + pMeanVolume_(0.0) +{ + if (patchId_ < 0) + { + FatalErrorIn + ( + "PatchFlowRateInjection<CloudType>::PatchFlowRateInjection" + "(" + "const dictionary&, " + "CloudType&" + ")" + ) << "Requested patch " << patchName_ << " not found" << nl + << "Available patches are: " << owner.mesh().boundaryMesh().names() + << nl << exit(FatalError); + } + + const polyPatch& patch = owner.mesh().boundaryMesh()[patchId_]; + + duration_ = owner.db().time().userTimeToTime(duration_); + + updateMesh(); + + // TODO: retrieve mean diameter from distrution model + scalar pMeanDiameter = + readScalar(this->coeffDict().lookup("meanParticleDiameter")); + pMeanVolume_ = constant::mathematical::pi*pow3(pMeanDiameter)/6.0; + + // patch geometry + label patchSize = cellOwners_.size(); + label totalPatchSize = patchSize; + reduce(totalPatchSize, sumOp<label>()); + fraction_ = scalar(patchSize)/totalPatchSize; + + patchArea_ = gSum(mag(patch.faceAreas())); + patchNormal_ = gSum(patch.faceNormals())/totalPatchSize; + patchNormal_ /= mag(patchNormal_); + + // Re-initialise total mass/volume to inject to zero + // - will be reset during each injection + this->volumeTotal_ = 0.0; + this->massTotal_ = 0.0; +} + + +template<class CloudType> +Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection +( + const PatchFlowRateInjection<CloudType>& im +) +: + InjectionModel<CloudType>(im), + patchName_(im.patchName_), + patchId_(im.patchId_), + patchArea_(im.patchArea_), + patchNormal_(im.patchNormal_), + phiName_(im.phiName_), + rhoName_(im.rhoName_), + duration_(im.duration_), + concentration_(im.concentration_), + parcelsPerSecond_(im.parcelsPerSecond_), + U0_(im.U0_), + sizeDistribution_(im.sizeDistribution_().clone().ptr()), + cellOwners_(im.cellOwners_), + fraction_(im.fraction_), + pMeanVolume_(im.pMeanVolume_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::PatchFlowRateInjection<CloudType>::~PatchFlowRateInjection() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +void Foam::PatchFlowRateInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + const polyPatch& patch = this->owner().mesh().boundaryMesh()[patchId_]; + cellOwners_ = patch.faceCells(); +} + + +template<class CloudType> +Foam::scalar Foam::PatchFlowRateInjection<CloudType>::timeEnd() const +{ + return this->SOI_ + duration_; +} + + +template<class CloudType> +Foam::label Foam::PatchFlowRateInjection<CloudType>::parcelsToInject +( + const scalar time0, + const scalar time1 +) +{ + if ((time0 >= 0.0) && (time0 < duration_)) + { + scalar nParcels = fraction_*(time1 - time0)*parcelsPerSecond_; + + cachedRandom& rnd = this->owner().rndGen(); + + label nParcelsToInject = floor(nParcels); + + // Inject an additional parcel with a probability based on the + // remainder after the floor function + if + ( + nParcelsToInject > 0 + && ( + nParcels - scalar(nParcelsToInject) + > rnd.position(scalar(0), scalar(1)) + ) + ) + { + ++nParcelsToInject; + } + + return nParcelsToInject; + } + else + { + return 0; + } +} + + +template<class CloudType> +Foam::scalar Foam::PatchFlowRateInjection<CloudType>::volumeToInject +( + const scalar time0, + const scalar time1 +) +{ + scalar volume = 0.0; + + if ((time0 >= 0.0) && (time0 < duration_)) + { + const polyMesh& mesh = this->owner().mesh(); + + const surfaceScalarField& phi = + mesh.lookupObject<surfaceScalarField>(phiName_); + + const scalarField& phip = phi.boundaryField()[patchId_]; + + scalar carrierVolume = 0.0; + if (phi.dimensions() == dimVelocity*dimArea) + { + const scalar flowRateIn = max(0.0, -sum(phip)); + U0_ = -patchNormal_*flowRateIn/patchArea_; + carrierVolume = (time1 - time0)*flowRateIn; + } + else + { + const volScalarField& rho = + mesh.lookupObject<volScalarField>(rhoName_); + const scalarField& rhop = rho.boundaryField()[patchId_]; + + const scalar flowRateIn = max(0.0, -sum(phip/rhop)); + U0_ = -patchNormal_*flowRateIn/patchArea_; + carrierVolume = (time1 - time0)*flowRateIn; + } + + const scalar newParticles = concentration_*carrierVolume; + + volume = pMeanVolume_*newParticles; + } + + reduce(volume, sumOp<scalar>()); + + this->volumeTotal_ = volume; + this->massTotal_ = volume*this->owner().constProps().rho0(); + + return fraction_*volume; +} + + +template<class CloudType> +void Foam::PatchFlowRateInjection<CloudType>::setPositionAndCell +( + const label, + const label, + const scalar, + vector& position, + label& cellOwner, + label& tetFaceI, + label& tetPtI +) +{ + if (cellOwners_.size() > 0) + { + cachedRandom& rnd = this->owner().rndGen(); + + label cellI = rnd.position<label>(0, cellOwners_.size() - 1); + + cellOwner = cellOwners_[cellI]; + + // The position is between the face and cell centre, which could be + // in any tet of the decomposed cell, so arbitrarily choose the first + // face of the cell as the tetFace and the first point after the base + // point on the face as the tetPt. The tracking will pick the cell + // consistent with the motion in the firsttracking step. + tetFaceI = this->owner().mesh().cells()[cellOwner][0]; + tetPtI = 1; + + // position perturbed between cell and patch face centres + const vector& pc = this->owner().mesh().C()[cellOwner]; + const vector& pf = + this->owner().mesh().Cf().boundaryField()[patchId_][cellI]; + + const scalar a = rnd.sample01<scalar>(); + const vector d = pf - pc; + position = pc + 0.5*a*d; + } + else + { + cellOwner = -1; + tetFaceI = -1; + tetPtI = -1; + // dummy position + position = pTraits<vector>::max; + } +} + + +template<class CloudType> +void Foam::PatchFlowRateInjection<CloudType>::setProperties +( + const label, + const label, + const scalar, + typename CloudType::parcelType& parcel +) +{ + // set particle velocity + parcel.U() = U0_; + + // set particle diameter + parcel.d() = sizeDistribution_->sample(); +} + + +template<class CloudType> +bool Foam::PatchFlowRateInjection<CloudType>::fullyDescribed() const +{ + return false; +} + + +template<class CloudType> +bool Foam::PatchFlowRateInjection<CloudType>::validInjection(const label) +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H new file mode 100644 index 0000000000000000000000000000000000000000..e6822a76d7d537d201cc6bfbc54bff5ba237cef4 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H @@ -0,0 +1,207 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +Class + Foam::PatchFlowRateInjection + +Description + Patch injection + - uses patch flow rate to determine concentration and velociy + + - User specifies + - Total mass to inject + - Name of patch + - Injection duration + - Initial parcel velocity + - Injection target concentration/carrier volume flow rate + - Parcel diameters obtained by distribution model + - Parcels injected at cell centres adjacent to patch + +SourceFiles + PatchFlowRateInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PatchFlowRateInjection_H +#define PatchFlowRateInjection_H + +#include "InjectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template<class Type> +class TimeDataEntry; + +class distributionModel; + +/*---------------------------------------------------------------------------*\ + Class PatchFlowRateInjection Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class PatchFlowRateInjection +: + public InjectionModel<CloudType> +{ + // Private data + + //- Name of patch + const word patchName_; + + //- Id of patch + const label patchId_; + + //- Patch area + scalar patchArea_; + + //- Patch normal direction + vector patchNormal_; + + //- Name of carrier (mass or volume) flux field + const word phiName_; + + //- Name of carrier density field + const word rhoName_; + + //- Injection duration [s] + scalar duration_; + + //- Concentration of particles to carrier [] (particles/m3) + const scalar concentration_; + + //- Number of parcels to introduce per second [] + const label parcelsPerSecond_; + + //- Initial parcel velocity [m/s] + vector U0_; + + //- Parcel size distribution model + const autoPtr<distributionModels::distributionModel> sizeDistribution_; + + //- List of cell labels corresponding to injector positions + labelList cellOwners_; + + //- Fraction of injection controlled by this processor + scalar fraction_; + + //- Mean particle volume TODO: temporary measure - return from PDF + scalar pMeanVolume_; + + +public: + + //- Runtime type information + TypeName("patchFlowRateInjection"); + + + // Constructors + + //- Construct from dictionary + PatchFlowRateInjection + ( + const dictionary& dict, + CloudType& owner, + const word& modelName + ); + + //- Construct copy + PatchFlowRateInjection(const PatchFlowRateInjection<CloudType>& im); + + //- Construct and return a clone + virtual autoPtr<InjectionModel<CloudType> > clone() const + { + return autoPtr<InjectionModel<CloudType> > + ( + new PatchFlowRateInjection<CloudType>(*this) + ); + } + + + //- Destructor + virtual ~PatchFlowRateInjection(); + + + // Member Functions + + //- Set injector locations when mesh is updated + virtual void updateMesh(); + + //- Return the end-of-injection time + scalar timeEnd() const; + + //- Number of parcels to introduce relative to SOI + virtual label parcelsToInject(const scalar time0, const scalar time1); + + //- Volume of parcels to introduce relative to SOI + virtual scalar volumeToInject(const scalar time0, const scalar time1); + + + // Injection geometry + + //- Set the injection position and owner cell, tetFace and tetPt + virtual void setPositionAndCell + ( + const label parcelI, + const label nParcels, + const scalar time, + vector& position, + label& cellOwner, + label& tetFaceI, + label& tetPtI + ); + + virtual void setProperties + ( + const label parcelI, + const label nParcels, + const scalar time, + typename CloudType::parcelType& parcel + ); + + //- Flag to identify whether model fully describes the parcel + virtual bool fullyDescribed() const; + + //- Return flag to identify whether or not injection of parcelI is + // permitted + virtual bool validInjection(const label parcelI); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "PatchFlowRateInjection.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index aae52b8e22b70d97c57d8a27180968cb2625e723..9744364ca19e31c53969b286c5ea0bacf5596b1c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -80,11 +80,9 @@ Foam::PatchInjection<CloudType>::PatchInjection << nl << exit(FatalError); } - const polyPatch& patch = owner.mesh().boundaryMesh()[patchId_]; - duration_ = owner.db().time().userTimeToTime(duration_); - cellOwners_ = patch.faceCells(); + updateMesh(); label patchSize = cellOwners_.size(); label totalPatchSize = patchSize; @@ -125,6 +123,15 @@ Foam::PatchInjection<CloudType>::~PatchInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::PatchInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + const polyPatch& patch = this->owner().mesh().boundaryMesh()[patchId_]; + cellOwners_ = patch.faceCells(); +} + + template<class CloudType> Foam::scalar Foam::PatchInjection<CloudType>::timeEnd() const { @@ -141,7 +148,7 @@ Foam::label Foam::PatchInjection<CloudType>::parcelsToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - scalar nParcels =fraction_*(time1 - time0)*parcelsPerSecond_; + scalar nParcels = fraction_*(time1 - time0)*parcelsPerSecond_; cachedRandom& rnd = this->owner().rndGen(); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H index 15874727d82e9a188ae9f69e909c4e33e0c75b82..a9d5d60a36941e921c817aa9fed53f03db834ded 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H @@ -129,6 +129,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C index c1ce95e215cc7ff8bf80c11b2cfacdf0089fdb2f..8ffae4f75ffaf78d258af6494aefd410acf2541e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C @@ -39,8 +39,26 @@ Foam::LocalInteraction<CloudType>::LocalInteraction nEscape_(patchData_.size(), 0), massEscape_(patchData_.size(), 0.0), nStick_(patchData_.size(), 0), - massStick_(patchData_.size(), 0.0) + massStick_(patchData_.size(), 0.0), + writeFields_(this->coeffDict().lookupOrDefault("writeFields", false)), + massEscapePtr_(NULL), + massStickPtr_(NULL) { + if (writeFields_) + { + word massEscapeName(this->owner().name() + "::massEscape"); + word massStickName(this->owner().name() + "::massStick"); + Info<< " Interaction fields will be written to " << massEscapeName + << " and " << massStickName << endl; + + (void)massEscape(); + (void)massStick(); + } + else + { + Info<< " Interaction fields will not be written" << endl; + } + // check that interactions are valid/specified forAll(patchData_, patchI) { @@ -74,7 +92,10 @@ Foam::LocalInteraction<CloudType>::LocalInteraction nEscape_(pim.nEscape_), massEscape_(pim.massEscape_), nStick_(pim.nStick_), - massStick_(pim.massStick_) + massStick_(pim.massStick_), + writeFields_(pim.writeFields_), + massEscapePtr_(NULL), + massStickPtr_(NULL) {} @@ -87,6 +108,64 @@ Foam::LocalInteraction<CloudType>::~LocalInteraction() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +template<class CloudType> +Foam::volScalarField& Foam::LocalInteraction<CloudType>::massEscape() +{ + if (!massEscapePtr_.valid()) + { + const fvMesh& mesh = this->owner().mesh(); + + massEscapePtr_.reset + ( + new volScalarField + ( + IOobject + ( + this->owner().name() + "::massEscape", + mesh.time().timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimMass, 0.0) + ) + ); + } + + return massEscapePtr_(); +} + + +template<class CloudType> +Foam::volScalarField& Foam::LocalInteraction<CloudType>::massStick() +{ + if (!massStickPtr_.valid()) + { + const fvMesh& mesh = this->owner().mesh(); + + massStickPtr_.reset + ( + new volScalarField + ( + IOobject + ( + this->owner().name() + "::massStick", + mesh.time().timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimMass, 0.0) + ) + ); + } + + return massStickPtr_(); +} + + template<class CloudType> bool Foam::LocalInteraction<CloudType>::correct ( @@ -97,14 +176,13 @@ bool Foam::LocalInteraction<CloudType>::correct const tetIndices& tetIs ) { - vector& U = p.U(); - - bool& active = p.active(); - label patchI = patchData_.applyToPatch(pp.index()); if (patchI >= 0) { + vector& U = p.U(); + bool& active = p.active(); + typename PatchInteractionModel<CloudType>::interactionType it = this->wordToInteractionType ( @@ -115,20 +193,36 @@ bool Foam::LocalInteraction<CloudType>::correct { case PatchInteractionModel<CloudType>::itEscape: { + scalar dm = p.mass()*p.nParticle(); + keepParticle = false; active = false; U = vector::zero; nEscape_[patchI]++; - massEscape_[patchI] += p.mass()*p.nParticle(); + massEscape_[patchI] += dm; + if (writeFields_) + { + label pI = pp.index(); + label fI = pp.whichFace(p.face()); + massEscape().boundaryField()[pI][fI] += dm; + } break; } case PatchInteractionModel<CloudType>::itStick: { + scalar dm = p.mass()*p.nParticle(); + keepParticle = true; active = false; U = vector::zero; nStick_[patchI]++; - massStick_[patchI] += p.mass()*p.nParticle(); + massStick_[patchI] += dm; + if (writeFields_) + { + label pI = pp.index(); + label fI = pp.whichFace(p.face()); + massStick().boundaryField()[pI][fI] += dm; + } break; } case PatchInteractionModel<CloudType>::itRebound: @@ -139,7 +233,7 @@ bool Foam::LocalInteraction<CloudType>::correct vector nw; vector Up; - this->patchData(p, pp, trackFraction, tetIs, nw, Up); + this->owner().patchData(p, pp, trackFraction, tetIs, nw, Up); // Calculate motion relative to patch velocity U -= Up; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H index a3a28121f0ffd98904bdad4743b9c42ad397dbe5..3a8c7767763161541425d5af7dc687ac0a1a627a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H @@ -34,6 +34,7 @@ Description #include "PatchInteractionModel.H" #include "patchInteractionDataList.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,6 +70,16 @@ class LocalInteraction List<scalar> massStick_; + //- Flag to output data as fields + Switch writeFields_; + + //- Mass escape field + autoPtr<volScalarField> massEscapePtr_; + + //- Mass stick field + autoPtr<volScalarField> massStickPtr_; + + public: //- Runtime type information @@ -99,6 +110,12 @@ public: // Member Functions + //- Return access to the massEscape field + volScalarField& massEscape(); + + //- Return access to the massStick field + volScalarField& massStick(); + //- Apply velocity correction // Returns true if particle remains in same cell virtual bool correct diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C index 9d2566ab365c5d05436efe457e872dbaa51ec853..6ffabc3715861117161bdd83231eab1ec5997abc 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,159 +179,6 @@ bool Foam::PatchInteractionModel<CloudType>::correct } -template<class CloudType> -void Foam::PatchInteractionModel<CloudType>::patchData -( - typename CloudType::parcelType& p, - const polyPatch& pp, - const scalar trackFraction, - const tetIndices& tetIs, - vector& nw, - vector& Up -) const -{ - const fvMesh& mesh = this->owner().mesh(); - - const volVectorField& Ufield = - mesh.objectRegistry::lookupObject<volVectorField>(UName_); - - label patchI = pp.index(); - label patchFaceI = pp.whichFace(p.face()); - - vector n = tetIs.faceTri(mesh).normal(); - n /= mag(n); - - vector U = Ufield.boundaryField()[patchI][patchFaceI]; - - // Unless the face is rotating, the required normal is n; - nw = n; - - if (!mesh.moving()) - { - // Only wall patches may have a non-zero wall velocity from - // the velocity field when the mesh is not moving. - - if (isA<wallPolyPatch>(pp)) - { - Up = U; - } - else - { - Up = vector::zero; - } - } - else - { - vector U00 = Ufield.oldTime().boundaryField()[patchI][patchFaceI]; - - vector n00 = tetIs.oldFaceTri(mesh).normal(); - - // Difference in normal over timestep - vector dn = vector::zero; - - if (mag(n00) > SMALL) - { - // If the old normal is zero (for example in layer - // addition) then use the current normal, meaning that the - // motion can only be translational, and dn remains zero, - // otherwise, calculate dn: - - n00 /= mag(n00); - - dn = n - n00; - } - - // Total fraction thought the timestep of the motion, - // including stepFraction before the current tracking step - // and the current trackFraction - // i.e. - // let s = stepFraction, t = trackFraction - // Motion of x in time: - // |-----------------|---------|---------| - // x00 x0 xi x - // - // where xi is the correct value of x at the required - // tracking instant. - // - // x0 = x00 + s*(x - x00) = s*x + (1 - s)*x00 - // - // i.e. the motion covered by previous tracking portions - // within this timestep, and - // - // xi = x0 + t*(x - x0) - // = t*x + (1 - t)*x0 - // = t*x + (1 - t)*(s*x + (1 - s)*x00) - // = (s + t - s*t)*x + (1 - (s + t - s*t))*x00 - // - // let m = (s + t - s*t) - // - // xi = m*x + (1 - m)*x00 = x00 + m*(x - x00); - // - // In the same form as before. - - scalar m = - p.stepFraction() - + trackFraction - - (p.stepFraction()*trackFraction); - - // When the mesh is moving, the velocity field on wall patches - // will contain the velocity associated with the motion of the - // mesh, in which case it is interpolated in time using m. - // For other patches the face velocity will need to be - // reconstructed from the face centre motion. - - const vector& Cf = mesh.faceCentres()[p.face()]; - - vector Cf00 = mesh.faces()[p.face()].centre(mesh.oldPoints()); - - if (isA<wallPolyPatch>(pp)) - { - Up = U00 + m*(U - U00); - } - else - { - Up = (Cf - Cf00)/this->owner().time().deltaTValue(); - } - - if (mag(dn) > SMALL) - { - // Rotational motion, nw requires interpolation and a - // rotational velocity around face centre correction to Up - // is required. - - nw = n00 + m*dn; - - // Cf at tracking instant - vector Cfi = Cf00 + m*(Cf - Cf00); - - // Normal vector cross product - vector omega = (n00 ^ n); - - scalar magOmega = mag(omega); - - // magOmega = sin(angle between unit normals) - // Normalise omega vector by magOmega, then multiply by - // angle/dt to give the correct angular velocity vector. - omega *= - Foam::asin(magOmega) - /(magOmega*this->owner().time().deltaTValue()); - - // Project position onto face and calculate this position - // relative to the face centre. - vector facePos = - p.position() - - ((p.position() - Cfi) & nw)*nw - - Cfi; - - Up += (omega ^ facePos); - } - - // No further action is required if the motion is - // translational only, nw and Up have already been set. - } -} - - template<class CloudType> void Foam::PatchInteractionModel<CloudType>::info(Ostream& os) { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H index 293d2cdb4519ad877592115faa14bf878ad49393..7f3ea38198a66b26a8c86d5e7cbd86c1f6538683 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -164,18 +164,6 @@ public: const tetIndices& tetIs ); - //- Calculate the patch normal and velocity to interact with, - // accounting for patch motion if required. - void patchData - ( - typename CloudType::parcelType& p, - const polyPatch& pp, - const scalar trackFraction, - const tetIndices& tetIs, - vector& normal, - vector& Up - ) const; - // I-O diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C index 147408204b32429d3f1634a9bbfc3c0fecd172af..f6c1fda460c528353d81ad31929038a28f24e443 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,7 +74,7 @@ bool Foam::Rebound<CloudType>::correct vector nw; vector Up; - this->patchData(p, pp, trackFraction, tetIs, nw, Up); + this->owner().patchData(p, pp, trackFraction, tetIs, nw, Up); // Calculate motion relative to patch velocity U -= Up; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C index b3052a4ec2265ee223f08641697c3191c2f238d8..d9b38daccf745faf341291960c027c1a2c16cdee 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C @@ -148,7 +148,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct vector nw; vector Up; - this->patchData(p, pp, trackFraction, tetIs, nw, Up); + this->owner().patchData(p, pp, trackFraction, tetIs, nw, Up); // Calculate motion relative to patch velocity U -= Up; diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 76a22ffe443791ed8d27c0ba0118b4724b299891..72e56bf8843b5e238e5917eb6155f7089b28eb8e 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -156,18 +156,20 @@ Foam::CompositionModel<CloudType>::componentNames(const label phaseI) const template<class CloudType> Foam::label Foam::CompositionModel<CloudType>::globalCarrierId ( - const word& cmptName + const word& cmptName, + const bool allowNotFound ) const { label id = thermo_.carrierId(cmptName); - if (id < 0) + if (id < 0 && !allowNotFound) { FatalErrorIn ( "Foam::label Foam::CompositionModel<CloudType>::globalCarrierId" "(" - "const word&" + "const word&, " + "const bool" ") const" ) << "Unable to determine global id for requested component " << cmptName << ". Available components are " << nl @@ -182,19 +184,21 @@ template<class CloudType> Foam::label Foam::CompositionModel<CloudType>::globalId ( const label phaseI, - const word& cmptName + const word& cmptName, + const bool allowNotFound ) const { label id = phaseProps_[phaseI].globalId(cmptName); - if (id < 0) + if (id < 0 && !allowNotFound) { FatalErrorIn ( "Foam::label Foam::CompositionModel<CloudType>::globalId" "(" "const label, " - "const word&" + "const word&, " + "const bool" ") const" ) << "Unable to determine global id for requested component " << cmptName << abort(FatalError); @@ -218,19 +222,21 @@ template<class CloudType> Foam::label Foam::CompositionModel<CloudType>::localId ( const label phaseI, - const word& cmptName + const word& cmptName, + const bool allowNotFound ) const { label id = phaseProps_[phaseI].id(cmptName); - if (id < 0) + if (id < 0 && !allowNotFound) { FatalErrorIn ( "Foam::label Foam::CompositionModel<CloudType>::localId" "(" "const label, " - "const word&" + "const word&, " + "const bool" ") const" ) << "Unable to determine local id for component " << cmptName << abort(FatalError); @@ -244,12 +250,13 @@ template<class CloudType> Foam::label Foam::CompositionModel<CloudType>::localToGlobalCarrierId ( const label phaseI, - const label id + const label id, + const bool allowNotFound ) const { label gid = phaseProps_[phaseI].globalCarrierIds()[id]; - if (gid < 0) + if (gid < 0 && !allowNotFound) { FatalErrorIn ( @@ -257,7 +264,8 @@ Foam::label Foam::CompositionModel<CloudType>::localToGlobalCarrierId "Foam::CompositionModel<CloudType>::localToGlobalCarrierId" "(" "const label, " - "const label" + "const label, " + "const bool" ") const" ) << "Unable to determine global carrier id for phase " << phaseI << " with local id " << id diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index 724354902c269577b8c888aad4bffaeae602d3b0..cabdd91eac44692d24aec277feaa2e9a029ca8c4 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -166,22 +166,37 @@ public: const wordList& componentNames(const label phaseI) const; //- Return global id of component cmptName in carrier thermo - label globalCarrierId(const word& cmptName) const; + label globalCarrierId + ( + const word& cmptName, + const bool allowNotFound = false + ) const; //- Return global id of component cmptName in phase phaseI - label globalId(const label phaseI, const word& cmptName) const; + label globalId + ( + const label phaseI, + const word& cmptName, + const bool allowNotFound = false + ) const; //- Return global ids of for phase phaseI const labelList& globalIds(const label phaseI) const; //- Return local id of component cmptName in phase phaseI - label localId(const label phaseI, const word& cmptName) const; + label localId + ( + const label phaseI, + const word& cmptName, + const bool allowNotFound = false + ) const; //- Return global carrier id of component given local id label localToGlobalCarrierId ( const label phaseI, - const label id + const label id, + const bool allowNotFound = false ) const; //- Return the list of phase phaseI mass fractions diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C index 46dafd52e6e0a1b330a51ecd29157201b5bfe682..711b3cec7a04263d16f1e628d60523e0f3f44112 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C @@ -64,16 +64,7 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection injectorTetFaces_.setSize(injectors_.size()); injectorTetPts_.setSize(injectors_.size()); - forAll(injectors_, i) - { - this->findCellAtPosition - ( - injectorCells_[i], - injectorTetFaces_[i], - injectorTetPts_[i], - injectors_[i].x() - ); - } + updateMesh(); // Determine volume of particles to inject this->volumeTotal_ = 0.0; @@ -111,6 +102,23 @@ Foam::ReactingLookupTableInjection<CloudType>::~ReactingLookupTableInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::ReactingLookupTableInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + forAll(injectors_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + injectorTetFaces_[i], + injectorTetPts_[i], + injectors_[i].x() + ); + } +} + + template<class CloudType> Foam::scalar Foam::ReactingLookupTableInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H index ece4b5fb1919919a38cfd38126d55590fd1d94d9..ef062fd72bd2ccc3a2214af2f3912e54a13574df 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H @@ -132,6 +132,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C index eb4cfe6efeca3c230905c0f5b90bfa6f0703c152..0de07723819a21e16cc3959e41b81da81853886c 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,10 +102,13 @@ template<class CloudType> void Foam::ConstantRateDevolatilisation<CloudType>::calculate ( const scalar dt, + const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV ) const diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H index d84810e81e990d3625c7f7db6ef6419220953bd6..7faffb990da36a57c34473bd7faaf626bc6ad8c1 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,10 +104,13 @@ public: virtual void calculate ( const scalar dt, + const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV ) const; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C index 331ae8d78e2cf0f2297eecac097fdba7d4840c19..6b4325db4fa36966a3f1181dd5138941bbaf1dc9 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C @@ -78,6 +78,9 @@ void Foam::DevolatilisationModel<CloudType>::calculate const scalar, const scalar, const scalar, + const scalar, + const scalarField&, + const scalarField&, const scalarField&, bool&, scalarField& @@ -91,6 +94,9 @@ void Foam::DevolatilisationModel<CloudType>::calculate "const scalar, " "const scalar, " "const scalar, " + "const scalar, " + "const scalarField&, " + "const scalarField&, " "const scalarField&, " "bool&, " "scalarField&" diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H index 5b72c0a36d93f3792ce1438b6fe5747970ba97ad..7cff8d426a3ab795a56bab9831837bd32bbfea5a 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class DevolatilisationModel Declaration + Class DevolatilisationModel Declaration \*---------------------------------------------------------------------------*/ template<class CloudType> @@ -126,10 +126,13 @@ public: virtual void calculate ( const scalar dt, + const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV ) const; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C index f2b581971532e9f8ffcc1e93731921d17d600320..238cb4a02ed59e253ac3ba433327b5d55b5fa576 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,9 @@ void Foam::NoDevolatilisation<CloudType>::calculate const scalar, const scalar, const scalar, + const scalar, + const scalarField&, + const scalarField&, const scalarField&, bool& canCombust, scalarField& diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H index 1b905d42fd94ecb3810e7a49e6cd65e9d0666a9a..b3a617ba86850aaec06e90381104ab5a5f2d8f55 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,10 +85,13 @@ public: virtual void calculate ( const scalar dt, + const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV ) const; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C index fd0f1429e31c297c9eebfe18c8cd8bdd951b0cb6..fe4b856cfbcf36dba3d44ff1a9bed0eedf61bc57 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,10 +105,13 @@ template<class CloudType> void Foam::SingleKineticRateDevolatilisation<CloudType>::calculate ( const scalar dt, + const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV ) const diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H index 535c7dfe1d4fb4ccc7e127cc6146e388874300f7..d9c3064ce9a09205245489eb494a8c038d4de820 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -229,10 +229,13 @@ public: virtual void calculate ( const scalar dt, + const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField& YGasEff, + const scalarField& YLiquidEff, + const scalarField& YSolidEff, bool& canCombust, scalarField& dMassDV ) const; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C index 192f2a55720d37f6d163effe5ce5c207bdc449c8..bd630d879dafdf1f668992f3614fdb7e40105348 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.C @@ -65,16 +65,7 @@ ReactingMultiphaseLookupTableInjection injectorTetFaces_.setSize(injectors_.size()); injectorTetPts_.setSize(injectors_.size()); - forAll(injectors_, i) - { - this->findCellAtPosition - ( - injectorCells_[i], - injectorTetFaces_[i], - injectorTetPts_[i], - injectors_[i].x() - ); - } + updateMesh(); // Determine volume of particles to inject this->volumeTotal_ = 0.0; @@ -114,6 +105,23 @@ Foam::ReactingMultiphaseLookupTableInjection<CloudType>:: // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + forAll(injectors_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + injectorTetFaces_[i], + injectorTetPts_[i], + injectors_[i].x() + ); + } +} + + template<class CloudType> Foam::scalar Foam::ReactingMultiphaseLookupTableInjection<CloudType>::timeEnd() const diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H index 6ee4b576c3aabb9c7458c280f7b17f6bd6c20fdc..7e6c32855817f3c85823f199886bbd2b8c55458d 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/InjectionModel/ReactingMultiphaseLookupTableInjection/ReactingMultiphaseLookupTableInjection.H @@ -135,6 +135,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C index 78a7d0725d973eb9ed3cdd1f7f0f7af51cef7ad5..fdc0a3b4a3eeb79d23cd2e81c40d4f1d06b6d62c 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C @@ -65,16 +65,7 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection injectorTetFaces_.setSize(injectors_.size()); injectorTetPts_.setSize(injectors_.size()); - forAll(injectors_, i) - { - this->findCellAtPosition - ( - injectorCells_[i], - injectorTetFaces_[i], - injectorTetPts_[i], - injectors_[i].x() - ); - } + updateMesh(); // Determine volume of particles to inject this->volumeTotal_ = 0.0; @@ -112,6 +103,23 @@ Foam::ThermoLookupTableInjection<CloudType>::~ThermoLookupTableInjection() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class CloudType> +void Foam::ThermoLookupTableInjection<CloudType>::updateMesh() +{ + // Set/cache the injector cells + forAll(injectors_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + injectorTetFaces_[i], + injectorTetPts_[i], + injectors_[i].x() + ); + } +} + + template<class CloudType> Foam::scalar Foam::ThermoLookupTableInjection<CloudType>::timeEnd() const { diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H index 61df05a112e9bc503eaf05a6ffb583577b8d5fb4..efb83c3614e04fe8ffb8993a5cd9b062c5061ec0 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H @@ -132,6 +132,9 @@ public: // Member Functions + //- Set injector locations when mesh is updated + virtual void updateMesh(); + //- Return the end-of-injection time scalar timeEnd() const; diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C index 3381bbc087f2f82e036bc72b503a2b59e696eb78..9bbd82d21f10e418ba833bc3a79b97e515f1583d 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C @@ -404,7 +404,7 @@ void Foam::SprayParcel<ParcelType>::solveTABEq // oscillation frequency (squared) scalar omega2 = TABComega*sigma/(rho*r3) - rtd*rtd; - if(omega2 > 0) + if (omega2 > 0) { scalar omega = sqrt(omega2); scalar rhoc = this->rhoc(); diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H index dc5bd6225e8cd4a358d65da101a9ba352fbd42f9..dba5fa2e2df3512c5897475ee319e030ab0e9b88 100644 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ License #include "ManualInjection.H" #include "NoInjection.H" #include "PatchInjection.H" +#include "PatchFlowRateInjection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,6 +51,7 @@ License makeInjectionModelType(InflationInjection, CloudType); \ makeInjectionModelType(ManualInjection, CloudType); \ makeInjectionModelType(NoInjection, CloudType); \ + makeInjectionModelType(PatchFlowRateInjection, CloudType); \ makeInjectionModelType(PatchInjection, CloudType); diff --git a/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H index a153b5a0caad655cd57fae9edb47bf6d50dc4c0e..b17798dd6ffacddd14e3111bbb50539ecd17710c 100644 --- a/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H +++ b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H @@ -4,7 +4,7 @@ scalar minValue = min(d, dD/10.0); scalar maxValue = dD; - if(maxValue - minValue < SMALL) + if (maxValue - minValue < SMALL) { minValue = d/10.0; } diff --git a/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C b/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C index fc34d0c224feb5db160421300661b920a4231d14..a5816c8f99732ce11a966a6bbc5564b157e8b495 100644 --- a/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C +++ b/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -176,11 +176,11 @@ bool Foam::SHF<CloudType>::update if (weGas > weConst_) { - if(weGas < weCrit1_) + if (weGas < weCrit1_) { tCharSecond = c1_*pow((weGas - weConst_), cExp1_); } - else if(weGas >= weCrit1_ && weGas <= weCrit2_) + else if (weGas >= weCrit1_ && weGas <= weCrit2_) { tCharSecond = c2_*pow((weGas - weConst_), cExp2_); } diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 5781ef991181cc4749ed2c3cac0bd59f1e30925f..7e85e6723e3db77181ac9ac223de233a26373196 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -25,7 +25,6 @@ License #include "AMIInterpolation.H" #include "meshTools.H" -#include "mergePoints.H" #include "mapDistribute.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -204,455 +203,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::resetTree } -template<class SourcePatch, class TargetPatch> -Foam::label Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcDistribution -( - const SourcePatch& srcPatch, - const TargetPatch& tgtPatch -) const -{ - label procI = 0; - - if (Pstream::parRun()) - { - List<label> facesPresentOnProc(Pstream::nProcs(), 0); - if ((srcPatch.size() > 0) || (tgtPatch.size() > 0)) - { - facesPresentOnProc[Pstream::myProcNo()] = 1; - } - else - { - facesPresentOnProc[Pstream::myProcNo()] = 0; - } - - Pstream::gatherList(facesPresentOnProc); - Pstream::scatterList(facesPresentOnProc); - - label nHaveFaces = sum(facesPresentOnProc); - - if (nHaveFaces > 1) - { - procI = -1; - if (debug) - { - Info<< "AMIInterpolation::calcDistribution: " - << "AMI split across multiple processors" << endl; - } - } - else if (nHaveFaces == 1) - { - procI = findIndex(facesPresentOnProc, 1); - if (debug) - { - Info<< "AMIInterpolation::calcDistribution: " - << "AMI local to processor" << procI << endl; - } - } - } - - - // Either not parallel or no faces on any processor - return procI; -} - - -template<class SourcePatch, class TargetPatch> -Foam::label -Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs -( - const List<treeBoundBoxList>& procBb, - const treeBoundBox& bb, - boolList& overlaps -) const -{ - overlaps.setSize(procBb.size()); - overlaps = false; - - label nOverlaps = 0; - - forAll(procBb, procI) - { - const List<treeBoundBox>& bbs = procBb[procI]; - - forAll(bbs, bbI) - { - if (bbs[bbI].overlaps(bb)) - { - overlaps[procI] = true; - nOverlaps++; - break; - } - } - } - return nOverlaps; -} - - -template<class SourcePatch, class TargetPatch> -void Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributePatches -( - const mapDistribute& map, - const TargetPatch& pp, - const globalIndex& gi, - List<faceList>& faces, - List<pointField>& points, - List<labelList>& faceIDs -) const -{ - PstreamBuffers pBufs(Pstream::nonBlocking); - - for (label domain = 0; domain < Pstream::nProcs(); domain++) - { - const labelList& sendElems = map.subMap()[domain]; - - if (domain != Pstream::myProcNo() && sendElems.size()) - { - labelList globalElems(sendElems.size()); - forAll(sendElems, i) - { - globalElems[i] = gi.toGlobal(sendElems[i]); - } - - faceList subFaces(UIndirectList<face>(pp, sendElems)); - primitivePatch subPatch - ( - SubList<face>(subFaces, subFaces.size()), - pp.points() - ); - - if (debug & 2) - { - Pout<< "distributePatches: to processor " << domain - << " sending faces " << subPatch.faceCentres() << endl; - } - - UOPstream toDomain(domain, pBufs); - toDomain - << subPatch.localFaces() << subPatch.localPoints() - << globalElems; - } - } - - // Start receiving - pBufs.finishedSends(); - - faces.setSize(Pstream::nProcs()); - points.setSize(Pstream::nProcs()); - faceIDs.setSize(Pstream::nProcs()); - - { - // Set up 'send' to myself - const labelList& sendElems = map.subMap()[Pstream::myProcNo()]; - faceList subFaces(UIndirectList<face>(pp, sendElems)); - primitivePatch subPatch - ( - SubList<face>(subFaces, subFaces.size()), - pp.points() - ); - - // Receive - if (debug & 2) - { - Pout<< "distributePatches: to processor " << Pstream::myProcNo() - << " sending faces " << subPatch.faceCentres() << endl; - } - - faces[Pstream::myProcNo()] = subPatch.localFaces(); - points[Pstream::myProcNo()] = subPatch.localPoints(); - - faceIDs[Pstream::myProcNo()].setSize(sendElems.size()); - forAll(sendElems, i) - { - faceIDs[Pstream::myProcNo()][i] = gi.toGlobal(sendElems[i]); - } - } - - // Consume - for (label domain = 0; domain < Pstream::nProcs(); domain++) - { - const labelList& recvElems = map.constructMap()[domain]; - - if (domain != Pstream::myProcNo() && recvElems.size()) - { - UIPstream str(domain, pBufs); - - str >> faces[domain] - >> points[domain] - >> faceIDs[domain]; - } - } -} - - -template<class SourcePatch, class TargetPatch> -void Foam::AMIInterpolation<SourcePatch, TargetPatch>:: -distributeAndMergePatches -( - const mapDistribute& map, - const TargetPatch& tgtPatch, - const globalIndex& gi, - faceList& tgtFaces, - pointField& tgtPoints, - labelList& tgtFaceIDs -) const -{ - // Exchange per-processor data - List<faceList> allFaces; - List<pointField> allPoints; - List<labelList> allTgtFaceIDs; - distributePatches(map, tgtPatch, gi, allFaces, allPoints, allTgtFaceIDs); - - // Renumber and flatten - label nFaces = 0; - label nPoints = 0; - forAll(allFaces, procI) - { - nFaces += allFaces[procI].size(); - nPoints += allPoints[procI].size(); - } - - tgtFaces.setSize(nFaces); - tgtPoints.setSize(nPoints); - tgtFaceIDs.setSize(nFaces); - - nFaces = 0; - nPoints = 0; - - // My own data first - { - const labelList& faceIDs = allTgtFaceIDs[Pstream::myProcNo()]; - SubList<label>(tgtFaceIDs, faceIDs.size()).assign(faceIDs); - - const faceList& fcs = allFaces[Pstream::myProcNo()]; - forAll(fcs, i) - { - const face& f = fcs[i]; - face& newF = tgtFaces[nFaces++]; - newF.setSize(f.size()); - forAll(f, fp) - { - newF[fp] = f[fp] + nPoints; - } - } - - const pointField& pts = allPoints[Pstream::myProcNo()]; - forAll(pts, i) - { - tgtPoints[nPoints++] = pts[i]; - } - } - - - // Other proc data follows - forAll(allFaces, procI) - { - if (procI != Pstream::myProcNo()) - { - const labelList& faceIDs = allTgtFaceIDs[procI]; - SubList<label>(tgtFaceIDs, faceIDs.size(), nFaces).assign(faceIDs); - - const faceList& fcs = allFaces[procI]; - forAll(fcs, i) - { - const face& f = fcs[i]; - face& newF = tgtFaces[nFaces++]; - newF.setSize(f.size()); - forAll(f, fp) - { - newF[fp] = f[fp] + nPoints; - } - } - - const pointField& pts = allPoints[procI]; - forAll(pts, i) - { - tgtPoints[nPoints++] = pts[i]; - } - } - } - - // Merge - labelList oldToNew; - pointField newTgtPoints; - bool hasMerged = mergePoints - ( - tgtPoints, - SMALL, - false, - oldToNew, - newTgtPoints - ); - - if (hasMerged) - { - if (debug) - { - Pout<< "Merged from " << tgtPoints.size() - << " down to " << newTgtPoints.size() << " points" << endl; - } - - tgtPoints.transfer(newTgtPoints); - forAll(tgtFaces, i) - { - inplaceRenumber(oldToNew, tgtFaces[i]); - } - } -} - - -template<class SourcePatch, class TargetPatch> -Foam::autoPtr<Foam::mapDistribute> -Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcProcMap -( - const SourcePatch& srcPatch, - const TargetPatch& tgtPatch -) const -{ - // Get decomposition of patch - List<treeBoundBoxList> procBb(Pstream::nProcs()); - - if (srcPatch.size()) - { - procBb[Pstream::myProcNo()] = treeBoundBoxList - ( - 1, // For now single bounding box per proc - treeBoundBox - ( - srcPatch.points(), - srcPatch.meshPoints() - ) - ); - } - else - { - procBb[Pstream::myProcNo()] = treeBoundBoxList(); - } - - // slightly increase size of bounding boxes to allow for cases where - // bounding boxes are perfectly alligned - forAll(procBb[Pstream::myProcNo()], bbI) - { - treeBoundBox& bb = procBb[Pstream::myProcNo()][bbI]; - bb.inflate(0.01); - } - - Pstream::gatherList(procBb); - Pstream::scatterList(procBb); - - - if (debug) - { - Info<< "Determining extent of srcPatch per processor:" << nl - << "\tproc\tbb" << endl; - forAll(procBb, procI) - { - Info<< '\t' << procI << '\t' << procBb[procI] << endl; - } - } - - - // Determine which faces of tgtPatch overlaps srcPatch per proc - const faceList& faces = tgtPatch.localFaces(); - const pointField& points = tgtPatch.localPoints(); - - labelListList sendMap; - - { - // Per processor indices into all segments to send - List<DynamicList<label> > dynSendMap(Pstream::nProcs()); - - // Work array - whether processor bb overlaps the face bounds - boolList procBbOverlaps(Pstream::nProcs()); - - forAll(faces, faceI) - { - if (faces[faceI].size()) - { - treeBoundBox faceBb(points, faces[faceI]); - - // Find the processor this face overlaps - calcOverlappingProcs(procBb, faceBb, procBbOverlaps); - - forAll(procBbOverlaps, procI) - { - if (procBbOverlaps[procI]) - { - dynSendMap[procI].append(faceI); - } - } - } - } - - // Convert dynamicList to labelList - sendMap.setSize(Pstream::nProcs()); - forAll(sendMap, procI) - { - sendMap[procI].transfer(dynSendMap[procI]); - } - } - - // Debug printing - if (debug) - { - Pout<< "Of my " << faces.size() << " I need to send to:" << nl - << "\tproc\tfaces" << endl; - forAll(sendMap, procI) - { - Pout<< '\t' << procI << '\t' << sendMap[procI].size() << endl; - } - } - - - // Send over how many faces I need to receive - labelListList sendSizes(Pstream::nProcs()); - sendSizes[Pstream::myProcNo()].setSize(Pstream::nProcs()); - forAll(sendMap, procI) - { - sendSizes[Pstream::myProcNo()][procI] = sendMap[procI].size(); - } - Pstream::gatherList(sendSizes); - Pstream::scatterList(sendSizes); - - - // Determine order of receiving - labelListList constructMap(Pstream::nProcs()); - - // My local segment first - constructMap[Pstream::myProcNo()] = identity - ( - sendMap[Pstream::myProcNo()].size() - ); - - label segmentI = constructMap[Pstream::myProcNo()].size(); - forAll(constructMap, procI) - { - if (procI != Pstream::myProcNo()) - { - // What I need to receive is what other processor is sending to me - label nRecv = sendSizes[procI][Pstream::myProcNo()]; - constructMap[procI].setSize(nRecv); - - for (label i = 0; i < nRecv; i++) - { - constructMap[procI][i] = segmentI++; - } - } - } - - autoPtr<mapDistribute> mapPtr - ( - new mapDistribute - ( - segmentI, // size after construction - sendMap.xfer(), - constructMap.xfer() - ) - ); - - return mapPtr; -} - - template<class SourcePatch, class TargetPatch> void Foam::AMIInterpolation<SourcePatch, TargetPatch>::projectPointsToSurface ( @@ -713,7 +263,7 @@ Foam::label Foam::AMIInterpolation<SourcePatch, TargetPatch>::findTargetFace const pointField& srcPts = srcPatch.points(); const face& srcFace = srcPatch[srcFaceI]; - const point& srcPt = srcFace.centre(srcPts); + const point srcPt = srcFace.centre(srcPts); const scalar srcFaceArea = srcMagSf_[srcFaceI]; // pointIndexHit sample = treePtr_->findNearest(srcPt, sqr(0.1*bb.mag())); @@ -782,6 +332,62 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::appendNbrFaces } +template<class SourcePatch, class TargetPatch> +bool Foam::AMIInterpolation<SourcePatch, TargetPatch>::processSourceFace +( + const SourcePatch& srcPatch, + const TargetPatch& tgtPatch, + const label srcFaceI, + const label tgtStartFaceI, + + // list of tgt face neighbour faces + DynamicList<label>& nbrFaces, + // list of faces currently visited for srcFaceI to avoid multiple hits + DynamicList<label>& visitedFaces, + + // temporary storage for addressing and weights + List<DynamicList<label> >& srcAddr, + List<DynamicList<scalar> >& srcWght, + List<DynamicList<label> >& tgtAddr, + List<DynamicList<scalar> >& tgtWght +) +{ + nbrFaces.clear(); + visitedFaces.clear(); + + // append initial target face and neighbours + nbrFaces.append(tgtStartFaceI); + appendNbrFaces(tgtStartFaceI, tgtPatch, visitedFaces, nbrFaces); + + bool faceProcessed = false; + + do + { + // process new target face + label tgtFaceI = nbrFaces.remove(); + visitedFaces.append(tgtFaceI); + scalar area = interArea(srcFaceI, tgtFaceI, srcPatch, tgtPatch); + + // store when intersection area > 0 + if (area > 0) + { + srcAddr[srcFaceI].append(tgtFaceI); + srcWght[srcFaceI].append(area); + + tgtAddr[tgtFaceI].append(srcFaceI); + tgtWght[tgtFaceI].append(area); + + appendNbrFaces(tgtFaceI, tgtPatch, visitedFaces, nbrFaces); + + faceProcessed = true; + } + + } while (nbrFaces.size() > 0); + + return faceProcessed; +} + + template<class SourcePatch, class TargetPatch> void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces ( @@ -811,7 +417,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces label faceT = visitedFaces[j]; scalar area = interArea(faceS, faceT, srcPatch0, tgtPatch0); - if (area > 0) + // Check that faces have enough overlap for robust walking + if (area/srcMagSf_[srcFaceI] > faceAreaIntersect::tolerance()) { // TODO - throwing area away - re-use in next iteration? @@ -864,7 +471,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces << "target face" << endl; } -// foundNextSeed = false; + foundNextSeed = false; for (label faceI = startSeedI; faceI < mapFlag.size(); faceI++) { if (mapFlag[faceI]) @@ -887,7 +494,8 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::setNextFaces FatalErrorIn ( - "void Foam::cyclicAMIPolyPatch::setNextFaces" + "void Foam::AMIInterpolation<SourcePatch, TargetPatch>::" + "setNextFaces" "(" "label&, " "label&, " @@ -946,6 +554,25 @@ Foam::scalar Foam::AMIInterpolation<SourcePatch, TargetPatch>::interArea { area = inter.calc(src, tgt, n, triMode_); } + else + { + WarningIn + ( + "void Foam::AMIInterpolation<SourcePatch, TargetPatch>::" + "interArea" + "(" + "const label, " + "const label, " + "const SourcePatch&, " + "const TargetPatch&" + ") const" + ) << "Invalid normal for source face " << srcFaceI + << " points " << UIndirectList<point>(srcPoints, src) + << " target face " << tgtFaceI + << " points " << UIndirectList<point>(tgtPoints, tgt) + << endl; + } + if ((debug > 1) && (area > 0)) { @@ -956,6 +583,105 @@ Foam::scalar Foam::AMIInterpolation<SourcePatch, TargetPatch>::interArea } +template<class SourcePatch, class TargetPatch> +void Foam::AMIInterpolation<SourcePatch, TargetPatch>:: +restartUncoveredSourceFace +( + const SourcePatch& srcPatch, + const TargetPatch& tgtPatch, + List<DynamicList<label> >& srcAddr, + List<DynamicList<scalar> >& srcWght, + List<DynamicList<label> >& tgtAddr, + List<DynamicList<scalar> >& tgtWght +) +{ + // Collect all src faces with a low weight + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + labelHashSet lowWeightFaces(100); + forAll(srcWght, srcFaceI) + { + scalar s = sum(srcWght[srcFaceI]); + scalar t = s/srcMagSf_[srcFaceI]; + + if (t < 0.5) + { + lowWeightFaces.insert(srcFaceI); + } + } + + Info<< "AMIInterpolation : restarting search on " + << returnReduce(lowWeightFaces.size(), sumOp<label>()) + << " faces since sum of weights < 0.5" << endl; + + if (lowWeightFaces.size() > 0) + { + // Erase all the lowWeight source faces from the target + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + DynamicList<label> okSrcFaces(10); + DynamicList<scalar> okSrcWeights(10); + forAll(tgtAddr, tgtFaceI) + { + okSrcFaces.clear(); + okSrcWeights.clear(); + DynamicList<label>& srcFaces = tgtAddr[tgtFaceI]; + DynamicList<scalar>& srcWeights = tgtWght[tgtFaceI]; + forAll(srcFaces, i) + { + if (!lowWeightFaces.found(srcFaces[i])) + { + okSrcFaces.append(srcFaces[i]); + okSrcWeights.append(srcWeights[i]); + } + } + if (okSrcFaces.size() < srcFaces.size()) + { + srcFaces.transfer(okSrcFaces); + srcWeights.transfer(okSrcWeights); + } + } + + + + // Restart search from best hit + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // list of tgt face neighbour faces + DynamicList<label> nbrFaces(10); + + // list of faces currently visited for srcFaceI to avoid multiple hits + DynamicList<label> visitedFaces(10); + + forAllConstIter(labelHashSet, lowWeightFaces, iter) + { + label srcFaceI = iter.key(); + label tgtFaceI = findTargetFace(srcFaceI, srcPatch); + if (tgtFaceI != -1) + { + //bool faceProcessed = + processSourceFace + ( + srcPatch, + tgtPatch, + srcFaceI, + tgtFaceI, + + nbrFaces, + visitedFaces, + + srcAddr, + srcWght, + tgtAddr, + tgtWght + ); + // ? Check faceProcessed to see if restarting has worked. + } + } + } +} + + template<class SourcePatch, class TargetPatch> void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing ( @@ -1073,37 +799,22 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing DynamicList<label> nonOverlapFaces; do { - nbrFaces.clear(); - visitedFaces.clear(); - - // append initial target face and neighbours - nbrFaces.append(tgtFaceI); - appendNbrFaces(tgtFaceI, tgtPatch, visitedFaces, nbrFaces); - - bool faceProcessed = false; - - do - { - // process new target face - tgtFaceI = nbrFaces.remove(); - visitedFaces.append(tgtFaceI); - scalar area = interArea(srcFaceI, tgtFaceI, srcPatch, tgtPatch); - - // store when intersection area > 0 - if (area > 0) - { - srcAddr[srcFaceI].append(tgtFaceI); - srcWght[srcFaceI].append(area); - - tgtAddr[tgtFaceI].append(srcFaceI); - tgtWght[tgtFaceI].append(area); - - appendNbrFaces(tgtFaceI, tgtPatch, visitedFaces, nbrFaces); + // Do advancing front starting from srcFaceI,tgtFaceI + bool faceProcessed = processSourceFace + ( + srcPatch, + tgtPatch, + srcFaceI, + tgtFaceI, - faceProcessed = true; - } + nbrFaces, + visitedFaces, - } while (nbrFaces.size() > 0); + srcAddr, + srcWght, + tgtAddr, + tgtWght + ); mapFlag[srcFaceI] = false; @@ -1140,6 +851,22 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing srcNonOverlap_.transfer(nonOverlapFaces); } + + // Check for badly covered faces + if (debug) + { + restartUncoveredSourceFace + ( + srcPatch, + tgtPatch, + srcAddr, + srcWght, + tgtAddr, + tgtWght + ); + } + + // transfer data to persistent storage forAll(srcAddr, i) { diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H index b3930308235cd683803a4e56a90f32dabea11573..abf4523afde408d1ca22944f0ab248c6107c15f6 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H @@ -246,6 +246,31 @@ class AMIInterpolation DynamicList<label>& faceIDs ) const; + bool processSourceFace + ( + const SourcePatch& srcPatch, + const TargetPatch& tgtPatch, + const label srcFaceI, + const label tgtStartFaceI, + + DynamicList<label>& nbrFaces, + DynamicList<label>& visitedFaces, + List<DynamicList<label> >& srcAddr, + List<DynamicList<scalar> >& srcWght, + List<DynamicList<label> >& tgtAddr, + List<DynamicList<scalar> >& tgtWght + ); + + void restartUncoveredSourceFace + ( + const SourcePatch& srcPatch, + const TargetPatch& tgtPatch, + List<DynamicList<label> >& srcAddr, + List<DynamicList<scalar> >& srcWght, + List<DynamicList<label> >& tgtAddr, + List<DynamicList<scalar> >& tgtWght + ); + //- Set the source and target seed faces void setNextFaces ( @@ -529,6 +554,7 @@ public: #ifdef NoRepository # include "AMIInterpolation.C" +# include "AMIInterpolationParallelOps.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationParallelOps.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationParallelOps.C new file mode 100644 index 0000000000000000000000000000000000000000..5abe0778eb4019cfcca028fc71ef30eac493d67f --- /dev/null +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolationParallelOps.C @@ -0,0 +1,481 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "AMIInterpolation.H" +#include "mergePoints.H" +#include "mapDistribute.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class SourcePatch, class TargetPatch> +Foam::label Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcDistribution +( + const SourcePatch& srcPatch, + const TargetPatch& tgtPatch +) const +{ + label procI = 0; + + if (Pstream::parRun()) + { + List<label> facesPresentOnProc(Pstream::nProcs(), 0); + if ((srcPatch.size() > 0) || (tgtPatch.size() > 0)) + { + facesPresentOnProc[Pstream::myProcNo()] = 1; + } + else + { + facesPresentOnProc[Pstream::myProcNo()] = 0; + } + + Pstream::gatherList(facesPresentOnProc); + Pstream::scatterList(facesPresentOnProc); + + label nHaveFaces = sum(facesPresentOnProc); + + if (nHaveFaces > 1) + { + procI = -1; + if (debug) + { + Info<< "AMIInterpolation::calcDistribution: " + << "AMI split across multiple processors" << endl; + } + } + else if (nHaveFaces == 1) + { + procI = findIndex(facesPresentOnProc, 1); + if (debug) + { + Info<< "AMIInterpolation::calcDistribution: " + << "AMI local to processor" << procI << endl; + } + } + } + + + // Either not parallel or no faces on any processor + return procI; +} + + +template<class SourcePatch, class TargetPatch> +Foam::label +Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs +( + const List<treeBoundBoxList>& procBb, + const treeBoundBox& bb, + boolList& overlaps +) const +{ + overlaps.setSize(procBb.size()); + overlaps = false; + + label nOverlaps = 0; + + forAll(procBb, procI) + { + const List<treeBoundBox>& bbs = procBb[procI]; + + forAll(bbs, bbI) + { + if (bbs[bbI].overlaps(bb)) + { + overlaps[procI] = true; + nOverlaps++; + break; + } + } + } + return nOverlaps; +} + + +template<class SourcePatch, class TargetPatch> +void Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributePatches +( + const mapDistribute& map, + const TargetPatch& pp, + const globalIndex& gi, + List<faceList>& faces, + List<pointField>& points, + List<labelList>& faceIDs +) const +{ + PstreamBuffers pBufs(Pstream::nonBlocking); + + for (label domain = 0; domain < Pstream::nProcs(); domain++) + { + const labelList& sendElems = map.subMap()[domain]; + + if (domain != Pstream::myProcNo() && sendElems.size()) + { + labelList globalElems(sendElems.size()); + forAll(sendElems, i) + { + globalElems[i] = gi.toGlobal(sendElems[i]); + } + + faceList subFaces(UIndirectList<face>(pp, sendElems)); + primitivePatch subPatch + ( + SubList<face>(subFaces, subFaces.size()), + pp.points() + ); + + if (debug & 2) + { + Pout<< "distributePatches: to processor " << domain + << " sending faces " << subPatch.faceCentres() << endl; + } + + UOPstream toDomain(domain, pBufs); + toDomain + << subPatch.localFaces() << subPatch.localPoints() + << globalElems; + } + } + + // Start receiving + pBufs.finishedSends(); + + faces.setSize(Pstream::nProcs()); + points.setSize(Pstream::nProcs()); + faceIDs.setSize(Pstream::nProcs()); + + { + // Set up 'send' to myself + const labelList& sendElems = map.subMap()[Pstream::myProcNo()]; + faceList subFaces(UIndirectList<face>(pp, sendElems)); + primitivePatch subPatch + ( + SubList<face>(subFaces, subFaces.size()), + pp.points() + ); + + // Receive + if (debug & 2) + { + Pout<< "distributePatches: to processor " << Pstream::myProcNo() + << " sending faces " << subPatch.faceCentres() << endl; + } + + faces[Pstream::myProcNo()] = subPatch.localFaces(); + points[Pstream::myProcNo()] = subPatch.localPoints(); + + faceIDs[Pstream::myProcNo()].setSize(sendElems.size()); + forAll(sendElems, i) + { + faceIDs[Pstream::myProcNo()][i] = gi.toGlobal(sendElems[i]); + } + } + + // Consume + for (label domain = 0; domain < Pstream::nProcs(); domain++) + { + const labelList& recvElems = map.constructMap()[domain]; + + if (domain != Pstream::myProcNo() && recvElems.size()) + { + UIPstream str(domain, pBufs); + + str >> faces[domain] + >> points[domain] + >> faceIDs[domain]; + } + } +} + + +template<class SourcePatch, class TargetPatch> +void Foam::AMIInterpolation<SourcePatch, TargetPatch>:: +distributeAndMergePatches +( + const mapDistribute& map, + const TargetPatch& tgtPatch, + const globalIndex& gi, + faceList& tgtFaces, + pointField& tgtPoints, + labelList& tgtFaceIDs +) const +{ + // Exchange per-processor data + List<faceList> allFaces; + List<pointField> allPoints; + List<labelList> allTgtFaceIDs; + distributePatches(map, tgtPatch, gi, allFaces, allPoints, allTgtFaceIDs); + + // Renumber and flatten + label nFaces = 0; + label nPoints = 0; + forAll(allFaces, procI) + { + nFaces += allFaces[procI].size(); + nPoints += allPoints[procI].size(); + } + + tgtFaces.setSize(nFaces); + tgtPoints.setSize(nPoints); + tgtFaceIDs.setSize(nFaces); + + nFaces = 0; + nPoints = 0; + + // My own data first + { + const labelList& faceIDs = allTgtFaceIDs[Pstream::myProcNo()]; + SubList<label>(tgtFaceIDs, faceIDs.size()).assign(faceIDs); + + const faceList& fcs = allFaces[Pstream::myProcNo()]; + forAll(fcs, i) + { + const face& f = fcs[i]; + face& newF = tgtFaces[nFaces++]; + newF.setSize(f.size()); + forAll(f, fp) + { + newF[fp] = f[fp] + nPoints; + } + } + + const pointField& pts = allPoints[Pstream::myProcNo()]; + forAll(pts, i) + { + tgtPoints[nPoints++] = pts[i]; + } + } + + + // Other proc data follows + forAll(allFaces, procI) + { + if (procI != Pstream::myProcNo()) + { + const labelList& faceIDs = allTgtFaceIDs[procI]; + SubList<label>(tgtFaceIDs, faceIDs.size(), nFaces).assign(faceIDs); + + const faceList& fcs = allFaces[procI]; + forAll(fcs, i) + { + const face& f = fcs[i]; + face& newF = tgtFaces[nFaces++]; + newF.setSize(f.size()); + forAll(f, fp) + { + newF[fp] = f[fp] + nPoints; + } + } + + const pointField& pts = allPoints[procI]; + forAll(pts, i) + { + tgtPoints[nPoints++] = pts[i]; + } + } + } + + // Merge + labelList oldToNew; + pointField newTgtPoints; + bool hasMerged = mergePoints + ( + tgtPoints, + SMALL, + false, + oldToNew, + newTgtPoints + ); + + if (hasMerged) + { + if (debug) + { + Pout<< "Merged from " << tgtPoints.size() + << " down to " << newTgtPoints.size() << " points" << endl; + } + + tgtPoints.transfer(newTgtPoints); + forAll(tgtFaces, i) + { + inplaceRenumber(oldToNew, tgtFaces[i]); + } + } +} + + +template<class SourcePatch, class TargetPatch> +Foam::autoPtr<Foam::mapDistribute> +Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcProcMap +( + const SourcePatch& srcPatch, + const TargetPatch& tgtPatch +) const +{ + // Get decomposition of patch + List<treeBoundBoxList> procBb(Pstream::nProcs()); + + if (srcPatch.size()) + { + procBb[Pstream::myProcNo()] = treeBoundBoxList + ( + 1, // For now single bounding box per proc + treeBoundBox + ( + srcPatch.points(), + srcPatch.meshPoints() + ) + ); + } + else + { + procBb[Pstream::myProcNo()] = treeBoundBoxList(); + } + + // slightly increase size of bounding boxes to allow for cases where + // bounding boxes are perfectly alligned + forAll(procBb[Pstream::myProcNo()], bbI) + { + treeBoundBox& bb = procBb[Pstream::myProcNo()][bbI]; + bb.inflate(0.01); + } + + Pstream::gatherList(procBb); + Pstream::scatterList(procBb); + + + if (debug) + { + Info<< "Determining extent of srcPatch per processor:" << nl + << "\tproc\tbb" << endl; + forAll(procBb, procI) + { + Info<< '\t' << procI << '\t' << procBb[procI] << endl; + } + } + + + // Determine which faces of tgtPatch overlaps srcPatch per proc + const faceList& faces = tgtPatch.localFaces(); + const pointField& points = tgtPatch.localPoints(); + + labelListList sendMap; + + { + // Per processor indices into all segments to send + List<DynamicList<label> > dynSendMap(Pstream::nProcs()); + + // Work array - whether processor bb overlaps the face bounds + boolList procBbOverlaps(Pstream::nProcs()); + + forAll(faces, faceI) + { + if (faces[faceI].size()) + { + treeBoundBox faceBb(points, faces[faceI]); + + // Find the processor this face overlaps + calcOverlappingProcs(procBb, faceBb, procBbOverlaps); + + forAll(procBbOverlaps, procI) + { + if (procBbOverlaps[procI]) + { + dynSendMap[procI].append(faceI); + } + } + } + } + + // Convert dynamicList to labelList + sendMap.setSize(Pstream::nProcs()); + forAll(sendMap, procI) + { + sendMap[procI].transfer(dynSendMap[procI]); + } + } + + // Debug printing + if (debug) + { + Pout<< "Of my " << faces.size() << " I need to send to:" << nl + << "\tproc\tfaces" << endl; + forAll(sendMap, procI) + { + Pout<< '\t' << procI << '\t' << sendMap[procI].size() << endl; + } + } + + + // Send over how many faces I need to receive + labelListList sendSizes(Pstream::nProcs()); + sendSizes[Pstream::myProcNo()].setSize(Pstream::nProcs()); + forAll(sendMap, procI) + { + sendSizes[Pstream::myProcNo()][procI] = sendMap[procI].size(); + } + Pstream::gatherList(sendSizes); + Pstream::scatterList(sendSizes); + + + // Determine order of receiving + labelListList constructMap(Pstream::nProcs()); + + // My local segment first + constructMap[Pstream::myProcNo()] = identity + ( + sendMap[Pstream::myProcNo()].size() + ); + + label segmentI = constructMap[Pstream::myProcNo()].size(); + forAll(constructMap, procI) + { + if (procI != Pstream::myProcNo()) + { + // What I need to receive is what other processor is sending to me + label nRecv = sendSizes[procI][Pstream::myProcNo()]; + constructMap[procI].setSize(nRecv); + + for (label i = 0; i < nRecv; i++) + { + constructMap[procI][i] = segmentI++; + } + } + } + + autoPtr<mapDistribute> mapPtr + ( + new mapDistribute + ( + segmentI, // size after construction + sendMap.xfer(), + constructMap.xfer() + ) + ); + + return mapPtr; +} + + +// ************************************************************************* // diff --git a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C index db8a0ba294fec342f15a3d201e59a084efec48d4..4135cfe04191b4ffc2e2135c41dbf5b802a6b5dc 100644 --- a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C +++ b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,10 @@ License #include "faceAreaIntersect.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +Foam::scalar Foam::faceAreaIntersect::tol = 1e-6; + // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // void Foam::faceAreaIntersect::triSliceWithPlane @@ -36,8 +40,6 @@ void Foam::faceAreaIntersect::triSliceWithPlane const scalar len ) { - const scalar matchTol = 1e-6; - // distance to cutting plane FixedList<scalar, 3> d; @@ -51,7 +53,7 @@ void Foam::faceAreaIntersect::triSliceWithPlane { d[i] = ((tri[i] - p.refPoint()) & p.normal()); - if (mag(d[i]) < matchTol*len) + if (mag(d[i]) < tol*len) { nCoPlanar++; copI = i; diff --git a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.H b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.H index 2a27e30960dee4d05235398e64bc53874817a8f1..bfbe7c08a2e2a1d31cbec044e7a01d12eea68399 100644 --- a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.H +++ b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,6 +78,11 @@ private: const bool reverseB_; + // Static data members + + static scalar tol; + + // Private Member Functions //- Get triPoints from face @@ -152,6 +157,9 @@ public: // Public Member Functions + //- Fraction of local length scale to use as intersection tolerance + inline static scalar& tolerance(); + //- Return area of intersection of faceA with faceB scalar calc ( diff --git a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersectI.H b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersectI.H index 0b8265aad66cb5e79b8a29f2adffb2cc92ab4e38..87fab781e075adea10d95d8e0d6f458ce063a5fc 100644 --- a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersectI.H +++ b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersectI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,8 @@ License \*---------------------------------------------------------------------------*/ +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + inline void Foam::faceAreaIntersect::setTriPoints ( const point& a, @@ -106,4 +108,12 @@ inline Foam::scalar Foam::faceAreaIntersect::triArea(const triPoints& t) const } +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::scalar& Foam::faceAreaIntersect::tolerance() +{ + return tol; +} + + // ************************************************************************* // diff --git a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C index c64c29e1e6eb62aaf4bdb825f1bac03e2447f2fa..a80688a184bc2147c00d68758d848a9dfe6eb72e 100644 --- a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C +++ b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C @@ -27,6 +27,7 @@ License #include "polyMesh.H" #include "globalMeshData.H" #include "plane.H" +#include "cellSet.H" #include "addToRunTimeSelectionTable.H" @@ -74,6 +75,7 @@ Foam::scalar Foam::targetVolumeToCell::volumeOfSet Foam::label Foam::targetVolumeToCell::selectCells ( const scalar normalComp, + const PackedBoolList& maskSet, PackedBoolList& selected ) const { @@ -86,7 +88,7 @@ Foam::label Foam::targetVolumeToCell::selectCells { const point& cc = mesh_.cellCentres()[cellI]; - if ((cc&n_) < normalComp) + if (maskSet[cellI] && ((cc&n_) < normalComp)) { selected[cellI] = true; nSelected++; @@ -103,14 +105,25 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const // Select no cells return; } - else if (gSum(mesh_.cellVolumes()) < vol_) + + + PackedBoolList maskSet(mesh_.nCells(), 1); + label nTotCells = mesh_.globalData().nTotalCells(); + if (maskSetName_.size()) { - // Select all cells - forAll(mesh_.cellVolumes(), cellI) + // Read cellSet + Info<< " Operating on subset defined by cellSet " << maskSetName_ + << endl; + + maskSet = 0; + cellSet subset(mesh_, maskSetName_); + + forAllConstIter(cellSet, subset, iter) { - addOrDelete(set, cellI, add); + maskSet[iter.key()] = 1; } - return; + + nTotCells = returnReduce(subset.size(), sumOp<label>()); } @@ -144,16 +157,16 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const } PackedBoolList maxSelected(mesh_.nCells()); - maxCells = selectCells(maxComp, maxSelected); + maxCells = selectCells(maxComp, maskSet, maxSelected); maxVol = volumeOfSet(maxSelected); // Check that maxPoint indeed selects all cells - if (maxCells != mesh_.globalData().nTotalCells()) + if (maxCells != nTotCells) { WarningIn("targetVolumeToCell::combine(topoSet&, const bool) const") << "Plane " << plane(points[maxPointI], n_) << " selects " << maxCells - << " cells instead of all " << mesh_.globalData().nTotalCells() + << " cells instead of all " << nTotCells << " cells. Results might be wrong." << endl; } } @@ -178,7 +191,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const { scalar mid = 0.5*(low + high); - nSelected = selectCells(mid, selected); + nSelected = selectCells(mid, maskSet, selected); selectedVol = volumeOfSet(selected); //Pout<< "High:" << high << " low:" << low << " mid:" << mid << nl @@ -191,7 +204,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const low = mid; PackedBoolList highSelected(mesh_.nCells()); - label nHigh = selectCells(high, selected); + label nHigh = selectCells(high, maskSet, selected); if (nSelected == nHigh) { break; @@ -202,7 +215,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const high = mid; PackedBoolList lowSelected(mesh_.nCells()); - label nLow = selectCells(low, selected); + label nLow = selectCells(low, maskSet, selected); if (nSelected == nLow) { break; @@ -210,7 +223,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const } } - nSelected = selectCells(high, selected); + nSelected = selectCells(high, maskSet, selected); selectedVol = volumeOfSet(selected); if (selectedVol < vol_) @@ -219,7 +232,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const } else { - nSelected = selectCells(low, selected); + nSelected = selectCells(low, maskSet, selected); selectedVol = volumeOfSet(selected); if (selectedVol < vol_) @@ -278,7 +291,8 @@ Foam::targetVolumeToCell::targetVolumeToCell : topoSetSource(mesh), vol_(readScalar(dict.lookup("volume"))), - n_(dict.lookup("normal")) + n_(dict.lookup("normal")), + maskSetName_(dict.lookupOrDefault<word>("set", "")) {} diff --git a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.H b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.H index 398e49c9f92ee1e07a1cf91d4238dc444cec8237..076f15e8aaea719228d510c913fbf287ff695dbd 100644 --- a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.H +++ b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.H @@ -37,7 +37,6 @@ SourceFiles #define targetVolumeToCell_H #include "topoSetSource.H" -//#include "plane.H" #include "PackedBoolList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -63,8 +62,10 @@ class targetVolumeToCell const scalar vol_; //- Normal of plane to sweep - vector n_; - //plane pl_; + const vector n_; + + //- Optional name of cellSet to calculate volume in + const word maskSetName_; // Private Member Functions @@ -74,6 +75,7 @@ class targetVolumeToCell label selectCells ( const scalar normalComp, + const PackedBoolList&, PackedBoolList& selected ) const; @@ -92,7 +94,6 @@ public: ( const polyMesh& mesh, const scalar vol, - //const plane& const vector& ); diff --git a/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C b/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C index d80c77b65c2a89363facc6d07af8f2cfa2c96b43..3c72a5399d38c0e425ec3d72aa4cf6bfbe801a68 100644 --- a/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C +++ b/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,7 +163,7 @@ void Foam::reconstructLagrangianFields IOobjectList fields = objects.lookupClass(fieldClassName); - if(fields.size()) + if (fields.size()) { Info<< " Reconstructing lagrangian " << fieldClassName << "s\n" << endl; diff --git a/src/postProcessing/foamCalcFunctions/field/magSqr/magSqr.C b/src/postProcessing/foamCalcFunctions/field/magSqr/magSqr.C index 084f87de4b7812d421223d0c8b82d51ae2fe4fbe..a608ade6bfee0670a9ca15e44abad28fdf2e6b8e 100644 --- a/src/postProcessing/foamCalcFunctions/field/magSqr/magSqr.C +++ b/src/postProcessing/foamCalcFunctions/field/magSqr/magSqr.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::calcTypes::magSqr::~magSqr() void Foam::calcTypes::magSqr::init() { - Foam::argList::validArgs.append("magSqr"); + argList::validArgs.append("magSqr"); argList::validArgs.append("fieldName"); } diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H index 1b5abb7644bb30b63fb7f6be7bfad2b9902c071b..db35e35d5c41c85c6b9404bc703f9569f8c32875 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H @@ -44,9 +44,6 @@ Description - base: average over 'time', or 'iteration' (\f$N\f$ in the above) - window: optional averaging window, specified in 'base' units - \note - To employ the \c prime2Mean option, the \c mean option must be selecetd. - Average field names are constructed by concatenating the base field with the averaging type, e.g. when averaging field 'U', the resultant fields are: @@ -99,6 +96,9 @@ Description } \endverbatim +Note + To employ the \c prime2Mean option, the \c mean option must be selecetd. + SourceFiles fieldAverage.C fieldAverageTemplates.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index fd95788894aa3e9d63ebc083045e422f66d6164c..f9199f451a48947f85f8dab945b079ec3570e173 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -28,6 +28,7 @@ Description Face source variant of field value function object. Values of user- specified fields reported for collections of faces. + \verbatim faceObj1 // Name also used to identify output folder { type faceSource; @@ -48,6 +49,7 @@ Description U ); } + \endverbatim source: - faceZone : requires a 'sourceName' entry to specify the faceZone @@ -56,34 +58,37 @@ Description sampleDict. operation is one of: - - none - - sum - - average - - weightedAverage - - areaAverage - - areaIntegrate - - min - - max - - CoV (Coefficient of variation: standard deviation/mean) - - areaNormalAverage (vector with first component (average of) inproduct - of value and face area vector) - - areaNormalIntegrate ( ,, ,, (sum of) ,, - - Notes: + - none + - sum + - average (ensemble) + - weightedAverage + - areaAverage + - areaIntegrate + - min + - max + - CoV (Coefficient of variation: standard deviation/mean) + - areaNormalAverage (vector with first component (average of) inproduct + of value and face area vector) + - areaNormalIntegrate ( ,, ,, (sum of) ,, + + For example, to calculate the volumetric or mass flux across a patch, + apply the 'sum' operator to the flux field (typically \c phi) + +Note - faces on empty patches get ignored - - if the field is a volField the faceZone can only consist of boundary - faces. - - all fields get oriented according to the faceZone (so you might e.g. see - negative pressure) - - using sampledSurfaces: - - they do not do surface fields - - if interpolate=true they use interpolationCellPoint - otherwise they use cell values - - each triangle in sampledSurface is logically only in one cell - so interpolation will be wrong when triangles are larger than - cells. This can only happen for sampling on triSurfaceMesh. - - take care when using isoSurfaces - these might have duplicate - triangles so integration might be wrong + - if the field is a volField the \c faceZone can only consist of boundary + faces + - all fields get oriented according to the \c faceZone (so you might + e.g. see negative pressure) + - using \c sampledSurfaces: + - they do not do surface fields + - if interpolate=true they use \c interpolationCellPoint + otherwise they use cell values + - each triangle in \c sampledSurface is logically only in one cell + so interpolation will be wrong when triangles are larger than + cells. This can only happen for sampling on \c triSurfaceMesh + - take care when using isoSurfaces - these might have duplicate + triangles so integration might be wrong SourceFiles faceSource.C diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C index b3aaac0dbf9fa2b525d96654f0fd494a470a449b..4aa1596b5a0ba61a99a5227725afeb018fd4ad5a 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C @@ -27,8 +27,8 @@ License #include "volFields.H" #include "regionSplit.H" #include "fvcVolumeIntegrate.H" -#include "Histogram.H" #include "mathematicalConstants.H" +#include "stringListOps.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -56,6 +56,281 @@ namespace Foam } +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::regionSizeDistribution::writeGraph +( + const coordSet& coords, + const word& valueName, + const scalarField& values +) const +{ + const fvMesh& mesh = refCast<const fvMesh>(obr_); + + const wordList valNames(1, valueName); + + fileName outputPath; + if (Pstream::parRun()) + { + outputPath = mesh.time().path()/".."/name_; + } + else + { + outputPath = mesh.time().path()/name_; + } + + if (mesh.name() != fvMesh::defaultRegion) + { + outputPath = outputPath/mesh.name(); + } + + mkDir(outputPath/mesh.time().timeName()); + OFstream str + ( + outputPath + / mesh.time().timeName() + / formatterPtr_().getFileName(coords, valNames) + ); + Info<< "Writing distribution of " << valueName << " to " << str.name() + << endl; + + List<const scalarField*> valPtrs(1); + valPtrs[0] = &values; + formatterPtr_().write(coords, valNames, valPtrs, str); +} + + +void Foam::regionSizeDistribution::writeAlphaFields +( + const regionSplit& regions, + const Map<label>& patchRegions, + const Map<scalar>& regionVolume, + const volScalarField& alpha +) const +{ + const scalar maxDropletVol = 1.0/6.0*pow(maxDiam_, 3); + + // Split alpha field + // ~~~~~~~~~~~~~~~~~ + // Split into + // - liquidCore : region connected to inlet patches + // - per region a volume : for all other regions + // - backgroundAlpha : remaining alpha + + + // Construct field + volScalarField liquidCore + ( + IOobject + ( + alphaName_ + "_liquidCore", + obr_.time().timeName(), + obr_, + IOobject::NO_READ + ), + alpha, + fvPatchField<scalar>::calculatedType() + ); + + volScalarField backgroundAlpha + ( + IOobject + ( + alphaName_ + "_background", + obr_.time().timeName(), + obr_, + IOobject::NO_READ + ), + alpha, + fvPatchField<scalar>::calculatedType() + ); + + + // Knock out any cell not in patchRegions + forAll(liquidCore, cellI) + { + label regionI = regions[cellI]; + if (patchRegions.found(regionI)) + { + backgroundAlpha[cellI] = 0; + } + else + { + liquidCore[cellI] = 0; + + scalar regionVol = regionVolume[regionI]; + if (regionVol < maxDropletVol) + { + backgroundAlpha[cellI] = 0; + } + } + } + liquidCore.correctBoundaryConditions(); + backgroundAlpha.correctBoundaryConditions(); + + Info<< "Volume of liquid-core = " + << fvc::domainIntegrate(liquidCore).value() + << endl; + Info<< "Volume of background = " + << fvc::domainIntegrate(backgroundAlpha).value() + << endl; + + Info<< "Writing liquid-core field to " << liquidCore.name() << endl; + liquidCore.write(); + Info<< "Writing background field to " << backgroundAlpha.name() << endl; + backgroundAlpha.write(); +} + + +Foam::Map<Foam::label> Foam::regionSizeDistribution::findPatchRegions +( + const polyMesh& mesh, + const regionSplit& regions +) const +{ + // Mark all regions starting at patches + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Count number of patch faces (just for initial sizing) + const labelHashSet patchIDs(mesh.boundaryMesh().patchSet(patchNames_)); + + label nPatchFaces = 0; + forAllConstIter(labelHashSet, patchIDs, iter) + { + nPatchFaces += mesh.boundaryMesh()[iter.key()].size(); + } + + + Map<label> patchRegions(nPatchFaces); + forAllConstIter(labelHashSet, patchIDs, iter) + { + const polyPatch& pp = mesh.boundaryMesh()[iter.key()]; + + // Collect all regions on the patch + const labelList& faceCells = pp.faceCells(); + + forAll(faceCells, i) + { + patchRegions.insert + ( + regions[faceCells[i]], + Pstream::myProcNo() // dummy value + ); + } + } + + + // Make sure all the processors have the same set of regions + Pstream::mapCombineGather(patchRegions, minEqOp<label>()); + Pstream::mapCombineScatter(patchRegions); + + return patchRegions; +} + + +Foam::tmp<Foam::scalarField> Foam::regionSizeDistribution::divide +( + const scalarField& num, + const scalarField& denom +) +{ + tmp<scalarField> tresult(new scalarField(num.size())); + scalarField& result = tresult(); + + forAll(denom, i) + { + if (denom[i] != 0) + { + result[i] = num[i]/denom[i]; + } + else + { + result[i] = 0.0; + } + } + return tresult; +} + + +void Foam::regionSizeDistribution::writeGraphs +( + const word& fieldName, // name of field + const labelList& indices, // index of bin for each region + const scalarField& sortedField, // per region field data + const scalarField& binCount, // per bin number of regions + const coordSet& coords // graph data for bins +) const +{ + if (Pstream::master()) + { + // Calculate per-bin average + scalarField binSum(nBins_, 0.0); + forAll(sortedField, i) + { + binSum[indices[i]] += sortedField[i]; + } + + scalarField binAvg(divide(binSum, binCount)); + + // Per bin deviation + scalarField binSqrSum(nBins_, 0.0); + forAll(sortedField, i) + { + binSqrSum[indices[i]] += Foam::sqr(sortedField[i]); + } + scalarField binDev + ( + sqrt(divide(binSqrSum, binCount) - Foam::sqr(binAvg)) + ); + + // Write average + writeGraph(coords, fieldName + "_sum", binSum); + // Write average + writeGraph(coords, fieldName + "_avg", binAvg); + // Write deviation + writeGraph(coords, fieldName + "_dev", binDev); + } +} + + +void Foam::regionSizeDistribution::writeGraphs +( + const word& fieldName, // name of field + const scalarField& cellField, // per cell field data + const regionSplit& regions, // per cell the region(=droplet) + const labelList& sortedRegions, // valid regions in sorted order + const scalarField& sortedNormalisation, + + const labelList& indices, // per region index of bin + const scalarField& binCount, // per bin number of regions + const coordSet& coords // graph data for bins +) const +{ + // Sum on a per-region basis. Parallel reduced. + Map<scalar> regionField(regionSum(regions, cellField)); + + // Extract in region order + scalarField sortedField + ( + sortedNormalisation + * extractData + ( + sortedRegions, + regionField + ) + ); + + writeGraphs + ( + fieldName, // name of field + indices, // index of bin for each region + sortedField, // per region field data + binCount, // per bin number of regions + coords // graph data for bins + ); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::regionSizeDistribution::regionSizeDistribution @@ -103,8 +378,11 @@ void Foam::regionSizeDistribution::read(const dictionary& dict) dict.lookup("field") >> alphaName_; dict.lookup("patches") >> patchNames_; dict.lookup("threshold") >> threshold_; - dict.lookup("volFraction") >> volFraction_; + dict.lookup("maxDiameter") >> maxDiam_; + minDiam_ = 0.0; + dict.readIfPresent("minDiameter", minDiam_); dict.lookup("nBins") >> nBins_; + dict.lookup("fields") >> fields_; word format(dict.lookup("setFormat")); formatterPtr_ = writer<scalar>::New(format); @@ -163,14 +441,17 @@ void Foam::regionSizeDistribution::write() : obr_.lookupObject<volScalarField>(alphaName_) ); - Info<< "Volume of alpha = " + Info<< "Volume of alpha = " << fvc::domainIntegrate(alpha).value() << endl; const scalar meshVol = gSum(mesh.V()); - Info<< "Mesh volume = " << meshVol << endl; - Info<< "Background region volume limit = " << volFraction_*meshVol - << endl; + const scalar maxDropletVol = 1.0/6.0*pow(maxDiam_, 3); + const scalar delta = (maxDiam_-minDiam_)/nBins_; + + Info<< "Mesh volume = " << meshVol << endl; + Info<< "Maximum droplet diameter = " << maxDiam_ << endl; + Info<< "Maximum droplet volume = " << maxDropletVol << endl; // Determine blocked faces @@ -260,325 +541,314 @@ void Foam::regionSizeDistribution::write() } - // Sum all regions - Map<Pair<scalar> > regionVolume(regions.nRegions()/Pstream::nProcs()); - forAll(alpha, cellI) - { - scalar cellVol = mesh.V()[cellI]; - scalar alphaVol = alpha[cellI]*cellVol; + // Determine regions connected to supplied patches + Map<label> patchRegions(findPatchRegions(mesh, regions)); - label regionI = regions[cellI]; - Map<Pair<scalar> >::iterator fnd = regionVolume.find(regionI); - if (fnd == regionVolume.end()) - { - regionVolume.insert - ( - regionI, - Pair<scalar>(cellVol, alphaVol) - ); - } - else - { - fnd().first() += cellVol; - fnd().second() += alphaVol; - } - } - Pstream::mapCombineGather(regionVolume, ListPlusEqOp<scalar, 2>()); - Pstream::mapCombineScatter(regionVolume); + // Sum all regions + const scalarField alphaVol(alpha.internalField()*mesh.V()); + Map<scalar> allRegionVolume(regionSum(regions, mesh.V())); + Map<scalar> allRegionAlphaVolume(regionSum(regions, alphaVol)); + Map<label> allRegionNumCells + ( + regionSum + ( + regions, + labelField(mesh.nCells(), 1.0) + ) + ); if (debug) { Info<< token::TAB << "Region" << token::TAB << "Volume(mesh)" << token::TAB << "Volume(" << alpha.name() << "):" + << token::TAB << "nCells" << endl; scalar meshSumVol = 0.0; scalar alphaSumVol = 0.0; + label nCells = 0; - forAllConstIter(Map<Pair<scalar> >, regionVolume, iter) + Map<scalar>::const_iterator vIter = allRegionVolume.begin(); + Map<scalar>::const_iterator aIter = allRegionAlphaVolume.begin(); + Map<label>::const_iterator numIter = allRegionNumCells.begin(); + for + ( + ; + vIter != allRegionVolume.end() + && aIter != allRegionAlphaVolume.end(); + ++vIter, ++aIter, ++numIter + ) { - Info<< token::TAB << iter.key() - << token::TAB << iter().first() - << token::TAB << iter().second() << endl; + Info<< token::TAB << vIter.key() + << token::TAB << vIter() + << token::TAB << aIter() + << token::TAB << numIter() + << endl; - meshSumVol += iter().first(); - alphaSumVol += iter().second(); + meshSumVol += vIter(); + alphaSumVol += aIter(); + nCells += numIter(); } Info<< token::TAB << "Total:" << token::TAB << meshSumVol - << token::TAB << alphaSumVol << endl; + << token::TAB << alphaSumVol + << token::TAB << nCells + << endl; Info<< endl; } - // Mark all regions starting at patches - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // Count number of patch faces (just for initial sizing) - label nPatchFaces = 0; - forAll(patchNames_, i) { - const word& pName = patchNames_[i]; - label patchI = mesh.boundaryMesh().findPatchID(pName); - if (patchI == -1) - { - WarningIn("regionSizeDistribution::write()") - << "Cannot find patch " << pName << ". Valid patches are " - << mesh.boundaryMesh().names() - << endl; - } - else + Info<< "Patch connected regions (liquid core):" << endl; + Info<< token::TAB << "Region" + << token::TAB << "Volume(mesh)" + << token::TAB << "Volume(" << alpha.name() << "):" + << endl; + forAllConstIter(Map<label>, patchRegions, iter) { - nPatchFaces += mesh.boundaryMesh()[patchI].size(); + label regionI = iter.key(); + Info<< token::TAB << iter.key() + << token::TAB << allRegionVolume[regionI] + << token::TAB << allRegionAlphaVolume[regionI] << endl; + } + Info<< endl; } - Map<label> keepRegions(nPatchFaces); - forAll(patchNames_, i) { - const word& pName = patchNames_[i]; + Info<< "Background regions:" << endl; + Info<< token::TAB << "Region" + << token::TAB << "Volume(mesh)" + << token::TAB << "Volume(" << alpha.name() << "):" + << endl; + Map<scalar>::const_iterator vIter = allRegionVolume.begin(); + Map<scalar>::const_iterator aIter = allRegionAlphaVolume.begin(); - label patchI = mesh.boundaryMesh().findPatchID(pName); - if (patchI != -1) + for + ( + ; + vIter != allRegionVolume.end() + && aIter != allRegionAlphaVolume.end(); + ++vIter, ++aIter + ) { - const polyPatch& pp = mesh.boundaryMesh()[patchI]; - - // Collect all regions on the patch - const labelList& faceCells = pp.faceCells(); - - forAll(faceCells, i) + if + ( + !patchRegions.found(vIter.key()) + && vIter() >= maxDropletVol + ) { - keepRegions.insert - ( - regions[faceCells[i]], - Pstream::myProcNo() - ); + Info<< token::TAB << vIter.key() + << token::TAB << vIter() + << token::TAB << aIter() << endl; } } + Info<< endl; } - // Make sure all the processors have the same set of regions - Pstream::mapCombineGather(keepRegions, minEqOp<label>()); - Pstream::mapCombineScatter(keepRegions); - Info<< "Patch connected regions (liquid core):" << endl; - forAllConstIter(Map<label>, keepRegions, iter) - { - label regionI = iter.key(); - Pair<scalar>& vols = regionVolume[regionI]; - Info<< token::TAB << iter.key() - << token::TAB << vols.first() - << token::TAB << vols.second() << endl; + // Split alpha field + // ~~~~~~~~~~~~~~~~~ + // Split into + // - liquidCore : region connected to inlet patches + // - per region a volume : for all other regions + // - backgroundAlpha : remaining alpha + writeAlphaFields(regions, patchRegions, allRegionVolume, alpha); - } - Info<< endl; - Info<< "Background regions:" << endl; - forAllConstIter(Map<Pair<scalar> >, regionVolume, iter) + // Extract droplet-only allRegionVolume, i.e. delete liquid core + // (patchRegions) and background regions from maps. + // Note that we have to use mesh volume (allRegionVolume) and not + // allRegionAlphaVolume since background might not have alpha in it. + forAllIter(Map<scalar>, allRegionVolume, vIter) { + label regionI = vIter.key(); if ( - !keepRegions.found(iter.key()) - && iter().first() >= volFraction_*meshVol + patchRegions.found(regionI) + || vIter() >= maxDropletVol ) { - Info<< token::TAB << iter.key() - << token::TAB << iter().first() - << token::TAB << iter().second() << endl; + allRegionVolume.erase(vIter); + allRegionAlphaVolume.erase(regionI); + allRegionNumCells.erase(regionI); } } - Info<< endl; + if (allRegionVolume.size()) + { + // Construct mids of bins for plotting + pointField xBin(nBins_); - // Split alpha field - // ~~~~~~~~~~~~~~~~~ - // Split into - // - liquidCore : region connected to inlet patches - // - per region a volume : for all other regions - // - backgroundAlpha : remaining alpha + scalar x = 0.5*delta; + forAll(xBin, i) + { + xBin[i] = point(x, 0, 0); + x += delta; + } + const coordSet coords("diameter", "x", xBin, mag(xBin)); - // Construct field - volScalarField liquidCore - ( - IOobject - ( - alphaName_ + "_liquidCore", - obr_.time().timeName(), - obr_, - IOobject::NO_READ - ), - alpha, - fvPatchField<scalar>::calculatedType() - ); - volScalarField backgroundAlpha - ( - IOobject - ( - alphaName_ + "_background", - obr_.time().timeName(), - obr_, - IOobject::NO_READ - ), - alpha, - fvPatchField<scalar>::calculatedType() - ); + // Get in region order the alpha*volume and diameter + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + const labelList sortedRegions = allRegionAlphaVolume.sortedToc(); - // Knock out any cell not in keepRegions - forAll(liquidCore, cellI) - { - label regionI = regions[cellI]; - if (keepRegions.found(regionI)) + scalarField sortedVols + ( + extractData + ( + sortedRegions, + allRegionAlphaVolume + ) + ); + + // Calculate the diameters + scalarField sortedDiameters(sortedVols.size()); + forAll(sortedDiameters, i) { - backgroundAlpha[cellI] = 0; + sortedDiameters[i] = Foam::cbrt + ( + sortedVols[i] + *6/constant::mathematical::pi + ); } - else - { - liquidCore[cellI] = 0; - scalar regionVol = regionVolume[regionI].first(); - if (regionVol < volFraction_*meshVol) - { - backgroundAlpha[cellI] = 0; - } + // Determine the bin index for all the diameters + labelList indices(sortedDiameters.size()); + forAll(sortedDiameters, i) + { + indices[i] = (sortedDiameters[i]-minDiam_)/delta; } - } - liquidCore.correctBoundaryConditions(); - backgroundAlpha.correctBoundaryConditions(); - - Info<< "Volume of liquid-core = " - << fvc::domainIntegrate(liquidCore).value() - << endl; - - Info<< "Writing liquid-core field to " << liquidCore.name() << endl; - liquidCore.write(); - - Info<< "Volume of background = " - << fvc::domainIntegrate(backgroundAlpha).value() - << endl; - - Info<< "Writing background field to " << backgroundAlpha.name() << endl; - backgroundAlpha.write(); + // Calculate the counts per diameter bin + scalarField binCount(nBins_, 0.0); + forAll(sortedDiameters, i) + { + binCount[indices[i]] += 1.0; + } + // Write counts + if (Pstream::master()) + { + writeGraph(coords, "count", binCount); + } - // Collect histogram - if (Pstream::master()) - { - DynamicList<scalar> diameters(regionVolume.size()); - forAllConstIter(Map<Pair<scalar> >, regionVolume, iter) + // Write to screen { - if (!keepRegions.found(iter.key())) + Info<< "Bins:" << endl; + Info<< token::TAB << "Bin" + << token::TAB << "Min diameter" + << token::TAB << "Count:" + << endl; + + scalar diam = 0.0; + forAll(binCount, binI) { - if (iter().first() < volFraction_*meshVol) - { - scalar v = iter().second(); - //scalar diam = Foam::cbrt(v*6/mathematicalConstant::pi); - scalar diam = - Foam::cbrt(v*6/constant::mathematical::pi); - diameters.append(diam); - } + Info<< token::TAB << binI + << token::TAB << diam + << token::TAB << binCount[binI] << endl; + diam += delta; } + Info<< endl; } - if (diameters.size()) + + // Write average and deviation of droplet volume. + writeGraphs + ( + "volume", // name of field + indices, // per region the bin index + sortedVols, // per region field data + binCount, // per bin number of regions + coords // graph data for bins + ); + + // Collect some more field { - scalar maxDiam = max(diameters); - scalar minDiam = 0.0; + wordList scalarNames(obr_.names(volScalarField::typeName)); + labelList selected = findStrings(fields_, scalarNames); - Info<< "Maximum diameter:" << maxDiam << endl; + forAll(selected, i) + { + const word& fldName = scalarNames[selected[i]]; + Info<< "Scalar field " << fldName << endl; - Histogram<List<scalar> > bins - ( - minDiam, - maxDiam, - nBins_, - diameters - ); + const scalarField& fld = obr_.lookupObject + < + volScalarField + >(fldName).internalField(); - /* 1.7.x - scalarField xBin(nBins_); + writeGraphs + ( + fldName, // name of field + alphaVol*fld, // per cell field data - scalar dx = (maxDiam-minDiam)/nBins_; - scalar x = 0.5*dx; - forAll(bins.counts(), i) - { - xBin[i] = x; - x += dx; + regions, // per cell the region(=droplet) + sortedRegions, // valid regions in sorted order + 1.0/sortedVols, // per region normalisation + + indices, // index of bin for each region + binCount, // per bin number of regions + coords // graph data for bins + ); } + } + { + wordList vectorNames(obr_.names(volVectorField::typeName)); + labelList selected = findStrings(fields_, vectorNames); - scalarField normalisedCount(bins.counts().size()); - forAll(bins.counts(), i) + forAll(selected, i) { - normalisedCount[i] = 1.0*bins.counts()[i]; - } + const word& fldName = vectorNames[selected[i]]; + Info<< "Vector field " << fldName << endl; - const coordSet coords - ( - "diameter", - "x", - xBin - ); - */ + const vectorField& fld = obr_.lookupObject + < + volVectorField + >(fldName).internalField(); - pointField xBin(nBins_); - scalar dx = (maxDiam - minDiam)/nBins_; - scalar x = 0.5*dx; - forAll(bins.counts(), i) - { - xBin[i] = point(x, 0, 0); - x += dx; - } - scalarField normalisedCount(bins.counts().size()); - forAll(bins.counts(), i) - { - normalisedCount[i] = 1.0*bins.counts()[i]; - } + // Components - const coordSet coords - ( - "diameter", - "x", - xBin, - mag(xBin) - ); - const wordList valNames(1, "count"); + for (direction cmp = 0; cmp < vector::nComponents; cmp++) + { + writeGraphs + ( + fldName + vector::componentNames[cmp], + alphaVol*fld.component(cmp),// per cell field data + regions, // per cell the region(=droplet) + sortedRegions, // valid regions in sorted order + 1.0/sortedVols, // per region normalisation - fileName outputPath; - if (Pstream::parRun()) - { - outputPath = mesh.time().path()/".."/name_; - } - else - { - outputPath = mesh.time().path()/name_; - } + indices, // index of bin for each region + binCount, // per bin number of regions + coords // graph data for bins + ); + } - if (mesh.name() != fvMesh::defaultRegion) - { - outputPath = outputPath/mesh.name(); - } + // Magnitude + writeGraphs + ( + fldName + "mag", // name of field + alphaVol*mag(fld), // per cell field data - mkDir(outputPath/mesh.time().timeName()); - OFstream str - ( - outputPath - / mesh.time().timeName() - / formatterPtr_().getFileName(coords, valNames) - ); - Info<< "Writing distribution to " << str.name() << endl; + regions, // per cell the region(=droplet) + sortedRegions, // valid regions in sorted order + 1.0/sortedVols, // per region normalisation - List<const scalarField*> valPtrs(1); - valPtrs[0] = &normalisedCount; - formatterPtr_().write(coords, valNames, valPtrs, str); + indices, // index of bin for each region + binCount, // per bin number of regions + coords // graph data for bins + ); + } } } } diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H index 149424fb27aebe5c84070c7482d4e1179285dd22..077d13f93d0ae87d25deb7b604299e5044eca4af 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H @@ -28,11 +28,67 @@ Group grpFieldFunctionObjects Description - Looks up a field, interpolates it to the faces and determines a connected - region from a patch where the field is above a certain value. - - Writes a field containing all regions starting at given patch - ('liquid core') - - All other regions are summed for volume and a histogram is calculated. + Droplet size distribution calculation. + + Looks up a void-fraction (alpha) field and splits the mesh into regions + based on where the field is below the threshold value. These + regions ("droplets") can now be analysed. + + Regions: + - (debug) write regions as a volScalarField + - (debug) print for all regions the sum of volume and alpha*volume + - print the regions connected to a user-defined set of patches. + (in spray calculation these form the liquid core) + - print the regions with too large volume. These are the 'background' + regions. + + Fields: + - write volScalarField alpha_liquidCore : alpha with outside liquid core + set to 0. + alpha_background : alpha with outside background + set to 0. + + Histogram: + - determine histogram of diameter (given minDiameter, maxDiameter, nBins) + - write graph of number of droplets per bin + - write graph of sum, average and deviation of droplet volume per bin + - write graph of sum, average and deviation of user-defined fields. For + volVectorFields these are those of the 3 components and the magnitude. + + Sample input: + + functions + { + regionSizeDistribution + { + type regionSizeDistribution; + + outputControl timeStep; + outputInterval 1; + + // Field to determine regions from + field alpha; + // Patches that provide the liquid core + patches (inlet); + // Delimit alpha regions + threshold 0.4; + + // Fields to sample (no need to include alpha) + fields (p U); + + // Number of bins for histogram + nBins 100; + // Max droplet diameter + maxDiameter 0.5e-4; + //// Min droplet diameter (default is 0) + //minDiameter 0; + + // Writing format + setFormat gnuplot; + } + } + + SourceFiles regionSizeDistribution.C @@ -44,6 +100,9 @@ SourceFiles #include "pointFieldFwd.H" #include "writer.H" +#include "Map.H" +#include "volFieldsFwd.H" +#include "wordReList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,6 +113,8 @@ namespace Foam class objectRegistry; class dictionary; class mapPolyMesh; +class regionSplit; +class polyMesh; /*---------------------------------------------------------------------------*\ Class regionSizeDistribution Declaration @@ -75,23 +136,85 @@ class regionSizeDistribution word alphaName_; //- Patches to walk from - wordList patchNames_; + wordReList patchNames_; //- Clip value scalar threshold_; - //- Background region volFraction - scalar volFraction_; + //- Maximum droplet diameter + scalar maxDiam_; + + //- Minimum droplet diameter + scalar minDiam_; //- Mumber of bins label nBins_; + //- Names of fields to sample on regions + wordReList fields_; + //- Output formatter to write autoPtr<writer<scalar> > formatterPtr_; // Private Member Functions + template<class Type> + Map<Type> regionSum(const regionSplit&, const Field<Type>&) const; + + //- Get data in order + template<class Type> + List<Type> extractData(const UList<label>& keys, const Map<Type>&) + const; + + void writeGraph + ( + const coordSet& coords, + const word& valueName, + const scalarField& values + ) const; + + //- Write volfields with the parts of alpha which are not + // droplets (liquidCore, backGround) + void writeAlphaFields + ( + const regionSplit& regions, + const Map<label>& keepRegions, + const Map<scalar>& regionVolume, + const volScalarField& alpha + ) const; + + //- Mark all regions starting at patches + Map<label> findPatchRegions(const polyMesh&, const regionSplit&) const; + + //- Helper: divide if denom != 0 + static tmp<scalarField> divide(const scalarField&, const scalarField&); + + //- Given per-region data calculate per-bin average/deviation and graph + void writeGraphs + ( + const word& fieldName, // name of field + const labelList& indices, // index of bin for each region + const scalarField& sortedField, // per region field data + const scalarField& binCount, // per bin number of regions + const coordSet& coords // graph data for bins + ) const; + + //- Given per-cell data calculate per-bin average/deviation and graph + void writeGraphs + ( + const word& fieldName, // name of field + const scalarField& cellField, // per cell field data + + const regionSplit& regions, // per cell the region(=droplet) + const labelList& sortedRegions, // valid regions in sorted order + const scalarField& sortedNormalisation, + + const labelList& indices, // index of bin for each region + const scalarField& binCount, // per bin number of regions + const coordSet& coords // graph data for bins + ) const; + //- Disallow default bitwise copy construct regionSizeDistribution(const regionSizeDistribution&); @@ -159,6 +282,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "regionSizeDistributionTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistributionTemplates.C b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistributionTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..2f55434315f165816263af977965f0cf4db898d7 --- /dev/null +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistributionTemplates.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "regionSizeDistribution.H" +#include "regionSplit.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::Map<Type> Foam::regionSizeDistribution::regionSum +( + const regionSplit& regions, + const Field<Type>& fld +) const +{ + // Per region the sum of fld + Map<Type> regionToSum(regions.nRegions()/Pstream::nProcs()); + + forAll(fld, cellI) + { + label regionI = regions[cellI]; + + typename Map<Type>::iterator fnd = regionToSum.find(regionI); + if (fnd == regionToSum.end()) + { + regionToSum.insert(regionI, fld[cellI]); + } + else + { + fnd() += fld[cellI]; + } + } + Pstream::mapCombineGather(regionToSum, plusEqOp<Type>()); + Pstream::mapCombineScatter(regionToSum); + + return regionToSum; +} + + +// Get data in sortedToc order +template<class Type> +Foam::List<Type> Foam::regionSizeDistribution::extractData +( + const UList<label>& keys, + const Map<Type>& regionData +) const +{ + List<Type> sortedData(keys.size()); + + forAll(keys, i) + { + sortedData[i] = regionData[keys[i]]; + } + return sortedData; +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index 1dd26906b74487d46da744e23d9f1c2a68dc67cd..ff9ba3a4e3e749c46189eb80334f68df95f95d53 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,14 +66,14 @@ Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const const compressible::LESModel& les = obr_.lookupObject<compressible::LESModel>("LESProperties"); - return les.devRhoBeff(); + return les.devRhoReff(); } else if (obr_.foundObject<incompressible::LESModel>("LESProperties")) { const incompressible::LESModel& les = obr_.lookupObject<incompressible::LESModel>("LESProperties"); - return rho()*les.devBeff(); + return rho()*les.devReff(); } else if (obr_.foundObject<basicThermo>("thermophysicalProperties")) { diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C index 3c45e36761bc4ac1575e3c571289dd5910d50eb9..ad2f2d895481a64cf7953194fb3ee3f866ca5d33 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,8 +129,7 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT) { FatalErrorIn ( - "Foam::sixDoFRigidBodyMotion::applyConstraints" - "(scalar deltaT)" + "Foam::sixDoFRigidBodyMotion::applyConstraints(scalar)" ) << nl << "Maximum number of sixDoFRigidBodyMotion constraint " << "iterations (" @@ -391,8 +390,8 @@ void Foam::sixDoFRigidBodyMotion::updatePosition ( "void Foam::sixDoFRigidBodyMotion::updatePosition" "(" - "scalar deltaT, " - "scalar deltaT0" + "scalar, " + "scalar" ")" ) << "Limited acceleration " << a() @@ -449,9 +448,9 @@ void Foam::sixDoFRigidBodyMotion::updateForce ( "void Foam::sixDoFRigidBodyMotion::updateForce" "(" - "const vector& fGlobal, " - "const vector& tauGlobal, " - "scalar deltaT" + "const vector&, " + "const vector&, " + "scalar" ")" ) << "Limited acceleration " << a() @@ -463,7 +462,7 @@ void Foam::sixDoFRigidBodyMotion::updateForce pi() += 0.5*(1 - cDamp_)*deltaT*tau(); - if(report_) + if (report_) { status(); } diff --git a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C index a512419c50e37f8e62ea7a9dea9ff1837a1c76cd..5e6c38045b6cce60b0fe4b068ab688feb6156c9a 100644 --- a/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/vtk/vtkSurfaceWriter.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -170,6 +170,7 @@ namespace Foam { const symmTensor& v = values[elemI]; os << float(v[0]) << ' ' << float(v[1]) << ' ' << float(v[2]) + << ' ' << float(v[3]) << ' ' << float(v[4]) << ' ' << float(v[5]) << nl; @@ -190,7 +191,9 @@ namespace Foam { const tensor& v = values[elemI]; os << float(v[0]) << ' ' << float(v[1]) << ' ' << float(v[2]) + << ' ' << float(v[3]) << ' ' << float(v[4]) << ' ' << float(v[5]) + << ' ' << float(v[6]) << ' ' << float(v[7]) << ' ' << float(v[8]) << nl; } diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index b57ea9df980d9fb1993fb65b038e8db02e789350..4cace549800e870c736df2ae1464a4d123ab615f 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -55,7 +55,7 @@ Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes() { hbt[patchi] = gradientEnergyFvPatchScalarField::typeName; } - else if(isA<mixedFvPatchScalarField>(tbf[patchi])) + else if (isA<mixedFvPatchScalarField>(tbf[patchi])) { hbt[patchi] = mixedEnergyFvPatchScalarField::typeName; } diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C index ec9676940a5c35246941f6a2d03973114f6ef8e5..aaa301f345514ff161928b16a1ad84e33291f9a8 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/radiationCoupledBase/radiationCoupledBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,7 +102,7 @@ Foam::radiationCoupledBase::radiationCoupledBase case LOOKUP: { - if(!dict.found("emissivity")) + if (!dict.found("emissivity")) { FatalIOErrorIn ( diff --git a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H index 8019e61017a739af99e1b3fd3e795b2b59261f2c..4f7afc0fa0ee417e43a6fd7886a2536b27538f8e 100644 --- a/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H +++ b/src/thermophysicalModels/radiationModels/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.H @@ -33,6 +33,11 @@ Description \heading Patch usage + \table + Property | Description | Required | Default value + T | temperature field name | no | T + \endtable + Example of the boundary condition specification: \verbatim myPatch diff --git a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C index a0d87a6081ce0211f22724fe545f02118dddcdb0..69e87fe518f7547767c7ca5c0ca591154a8215c4 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/singleStepReactingMixture/singleStepReactingMixture.C @@ -108,7 +108,14 @@ void Foam::singleStepReactingMixture<ThermoType>::calculateMaxProducts() Yprod0_[specieI] = this->speciesData()[specieI].W()/Wm*Xi[i]; } - Info << "Maximum products mass concentrations :" << Yprod0_<< endl; + Info << "Maximum products mass concentrations:" << nl; + forAll(Yprod0_, i) + { + if (Yprod0_[i] > 0) + { + Info<< " " << this->species()[i] << ": " << Yprod0_[i] << nl; + } + } // Normalize the stoichiometric coeff to mass forAll(specieStoichCoeffs_, i) diff --git a/src/thermophysicalModels/solid/reaction/Reactions/solidReaction/solidReaction.C b/src/thermophysicalModels/solid/reaction/Reactions/solidReaction/solidReaction.C index b2fa34d7262d8dfac88ff29b81149adf09a16c62..5e351cff4a3ff4e9b5dc5f02d57bb089b4c0c171 100644 --- a/src/thermophysicalModels/solid/reaction/Reactions/solidReaction/solidReaction.C +++ b/src/thermophysicalModels/solid/reaction/Reactions/solidReaction/solidReaction.C @@ -161,7 +161,7 @@ void Foam::solidReaction::setLRhs(Istream& is) { if (t == token::ADD) { - if(isGas) + if (isGas) { grhs_ = dlsrhs.shrink(); dlsrhs.clear(); @@ -177,7 +177,7 @@ void Foam::solidReaction::setLRhs(Istream& is) } else if (t == token::ASSIGN) { - if(isGas) + if (isGas) { Info << "Pyrolysis Gases should appear on lhs of the" "reaction" << endl; @@ -188,7 +188,7 @@ void Foam::solidReaction::setLRhs(Istream& is) dlsrhs.clear(); } } - else if(isGas) + else if (isGas) { grhs_ = dlsrhs.shrink(); is.putBack(t); @@ -201,7 +201,7 @@ void Foam::solidReaction::setLRhs(Istream& is) return; } } - else if(isGas) + else if (isGas) { grhs_ = dlsrhs.shrink(); is.putBack(t); diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index a55997915cc2064372fbab3d4277591da9970151..2031e2a808ac4692580927c0ee9d82485b093fbb 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -46,9 +46,6 @@ Description L | length scale \endvartable - \note - In the event of reverse flow, a zero-gradient condition is applied - \heading Patch usage \table @@ -68,6 +65,9 @@ Description } \endverbatim +Note + In the event of reverse flow, a zero-gradient condition is applied + SeeAlso Foam::inletOutletFvPatchField diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index 68f2a0088473a141fb05e31f4740665e1a30dffd..9aaeb71db0a5d0ef46df8b03080b489ebfb3a6ed 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -45,9 +45,6 @@ Description L | length scale \endvartable - \note - In the event of reverse flow, a zero-gradient condition is applied - \heading Patch usage \table @@ -67,6 +64,9 @@ Description } \endverbatim +Note + In the event of reverse flow, a zero-gradient condition is applied + SeeAlso Foam::inletOutletFvPatchField diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H index 1230136b7393c20d30e5dadc7843e50ffdb71ac4..44e96635bacdf6056c9b724dff868e8660977e9a 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H @@ -55,8 +55,8 @@ Description } \endverbatim - \note - Only supply \h an \c Ta, or \c q in the dictionary (see above) +Note + Only supply \c h and \c Ta, or \c q in the dictionary (see above) SourceFiles externalWallHeatFluxTemperatureFvPatchScalarField.C diff --git a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H index b45b7a330c2f01bbad0ca1c6eb34454fe6e7f582..a52e8e5b34fa2731631459a4be58c037d0a30fad 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H @@ -73,7 +73,7 @@ Description } \endverbatim - \note +Note The underlying \c patchType should be set to \c cyclic SourceFiles diff --git a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C index 0c905a91cedb52c7953accfd971beeb04b320dcb..69795c56d7af1d6edaebddf0361e1c8f66063ae2 100644 --- a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C +++ b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,17 +87,34 @@ tmp<volSymmTensorField> GenEddyVisc::B() const } -tmp<volSymmTensorField> GenEddyVisc::devBeff() const +tmp<volSymmTensorField> GenEddyVisc::devReff() const { return -nuEff()*dev(twoSymm(fvc::grad(U()))); } -tmp<fvVectorMatrix> GenEddyVisc::divDevBeff(volVectorField& U) const +tmp<fvVectorMatrix> GenEddyVisc::divDevReff(volVectorField& U) const { return ( - - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U)))) + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(T(fvc::grad(U)))) + ); +} + + +tmp<fvVectorMatrix> GenEddyVisc::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) ); } diff --git a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H index c5a81193329e56fdca33ac7cdb348752c71969b3..2882257c8407848746a52442889ec92a80256293 100644 --- a/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.H @@ -121,11 +121,19 @@ public: //- Return the effective sub-grid turbulence stress tensor // including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<volSymmTensorField> devReff() const; //- Return the deviatoric part of the effective sub-grid // turbulence stress tensor including the laminar stress - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp<volTensorField>& gradU); diff --git a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C index 9d385c21eb1687c6e72d5e43b965716c746deb95..1618fb7f3be0a3f9b0e96e2dff12c4bd08855207 100644 --- a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C +++ b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,7 +115,7 @@ GenSGSStress::GenSGSStress // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -tmp<volSymmTensorField> GenSGSStress::devBeff() const +tmp<volSymmTensorField> GenSGSStress::devReff() const { return tmp<volSymmTensorField> ( @@ -135,7 +135,7 @@ tmp<volSymmTensorField> GenSGSStress::devBeff() const } -tmp<fvVectorMatrix> GenSGSStress::divDevBeff +tmp<fvVectorMatrix> GenSGSStress::divDevReff ( volVectorField& U ) const @@ -164,6 +164,38 @@ tmp<fvVectorMatrix> GenSGSStress::divDevBeff } +tmp<fvVectorMatrix> GenSGSStress::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div(rho*B_ + couplingFactor_*rho*nuSgs_*fvc::grad(U)) + + fvc::laplacian + ( + (1.0 - couplingFactor_)*rho*nuSgs_, U, "laplacian(muEff,U)" + ) + - fvm::laplacian(muEff, U) + ); + } + else + { + return + ( + fvc::div(rho*B_) + + fvc::laplacian(rho*nuSgs_, U, "laplacian(muEff,U)") + - fvm::laplacian(muEff, U) + ); + } +} + + bool GenSGSStress::read() { if (LESModel::read()) diff --git a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H index afe797b409a6125b0d8b55058241935333ee2229..4967b482bb1896dce1fcbf43bf356c3a6ca8c960 100644 --- a/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H +++ b/src/turbulenceModels/incompressible/LES/GenSGSStress/GenSGSStress.H @@ -131,11 +131,19 @@ public: //- Return the effective sub-grid turbulence stress tensor // including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<volSymmTensorField> devReff() const; - //- Returns div(B). - // This is the additional term due to the filtering of the NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Read LESProperties dictionary virtual bool read(); diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H index ab1265b7d2a72f7ab88da0da13cc7d47d08e6933..b8a2a5f9aca56f7a8e413b24505d0fa8d8b1a95a 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -205,14 +205,6 @@ public: //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const = 0; - //- Return the deviatoric part of the effective sub-grid - // turbulence stress tensor including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const = 0; - - //- Returns div(dev(Beff)). - // This is the additional term due to the filtering of the NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const = 0; - // RAS compatibility functions for the turbulenceModel base class @@ -228,18 +220,6 @@ public: return B(); } - //- Return the effective stress tensor including the laminar stress - virtual tmp<volSymmTensorField> devReff() const - { - return devBeff(); - } - - //- Return the source term for the momentum equation - virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const - { - return divDevBeff(U); - } - //- Correct Eddy-Viscosity and related properties. // This calls correct(const tmp<volTensorField>& gradU) by supplying diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C index 97d32bce9dd2ac39bc2fb3184487085be42132e9..84fc1fc7be5cfdf412cb9838089552668770af87 100644 --- a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,7 +81,7 @@ tmp<volSymmTensorField> Smagorinsky2::B() const } -tmp<fvVectorMatrix> Smagorinsky2::divDevBeff +tmp<fvVectorMatrix> Smagorinsky2::divDevReff ( volVectorField& U ) const @@ -101,6 +101,28 @@ tmp<fvVectorMatrix> Smagorinsky2::divDevBeff } +tmp<fvVectorMatrix> Smagorinsky2::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volTensorField gradU(fvc::grad(U)); + + volSymmTensorField aniMuEff + ( + "muEff", + I*(rho*nuEff()) + (cD2_*rho*delta())*symm(gradU) + ); + + return + ( + - fvm::laplacian(aniMuEff, U) + - fvc::div(rho*nuEff()*dev(T(fvc::grad(U)))) + ); +} + + bool Smagorinsky2::read() { if (Smagorinsky::read()) diff --git a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H index 139e66fe53cc2f02cafdb1c788ccf9c0ea5a7104..b51528f945e9f40c07dfb9e71e0509a04b0792b4 100644 --- a/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H +++ b/src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.H @@ -112,9 +112,17 @@ public: //- Return B. virtual tmp<volSymmTensorField> B() const; - //- Returns div(B). - // This is the additional term due to the filtering of the NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Read LESProperties dictionary virtual bool read(); diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C index 6a34f90892e0ae075f022959b87b516c3b9e8037..da8ab55e07b45492e216296381b0f4cd89a7d78d 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -338,17 +338,34 @@ tmp<volSymmTensorField> SpalartAllmaras::B() const } -tmp<volSymmTensorField> SpalartAllmaras::devBeff() const +tmp<volSymmTensorField> SpalartAllmaras::devReff() const { return -nuEff()*dev(twoSymm(fvc::grad(U()))); } -tmp<fvVectorMatrix> SpalartAllmaras::divDevBeff(volVectorField& U) const +tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const { return ( - - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U)))) + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(T(fvc::grad(U)))) + ); +} + + +tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) ); } diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H index 9a4ee1738843edb08dc093c5d411dd5fc733ef1d..674a42134d3f3028aba87761a0abfdd375fe98f2 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -175,11 +175,19 @@ public: //- Return the effective sub-grid turbulence stress tensor // including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<volSymmTensorField> devReff() const; - //- Return the deviatoric part of the divergence of Beff - // i.e. the additional term in the filtered NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Correct nuTilda and related properties virtual void correct(const tmp<volTensorField>& gradU); diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C index 5e6890d016c39d8877241dba11a5076c4947af79..12a6f1b3d111b051302587ca94d4709c24f0077a 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -388,7 +388,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) - fvm::Sp(fvc::div(phi()), omega_) - fvm::laplacian(DomegaEff(F1), omega_) == - gamma(F1)*0.5*S2 + gamma(F1)*S2 - fvm::Sp(beta(F1)*omega_, omega_) - fvm::SuSp // cross diffusion term ( @@ -425,17 +425,34 @@ tmp<volSymmTensorField> kOmegaSSTSAS::B() const } -tmp<volSymmTensorField> kOmegaSSTSAS::devBeff() const +tmp<volSymmTensorField> kOmegaSSTSAS::devReff() const { return -nuEff()*dev(twoSymm(fvc::grad(U()))); } -tmp<fvVectorMatrix> kOmegaSSTSAS::divDevBeff(volVectorField& U) const +tmp<fvVectorMatrix> kOmegaSSTSAS::divDevReff(volVectorField& U) const { return ( - - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U)))) + - fvm::laplacian(nuEff(), U) + - fvc::div(nuEff()*dev(T(fvc::grad(U)))) + ); +} + + +tmp<fvVectorMatrix> kOmegaSSTSAS::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) ); } diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H index 97354ff4921fc47607b8bf025d91e19d9666eddb..6d5eb587a7d0f1987cfecc800609bfc2ea6123c2 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.H @@ -252,11 +252,19 @@ public: //- Return the effective sub-grid turbulence stress tensor // including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<volSymmTensorField> devReff() const; - //- Return the deviatoric part of the divergence of Beff - // i.e. the additional term in the filtered NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Solve the turbulence equations (k-w) and correct the turbulence // viscosity diff --git a/src/turbulenceModels/incompressible/LES/laminar/laminar.C b/src/turbulenceModels/incompressible/LES/laminar/laminar.C index c88ff32beba4648761bf68b8f8d669b816e17257..5a78c213ee3f78201d77366f2e2bf54b38590c5c 100644 --- a/src/turbulenceModels/incompressible/LES/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/LES/laminar/laminar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,17 +136,34 @@ tmp<volSymmTensorField> laminar::B() const } -tmp<volSymmTensorField> laminar::devBeff() const +tmp<volSymmTensorField> laminar::devReff() const { return -nu()*dev(twoSymm(fvc::grad(U()))); } -tmp<fvVectorMatrix> laminar::divDevBeff(volVectorField& U) const +tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const { return ( - - fvm::laplacian(nu(), U) - fvc::div(nu()*dev(T(fvc::grad(U)))) + - fvm::laplacian(nu(), U) + - fvc::div(nu()*dev(T(fvc::grad(U)))) + ); +} + + +tmp<fvVectorMatrix> laminar::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) ); } diff --git a/src/turbulenceModels/incompressible/LES/laminar/laminar.H b/src/turbulenceModels/incompressible/LES/laminar/laminar.H index 14de7a142ac90302938c5196c5d04ab16ebf7a5e..777a9228a73e61fd0fe09724297142515347de1e 100644 --- a/src/turbulenceModels/incompressible/LES/laminar/laminar.H +++ b/src/turbulenceModels/incompressible/LES/laminar/laminar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,13 +104,21 @@ public: //- Return the sub-grid stress tensor B. virtual tmp<volSymmTensorField> B() const; + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + //- Return the deviatoric part of the effective sub-grid // turbulence stress tensor including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; - //- Return the deviatoric part of the divergence of Beff - // i.e. the additional term in the filtered NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Read LESProperties dictionary bool read(); diff --git a/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C index 4f2804577fa4020e007e222bdc946badee3e3715..b17f4ea572a2a0ab80ecc67e567f851ddfdbcc62 100644 --- a/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C +++ b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,25 +91,39 @@ tmp<volSymmTensorField> mixedSmagorinsky::B() const } -tmp<volSymmTensorField> mixedSmagorinsky::devBeff() const +tmp<volSymmTensorField> mixedSmagorinsky::devReff() const { return ( - scaleSimilarity::devBeff() - + Smagorinsky::devBeff() + scaleSimilarity::devReff() + + Smagorinsky::devReff() ); } -tmp<fvVectorMatrix> mixedSmagorinsky::divDevBeff +tmp<fvVectorMatrix> mixedSmagorinsky::divDevReff ( volVectorField& U ) const { return ( - scaleSimilarity::divDevBeff(U) - + Smagorinsky::divDevBeff(U) + scaleSimilarity::divDevReff(U) + + Smagorinsky::divDevReff(U) + ); +} + + +tmp<fvVectorMatrix> mixedSmagorinsky::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + return + ( + scaleSimilarity::divDevRhoReff(rho, U) + + Smagorinsky::divDevRhoReff(rho, U) ); } diff --git a/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H index 1793c8053dc235bbb823485c25ea4b57f1a2c818..c48932d0874a17565c6ccf099057a731ce552b0c 100644 --- a/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H +++ b/src/turbulenceModels/incompressible/LES/mixedSmagorinsky/mixedSmagorinsky.H @@ -132,11 +132,19 @@ public: //- Return the effective sub-grid turbulence stress tensor // including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<volSymmTensorField> devReff() const; - //- Implementation of div(B). This is necessary to override - // (and include) the div(B) terms from both the parent classes. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp<volTensorField>& gradU); diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C index b253573be13a387b48239fae3bd0359e2060b968..61322de356f08e3401d7454eeb442ec26b7a4d70 100644 --- a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,15 +79,25 @@ tmp<volSymmTensorField> scaleSimilarity::B() const } -tmp<volSymmTensorField> scaleSimilarity::devBeff() const +tmp<volSymmTensorField> scaleSimilarity::devReff() const { return dev(B()); } -tmp<fvVectorMatrix> scaleSimilarity::divDevBeff(volVectorField& U) const +tmp<fvVectorMatrix> scaleSimilarity::divDevReff(volVectorField& U) const { - return fvm::Su(fvc::div(devBeff()), U); + return fvm::Su(fvc::div(devReff()), U); +} + + +tmp<fvVectorMatrix> scaleSimilarity::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + return fvm::Su(fvc::div(rho*devReff()), U); } diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H index 5a6a5d97a6061f45898c451b09bd747ce029b765..f159ebab741ccb03892e77d54eea30bf296c1ca1 100644 --- a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H @@ -109,13 +109,21 @@ public: //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const; + //- Return the effective sub-grid turbulence stress tensor + // including the laminar stress + virtual tmp<volSymmTensorField> devReff() const; + //- Return the deviatoric part of the effective sub-grid // turbulence stress tensor including the laminar stress - virtual tmp<volSymmTensorField> devBeff() const; + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; - //- Return the deviatoric part of the divergence of Beff - // i.e. the additional term in the filtered NSE. - virtual tmp<fvVectorMatrix> divDevBeff(volVectorField& U) const; + //- Return the deviatoric part of the effective sub-grid + // turbulence stress tensor including the laminar stress + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp<volTensorField>&); diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C index 30afa63ce9964921dff160aeffa0f2fc38f2b00a..c2c7e5efbe456224c622afbfb168183dfb430dae 100644 --- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -259,6 +259,44 @@ tmp<fvVectorMatrix> LRR::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> LRR::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div + ( + rho*R_ + couplingFactor_*(rho*nut_)*fvc::grad(U), + "div((rho*R))" + ) + + fvc::laplacian + ( + (1.0 - couplingFactor_)*rho*nut_, + U, + "laplacian(muEff,U)" + ) + - fvm::laplacian(muEff, U) + ); + } + else + { + return + ( + fvc::div(rho*R_) + + fvc::laplacian(rho*nut_, U, "laplacian(muEff,U)") + - fvm::laplacian(muEff, U) + ); + } +} + + bool LRR::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.H b/src/turbulenceModels/incompressible/RAS/LRR/LRR.H index 9b03c598eb26254166cb48d203ae2cb53978c224..f60f0a66304102f5d2655b8496445b5c27ff30da 100644 --- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.H +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.H @@ -176,6 +176,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C index 1671c625a083b67609baccbb85d59592f925706a..10de46f58703089b06356d9265b17ccde0efdc8b 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,6 +204,22 @@ tmp<fvVectorMatrix> LamBremhorstKE::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> LamBremhorstKE::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool LamBremhorstKE::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H index 9f826ce1ee998172c9a02b130e56b7fab3e9aa9c..2b5870cacdf7e649497177715bcc93d7ef9364be 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.H @@ -150,6 +150,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index aafa62af19292d35f01cae9828208b453614932a..49326b1ff50c27f6453223ec8f489c590b13cce3 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -276,7 +276,12 @@ tmp<fvVectorMatrix> LaunderGibsonRSTM::divDevReff(volVectorField& U) const return ( fvc::div(R_ + couplingFactor_*nut_*fvc::grad(U), "div(R)") - + fvc::laplacian((1.0-couplingFactor_)*nut_, U, "laplacian(nuEff,U)") + + fvc::laplacian + ( + (1.0 - couplingFactor_)*nut_, + U, + "laplacian(nuEff,U)" + ) - fvm::laplacian(nuEff(), U) ); } @@ -292,6 +297,44 @@ tmp<fvVectorMatrix> LaunderGibsonRSTM::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> LaunderGibsonRSTM::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + if (couplingFactor_.value() > 0.0) + { + return + ( + fvc::div + ( + rho*R_ + couplingFactor_*(rho*nut_)*fvc::grad(U), + "div((rho*R))" + ) + + fvc::laplacian + ( + (1.0 - couplingFactor_)*rho*nut_, + U, + "laplacian(muEff,U)" + ) + - fvm::laplacian(muEff, U) + ); + } + else + { + return + ( + fvc::div(rho*R_) + + fvc::laplacian(rho*nut_, U, "laplacian(muEff,U)") + - fvm::laplacian(muEff, U) + ); + } +} + + bool LaunderGibsonRSTM::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H index 909844a5ed39ffccb6f5cd75517b09962a7a95df..42233d41b0454087cc52c2d559129381aeba818d 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -187,6 +187,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index f0fa6e60c8d3abc3fd363025c6f45d39e9e85afb..c514a378e20c4b268b229e1960fb4084d3e777b4 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -210,6 +210,22 @@ tmp<fvVectorMatrix> LaunderSharmaKE::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> LaunderSharmaKE::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool LaunderSharmaKE::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H index 92a53434d7bdfb489bd6da555433d173813987e4..9396df87b9dcef65ad95705288bda9faf35a0f5b 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -167,6 +167,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C index 03e1e5aa1acb2673e463975a1b8483cf47cab590..20d8dee95140a3c513c4c3f1729266176f63c844 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C @@ -298,6 +298,23 @@ tmp<fvVectorMatrix> LienCubicKE::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> LienCubicKE::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + fvc::div(rho*nonlinearStress_) + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool LienCubicKE::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H index bbeedbff05f4b6829b3a2e2da6b4373df3ae7e6d..78771f9d6e0be42579b75c27b966d4ddff00f0f4 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.H @@ -162,6 +162,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index e0bd0f0df9f76afb0b15821460b37463f405903f..da81b66edddd428183e706efb5f1357fa58de2f4 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -365,6 +365,23 @@ tmp<fvVectorMatrix> LienCubicKELowRe::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> LienCubicKELowRe::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + fvc::div(rho*nonlinearStress_) + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool LienCubicKELowRe::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H index cae720d40d743f553975b205ff685fa400f2b206..df9d0fab823ce8eac199462569a7095638239307 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.H @@ -189,6 +189,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index 91e288f104258375661e2d1fda755d9e13c4b36b..15296cdf5bb03f0b80b576d58ffab1629baceca5 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -243,12 +243,27 @@ tmp<fvVectorMatrix> LienLeschzinerLowRe::divDevReff(volVectorField& U) const return ( - fvm::laplacian(nuEff(), U) - //- (fvc::grad(U) & fvc::grad(nuEff())) - fvc::div(nuEff()*T(fvc::grad(U))) ); } +tmp<fvVectorMatrix> LienLeschzinerLowRe::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool LienLeschzinerLowRe::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H index 2131ac8784923b079687c1e2fed0f195b8216201..0d8da074b558030135c21d7c295374e7da502693 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.H @@ -159,6 +159,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C index 33cc03edac8927bb0aa577b1bfef6b92870ad940..4dbb7b7b6832155c1d6f4d85829e2dd6235a01c5 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -287,6 +287,23 @@ tmp<fvVectorMatrix> NonlinearKEShih::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> NonlinearKEShih::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + fvc::div(rho*nonlinearStress_) + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool NonlinearKEShih::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H index 19f5b9c427669e3b76959f9c35844ef7e329f8df..b7c89fac1bf8eb201e073b939c8efb8ab6256810 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.H @@ -165,6 +165,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C index 794d9f9b07f10a4888eb2b27ec7b671eaa8d0a4f..460a6609acdd01f2497333776058deaf808cf90a 100644 --- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -220,6 +220,22 @@ tmp<fvVectorMatrix> RNGkEpsilon::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> RNGkEpsilon::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool RNGkEpsilon::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H index 0b7951ad8588572ab7ae428a128ca634582d3cfd..b9bf88048af2bc41bd31fa00783c589d440fb68e 100644 --- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -164,6 +164,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C index 1804ba5b01007b741f4ad25a14c612032c0940d4..4105cb1876e1664fd74006e7193ccd895f01b951 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -337,6 +337,22 @@ tmp<fvVectorMatrix> SpalartAllmaras::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> SpalartAllmaras::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool SpalartAllmaras::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H index 26c38db03725c34ad0e43bafd428727cfb035305..d7479c2dd5b829c5b08e703682f730fbd33f3252 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -187,6 +187,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H index 0b1e2002f82109de12f10127ee3dbf6cc6a9537f..b37c40a3da6d37849f6653708f08388677f52359 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H @@ -64,12 +64,6 @@ Description layer", Journal of Wind Engineering and Industrial Aerodynamics 95(2007), pp 355-369. - \note - D.M. Hargreaves and N.G. Wright recommend Gamma epsilon in the - k-epsilon model should be changed from 1.3 to 1.11 for consistency. - The roughness height (Er) is given by Er = 20 z0 following the same - reference. - \heading Patch usage \table @@ -98,6 +92,12 @@ Description } \endverbatim +Note + D.M. Hargreaves and N.G. Wright recommend Gamma epsilon in the + k-epsilon model should be changed from 1.3 to 1.11 for consistency. + The roughness height (Er) is given by Er = 20 z0 following the same + reference. + SourceFiles atmBoundaryLayerInletVelocityFvPatchVectorField.C diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H index 60d150deb0e32d40d42d4a43bd8f90292b4cd4a2..59b8106d151bc72f91b692708d9d0e04047755ce 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H @@ -41,11 +41,6 @@ Description alphaEff | turbulent thermal diffusivity field name | yes | \endtable - \note - - it is assumed that the units of \c alphaEff are [kg/m/s] - - the specific heat capcaity is read from the transport dictionary entry - \c Cp0 - Example of the boundary condition specification: \verbatim myPatch @@ -58,6 +53,11 @@ Description } \endverbatim +Note + - it is assumed that the units of \c alphaEff are [kg/m/s] + - the specific heat capcaity is read from the transport dictionary entry + \c Cp0 + SourceFiles turbulentHeatFluxTemperatureFvPatchScalarField.C diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index 6f812db1e6437cd33ba27a30c54c002b7c2cc0f2..7a74a838496833a460e917438c7cffae9342dfa1 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -46,9 +46,6 @@ Description L | length scale \endvartable - \note - In the event of reverse flow, a zero-gradient condition is applied - \heading Patch usage \table @@ -68,6 +65,9 @@ Description } \endverbatim +Note + In the event of reverse flow, a zero-gradient condition is applied + SeeAlso Foam::inletOutletFvPatchField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index 602c382b9fd4abcca55fa9c116f6ddbcb7462cdd..e39e13845f464066d08ba247f94d0a1efbc9c156 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -45,9 +45,6 @@ Description L | length scale \endvartable - \note - In the event of reverse flow, a zero-gradient condition is applied - \heading Patch usage \table @@ -67,6 +64,9 @@ Description } \endverbatim +Note + In the event of reverse flow, a zero-gradient condition is applied + SeeAlso Foam::inletOutletFvPatchField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H index aaa71c3f4714ca4132a4ca11bcc91f1460eb5506..c26d9a41ecbfadfe77b83ca340892a814034f7e0 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H @@ -32,9 +32,6 @@ Description This boundary condition provides a kinematic turbulent thermal conductivity for using wall functions, using the Jayatilleke 'P' function. - \note - The units of kinematic turbulent thermal conductivity are m2/s - \heading Patch usage \table @@ -53,6 +50,9 @@ Description } \endverbatim +Note + The units of kinematic turbulent thermal conductivity are [m2/s] + SeeAlso Foam::fixedValueFvPatchField diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H index 591cf8da779570cd3a3227c5c9e92ae35da93f3e..95bde3ba032d724ebb8c5628af4a7155ff6632bc 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H @@ -33,10 +33,6 @@ Description of U+ as a function of near-wall Reynolds number. The table should be located in the $FOAM_CASE/constant folder. - \note - the tables are not registered since the same table object may be used for - more than one patch. - \heading Patch usage \table @@ -53,6 +49,10 @@ Description } \endverbatim +Note + The tables are not registered since the same table object may be used for + more than one patch. + SeeAlso Foam::nutWallFunctionFvPatchScalarField diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C index 99b4188cc016f2343d582fcfa798b602151f0c00..029b9f9db790f4a44b555f4e01182741e16c3fe4 100644 --- a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -192,6 +192,22 @@ tmp<fvVectorMatrix> kEpsilon::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> kEpsilon::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool kEpsilon::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H index 2e07ffde49a2a88cbb93bee244c158aa02661b3c..1ba0f94fd9c083e3d64e7ee19ddc0350f3fabf9b 100644 --- a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H +++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.H @@ -158,6 +158,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C index 7106c0ea2cd234b78401e0fccdbed220365043ff..51e1fbd491963020544af6770dc5c282d574cee8 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,6 +201,22 @@ tmp<fvVectorMatrix> kOmega::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> kOmega::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool kOmega::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H index 098f55e81152f86dbf5ff0b6aa4250c9a7c40970..d0c9e3ad2f6ff6070548ef94f4753adbd0c81cd5 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.H @@ -191,6 +191,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index c025076baa9936cfc78b97ff206c7a8d1f468b5b..e6c49db1c86724808fed61940c3d9ac16246383b 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -308,6 +308,22 @@ tmp<fvVectorMatrix> kOmegaSST::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> kOmegaSST::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool kOmegaSST::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H index f4d207cf84024be4076a0e64af56a8f823eabbec..7b2580094e1cb76e511066f3cb7dbd8e36aa6e25 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -261,6 +261,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C index abf9b29cde745690e802753df899e10c57595a14..45f4f69d1302091cc5bec564af3c8d1f3680b97a 100644 --- a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C +++ b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.C @@ -570,6 +570,22 @@ tmp<fvVectorMatrix> kkLOmega::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> kkLOmega::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool kkLOmega::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H index 6151e8ca9f6d2fa893cb7a7e4fb6e7dd71c54738..6badc208c3dd98b33fd630f059281ec902659b04 100644 --- a/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H +++ b/src/turbulenceModels/incompressible/RAS/kkLOmega/kkLOmega.H @@ -279,6 +279,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C index 68adca77b3f79374264bf36cd4316b78543aa62d..f0597b58da5f3fd4fe7c692f391b857a5072b238 100644 --- a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -177,6 +177,22 @@ tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> laminar::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool laminar::read() { return RASModel::read(); diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.H b/src/turbulenceModels/incompressible/RAS/laminar/laminar.H index 18f824b28447213c099c113dbb5a7a9f863f81d2..29426dadaf362dc1b2b66509c908f86d8f6fa292 100644 --- a/src/turbulenceModels/incompressible/RAS/laminar/laminar.H +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.H @@ -108,6 +108,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Correct the laminar viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C index 25940abb9ef0c81be459ea2effc2f19dffc3f8b3..1fd761b1d7e9e23e5b334684add0937e4cdaa7f3 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -262,6 +262,22 @@ tmp<fvVectorMatrix> qZeta::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> qZeta::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool qZeta::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H index 88e54c8a0688229e37eb6a9b474a6d4764d7956c..d45f686af7bf9af12286147843d5357af8eff77f 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.H @@ -214,6 +214,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C index 71058caa7d9472fb2667c09183e1d4e4349e7bcb..495b8930dfc6b0df2b18c350e3725af06a65fe0d 100644 --- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -246,6 +246,22 @@ tmp<fvVectorMatrix> realizableKE::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> realizableKE::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + bool realizableKE::read() { if (RASModel::read()) diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H index c467b0b797d11ca950b64258650b2cd545ae6c51..3f32089a6c9dd3abc554772931918bc1b720fcd1 100644 --- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.H @@ -183,6 +183,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C index c102b52cb1e10e2ae7a5525b590be169360b9a1c..a633c7a70e30df29bdc8c7feb1b33e4fa86d3ffc 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -203,6 +203,22 @@ tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const } +tmp<fvVectorMatrix> laminar::divDevRhoReff +( + const volScalarField& rho, + volVectorField& U +) const +{ + volScalarField muEff("muEff", rho*nuEff()); + + return + ( + - fvm::laplacian(muEff, U) + - fvc::div(muEff*dev(T(fvc::grad(U)))) + ); +} + + void laminar::correct() { turbulenceModel::correct(); diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H index 72994e90fb84908cb4f6a29e93a702a8cfc0afb6..5b79ecd48538d6226854350183a0746e7ab9b5ca 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,6 +111,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const; + //- Correct the laminar viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H index 405cfef0bfa47b20b1e34765820b0deb0ba7598f..c2eacdaf39201458b69422646d363383a7fde7f3 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H @@ -204,6 +204,13 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0; + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff + ( + const volScalarField& rho, + volVectorField& U + ) const = 0; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct() = 0; diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties index fb38fc764bf242af439a1aa4e99aaebfc12654a9..f1fec22f39d901e3db9008c19e59e9fd7e244f19 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties index fb38fc764bf242af439a1aa4e99aaebfc12654a9..f1fec22f39d901e3db9008c19e59e9fd7e244f19 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties index fb38fc764bf242af439a1aa4e99aaebfc12654a9..f1fec22f39d901e3db9008c19e59e9fd7e244f19 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/B b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/B deleted file mode 100644 index 39354d72f9cfc4b1b652b524d93cea5e090ff839..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/B +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------*- 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 volTensorField; - object B; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0 0 0 0); - -boundaryField -{ - inlet - { - type fixedValue; - value uniform (0 0 0 0 0 0 0 0 0); - } - - outlet - { - type inletOutlet; - inletValue uniform (0 0 0 0 0 0 0 0 0); - value uniform (0 0 0 0 0 0 0 0 0); - } - - upperWall - { - type zeroGradient; - } - - lowerWall - { - type zeroGradient; - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 index 79da11e10ac8f655aa16fc6287c9496875d8672f..2e865a7856a7ac268e22302a7b752184d8bc0ba7 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -107,55 +107,79 @@ edges ( ); -patches +boundary ( // is there no way of defining all my 'defaultFaces' to be 'wall'? - wall front - ( - // inlet block - frontQuad(in1, join1, join2, in2) - // outlet block - frontQuad(poro1, out1, out2, poro2) - ) - - wall back - ( - // inlet block - backQuad(in1, join1, join2, in2) - // outlet block - backQuad(poro1, out1, out2, poro2) - ) - - wall wall - ( - // inlet block - quad2D(in1, join1) - quad2D(join2, in2) - // outlet block - quad2D(poro1, out1) - quad2D(out2, poro2) - ) - - wall porosityWall - ( - // porosity block - frontQuad(join1, poro1, poro2, join2) - // porosity block - backQuad(join1, poro1, poro2, join2) - // porosity block - quad2D(join1, poro1) - quad2D(poro2, join2) - ) - - patch inlet - ( - quad2D(in2, in1) - ) - - patch outlet - ( - quad2D(out2, out1) - ) + front + { + type wall; + faces + ( + // inlet block + frontQuad(in1, join1, join2, in2) + // outlet block + frontQuad(poro1, out1, out2, poro2) + ); + } + + back + { + type wall; + faces + ( + // inlet block + backQuad(in1, join1, join2, in2) + // outlet block + backQuad(poro1, out1, out2, poro2) + ); + } + + wall + { + type wall; + faces + ( + // inlet block + quad2D(in1, join1) + quad2D(join2, in2) + // outlet block + quad2D(poro1, out1) + quad2D(out2, poro2) + ); + } + + porosityWall + { + type wall; + faces + ( + // porosity block + frontQuad(join1, poro1, poro2, join2) + // porosity block + backQuad(join1, poro1, poro2, join2) + // porosity block + quad2D(join1, poro1) + quad2D(poro2, join2) + ); + } + + inlet + { + type patch; + faces + ( + quad2D(in2, in1) + ); + } + + outlet + { + type patch; + faces + ( + quad2D(out2, out1) + ); + } ); mergePatchPairs diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/boundary b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/boundary deleted file mode 100644 index 0abd1608aba0dcb6aa66c9488133a3c4b51c7588..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/boundary +++ /dev/null @@ -1,58 +0,0 @@ -/*--------------------------------*- 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; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( - front - { - type wall; - nFaces 700; - startFace 63400; - } - back - { - type wall; - nFaces 700; - startFace 64100; - } - wall - { - type wall; - nFaces 1400; - startFace 64800; - } - porosityWall - { - type wall; - nFaces 1600; - startFace 66200; - } - inlet - { - type patch; - nFaces 400; - startFace 67800; - } - outlet - { - type patch; - nFaces 400; - startFace 68200; - } -) - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/ras/cavity/0/R b/tutorials/compressible/rhoPimpleFoam/ras/cavity/0/R deleted file mode 100644 index be21f26a9ecc13647d852108184efac0f619890b..0000000000000000000000000000000000000000 --- a/tutorials/compressible/rhoPimpleFoam/ras/cavity/0/R +++ /dev/null @@ -1,43 +0,0 @@ -/*--------------------------------*- 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 volSymmTensorField; - location "0"; - object R; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [ 0 2 -2 0 0 0 0 ]; - -internalField uniform ( 0 0 0 0 0 0 ); - -boundaryField -{ - movingWall - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - fixedWalls - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - frontAndBack - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/0/R b/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/0/R deleted file mode 100644 index d51cd49b93514a0b2eb935da1197c0449c16c237..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/0/R +++ /dev/null @@ -1,49 +0,0 @@ -/*--------------------------------*- 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 volSymmTensorField; - location "0"; - object R; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [ 0 2 -2 0 0 0 0 ]; - -internalField uniform ( 0 0 0 0 0 0 ); - -boundaryField -{ - lowerWall - { - type fixedValue; - value uniform ( 0 0 0 0 0 0 ); - } - upperWall - { - type fixedValue; - value uniform ( 0 0 0 0 0 0 ); - } - front - { - type cyclic; - } - back - { - type cyclic; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/R b/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/R deleted file mode 100644 index 7d963a944e57cedbe8700b63d473cb1f6c41b371..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/0/R +++ /dev/null @@ -1,47 +0,0 @@ -/*--------------------------------*- 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 volSymmTensorField; - location "0"; - object R; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [ 0 2 -2 0 0 0 0 ]; - -internalField uniform ( 0 0 0 0 0 0 ); - -boundaryField -{ - lowerWall - { - type zeroGradient; - } - upperWall - { - type zeroGradient; - } - front - { - type cyclic; - } - back - { - type cyclic; - } - defaultFaces - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict index 6f91f2d72f2cbc82086a22a3c5ff9b988857df5e..1df8467c2e836d5f319737c5f511d6557bb9c921 100644 --- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/dynamicMeshDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allclean b/tutorials/incompressible/pimpleDyMFoam/propeller/Allclean index f87f062960efbaed2ae46610209f269aa168951d..7be04a3babde2d1dccf2e93522c5ad6222f04473 100755 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allclean +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allclean @@ -4,9 +4,11 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions +# remove surface +\rm -f constant/triSurface/propellerTip.obj.gz + cleanCase \rm -rf 0 \rm -rf constant/extendedFeatureEdgeMesh/ \rm -f constant/triSurface/*.eMesh* - diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict index 4ab93d683a41dd4832bb9224d01e0cac916a9bff..a657902851b89fcbb1c3404b12acf247ef74667f 100644 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/constant/dynamicMeshDict @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/incompressible/pimpleFoam/channel395/0.org/B b/tutorials/incompressible/pimpleFoam/channel395/0.org/B deleted file mode 100644 index 78d2540b2e77db6ded1a44c4542925a9f6bd2e38..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/pimpleFoam/channel395/0.org/B +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------*- 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 volTensorField; - location "1"; - object B; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [ 0 2 -2 0 0 0 0 ]; - -internalField uniform ( 0 0 0 0 0 0 0 0 0 ); - -boundaryField -{ - bottomWall - { - type zeroGradient; - } - topWall - { - type zeroGradient; - } - sides1_half0 - { - type cyclic; - } - sides2_half0 - { - type cyclic; - } - inout1_half0 - { - type cyclic; - } - inout2_half0 - { - type cyclic; - } - sides2_half1 - { - type cyclic; - } - sides1_half1 - { - type cyclic; - } - inout1_half1 - { - type cyclic; - } - inout2_half1 - { - type cyclic; - } -} - - -// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/LESProperties b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/LESProperties index 9d0f065bf4f59df6525e67f281a076b303d9945b..197e16d1261b7f744db693cc75782d86837d7ecb 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/LESProperties +++ b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/LESProperties @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class dictionary; + location "constant"; object LESProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -20,125 +21,6 @@ delta cubeRootVol; printCoeffs on; -laminarCoeffs -{ -} - -oneEqEddyCoeffs -{ - ck 0.07; - ce 1.05; -} - -dynOneEqEddyCoeffs -{ - ce 1.05; - filter simple; -} - -locDynOneEqEddyCoeffs -{ - ce 1.05; - filter simple; -} - -SmagorinskyCoeffs -{ - ce 1.05; - ck 0.07; -} - -Smagorinsky2Coeffs -{ - ce 1.05; - ck 0.07; - cD2 0.02; -} - -spectEddyViscCoeffs -{ - ce 1.05; - cB 8.22; - cK1 0.83; - cK2 1.03; - cK3 4.75; - cK4 2.55; -} - -dynSmagorinskyCoeffs -{ - ce 1.05; - filter simple; -} - -mixedSmagorinskyCoeffs -{ - ce 1.05; - ck 0.07; - filter simple; -} - -dynMixedSmagorinskyCoeffs -{ - ce 1.05; - filter simple; -} - -LRRDiffStressCoeffs -{ - ce 1.05; - ck 0.09; - c1 1.8; - c2 0.6; -} - -DeardorffDiffStressCoeffs -{ - ce 1.05; - ck 0.09; - cm 4.13; -} - -SpalartAllmarasCoeffs -{ - alphaNut 1.5; - Cb1 0.1355; - Cb2 0.622; - Cw2 0.3; - Cw3 2; - Cv1 7.1; - Cv2 5.0; - CDES 0.65; - ck 0.07; -} - -SpalartAllmarasDDESCoeffs -{ - alphaNut 1.5; - Cb1 0.1355; - Cb2 0.622; - Cw2 0.3; - Cw3 2.0; - Cv1 7.1; - Cv2 5.0; - CDES 0.65; - ck 0.07; -} - -SpalartAllmarasIDDESCoeffs -{ - alphaNut 1.5; - kappa 0.4187; - Cb1 0.1355; - Cb2 0.622; - Cw2 0.3; - Cw3 2.0; - Cv1 7.1; - Cv2 5.0; - CDES 0.65; - ck 0.07; -} - cubeRootVolCoeffs { deltaCoeff 1; @@ -193,11 +75,5 @@ smoothCoeffs maxDeltaRatio 1.1; } -kappa 0.4187; - -wallFunctionCoeffs -{ - E 9; -} // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/turbulenceProperties b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/turbulenceProperties index 0000f87e4389e5e490be5c0bc11727c54eb19d3d..ab998a16d7a87b1579af406f4b27fc4cb98337a4 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/turbulenceProperties +++ b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/turbulenceProperties @@ -10,166 +10,11 @@ FoamFile version 2.0; format ascii; class dictionary; + location "constant"; object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // simulationType LESModel; -turbulenceModel SpalartAllmaras; //kEpsilon; - -turbulence on; - -laminarCoeffs -{ -} - -kEpsilonCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; -} - -RNGkEpsilonCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.0845; - C1 C1 [0 0 0 0 0 0 0] 1.42; - C2 C2 [0 0 0 0 0 0 0] 1.68; - alphak alphaK [0 0 0 0 0 0 0] 1.39; - alphaEps alphaEps [0 0 0 0 0 0 0] 1.39; - eta0 eta0 [0 0 0 0 0 0 0] 4.38; - beta beta [0 0 0 0 0 0 0] 0.012; -} - -NonlinearKEShihCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphak alphak [0 0 0 0 0 0 0] 1; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76932; - A1 A1 [0 0 0 0 0 0 0] 1.25; - A2 A2 [0 0 0 0 0 0 0] 1000; - Ctau1 Ctau1 [0 0 0 0 0 0 0] -4; - Ctau2 Ctau2 [0 0 0 0 0 0 0] 13; - Ctau3 Ctau3 [0 0 0 0 0 0 0] -2; - alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9; -} - -LienCubicKECoeffs -{ - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphak alphak [0 0 0 0 0 0 0] 1; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; - A1 A1 [0 0 0 0 0 0 0] 1.25; - A2 A2 [0 0 0 0 0 0 0] 1000; - Ctau1 Ctau1 [0 0 0 0 0 0 0] -4; - Ctau2 Ctau2 [0 0 0 0 0 0 0] 13; - Ctau3 Ctau3 [0 0 0 0 0 0 0] -2; - alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9; -} - -QZetaCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphaZeta alphaZeta [0 0 0 0 0 0 0] 0.76923; - anisotropic no; -} - -LaunderSharmaKECoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; -} - -LamBremhorstKECoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; -} - -LienCubicKELowReCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphak alphak [0 0 0 0 0 0 0] 1; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; - A1 A1 [0 0 0 0 0 0 0] 1.25; - A2 A2 [0 0 0 0 0 0 0] 1000; - Ctau1 Ctau1 [0 0 0 0 0 0 0] -4; - Ctau2 Ctau2 [0 0 0 0 0 0 0] 13; - Ctau3 Ctau3 [0 0 0 0 0 0 0] -2; - alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9; - Am Am [0 0 0 0 0 0 0] 0.016; - Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263; - Amu Amu [0 0 0 0 0 0 0] 0.00222; -} - -LienLeschzinerLowReCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - alphak alphak [0 0 0 0 0 0 0] 1; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; - Am Am [0 0 0 0 0 0 0] 0.016; - Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263; - Amu Amu [0 0 0 0 0 0 0] 0.00222; -} - -LRRCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - Clrr1 Clrr1 [0 0 0 0 0 0 0] 1.8; - Clrr2 Clrr2 [0 0 0 0 0 0 0] 0.6; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - Cs Cs [0 0 0 0 0 0 0] 0.25; - Ceps Ceps [0 0 0 0 0 0 0] 0.15; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; -} - -LaunderGibsonRSTMCoeffs -{ - Cmu Cmu [0 0 0 0 0 0 0] 0.09; - Clg1 Clg1 [0 0 0 0 0 0 0] 1.8; - Clg2 Clg2 [0 0 0 0 0 0 0] 0.6; - C1 C1 [0 0 0 0 0 0 0] 1.44; - C2 C2 [0 0 0 0 0 0 0] 1.92; - C1Ref C1Ref [0 0 0 0 0 0 0] 0.5; - C2Ref C2Ref [0 0 0 0 0 0 0] 0.3; - Cs Cs [0 0 0 0 0 0 0] 0.25; - Ceps Ceps [0 0 0 0 0 0 0] 0.15; - alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; - alphaR alphaR [0 0 0 0 0 0 0] 1.22; -} - -SpalartAllmarasCoeffs -{ - alphaNut alphaNut [0 0 0 0 0 0 0] 1.5; - Cb1 Cb1 [0 0 0 0 0 0 0] 0.1355; - Cb2 Cb2 [0 0 0 0 0 0 0] 0.622; - Cw2 Cw2 [0 0 0 0 0 0 0] 0.3; - Cw3 Cw3 [0 0 0 0 0 0 0] 2; - Cv1 Cv1 [0 0 0 0 0 0 0] 7.1; - //Next line Modified vorticity factor by Ashford 1996 - Cv2 Cv2 [0 0 0 0 0 0 0] 5.0; -} - -wallFunctionCoeffs -{ - kappa kappa [0 0 0 0 0 0 0] 0.4187; - E E [0 0 0 0 0 0 0] 9; -} - // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun index 5aa430556ad1a75e7d0c43f6084c0907d076554a..3815c35895356a5df5f8df3fa9be908e6bdfd20c 100755 --- a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun +++ b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun @@ -11,13 +11,10 @@ cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/ mkdir 0 runApplication blockMesh - cp system/decomposeParDict.hierarchical system/decomposeParDict - runApplication decomposePar cp system/decomposeParDict.ptscotch system/decomposeParDict - runParallel snappyHexMesh 8 -overwrite -parallel find . -type f -iname "*level*" -exec rm {} \; diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/controlDict b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/controlDict index d7759e4112d5c2dbe19b168b563d59bda6850e78..6569a100b7001f7129adf6aa24a8bfc7d7dec02b 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/controlDict +++ b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/controlDict @@ -17,7 +17,7 @@ FoamFile libs ("libOpenFOAM.so" "libfieldFunctionObjects.so"); -application pisoFoam; +application simpleFoam; startFrom latestTime; diff --git a/tutorials/incompressible/pisoFoam/les/pitzDaily/0/B b/tutorials/incompressible/pisoFoam/les/pitzDaily/0/B deleted file mode 100644 index 39354d72f9cfc4b1b652b524d93cea5e090ff839..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/pisoFoam/les/pitzDaily/0/B +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------*- 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 volTensorField; - object B; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0 0 0 0); - -boundaryField -{ - inlet - { - type fixedValue; - value uniform (0 0 0 0 0 0 0 0 0); - } - - outlet - { - type inletOutlet; - inletValue uniform (0 0 0 0 0 0 0 0 0); - value uniform (0 0 0 0 0 0 0 0 0); - } - - upperWall - { - type zeroGradient; - } - - lowerWall - { - type zeroGradient; - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/pitzDaily/constant/turbulenceProperties b/tutorials/incompressible/pisoFoam/les/pitzDaily/constant/turbulenceProperties index a925d3cc2b28640b5aebf7779f6a9008e77b09fc..ab998a16d7a87b1579af406f4b27fc4cb98337a4 100644 --- a/tutorials/incompressible/pisoFoam/les/pitzDaily/constant/turbulenceProperties +++ b/tutorials/incompressible/pisoFoam/les/pitzDaily/constant/turbulenceProperties @@ -17,5 +17,4 @@ FoamFile simulationType LESModel; - // ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/0/B b/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/0/B deleted file mode 100644 index 3cca215a8782df2728d6e6f4e14403e90e50020b..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/0/B +++ /dev/null @@ -1,55 +0,0 @@ -/*--------------------------------*- 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 volTensorField; - object B; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0 0 0 0); - -boundaryField -{ - inlet - { - type mapped; - value uniform (0 0 0 0 0 0 0 0 0); - interpolationScheme cell; - setAverage false; - average (0 0 0 0 0 0 0 0 0); - } - - outlet - { - type inletOutlet; - inletValue uniform (0 0 0 0 0 0 0 0 0); - value uniform (0 0 0 0 0 0 0 0 0); - } - - upperWall - { - type zeroGradient; - } - - lowerWall - { - type zeroGradient; - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavity/0/R b/tutorials/incompressible/pisoFoam/ras/cavity/0/R deleted file mode 100644 index 8b8fd01091bbcaf03a46adb16e8242b0fdd0b91a..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/pisoFoam/ras/cavity/0/R +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------*- 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 volSymmTensorField; - object R; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0); - -boundaryField -{ - movingWall - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - fixedWalls - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/motorBike/Allrun b/tutorials/incompressible/simpleFoam/motorBike/Allrun index cb5a66db11d9dd5bed22612546607ef0d9321b2e..d8fdb9d007a75fc3add9c3585a9199a4f0be229a 100755 --- a/tutorials/incompressible/simpleFoam/motorBike/Allrun +++ b/tutorials/incompressible/simpleFoam/motorBike/Allrun @@ -1,4 +1,6 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions @@ -12,3 +14,5 @@ runApplication snappyHexMesh -overwrite runApplication potentialFoam -noFunctionObjects -writep runApplication `getApplication` + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/0/R b/tutorials/incompressible/simpleFoam/pitzDaily/0/R deleted file mode 100644 index da397ebfb3afaba8674f1702392e99f8d03d978b..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/simpleFoam/pitzDaily/0/R +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------*- 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 volSymmTensorField; - object R; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0); - -boundaryField -{ - inlet - { - type fixedValue; - value uniform (0 0 0 0 0 0); - } - - outlet - { - type zeroGradient; - } - - upperWall - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - lowerWall - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/R b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/R deleted file mode 100644 index da397ebfb3afaba8674f1702392e99f8d03d978b..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/R +++ /dev/null @@ -1,52 +0,0 @@ -/*--------------------------------*- 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 volSymmTensorField; - object R; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0); - -boundaryField -{ - inlet - { - type fixedValue; - value uniform (0 0 0 0 0 0); - } - - outlet - { - type zeroGradient; - } - - upperWall - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - lowerWall - { - type kqRWallFunction; - value uniform ( 0 0 0 0 0 0 ); - } - - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/U b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/U similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/U rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/U diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/epsilon b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/epsilon rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/epsilon diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/ABLConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/ABLConditions rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/ABLConditions diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/fixedInlet b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/fixedInlet similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/fixedInlet rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/fixedInlet diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/initialConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/initialConditions similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/initialConditions rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/initialConditions diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/sideAndTopPatches similarity index 93% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/sideAndTopPatches index 96611f16ffa013e5b582c6e9d635b7c9eb4bcd59..bddc17121fea43547b9d76cf7fb907b1392900e0 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches +++ b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/include/sideAndTopPatches @@ -16,4 +16,9 @@ sides type slip; } +"proc.*" +{ + type processor; +} + // ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/k b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/k similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/k rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/k diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/nut b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/nut similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/nut rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/nut diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/0/p b/tutorials/incompressible/simpleFoam/turbineSiting/0.org/p similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/0/p rename to tutorials/incompressible/simpleFoam/turbineSiting/0.org/p diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allclean b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean index 2e2bcf8132e8b630bfdbea55b37364d3e79c9f91..dad1f81a5fed5ad16ec3452cfeb163a9bd298955 100755 --- a/tutorials/incompressible/simpleFoam/turbineSiting/Allclean +++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean @@ -4,22 +4,11 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions +rm -rf 0 > /dev/null 2>&1 + cleanCase -rm -rf VTK -#rm -rf constant/cellToRegion constant/polyMesh/sets -rm -rf constant/polyMesh/sets -#rm -rf constant/cellLevel -#rm -rf constant/cellZones -#rm -rf constant/faceZones -#rm -rf constant/faces -#rm -rf constant/neighbour -#rm -rf constant/owner -#rm -rf constant/pointZones -#rm -rf constant/points -#rm -rf constant/refinementHistory -#rm -rf constant/surfaceIndex -# Reset decomposeParDict -cp system/decomposeParDict-nonPar system/decomposeParDict +# Remove decomposeParDict +rm -f system/decomposeParDict # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun index 81d296213c4166088eeb71fe1cca4269ff463203..9852cc1cf9c92226f0a21da02b984abd269e03c9 100755 --- a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun +++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun @@ -4,36 +4,19 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions +# Make dummy 0 directory +mkdir 0 + runApplication blockMesh -cp system/decomposeParDict-nonPar system/decomposeParDict +cp system/decomposeParDict.hierarchical system/decomposeParDict runApplication decomposePar -#runApplication snappyHexMesh -overwrite -#runApplication setSet -batch makeZones -#runApplication setsToZones -noFlipMap -#runApplication `getApplication` - -cp system/decomposeParDict-par system/decomposeParDict -runParallel snappyHexMesh 2 -overwrite -# *ProcAddressing files written by decomposePar no longer valid -rm -f processor*/constant/polyMesh/*ProcAddressing - -# Add wildcard entries for meshed patches since not preserved -# by decomposePar. Notice -literalRE option to add wildcard itself -# without evaluation. -runParallel changeDictionary 2 -literalRE -enableFunctionEntries - -cp system/decomposeParDict-4proc system/decomposeParDict -# Unset floating point trapping since creating processor directories -unset FOAM_SIGFPE -unset FOAM_SETNAN -runParallel redistributePar 4 -overwrite -runParallel renumberMesh 4 -overwrite - -# Add wildcard entries for meshes patches since not preserved -# by decomposePar. Notice -literalRE option to add wildcard itself -# without evaluation. -#runParallel changeDictionary 4 -literalRE +cp system/decomposeParDict.ptscotch system/decomposeParDict +runParallel snappyHexMesh 4 -overwrite + +find . -type f -iname "*level*" -exec rm {} \; + +ls -d processor* | xargs -i cp -r 0.org/* ./{}/0/ $1 runParallel topoSet 4 runParallel `getApplication` 4 diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary index 7b72e85f595d014f15070eef4db4e25d5088980a..c3da61bd8ccedea26df22b891bcf5d95f322dd66 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary +++ b/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary @@ -8,44 +8,50 @@ FoamFile { version 2.0; - format ascii; + format binary; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -5 +6 ( outlet { type patch; - nFaces 600; - startFace 51900; + nFaces 922; + startFace 364825; } sides { type patch; - nFaces 1200; - startFace 52500; + nFaces 1834; + startFace 365747; } inlet { type patch; - nFaces 600; - startFace 53700; + nFaces 923; + startFace 367581; } ground { type wall; - nFaces 900; - startFace 54300; + nFaces 0; + startFace 368504; } top { type patch; nFaces 900; - startFace 55200; + startFace 368504; + } + terrain_patch0 + { + type wall; + nFaces 14400; + startFace 369404; } ) diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict deleted file mode 100644 index f0dc0c34f6c71c23c8ffe3218b32906333da89f3..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict +++ /dev/null @@ -1,200 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object changeDictionaryDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "$FOAM_CASE/0/include/initialConditions" -#include "$FOAM_CASE/0/include/ABLConditions" - -dictionaryReplacement -{ - - // Specify - // - all fvPatchFields with potential non-uniform values - // - all fvPatchFields originating from meshing - // - all fvPatchFields originating from mesh-redistribution - - p - { - boundaryField - { - outlet - { - type uniformFixedValue; - uniformValue constant $pressure; - } - inlet - { - type zeroGradient; - } - "terrain_.*" - { - type zeroGradient; - } - ground - { - type zeroGradient; - } - #include "$FOAM_CASE/0/include/sideAndTopPatches" - "procBoundary.*" - { - type processor; - } - } - } - - k - { - boundaryField - { - outlet - { - type inletOutlet; - inletValue uniform 0.0; - value uniform $turbulentKE; - } - inlet - { - type uniformFixedValue; - uniformValue constant $turbulentKE; - } - "terrain_.*" - { - type kqRWallFunction; - value uniform 0.0; - } - ground - { - type zeroGradient; - } - #include "$FOAM_CASE/0/include/sideAndTopPatches" - "procBoundary.*" - { - type processor; - } - } - } - - U - { - boundaryField - { - outlet - { - type inletOutlet; - inletValue uniform (0 0 0); - value uniform $flowVelocity; - } - inlet - { - type atmBoundaryLayerInletVelocity; - Uref $Uref; - Href $Href; - n $windDirection; - z $zDirection; - z0 $z0; - zGround $zGround; - value uniform $flowVelocity; - } - "terrain_.*" - { - type uniformFixedValue; - uniformValue constant $flowVelocity; - } - ground - { - type uniformFixedValue; - uniformValue constant $flowVelocity; - } - #include "$FOAM_CASE/0/include/sideAndTopPatches" - "procBoundary.*" - { - type processor; - } - } - } - - nut - { - boundaryField - { - outlet - { - type calculated; - value uniform 0; - } - inlet - { - type calculated; - value uniform 0; - } - "terrain_.*" - { - type nutkAtmRoughWallFunction; - z0 $z0; - value uniform 0.0; - } - ground - { - type calculated; - value uniform 0; - } - #include "$FOAM_CASE/0/include/sideAndTopPatches" - "procBoundary.*" - { - type processor; - } - } - } - - epsilon - { - boundaryField - { - outlet - { - type zeroGradient; - } - inlet - { - type atmBoundaryLayerInletEpsilon; - z $zDirection; - z0 $z0; - zGround $zGround; - Uref $Uref; - Href $Href; - value uniform $turbulentEpsilon; - } - "terrain_.*" - { - type epsilonWallFunction; - Cmu 0.09; - kappa 0.4; - E 9.8; - value uniform $turbulentEpsilon; - } - ground - { - type zeroGradient; - } - #include "$FOAM_CASE/0/include/sideAndTopPatches" - "procBoundary.*" - { - type processor; - } - } - } -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar deleted file mode 100644 index 42f1606ec970b9ac6dee51c6748d67a0b1d199a7..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object decomposeParDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 2; - -method hierarchical; - -hierarchicalCoeffs -{ - n (2 1 1); - delta 0.001; - order xyz; -} - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par deleted file mode 100644 index ded6aceec01b81447592b9077166b7264d8c3bac..0000000000000000000000000000000000000000 --- a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object decomposeParDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 2; - -method ptscotch; - -// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.hierarchical similarity index 95% rename from tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.hierarchical index 42f1606ec970b9ac6dee51c6748d67a0b1d199a7..541de112df4d09c17b8e99fb24ba2d14ce2cbec7 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict +++ b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.hierarchical @@ -15,13 +15,13 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 2; +numberOfSubdomains 4; method hierarchical; hierarchicalCoeffs { - n (2 1 1); + n (2 2 1); delta 0.001; order xyz; } diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-4proc b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.ptscotch similarity index 100% rename from tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-4proc rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict.ptscotch diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index d395197f983872d6258afc8e53b2a5d1944b4452..c155594c01f6b4b1225ac58ddbcce13c8138a456 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -36,6 +36,7 @@ solution U semiImplicit 1; Yi semiImplicit 1; h semiImplicit 1; + radiation semiImplicit 1; } } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index 515ff9908a1bd4c51e4a5a96c32267cfd4f68958..8f07ac40e7b6722571372b7d70285bfa576e90c9 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -30,6 +30,7 @@ solution U semiImplicit 1; Yi semiImplicit 1; h semiImplicit 1; + radiation semiImplicit 1; } } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index f82e81837e430787e04d968327999de2762d8103..f1498734277b51a40dfbf539bc7c471abe08019d 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -28,6 +28,7 @@ solution { U explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties index fe1b09453b1f6f4f78bc419bf29843de4b80fae5..36af7910eb260ae8e0156ce243c106dd31603293 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties index 2545b74976fe9cd431aa8d7c21c12673269869c0..c2fb9a550b515bc0ec3ebe62c41f54519146ff97 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index 9b5ca04fcb053f3ddfdaeea019d271400748a948..c05dc6a728781b466eabab72c40e72f3606a4ec4 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution index 8e76e79670320136c8ff03f028293c8737ef79d0..cd9ebab8b25a478e24f0c40fbcb6e55fff1b3b41 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties index 848a471ba961ed525730210f3e26a214db8b1920..4b520415a0a0e8873ca4bd5fcc392d042ae263d8 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties index 412945dbcdffbac0489cba793bb3d917f9855a44..adef8f34d4d516b5b0d2016720711b9105978756 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles index 9a580d2a667cea5a5ef84fa54abfeb04b9a90a7a..bc9fe0a8a3f54d8725ca72fcab2b0d85938b942c 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles @@ -1,11 +1,11 @@ #!/bin/bash -#--------------------------------*- C++ -*----------------------------------# -# ========= | # -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # -# \\ / O peration | Version: dev # -# \\ / A nd | Web: www.OpenFOAM.org # -# \\/ M anipulation | # -#---------------------------------------------------------------------------# +#--------------------------------*- C++ -*------------------------------------# +# ========= | # +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # +# \\ / O peration | Version: dev # +# \\ / A nd | Web: www.OpenFOAM.org # +# \\/ M anipulation | # +#-----------------------------------------------------------------------------# cd ${0%/*} || exit 1 # run from this directory x0=0.4 diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties index b763043e31b88ffe7867bd0da502dcda91709e0f..6c2f59c4b4a32255f32830722e7c8897fcfb86db 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties index 4cae4e5161424517a149f57edc915d0a3b2df460..778983882a6e9a8a8b3daa7496c2c26959d18acd 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties index 8c2494e676f4531544949d06be65ec47670e0eab..987dd33eaa0cc4e67ea13feeeaf7c38cc8d4a06a 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties @@ -30,6 +30,7 @@ solution U explicit 1; Yi explicit 1; h explicit 1; + radiation explicit 1; } } diff --git a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes index 22366f437b7bcaa5224b1effab5efdaeb66d0ba5..7018c5eaa736966eedef0d3358cf514187949c90 100644 --- a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes +++ b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes @@ -32,6 +32,7 @@ divSchemes div(phirb,alpha) Gauss interfaceCompression; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes index 41159c5be641e0b096ffce563f9b4a105ed2a7a7..3827ac6548c856001186bea04d81494e454c8392 100644 --- a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss linear; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes index b4ad45237d10b2f82fe10d6a8e7f4eadd2356b5d..d1ed26cae3bca94b43c279390ae992152d8c1682 100644 --- a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss limitedLinearV 1; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes index 0c8bf54bb5147c6e3efe5a0212ddbf9d31f23449..3d506aa1d7f2e631efb8635916edcd7f8dcc0ab1 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/les/throttle/system/fvSchemes @@ -31,6 +31,7 @@ divSchemes div(phiv,rho) Gauss limitedLinear 0.2; div(phi,U) Gauss filteredLinear2V 0.2 0; div(phiv,k) Gauss filteredLinear2 0.2 0; + div((muEff*dev(T(grad(U))))) Gauss linear; } gradSchemes diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes index 0c8bf54bb5147c6e3efe5a0212ddbf9d31f23449..3d506aa1d7f2e631efb8635916edcd7f8dcc0ab1 100644 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/system/fvSchemes @@ -31,6 +31,7 @@ divSchemes div(phiv,rho) Gauss limitedLinear 0.2; div(phi,U) Gauss filteredLinear2V 0.2 0; div(phiv,k) Gauss filteredLinear2 0.2 0; + div((muEff*dev(T(grad(U))))) Gauss linear; } gradSchemes diff --git a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes index 633e4a749e31ff2499e39cf4bc8b0ef6b26c2dae..32379fb2c2bd82a8a82c7ce40705b1c31dba608f 100644 --- a/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes +++ b/tutorials/multiphase/cavitatingFoam/ras/throttle/system/fvSchemes @@ -32,6 +32,7 @@ divSchemes div(phi,U) Gauss limitedLinearV 1; div(phiv,omega) Gauss limitedLinear 1; div(phiv,k) Gauss limitedLinear 1; + div((muEff*dev(T(grad(U))))) Gauss linear; } gradSchemes diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes index c35af6cc4f1f5d6fee1dbd9232c03ad306fbbec1..903d94d30c6e6ac6ecc85e0d048a668f7d3cb220 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge2D/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phid2,p_rgh) Gauss upwind; div(rho*phi,T) Gauss upwind; div(phi,k) Gauss vanLeer; - div((nuEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes index c35af6cc4f1f5d6fee1dbd9232c03ad306fbbec1..903d94d30c6e6ac6ecc85e0d048a668f7d3cb220 100644 --- a/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/les/depthCharge3D/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phid2,p_rgh) Gauss upwind; div(rho*phi,T) Gauss upwind; div(phi,k) Gauss vanLeer; - div((nuEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh index 5c911a0345a594e93bda4ea5a00079c63723c8dc..e4a0e7e87a21dc10c5778e836ed335fdc0d43a2d 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/0.org/p_rgh @@ -23,12 +23,14 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } obstacle { type fixedFluxPressure; + phi phiAbs; value uniform 0; } diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes index fa6ef27c434ef90089fa8009d6f23362c604aaf9..ba444728e19c244ad788ce3878e4c65a2609b292 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh index 825a15d6dc99da40eadda49f7cb085281d7a3ec4..dc6376bc69e9b8d50d7cba62460bb8d75af7acd7 100644 --- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p_rgh @@ -23,6 +23,7 @@ boundaryField stationaryWalls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } atmosphere @@ -39,6 +40,7 @@ boundaryField floatingObject { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes index 5ce6b8ee1718544482f1496e5c24cc8275cb6e34..852f5e0c74425f84b7f2d62fe4dda0a2ab1fec4a 100644 --- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes @@ -32,6 +32,7 @@ divSchemes div(phirb,alpha) Gauss interfaceCompression; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh index 5c0b4be6fd997364797adbf679d53bfbabe379d7..dafcfc526a1009b4eb35db6050301abce604f11a 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/0/p_rgh @@ -31,6 +31,7 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes index a0a60315bd4849d92792125419fdb9570653849d..b2c0af769de60be4fa5704d4973f1d0e6ae62d45 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss vanLeer; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh index 5c0b4be6fd997364797adbf679d53bfbabe379d7..dafcfc526a1009b4eb35db6050301abce604f11a 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/0/p_rgh @@ -31,6 +31,7 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes index a0a60315bd4849d92792125419fdb9570653849d..b2c0af769de60be4fa5704d4973f1d0e6ae62d45 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss vanLeer; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh index 29202adadbe7d1acbcceb457c21c5d120c7dfe7f..5e7bcfb8bc744ff80bc6d7375b4a285709ea5657 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/0/p_rgh @@ -23,6 +23,7 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes index a0a60315bd4849d92792125419fdb9570653849d..b2c0af769de60be4fa5704d4973f1d0e6ae62d45 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss vanLeer; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh index 29202adadbe7d1acbcceb457c21c5d120c7dfe7f..5e7bcfb8bc744ff80bc6d7375b4a285709ea5657 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/0/p_rgh @@ -23,6 +23,7 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes index a0a60315bd4849d92792125419fdb9570653849d..b2c0af769de60be4fa5704d4973f1d0e6ae62d45 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss vanLeer; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh index 29202adadbe7d1acbcceb457c21c5d120c7dfe7f..5e7bcfb8bc744ff80bc6d7375b4a285709ea5657 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/0/p_rgh @@ -23,6 +23,7 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes index a0a60315bd4849d92792125419fdb9570653849d..b2c0af769de60be4fa5704d4973f1d0e6ae62d45 100644 --- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss vanLeer; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh index 29202adadbe7d1acbcceb457c21c5d120c7dfe7f..5e7bcfb8bc744ff80bc6d7375b4a285709ea5657 100644 --- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p_rgh @@ -23,6 +23,7 @@ boundaryField walls { type fixedFluxPressure; + phi phiAbs; value uniform 0; } } diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes index a0a60315bd4849d92792125419fdb9570653849d..b2c0af769de60be4fa5704d4973f1d0e6ae62d45 100644 --- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss vanLeer; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes index c2c563142ca051a8a9bcb924df1baa06b8264939..2a580ed9eb90ab5088bf09e7caf69fd7ba0ac138 100644 --- a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes +++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes index 7bb78c013cfdfd415ca1868448b5a7739cf2814b..986a20eebeb97fe96e535bdd4b6ba3a632f1a4b3 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss limitedLinearV 1; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/B b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/B deleted file mode 100644 index d84b78205417cdc8e18e75821c9134a492aefe91..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/B +++ /dev/null @@ -1,57 +0,0 @@ -/*--------------------------------*- 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 volTensorField; - object B; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 2 -2 0 0 0 0]; - -internalField uniform (0 0 0 0 0 0 0 0 0); - -boundaryField -{ - axis - { - type empty; - } - - inlet - { - type fixedValue; - value uniform (0 0 0 0 0 0 0 0 0); - } - - wall - { - type zeroGradient; - } - - atmosphere - { - type inletOutlet; - inletValue uniform (0 0 0 0 0 0 0 0 0); - value uniform (0 0 0 0 0 0 0 0 0); - } - - front - { - type wedge; - } - - back - { - type wedge; - } -} - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes index be6806ad7320924d7a785e8e826a48d3f45e549c..26e06a656bd68191f6c494cdb2f9a44f7b785205 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,B) Gauss limitedLinear 1; div(B) Gauss linear; div(phi,nuTilda) Gauss limitedLinear 1; - div((nuEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes index 28b3d7d20aeb00f17348671a1a85ba2700c6f874..8ed8e03cc081883369e850bae8f758e5823c4b5b 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,R) Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) Gauss upwind; - div((nuEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes index 28b3d7d20aeb00f17348671a1a85ba2700c6f874..8ed8e03cc081883369e850bae8f758e5823c4b5b 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,R) Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) Gauss upwind; - div((nuEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes index 22366f437b7bcaa5224b1effab5efdaeb66d0ba5..7018c5eaa736966eedef0d3358cf514187949c90 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes @@ -32,6 +32,7 @@ divSchemes div(phirb,alpha) Gauss interfaceCompression; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes index 43847dd8414adf639354202fa7159ef5620866ee..bb536c017ce4cef960716bc13d34c040d9f6d17a 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes @@ -33,6 +33,7 @@ divSchemes div(phi,k) Gauss upwind; div(phi,omega) $div(phi,k); + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes b/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes index 28b3d7d20aeb00f17348671a1a85ba2700c6f874..8ed8e03cc081883369e850bae8f758e5823c4b5b 100644 --- a/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes @@ -35,7 +35,7 @@ divSchemes div(phi,R) Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) Gauss upwind; - div((nuEff*dev(T(grad(U))))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes index ed937573ff92bb26dc2313204024c0bd69473172..c80ccb314ef4160a628f59e7e4ffc6d97caa3dd8 100644 --- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes div(rho*phi,U) Gauss limitedLinearV 1; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes index c1b7f7120651910e965db385aebc9c9757227b01..44313d502d0f1656f7c94ed9109b2673d16b600c 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes @@ -30,9 +30,9 @@ divSchemes div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,omega) Gauss linearUpwind grad(omega); div(phi,k) Gauss linearUpwind grad(k); - div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } gradSchemes diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes index 6e3d6f1b848066c7a0ccfb94e97c541fcea03398..e1436932da80a557362978007f606cf262f31dd5 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes @@ -32,6 +32,7 @@ divSchemes div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes index 6e3d6f1b848066c7a0ccfb94e97c541fcea03398..e1436932da80a557362978007f606cf262f31dd5 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes @@ -32,6 +32,7 @@ divSchemes div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSchemes b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSchemes index 4bb0230588cf9b264ce877886a7bcec8f595b18e..35930b92037ebce04ce8e97605ce4f145759b445 100644 --- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSchemes +++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSchemes @@ -33,7 +33,7 @@ divSchemes div(rho*phi,U) Gauss linear; div(phi,alpha1) Gauss vanLeer; div(phi,k) Gauss limitedLinear 1; - div(((rho*nuEff)*dev(grad(U).T()))) Gauss linear; + div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes