diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 06997e52ecd2182eaef16e16a89cd63fd01d73a3..0b7ec84dfea4f8a81ea916d2babd8933c06eaa02 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -38,6 +38,7 @@ // calculated from the relaxed pressure U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); U.correctBoundaryConditions(); + fvOptions.correct(U); } } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H index c07a344017abbc772bfb2cd09e5d7cd680ea63c7..53fec2e1b64e9944244e7bbf9d61ee37ca036625 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H @@ -41,6 +41,7 @@ // calculated from the relaxed pressure U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); U.correctBoundaryConditions(); + fvOptions.correct(U); } } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwclean index cc138bc068e6882e24eb995668e00a0fc18d3e58..8af1402435a2178688f40851c00f4059d8fe6ecd 100755 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwclean @@ -2,9 +2,9 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wclean libso phaseModel +wclean libso twoPhaseSystem wclean libso interfacialModels -wclean libso kineticTheoryModels +wclean libso phaseIncompressibleTurbulenceModels wclean # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwmake b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwmake index 29294d166a947be8f5f391168d9e4f67faeb8718..6ba04af78975101142523bd6ce3d4d82229fd1e6 100755 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Allwmake @@ -2,9 +2,10 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso phaseModel +wmakeLnInclude interfacialModels +wmake libso twoPhaseSystem wmake libso interfacialModels -wmake libso kineticTheoryModels +wmake libso phaseIncompressibleTurbulenceModels wmake # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H index 1810bdd4d9f07377f8f7cb42702f3bd4e4a19ef9..3127450f0090dbe406d994f192ceb674be5f5936 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/EEqns.H @@ -1,22 +1,12 @@ { - volScalarField k1 - ( - "k1", - alpha1*(thermo1.alpha()/rho1 + sqr(Ct)*nut2*thermo1.CpByCpv()/Prt) - ); - - volScalarField k2 - ( - "k2", - alpha2*(thermo2.alpha()/rho2 + nut2*thermo2.CpByCpv()/Prt) - ); - volScalarField& he1 = thermo1.he(); volScalarField& he2 = thermo2.he(); volScalarField Cpv1(thermo1.Cpv()); volScalarField Cpv2(thermo2.Cpv()); + volScalarField heatTransferCoeff(fluid.heatTransferCoeff()); + fvScalarMatrix he1Eqn ( fvm::ddt(alpha1, he1) + fvm::div(alphaPhi1, he1) @@ -32,7 +22,8 @@ : -alpha1*dpdt )/rho1 - - fvm::laplacian(k1, he1) + //***HGW- fvm::laplacian(alpha1*turbulence1->alphaEff(), he1) + - fvm::laplacian(alpha1*turbulence1->nuEff(), he1) == heatTransferCoeff*(thermo2.T() - thermo1.T())/rho1 + heatTransferCoeff*he1/Cpv1/rho1 @@ -54,7 +45,8 @@ : -alpha2*dpdt )/rho2 - - fvm::laplacian(k2, he2) + //***HGW- fvm::laplacian(alpha2*turbulence2->alphaEff(), he2) + - fvm::laplacian(alpha2*turbulence2->nuEff(), he2) == heatTransferCoeff*(thermo1.T() - thermo2.T())/rho2 + heatTransferCoeff*he2/Cpv2/rho2 diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options index d90ba7bbbdf308e0b43489c0e0efd851b5367e28..ac52ae02aebc843117cfdf2b6aebf22514d7ae73 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options @@ -2,18 +2,22 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -IturbulenceModel \ - -IkineticTheoryModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ + -IphaseIncompressibleTurbulenceModels/lnInclude \ -IinterfacialModels/lnInclude \ - -IphaseModel/lnInclude \ + -ItwoPhaseSystem/lnInclude \ -Iaveraging EXE_LIBS = \ -lfluidThermophysicalModels \ -lspecie \ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ + -lphaseIncompressibleTurbulenceModels \ -lincompressibleTransportModels \ - -lcompressiblePhaseModel \ + -lcompressibleTwoPhaseSystem \ -lcompressibleEulerianInterfacialModels \ - -lcompressibleKineticTheoryModel \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H index ae22926c4e79f29ebf2ebdaccca548933218a9d1..dea48be335460a4e698b13fa867467eedb0af76c 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H @@ -5,31 +5,12 @@ mrfZones.correctBoundaryVelocity(U); fvVectorMatrix U1Eqn(U1, U1.dimensions()*dimVol/dimTime); fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); -{ - { - volTensorField gradU1T(fvc::grad(U1)().T()); - - if (kineticTheory.on()) - { - kineticTheory.solve(gradU1T); - nuEff1 = kineticTheory.mu1()/rho1; - } - else // If not using kinetic theory is using Ct model - { - nuEff1 = sqr(Ct)*nut2 + thermo1.mu()/rho1; - } - - volTensorField Rc1 - ( - "Rc", - (((2.0/3.0)*I)*nuEff1)*tr(gradU1T) - nuEff1*gradU1T - ); +volScalarField dragCoeff(fluid.dragCoeff()); - if (kineticTheory.on()) - { - Rc1 -= ((kineticTheory.lambda()/rho1)*tr(gradU1T))*tensor(I); - } +{ + volVectorField liftForce(fluid.liftForce(U)); + { U1Eqn = ( fvm::ddt(alpha1, U1) @@ -38,31 +19,23 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); // Compressibity correction - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1) - + Cvm*rho2*alpha1*alpha2/rho1* + + fluid.Cvm()*rho2*alpha1*alpha2/rho1* ( fvm::ddt(U1) + fvm::div(phi1, U1) - fvm::Sp(fvc::div(phi1), U1) ) - - fvm::laplacian(alpha1*nuEff1, U1) - + fvc::div(alpha1*Rc1) + + turbulence1->divDevReff(U1) == - fvm::Sp(dragCoeff/rho1, U1) - - alpha1*alpha2/rho1*(liftForce - Cvm*rho2*DDtU2) + - alpha1*alpha2/rho1*(liftForce - fluid.Cvm()*rho2*DDtU2) ); - mrfZones.addCoriolis(alpha1*(1 + Cvm*rho2*alpha2/rho1), U1Eqn); + mrfZones.addCoriolis(alpha1*(1 + fluid.Cvm()*rho2*alpha2/rho1), U1Eqn); U1Eqn.relax(); } { - volTensorField gradU2T(fvc::grad(U2)().T()); - volTensorField Rc2 - ( - "Rc", - (((2.0/3.0)*I)*nuEff2)*tr(gradU2T) - nuEff2*gradU2T - ); - U2Eqn = ( fvm::ddt(alpha2, U2) @@ -71,20 +44,18 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); // Compressibity correction - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2) - + Cvm*rho2*alpha1*alpha2/rho2* + + fluid.Cvm()*rho2*alpha1*alpha2/rho2* ( fvm::ddt(U2) + fvm::div(phi2, U2) - fvm::Sp(fvc::div(phi2), U2) ) - - - fvm::laplacian(alpha2*nuEff2, U2) - + fvc::div(alpha2*Rc2) + + turbulence2->divDevReff(U2) == - fvm::Sp(dragCoeff/rho2, U2) - + alpha1*alpha2/rho2*(liftForce + Cvm*rho2*DDtU1) + + alpha1*alpha2/rho2*(liftForce + fluid.Cvm()*rho2*DDtU1) ); - mrfZones.addCoriolis(alpha2*(1 + Cvm*rho2*alpha1/rho2), U2Eqn); + mrfZones.addCoriolis(alpha2*(1 + fluid.Cvm()*rho2*alpha1/rho2), U2Eqn); U2Eqn.relax(); } } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H index 601ff0e919a5b3537f01799ae3a425ede07dae43..2bd8277caabe0140e953b2df7222cbd30df32d7e 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/alphaEqn.H @@ -1,6 +1,3 @@ -surfaceScalarField alphaPhi1("alphaPhi" + phase1Name, phi1); -surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); - { word alphaScheme("div(phi," + alpha1.name() + ')'); word alpharScheme("div(phir," + alpha1.name() + ')'); @@ -8,12 +5,23 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); surfaceScalarField phic("phic", phi); surfaceScalarField phir("phir", phi1 - phi2); - if (g0.value() > 0.0) + surfaceScalarField alpha1f(fvc::interpolate(max(alpha1, 0.0))); + + tmp<surfaceScalarField> pPrimeByA; + + if (implicitPhasePressure) { - surfaceScalarField alpha1f(fvc::interpolate(alpha1)); - surfaceScalarField phipp(ppMagf*fvc::snGrad(alpha1)*mesh.magSf()); - phir += phipp; - phic += alpha1f*phipp; + pPrimeByA = + fvc::interpolate((1.0/rho1)*rAU1*turbulence1().pPrime()) + + fvc::interpolate((1.0/rho2)*rAU2*turbulence2().pPrime()); + + surfaceScalarField phiP + ( + pPrimeByA()*fvc::snGrad(alpha1, "bounded")*mesh.magSf() + ); + + phic += alpha1f*phiP; + phir += phiP; } for (int acorr=0; acorr<nAlphaCorr; acorr++) @@ -92,7 +100,7 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); alphaPhic1, Sp, Su, - (g0.value() > 0 ? alphaMax : 1), + 1, 0 ); @@ -104,61 +112,19 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); { alphaPhi1 = alphaPhic1; } - - /* - // Legacy semi-implicit and potentially unbounded form - fvScalarMatrix alpha1Eqn - ( - fvm::ddt(alpha1) - + fvm::div(phic, alpha1, alphaScheme) - + fvm::div - ( - -fvc::flux(-phir, alpha2, alpharScheme), - alpha1, - alpharScheme - ) - == - fvm::Sp(Sp, alpha1) + Su - ); - - alpha1Eqn.relax(); - alpha1Eqn.solve(); - - if (nAlphaSubCycles > 1) - { - alphaPhi1 += (runTime.deltaT()/totalDeltaT)*alpha1Eqn.flux(); - } - else - { - alphaPhi1 = alpha1Eqn.flux(); - } - */ } - if (g0.value() > 0.0) + if (implicitPhasePressure) { - surfaceScalarField alpha1f(fvc::interpolate(alpha1)); - - ppMagf = - fvc::interpolate((1.0/rho1)*rAU1) - *g0*min(exp(preAlphaExp*(alpha1f - alphaMax)), expMax); - fvScalarMatrix alpha1Eqn ( fvm::ddt(alpha1) - fvc::ddt(alpha1) - - fvm::laplacian - ( - alpha1f*ppMagf, - alpha1, - "laplacian(alpha1PpMag,alpha1)" - ) + - fvm::laplacian(alpha1f*pPrimeByA, alpha1, "bounded") ); alpha1Eqn.relax(); alpha1Eqn.solve(); - #include "packingLimiter.H" - alphaPhi1 += alpha1Eqn.flux(); } @@ -173,4 +139,4 @@ surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2); } } -rho = alpha1*rho1 + alpha2*rho2; +rho = fluid.rho(); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C index 50266a195e0277bdee6148d35ae14e43fbadbcb0..22018f9d8caf0f0fb85396a8cdb2406b3c6eb429 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C @@ -34,21 +34,11 @@ Description #include "MULES.H" #include "subCycle.H" #include "rhoThermo.H" -#include "nearWallDist.H" -#include "wallFvPatch.H" -#include "fixedValueFvsPatchFields.H" -#include "Switch.H" - -#include "IFstream.H" -#include "OFstream.H" - -#include "phaseModel.H" +#include "twoPhaseSystem.H" #include "dragModel.H" #include "heatTransferModel.H" -#include "kineticTheoryModel.H" - +#include "PhaseIncompressibleTurbulenceModel.H" #include "pimpleControl.H" - #include "IOMRFZoneList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,7 +52,6 @@ int main(int argc, char *argv[]) #include "readGravitationalAcceleration.H" #include "createFields.H" #include "createMRFZones.H" - #include "readPPProperties.H" #include "initContinuityErrs.H" #include "readTimeControls.H" #include "CourantNos.H" @@ -87,8 +76,6 @@ int main(int argc, char *argv[]) while (pimple.loop()) { #include "alphaEqn.H" - #include "kEpsilon.H" - #include "interfacialCoeffs.H" #include "EEqns.H" #include "UEqns.H" @@ -99,6 +86,12 @@ int main(int argc, char *argv[]) } #include "DDtU.H" + + if (pimple.turbCorr()) + { + turbulence1->correct(); + turbulence2->correct(); + } } #include "write.H" diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H index 5b030b95ea64522589ec0583b07e58b51f61d73f..f279445cf639bc7992037f31a6f4b92ed487c714 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createFields.H @@ -1,64 +1,38 @@ - Info<< "Reading transportProperties\n" << endl; + Info<< "Creating twoPhaseSystem\n" << endl; - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); + twoPhaseSystem fluid(mesh); - word phase1Name - ( - transportProperties.found("phases") - ? wordList(transportProperties.lookup("phases"))[0] - : "1" - ); + phaseModel& phase1 = fluid.phase1(); + phaseModel& phase2 = fluid.phase2(); - word phase2Name - ( - transportProperties.found("phases") - ? wordList(transportProperties.lookup("phases"))[1] - : "2" - ); + volScalarField& alpha1 = phase1; + volScalarField& alpha2 = phase2; - autoPtr<phaseModel> phase1 = phaseModel::New + volVectorField& U1 = phase1.U(); + surfaceScalarField& phi1 = phase1.phi(); + surfaceScalarField alphaPhi1 ( - mesh, - transportProperties, - phase1Name + IOobject::groupName("alphaPhi", phase1.name()), + fvc::interpolate(alpha1)*phi1 ); - autoPtr<phaseModel> phase2 = phaseModel::New + volVectorField& U2 = phase2.U(); + surfaceScalarField& phi2 = phase2.phi(); + surfaceScalarField alphaPhi2 ( - mesh, - transportProperties, - phase2Name + IOobject::groupName("alphaPhi", phase2.name()), + fvc::interpolate(alpha2)*phi2 ); - volScalarField& alpha1 = phase1(); - volScalarField& alpha2 = phase2(); - alpha2 = scalar(1) - alpha1; - - volVectorField& U1 = phase1->U(); - surfaceScalarField& phi1 = phase1->phi(); - - volVectorField& U2 = phase2->U(); - surfaceScalarField& phi2 = phase2->phi(); - dimensionedScalar pMin ( "pMin", dimPressure, - transportProperties.lookup("pMin") + fluid.lookup("pMin") ); - rhoThermo& thermo1 = phase1->thermo(); - rhoThermo& thermo2 = phase2->thermo(); + rhoThermo& thermo1 = phase1.thermo(); + rhoThermo& thermo2 = phase2.thermo(); volScalarField& p = thermo1.p(); @@ -78,7 +52,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - alpha1*U1 + alpha2*U2 + fluid.U() ); surfaceScalarField phi @@ -91,7 +65,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - fvc::interpolate(alpha1)*phi1 + fvc::interpolate(alpha2)*phi2 + fluid.phi() ); volScalarField rho @@ -104,7 +78,7 @@ IOobject::NO_READ, IOobject::AUTO_WRITE ), - alpha1*rho1 + alpha2*rho2 + fluid.rho() ); Info<< "Calculating field DDtU1 and DDtU2\n" << endl; @@ -127,119 +101,11 @@ Info<< "Calculating field g.h\n" << endl; volScalarField gh("gh", g & mesh.C()); - dimensionedScalar Cvm - ( - "Cvm", - dimless, - transportProperties.lookup("Cvm") - ); - - dimensionedScalar Cl - ( - "Cl", - dimless, - transportProperties.lookup("Cl") - ); - - dimensionedScalar Ct - ( - "Ct", - dimless, - transportProperties.lookup("Ct") - ); - - #include "createRASTurbulence.H" - - IOdictionary interfacialProperties - ( - IOobject - ( - "interfacialProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - autoPtr<dragModel> drag1 = dragModel::New - ( - interfacialProperties, - alpha1, - phase1, - phase2 - ); - - autoPtr<dragModel> drag2 = dragModel::New - ( - interfacialProperties, - alpha2, - phase2, - phase1 - ); - - autoPtr<heatTransferModel> heatTransfer1 = heatTransferModel::New - ( - interfacialProperties, - alpha1, - phase1, - phase2 - ); - - autoPtr<heatTransferModel> heatTransfer2 = heatTransferModel::New - ( - interfacialProperties, - alpha2, - phase2, - phase1 - ); - - word dispersedPhase(interfacialProperties.lookup("dispersedPhase")); - - if - ( - !( - dispersedPhase == phase1Name - || dispersedPhase == phase2Name - || dispersedPhase == "both" - ) - ) - { - FatalErrorIn(args.executable()) - << "invalid dispersedPhase " << dispersedPhase - << exit(FatalError); - } - - Info << "dispersedPhase is " << dispersedPhase << endl; - - scalar residualPhaseFraction - ( - readScalar - ( - interfacialProperties.lookup("residualPhaseFraction") - ) - ); - - dimensionedScalar residualSlip - ( - "residualSlip", - dimVelocity, - interfacialProperties.lookup("residualSlip") - ); - - kineticTheoryModel kineticTheory - ( - phase1, - U2, - alpha1, - drag1 - ); - volScalarField rAU1 ( IOobject ( - "rAU" + phase1Name, + IOobject::groupName("rAU", phase1.name()), runTime.timeName(), mesh, IOobject::NO_READ, @@ -249,21 +115,20 @@ dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0) ); - surfaceScalarField ppMagf + volScalarField rAU2 ( IOobject ( - "ppMagf", + IOobject::groupName("rAU", phase2.name()), runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, - dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0) + dimensionedScalar("zero", dimensionSet(0, 0, 1, 0, 0), 0.0) ); - label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); @@ -290,5 +155,31 @@ Info<< "Creating field kinetic energy K\n" << endl; - volScalarField K1("K" + phase1Name, 0.5*magSqr(U1)); - volScalarField K2("K" + phase2Name, 0.5*magSqr(U2)); + volScalarField K1(IOobject::groupName("K", phase1.name()), 0.5*magSqr(U1)); + volScalarField K2(IOobject::groupName("K", phase2.name()), 0.5*magSqr(U2)); + + autoPtr<PhaseIncompressibleTurbulenceModel<phaseModel> > + turbulence1 + ( + PhaseIncompressibleTurbulenceModel<phaseModel>::New + ( + alpha1, + U1, + alphaPhi1, + phi1, + phase1 + ) + ); + + autoPtr<PhaseIncompressibleTurbulenceModel<phaseModel> > + turbulence2 + ( + PhaseIncompressibleTurbulenceModel<phaseModel>::New + ( + alpha2, + U2, + alphaPhi2, + phi2, + phase2 + ) + ); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createRASTurbulence.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createRASTurbulence.H deleted file mode 100644 index 0a782ef51edf99f32eaf986325fd926db596e410..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/createRASTurbulence.H +++ /dev/null @@ -1,189 +0,0 @@ - IOdictionary RASProperties - ( - IOobject - ( - "RASProperties", - runTime.constant(), - mesh, - //IOobject::MUST_READ_IF_MODIFIED, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - - Switch turbulence - ( - RASProperties.lookup("turbulence") - ); - - dictionary kEpsilonDict - ( - RASProperties.subDictPtr("kEpsilonCoeffs") - ); - - dimensionedScalar Cmu - ( - dimensionedScalar::lookupOrAddToDict - ( - "Cmu", - kEpsilonDict, - 0.09 - ) - ); - - dimensionedScalar C1 - ( - dimensionedScalar::lookupOrAddToDict - ( - "C1", - kEpsilonDict, - 1.44 - ) - ); - - dimensionedScalar C2 - ( - dimensionedScalar::lookupOrAddToDict - ( - "C2", - kEpsilonDict, - 1.92 - ) - ); - - dimensionedScalar alpha1k - ( - dimensionedScalar::lookupOrAddToDict - ( - "alpha1k", - kEpsilonDict, - 1.0 - ) - ); - - dimensionedScalar alpha1Eps - ( - dimensionedScalar::lookupOrAddToDict - ( - "alpha1Eps", - kEpsilonDict, - 0.76923 - ) - ); - - dimensionedScalar Prt - ( - dimensioned<scalar>::lookupOrAddToDict - ( - "Prt", - kEpsilonDict, - 1.0 - ) - ); - - dictionary wallFunctionDict - ( - RASProperties.subDictPtr("wallFunctionCoeffs") - ); - - dimensionedScalar kappa - ( - dimensionedScalar::lookupOrAddToDict - ( - "kappa", - wallFunctionDict, - 0.41 - ) - ); - - dimensionedScalar E - ( - dimensionedScalar::lookupOrAddToDict - ( - "E", - wallFunctionDict, - 9.8 - ) - ); - - if (RASProperties.lookupOrDefault("printCoeffs", false)) - { - Info<< "kEpsilonCoeffs" << kEpsilonDict << nl - << "wallFunctionCoeffs" << wallFunctionDict << endl; - } - - - nearWallDist y(mesh); - - - Info<< "Reading field k\n" << endl; - volScalarField k - ( - IOobject - ( - "k", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - Info<< "Reading field epsilon\n" << endl; - volScalarField epsilon - ( - IOobject - ( - "epsilon", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - - Info<< "Calculating field nut2\n" << endl; - volScalarField nut2 - ( - IOobject - ( - "nut" + phase2Name, - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - Cmu*sqr(k)/epsilon - ); - - Info<< "Calculating field nuEff1\n" << endl; - volScalarField nuEff1 - ( - IOobject - ( - "nuEff" + phase1Name, - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - sqr(Ct)*nut2 + thermo1.mu()/rho1 - ); - - Info<< "Calculating field nuEff2\n" << endl; - volScalarField nuEff2 - ( - IOobject - ( - "nuEff" + phase2Name, - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - nut2 + thermo2.mu()/rho2 - ); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H deleted file mode 100644 index d53bec5ea4f5ed2dc8393425bb4c4ddfa816c39d..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H +++ /dev/null @@ -1,88 +0,0 @@ -volScalarField dragCoeff -( - IOobject - ( - "dragCoeff", - runTime.timeName(), - mesh - ), - mesh, - dimensionedScalar("dragCoeff", dimensionSet(1, -3, -1, 0, 0), 0) -); - -volVectorField liftForce -( - IOobject - ( - "liftForce", - runTime.timeName(), - mesh - ), - mesh, - dimensionedVector("liftForce", dimensionSet(1, -2, -2, 0, 0), vector::zero) -); - -volScalarField heatTransferCoeff -( - IOobject - ( - "heatTransferCoeff", - runTime.timeName(), - mesh - ), - mesh, - dimensionedScalar("heatTransferCoeff", dimensionSet(1, -1, -3, -1, 0), 0) -); - -{ - volVectorField Ur(U1 - U2); - volScalarField magUr(mag(Ur) + residualSlip); - - if (dispersedPhase == phase1Name) - { - dragCoeff = drag1->K(magUr); - heatTransferCoeff = heatTransfer1->K(magUr); - } - else if (dispersedPhase == phase2Name) - { - dragCoeff = drag2->K(magUr); - heatTransferCoeff = heatTransfer2->K(magUr); - } - else if (dispersedPhase == "both") - { - dragCoeff = - ( - alpha2*drag1->K(magUr) - + alpha1*drag2->K(magUr) - ); - - heatTransferCoeff = - ( - alpha2*heatTransfer1->K(magUr) - + alpha1*heatTransfer2->K(magUr) - ); - } - else - { - FatalErrorIn(args.executable()) - << "dispersedPhase: " << dispersedPhase << " is incorrect" - << exit(FatalError); - } - - volScalarField alphaCoeff(max(alpha1*alpha2, residualPhaseFraction)); - dragCoeff *= alphaCoeff; - heatTransferCoeff *= alphaCoeff; - - liftForce = Cl*(alpha1*rho1 + alpha2*rho2)*(Ur ^ fvc::curl(U)); - - // Remove lift, drag and phase heat-transfer at fixed-flux boundaries - forAll(phi1.boundaryField(), patchi) - { - if (isA<fixedValueFvsPatchScalarField>(phi1.boundaryField()[patchi])) - { - dragCoeff.boundaryField()[patchi] = 0.0; - heatTransferCoeff.boundaryField()[patchi] = 0.0; - liftForce.boundaryField()[patchi] = vector::zero; - } - } -} diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/options index f031e058986a9c4ac3c37c83fafeaf2f592f28df..e7e60696ec115958097f3014006ebf9c93889980 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/options @@ -1,9 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I../phaseModel/lnInclude + -I../twoPhaseSystem/lnInclude LIB_LIBS = \ - -lcompressiblePhaseModel \ + -lcompressibleTwoPhaseSystem \ -lfluidThermophysicalModels \ -lspecie diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 00be8a338ffa3db3b10a1b2043105ff598e0314f..9159b287849963cdd03963567beccf66753b32a6 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -37,7 +37,7 @@ Foam::autoPtr<Foam::dragModel> Foam::dragModel::New { word dragModelType ( - interfaceDict.lookup("dragModel" + phase1.name()) + interfaceDict.lookup(phase1.name()) ); Info << "Selecting dragModel for phase " diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index aaa972032d071d9ee1945e3bb141cff24cb16c36..cf3ae9741236ef8942a4ecd88eb4fb8539714d17 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -37,7 +37,7 @@ Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New { word heatTransferModelType ( - interfaceDict.lookup("heatTransferModel" + phase1.name()) + interfaceDict.lookup(phase1.name()) ); Info<< "Selecting heatTransferModel for phase " diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files deleted file mode 100644 index 2b36d0bc319b5a3b3541a93c316a671d508a4285..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files +++ /dev/null @@ -1,32 +0,0 @@ -kineticTheoryModel/kineticTheoryModel.C - -viscosityModel/viscosityModel/viscosityModel.C -viscosityModel/viscosityModel/newViscosityModel.C -viscosityModel/Gidaspow/GidaspowViscosity.C -viscosityModel/Syamlal/SyamlalViscosity.C -viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C -viscosityModel/none/noneViscosity.C - -conductivityModel/conductivityModel/conductivityModel.C -conductivityModel/conductivityModel/newConductivityModel.C -conductivityModel/Gidaspow/GidaspowConductivity.C -conductivityModel/Syamlal/SyamlalConductivity.C -conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C - -radialModel/radialModel/radialModel.C -radialModel/radialModel/newRadialModel.C -radialModel/CarnahanStarling/CarnahanStarlingRadial.C -radialModel/LunSavage/LunSavageRadial.C -radialModel/SinclairJackson/SinclairJacksonRadial.C - -granularPressureModel/granularPressureModel/granularPressureModel.C -granularPressureModel/granularPressureModel/newGranularPressureModel.C -granularPressureModel/Lun/LunPressure.C -granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C - -frictionalStressModel/frictionalStressModel/frictionalStressModel.C -frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C -frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C -frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C - -LIB = $(FOAM_LIBBIN)/libcompressibleKineticTheoryModel diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/options deleted file mode 100644 index 7fdabf573092bd4219e75fa41044236e02b7d50e..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/options +++ /dev/null @@ -1,6 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/foam/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I../phaseModel/lnInclude \ - -I../interfacialModels/lnInclude diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C deleted file mode 100644 index 81393568200bd0b7b97cf54e8e0c0bf3a8ae1d7b..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ /dev/null @@ -1,389 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 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 "kineticTheoryModel.H" -#include "surfaceInterpolate.H" -#include "mathematicalConstants.H" -#include "fvCFD.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::kineticTheoryModel::kineticTheoryModel -( - const Foam::phaseModel& phase1, - const Foam::volVectorField& U2, - const Foam::volScalarField& alpha1, - const Foam::dragModel& draga -) -: - phase1_(phase1), - U1_(phase1.U()), - U2_(U2), - alpha1_(alpha1), - phi1_(phase1.phi()), - draga_(draga), - - rho1_(phase1.rho()), - - kineticTheoryProperties_ - ( - IOobject - ( - "kineticTheoryProperties", - U1_.time().constant(), - U1_.mesh(), - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ), - kineticTheory_(kineticTheoryProperties_.lookup("kineticTheory")), - equilibrium_(kineticTheoryProperties_.lookup("equilibrium")), - - viscosityModel_ - ( - kineticTheoryModels::viscosityModel::New - ( - kineticTheoryProperties_ - ) - ), - conductivityModel_ - ( - kineticTheoryModels::conductivityModel::New - ( - kineticTheoryProperties_ - ) - ), - radialModel_ - ( - kineticTheoryModels::radialModel::New - ( - kineticTheoryProperties_ - ) - ), - granularPressureModel_ - ( - kineticTheoryModels::granularPressureModel::New - ( - kineticTheoryProperties_ - ) - ), - frictionalStressModel_ - ( - kineticTheoryModels::frictionalStressModel::New - ( - kineticTheoryProperties_ - ) - ), - e_(kineticTheoryProperties_.lookup("e")), - alphaMax_(kineticTheoryProperties_.lookup("alphaMax")), - alphaMinFriction_(kineticTheoryProperties_.lookup("alphaMinFriction")), - Fr_(kineticTheoryProperties_.lookup("Fr")), - eta_(kineticTheoryProperties_.lookup("eta")), - p_(kineticTheoryProperties_.lookup("p")), - phi_(dimensionedScalar(kineticTheoryProperties_.lookup("phi"))*M_PI/180.0), - Theta_ - ( - IOobject - ( - "Theta", - U1_.time().timeName(), - U1_.mesh(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - U1_.mesh() - ), - mu1_ - ( - IOobject - ( - "mu" + phase1.name(), - U1_.time().timeName(), - U1_.mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - U1_.mesh(), - dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) - ), - lambda_ - ( - IOobject - ( - "lambda", - U1_.time().timeName(), - U1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - U1_.mesh(), - dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) - ), - pa_ - ( - IOobject - ( - "pa", - U1_.time().timeName(), - U1_.mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - U1_.mesh(), - dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0) - ), - kappa_ - ( - IOobject - ( - "kappa", - U1_.time().timeName(), - U1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - U1_.mesh(), - dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) - ), - gs0_ - ( - IOobject - ( - "gs0", - U1_.time().timeName(), - U1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - U1_.mesh(), - dimensionedScalar("zero", dimensionSet(0, 0, 0, 0, 0), 1.0) - ) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::kineticTheoryModel::~kineticTheoryModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::kineticTheoryModel::solve(const volTensorField& gradU1t) -{ - if (!kineticTheory_) - { - return; - } - - const scalar sqrtPi = sqrt(constant::mathematical::pi); - - volScalarField da_(phase1_.d()); - - surfaceScalarField phi(1.5*phi1_*fvc::interpolate(rho1_*alpha1_)); - - volTensorField dU(gradU1t.T()); - volSymmTensorField D(symm(dU)); - - // NB, drag = K*alpha1*alpha2, - // (the alpha1 and alpha2 has been extracted from the drag function for - // numerical reasons) - volScalarField Ur(mag(U1_ - U2_)); - volScalarField alpha2Prim(alpha1_*(1.0 - alpha1_)*draga_.K(Ur)); - - // Calculating the radial distribution function (solid volume fraction is - // limited close to the packing limit, but this needs improvements) - // The solution is higly unstable close to the packing limit. - gs0_ = radialModel_->g0 - ( - min(max(alpha1_, scalar(1e-6)), alphaMax_ - 0.01), - alphaMax_ - ); - - // particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45) - volScalarField PsCoeff - ( - granularPressureModel_->granularPressureCoeff - ( - alpha1_, - gs0_, - rho1_, - e_ - ) - ); - - // 'thermal' conductivity (Table 3.3, p. 49) - kappa_ = conductivityModel_->kappa(alpha1_, Theta_, gs0_, rho1_, da_, e_); - - // particle viscosity (Table 3.2, p.47) - mu1_ = viscosityModel_->mu1(alpha1_, Theta_, gs0_, rho1_, da_, e_); - - dimensionedScalar Tsmall - ( - "small", - dimensionSet(0 , 2 ,-2 ,0 , 0, 0, 0), - 1.0e-6 - ); - - dimensionedScalar TsmallSqrt = sqrt(Tsmall); - volScalarField ThetaSqrt(sqrt(Theta_)); - - // dissipation (Eq. 3.24, p.50) - volScalarField gammaCoeff - ( - 12.0*(1.0 - sqr(e_))*sqr(alpha1_)*rho1_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi - ); - - // Eq. 3.25, p. 50 Js = J1 - J2 - volScalarField J1(3.0*alpha2Prim); - volScalarField J2 - ( - 0.25*sqr(alpha2Prim)*da_*sqr(Ur) - /(max(alpha1_, scalar(1e-6))*rho1_*sqrtPi*(ThetaSqrt + TsmallSqrt)) - ); - - // bulk viscosity p. 45 (Lun et al. 1984). - lambda_ = (4.0/3.0)*sqr(alpha1_)*rho1_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi; - - // stress tensor, Definitions, Table 3.1, p. 43 - volSymmTensorField tau(2.0*mu1_*D + (lambda_ - (2.0/3.0)*mu1_)*tr(D)*I); - - if (!equilibrium_) - { - // construct the granular temperature equation (Eq. 3.20, p. 44) - // NB. note that there are two typos in Eq. 3.20 - // no grad infront of Ps - // wrong sign infront of laplacian - fvScalarMatrix ThetaEqn - ( - fvm::ddt(1.5*alpha1_*rho1_, Theta_) - + fvm::div(phi, Theta_, "div(phi,Theta)") - == - fvm::SuSp(-((PsCoeff*I) && dU), Theta_) - + (tau && dU) - + fvm::laplacian(kappa_, Theta_, "laplacian(kappa,Theta)") - + fvm::Sp(-gammaCoeff, Theta_) - + fvm::Sp(-J1, Theta_) - + fvm::Sp(J2/(Theta_ + Tsmall), Theta_) - ); - - ThetaEqn.relax(); - ThetaEqn.solve(); - } - else - { - // equilibrium => dissipation == production - // Eq. 4.14, p.82 - volScalarField K1(2.0*(1.0 + e_)*rho1_*gs0_); - volScalarField K3 - ( - 0.5*da_*rho1_* - ( - (sqrtPi/(3.0*(3.0-e_))) - *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha1_*gs0_) - +1.6*alpha1_*gs0_*(1.0 + e_)/sqrtPi - ) - ); - - volScalarField K2 - ( - 4.0*da_*rho1_*(1.0 + e_)*alpha1_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0 - ); - - volScalarField K4(12.0*(1.0 - sqr(e_))*rho1_*gs0_/(da_*sqrtPi)); - - volScalarField trD(tr(D)); - volScalarField tr2D(sqr(trD)); - volScalarField trD2(tr(D & D)); - - volScalarField t1(K1*alpha1_ + rho1_); - volScalarField l1(-t1*trD); - volScalarField l2(sqr(t1)*tr2D); - volScalarField l3 - ( - 4.0 - *K4 - *max(alpha1_, scalar(1e-6)) - *(2.0*K3*trD2 + K2*tr2D) - ); - - Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha1_ + 1.0e-4)*K4)); - } - - Theta_.max(1.0e-15); - Theta_.min(1.0e+3); - - volScalarField pf - ( - frictionalStressModel_->frictionalPressure - ( - alpha1_, - alphaMinFriction_, - alphaMax_, - Fr_, - eta_, - p_ - ) - ); - - PsCoeff += pf/(Theta_+Tsmall); - - PsCoeff.min(1.0e+10); - PsCoeff.max(-1.0e+10); - - // update particle pressure - pa_ = PsCoeff*Theta_; - - // frictional shear stress, Eq. 3.30, p. 52 - volScalarField muf - ( - frictionalStressModel_->muf - ( - alpha1_, - alphaMax_, - pf, - D, - phi_ - ) - ); - - // add frictional stress - mu1_ += muf; - mu1_.min(1.0e+2); - mu1_.max(0.0); - - Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl; - - volScalarField ktn(mu1_/rho1_); - - Info<< "kinTheory: min(nu1) = " << min(ktn).value() - << ", max(nu1) = " << max(ktn).value() << endl; - - Info<< "kinTheory: min(pa) = " << min(pa_).value() - << ", max(pa) = " << max(pa_).value() << endl; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H deleted file mode 100644 index a5861ae12967f45a048475b792b7e9dd5a8fcdfb..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ /dev/null @@ -1,196 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 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::kineticTheoryModel - -Description - -SourceFiles - kineticTheoryModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef kineticTheoryModel_H -#define kineticTheoryModel_H - -#include "dragModel.H" -#include "phaseModel.H" -#include "autoPtr.H" -#include "viscosityModel.H" -#include "conductivityModel.H" -#include "radialModel.H" -#include "granularPressureModel.H" -#include "frictionalStressModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class kineticTheoryModel Declaration -\*---------------------------------------------------------------------------*/ - -class kineticTheoryModel -{ - // Private data - - const phaseModel& phase1_; - const volVectorField& U1_; - const volVectorField& U2_; - const volScalarField& alpha1_; - const surfaceScalarField& phi1_; - - const dragModel& draga_; - - const volScalarField& rho1_; - - //- dictionary holding the modeling info - IOdictionary kineticTheoryProperties_; - - //- use kinetic theory or not. - Switch kineticTheory_; - - //- use generation == dissipation - Switch equilibrium_; - - autoPtr<kineticTheoryModels::viscosityModel> viscosityModel_; - - autoPtr<kineticTheoryModels::conductivityModel> conductivityModel_; - - autoPtr<kineticTheoryModels::radialModel> radialModel_; - - autoPtr<kineticTheoryModels::granularPressureModel> - granularPressureModel_; - - autoPtr<kineticTheoryModels::frictionalStressModel> - frictionalStressModel_; - - //- coefficient of restitution - const dimensionedScalar e_; - - //- maximum packing - const dimensionedScalar alphaMax_; - - //- min value for which the frictional stresses are zero - const dimensionedScalar alphaMinFriction_; - - //- material constant for frictional normal stress - const dimensionedScalar Fr_; - - //- material constant for frictional normal stress - const dimensionedScalar eta_; - - //- material constant for frictional normal stress - const dimensionedScalar p_; - - //- angle of internal friction - const dimensionedScalar phi_; - - //- The granular energy/temperature - volScalarField Theta_; - - //- The granular viscosity - volScalarField mu1_; - - //- The granular bulk viscosity - volScalarField lambda_; - - //- The granular pressure - volScalarField pa_; - - //- The granular temperature conductivity - volScalarField kappa_; - - //- The radial distribution function - volScalarField gs0_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - kineticTheoryModel(const kineticTheoryModel&); - - //- Disallow default bitwise assignment - void operator=(const kineticTheoryModel&); - - -public: - - // Constructors - - //- Construct from components - kineticTheoryModel - ( - const phaseModel& phase1, - const volVectorField& U2, - const volScalarField& alpha1, - const dragModel& draga - ); - - - //- Destructor - virtual ~kineticTheoryModel(); - - - // Member Functions - - void solve(const volTensorField& gradU1t); - - bool on() const - { - return kineticTheory_; - } - - const volScalarField& mu1() const - { - return mu1_; - } - - const volScalarField& pa() const - { - return pa_; - } - - const volScalarField& lambda() const - { - return lambda_; - } - - const volScalarField& kappa() const - { - return kappa_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H index 756a231fc2f589ad5bb35bc021d44737260d38b5..e9211def7f4054b279e3cf16f5c4f1bd938f0dc3 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H @@ -3,15 +3,23 @@ surfaceScalarField alpha2f(scalar(1) - alpha1f); rAU1 = 1.0/U1Eqn.A(); - volScalarField rAU2(1.0/U2Eqn.A()); + rAU2 = 1.0/U2Eqn.A(); surfaceScalarField rAlphaAU1f(fvc::interpolate(alpha1*rAU1)); surfaceScalarField rAlphaAU2f(fvc::interpolate(alpha2*rAU2)); - volVectorField HbyA1("HbyA" + phase1Name, U1); + volVectorField HbyA1 + ( + IOobject::groupName("HbyA", phase1.name()), + U1 + ); HbyA1 = rAU1*U1Eqn.H(); - volVectorField HbyA2("HbyA" + phase2Name, U2); + volVectorField HbyA2 + ( + IOobject::groupName("HbyA", phase2.name()), + U2 + ); HbyA2 = rAU2*U2Eqn.H(); mrfZones.absoluteFlux(phi1.oldTime()); @@ -19,30 +27,32 @@ mrfZones.absoluteFlux(phi2.oldTime()); mrfZones.absoluteFlux(phi2); - surfaceScalarField ppDrag("ppDrag", 0.0*phi1); - - if (g0.value() > 0.0) - { - ppDrag -= ppMagf*fvc::snGrad(alpha1)*mesh.magSf(); - } + // Phase-1 pressure flux (e.g. due to particle-particle pressure) + surfaceScalarField phiP1 + ( + "phiP1", + fvc::interpolate((1.0/rho1)*rAU1*turbulence1().pPrime()) + *fvc::snGrad(alpha1)*mesh.magSf() + ); - if (kineticTheory.on()) - { - ppDrag -= - fvc::interpolate(1.0/rho1)*rAlphaAU1f - *fvc::snGrad(kineticTheory.pa())*mesh.magSf(); - } + // Phase-2 pressure flux (e.g. due to particle-particle pressure) + surfaceScalarField phiP2 + ( + "phiP2", + fvc::interpolate((1.0/rho2)*rAU2*turbulence2().pPrime()) + *fvc::snGrad(alpha2)*mesh.magSf() + ); surfaceScalarField phiHbyA1 ( - "phiHbyA" + phase1Name, + IOobject::groupName("phiHbyA", phase1.name()), (fvc::interpolate(HbyA1) & mesh.Sf()) + fvc::ddtPhiCorr(rAU1, alpha1, U1, phi1) ); surfaceScalarField phiHbyA2 ( - "phiHbyA" + phase2Name, + IOobject::groupName("phiHbyA", phase2.name()), (fvc::interpolate(HbyA2) & mesh.Sf()) + fvc::ddtPhiCorr(rAU2, alpha2, U2, phi2) ); @@ -53,7 +63,7 @@ phiHbyA1 += ( fvc::interpolate((1.0/rho1)*rAU1*dragCoeff)*phi2 - + ppDrag + - phiP1 + rAlphaAU1f*(g & mesh.Sf()) ); mrfZones.relativeFlux(phiHbyA1); @@ -61,6 +71,7 @@ phiHbyA2 += ( fvc::interpolate((1.0/rho2)*rAU2*dragCoeff)*phi1 + - phiP2 + rAlphaAU2f*(g & mesh.Sf()) ); mrfZones.relativeFlux(phiHbyA2); @@ -92,12 +103,12 @@ { surfaceScalarField phid1 ( - "phid" + phase1Name, + IOobject::groupName("phid", phase1.name()), fvc::interpolate(psi1)*phi1 ); surfaceScalarField phid2 ( - "phid" + phase2Name, + IOobject::groupName("phid", phase2.name()), fvc::interpolate(psi2)*phi2 ); @@ -173,29 +184,30 @@ mSfGradp = pEqnIncomp.flux()/Dp; U1 = HbyA1 - + fvc::reconstruct - ( - ppDrag - + rAlphaAU1f - *( - (g & mesh.Sf()) - + mSfGradp/fvc::interpolate(rho1) - ) - ); + + fvc::reconstruct + ( + rAlphaAU1f + *( + (g & mesh.Sf()) + + mSfGradp/fvc::interpolate(rho1) + ) + - phiP1 + ); U1.correctBoundaryConditions(); U2 = HbyA2 - + fvc::reconstruct - ( - rAlphaAU2f - *( + + fvc::reconstruct + ( + rAlphaAU2f + *( (g & mesh.Sf()) + mSfGradp/fvc::interpolate(rho2) ) - ); + - phiP2 + ); U2.correctBoundaryConditions(); - U = alpha1*U1 + alpha2*U2; + U = fluid.U(); } } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/packingLimiter.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/packingLimiter.H deleted file mode 100644 index 249f1035a19fffe95efe6b378c96bfb275858a2d..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/packingLimiter.H +++ /dev/null @@ -1,36 +0,0 @@ - if (packingLimiter) - { - // Calculating exceeding volume fractions - volScalarField alpha1Ex(max(alpha1 - alphaMax, scalar(0))); - - // Finding neighbouring cells of the whole domain - labelListList neighbour = mesh.cellCells(); - scalarField cellVolumes(mesh.cellVolumes()); - - forAll (alpha1Ex, celli) - { - // Finding the labels of the neighbouring cells - labelList neighbourCell = neighbour[celli]; - - // Initializing neighbouring cells contribution - scalar neighboursEx = 0.0; - - forAll (neighbourCell, cellj) - { - labelList neighboursNeighbour = neighbour[neighbourCell[cellj]]; - scalar neighboursNeighbourCellVolumes = 0.0; - - forAll (neighboursNeighbour, cellk) - { - neighboursNeighbourCellVolumes += - cellVolumes[neighboursNeighbour[cellk]]; - } - - neighboursEx += - alpha1Ex[neighbourCell[cellj]]*cellVolumes[celli] - /neighboursNeighbourCellVolumes; - } - - alpha1[celli] += neighboursEx - alpha1Ex[celli]; - } - } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/files b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..96f9c63e4a872a15dc04d48ed0c5be265b410888 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/files @@ -0,0 +1,35 @@ +phaseIncompressibleTurbulenceModels.C +phasePressureModel/phasePressureModel.C + +kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C + +kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C +kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C +kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C +kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +kineticTheoryModels/viscosityModel/none/noneViscosity.C + +kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C +kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C +kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C +kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C + +kineticTheoryModels/radialModel/radialModel/radialModel.C +kineticTheoryModels/radialModel/radialModel/newRadialModel.C +kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C +kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C +kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C + +kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C +kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +kineticTheoryModels/granularPressureModel/Lun/LunPressure.C +kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C + +kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C +kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C + +LIB = $(FOAM_LIBBIN)/libphaseIncompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..8608cd8610cde43bf90a3aca9da2068137d553f0 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I$(LIB_SRC)/foam/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ + -I../twoPhaseSystem/lnInclude \ + -I../interfacialModels/lnInclude diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C similarity index 98% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C index ced65bf823635d5c73f36a3ea44dc9ba35ef8cfc..8f9289293eb9aefc4061f56c54f0fdc7c233559f 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C @@ -80,7 +80,7 @@ Foam::kineticTheoryModels::conductivityModels::Gidaspow::kappa { const scalar sqrtPi = sqrt(constant::mathematical::pi); - return rho1*da*sqrt(Theta)* + return da*sqrt(Theta)* ( 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi + (9.0/8.0)*sqrtPi*g0*0.5*(1.0 + e)*sqr(alpha1) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C similarity index 90% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index b103a1afe22a86ad13ce37f9b0dd880d97f0c06c..2d2e1f65512dcce562369d1abffcbe4f3f41a389 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -56,8 +56,8 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair ) : conductivityModel(dict), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - L_(coeffsDict_.lookup("L")) + coeffDict_(dict.subDict(typeName + "Coeffs")), + L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_.lookup("L")) {} @@ -88,7 +88,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa scalar(1) + da/(6.0*sqrt(2.0)*(alpha1 + scalar(1.0e-5)))/L_ ); - return rho1*da*sqrt(Theta)* + return da*sqrt(Theta)* ( 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi + (9.0/8.0)*sqrtPi*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha1) @@ -101,4 +101,14 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa } +bool Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::read() +{ + coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + + L_.readIfPresent(coeffDict_); + + return true; +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H similarity index 97% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H index e2ab8b8cca4a3fc6b417c63cf4f6bfba49a00953..0280a2359655a0d953e5d4d267ef86fb3c7429d3 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H @@ -53,12 +53,12 @@ class HrenyaSinclair : public conductivityModel { - - dictionary coeffsDict_; + dictionary coeffDict_; //- characteristic length of geometry dimensionedScalar L_; + public: //- Runtime type information @@ -86,6 +86,8 @@ public: const volScalarField& da, const dimensionedScalar& e ) const; + + virtual bool read(); }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C similarity index 98% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C index a50c6ceec4107c8e8ba735d6833ffbefeeabef24..d7dac43706749b971d5d9ef25a3aa99889c60624 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C @@ -80,7 +80,7 @@ Foam::kineticTheoryModels::conductivityModels::Syamlal::kappa { const scalar sqrtPi = sqrt(constant::mathematical::pi); - return rho1*da*sqrt(Theta)* + return da*sqrt(Theta)* ( 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha1) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H similarity index 97% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H index 7981a2b141823699b832815c3577805f54a6d07c..f4a8a2566e6858259fab03d4fba8f7d8127a58f0 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H @@ -113,6 +113,11 @@ public: const volScalarField& da, const dimensionedScalar& e ) const = 0; + + virtual bool read() + { + return true; + } }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C similarity index 68% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index eb7d0292949bfcd3bc6ee1013f6ca9ef83719c12..b05277dbb191d3aa9b627842bc501aea0df7ce85 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "JohnsonJacksonFrictionalStress.H" #include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -55,8 +56,15 @@ JohnsonJackson const dictionary& dict ) : - frictionalStressModel(dict) -{} + frictionalStressModel(dict), + coeffDict_(dict.subDict(typeName + "Coeffs")), + Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_.lookup("Fr")), + eta_("eta", dimless, coeffDict_.lookup("eta")), + p_("p", dimless, coeffDict_.lookup("p")), + phi_("phi", dimless, coeffDict_.lookup("phi")) +{ + phi_ *= constant::mathematical::pi/180.0; +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -74,16 +82,13 @@ frictionalPressure ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const { return - Fr*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta) - /pow(max(alphaMax - alpha1, scalar(5.0e-2)), p); + Fr_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_) + /pow(max(alphaMax - alpha1, scalar(5.0e-2)), p_); } @@ -93,32 +98,41 @@ frictionalPressurePrime ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const { - return Fr* + return Fr_* ( - eta*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta - 1.0) + eta_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_ - 1.0) *(alphaMax-alpha1) - + p*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta) - )/pow(max(alphaMax - alpha1, scalar(5.0e-2)), p + 1.0); + + p_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_) + )/pow(max(alphaMax - alpha1, scalar(5.0e-2)), p_ + 1.0); } Foam::tmp<Foam::volScalarField> -Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::muf +Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu ( const volScalarField& alpha1, const dimensionedScalar& alphaMax, const volScalarField& pf, - const volSymmTensorField& D, - const dimensionedScalar& phi + const volSymmTensorField& D ) const { - return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi); + return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi_); +} + + +bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read() +{ + coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + + Fr_.readIfPresent(coeffDict_); + eta_.readIfPresent(coeffDict_); + p_.readIfPresent(coeffDict_); + phi_.readIfPresent(coeffDict_); + + return true; } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H similarity index 81% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H index 985338b741b953f8c846cf7f9b92a29e3689fe5a..2b59c0a043f0266a8483481b9b72b739a8a4a587 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,6 +53,22 @@ class JohnsonJackson : public frictionalStressModel { + // Private data + + dictionary coeffDict_; + + //- Material constant for frictional normal stress + dimensionedScalar Fr_; + + //- Material constant for frictional normal stress + dimensionedScalar eta_; + + //- Material constant for frictional normal stress + dimensionedScalar p_; + + //- Angle of internal friction + dimensionedScalar phi_; + public: @@ -76,30 +92,25 @@ public: ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const; virtual tmp<volScalarField> frictionalPressurePrime ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const; - virtual tmp<volScalarField> muf + virtual tmp<volScalarField> nu ( const volScalarField& alpha1, const dimensionedScalar& alphaMax, const volScalarField& pf, - const volSymmTensorField& D, - const dimensionedScalar& phi + const volSymmTensorField& D ) const; + + virtual bool read(); }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C similarity index 76% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index ec6f55ab65d74039b183f233550c9ef920f8aaa7..537a76fecd785083b965f8aa7854cea58258edd5 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,9 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer const dictionary& dict ) : - frictionalStressModel(dict) + frictionalStressModel(dict), + coeffDict_(dict.subDict(typeName + "Coeffs")), + phi_("phi", dimless, coeffDict_.lookup("phi")) {} @@ -72,10 +74,7 @@ frictionalPressure ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const { return @@ -90,10 +89,7 @@ frictionalPressurePrime ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const { return @@ -103,42 +99,44 @@ frictionalPressurePrime Foam::tmp<Foam::volScalarField> -Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::muf +Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu ( const volScalarField& alpha1, const dimensionedScalar& alphaMax, const volScalarField& pf, - const volSymmTensorField& D, - const dimensionedScalar& phi + const volSymmTensorField& D ) const { const scalar I2Dsmall = 1.0e-15; - // Creating muf assuming it should be 0 on the boundary which may not be + // Creating nu assuming it should be 0 on the boundary which may not be // true - tmp<volScalarField> tmuf + tmp<volScalarField> tnu ( new volScalarField ( IOobject ( - "muf", + "Schaeffer:nu", alpha1.mesh().time().timeName(), - alpha1.mesh() + alpha1.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false ), alpha1.mesh(), - dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 0.0) + dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0) ) ); - volScalarField& muff = tmuf(); + volScalarField& nuf = tnu(); forAll (D, celli) { if (alpha1[celli] > alphaMax.value() - 5e-2) { - muff[celli] = - 0.5*pf[celli]*sin(phi.value()) + nuf[celli] = + 0.5*pf[celli]*sin(phi_.value()) /( sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy()) + sqr(D[celli].yy() - D[celli].zz()) @@ -149,9 +147,20 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::muf } } - muff.correctBoundaryConditions(); + // Correct coupled BCs + nuf.correctBoundaryConditions(); + + return tnu; +} + + +bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read() +{ + coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + + phi_.readIfPresent(coeffDict_); - return tmuf; + return true; } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H similarity index 84% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H index d99da3a32d1ab44772710f9d1f0da4923ab4e47f..1de4d5042ff6c779966b47207580b7283dd06976 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,6 +53,13 @@ class Schaeffer : public frictionalStressModel { + // Private data + + dictionary coeffDict_; + + //- Angle of internal friction + dimensionedScalar phi_; + public: @@ -76,30 +83,25 @@ public: ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const; virtual tmp<volScalarField> frictionalPressurePrime ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& n, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const; - virtual tmp<volScalarField> muf + virtual tmp<volScalarField> nu ( const volScalarField& alpha1, const dimensionedScalar& alphaMax, const volScalarField& pf, - const volSymmTensorField& D, - const dimensionedScalar& phi + const volSymmTensorField& D ) const; + + virtual bool read(); }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C similarity index 96% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C index 3b59e3615f86050567ecea083641bcd4f5f30541..02e1dc702fbb0d7847973064b45e20461952410f 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H similarity index 87% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H index 913b2ad105caab94c7ddcbe0d05ce1b6dc131154..0da14115cf84c4889a1ef2197c8155a16109ce63 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,6 +63,7 @@ protected: // Protected data + //- Reference to higher-level dictionary for re-read const dictionary& dict_; @@ -108,30 +109,25 @@ public: ( const volScalarField& alpha1, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const = 0; virtual tmp<volScalarField> frictionalPressurePrime ( const volScalarField& alpha1f, const dimensionedScalar& alphaMinFriction, - const dimensionedScalar& alphaMax, - const dimensionedScalar& Fr, - const dimensionedScalar& eta, - const dimensionedScalar& p + const dimensionedScalar& alphaMax ) const = 0; - virtual tmp<volScalarField> muf + virtual tmp<volScalarField> nu ( const volScalarField& alpha1, const dimensionedScalar& alphaMax, const volScalarField& pf, - const volSymmTensorField& D, - const dimensionedScalar& phi + const volSymmTensorField& D ) const = 0; + + virtual bool read() = 0; }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H similarity index 98% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H index df3ef7e8c155f99fedd67d1495f552540db64514..d30373ac2cc35efa91a074b4739f1f8d56c7ba66 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H @@ -122,6 +122,11 @@ public: const volScalarField& rho1, const dimensionedScalar& e ) const = 0; + + virtual bool read() + { + return true; + } }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C new file mode 100644 index 0000000000000000000000000000000000000000..3af90199a660f1cc74ab2b81200cd092663e1dd0 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -0,0 +1,546 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "kineticTheoryModel.H" +#include "surfaceInterpolate.H" +#include "mathematicalConstants.H" +#include "twoPhaseSystem.H" +#include "fvcDiv.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModel::kineticTheoryModel +( + const volScalarField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& phase, + const word& propertiesName, + const word& type +) +: + RASModels::eddyViscosity<PhaseIncompressibleTurbulenceModel<phaseModel> > + ( + type, + alpha, + rho, + U, + alphaPhi, + phi, + phase, + propertiesName + ), + + phase_(phase), + + draga_(phase.fluid().drag1()), + + viscosityModel_ + ( + kineticTheoryModels::viscosityModel::New + ( + this->coeffDict_ + ) + ), + conductivityModel_ + ( + kineticTheoryModels::conductivityModel::New + ( + this->coeffDict_ + ) + ), + radialModel_ + ( + kineticTheoryModels::radialModel::New + ( + this->coeffDict_ + ) + ), + granularPressureModel_ + ( + kineticTheoryModels::granularPressureModel::New + ( + this->coeffDict_ + ) + ), + frictionalStressModel_ + ( + kineticTheoryModels::frictionalStressModel::New + ( + this->coeffDict_ + ) + ), + + equilibrium_(this->coeffDict_.lookup("equilibrium")), + e_("e", dimless, this->coeffDict_.lookup("e")), + alphaMax_("alphaMax", dimless, this->coeffDict_.lookup("alphaMax")), + alphaMinFriction_ + ( + "alphaMinFriction", + dimless, + this->coeffDict_.lookup("alphaMinFriction") + ), + + Theta_ + ( + IOobject + ( + IOobject::groupName("Theta", phase.name()), + U.time().timeName(), + U.mesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + U.mesh() + ), + + lambda_ + ( + IOobject + ( + IOobject::groupName("lambda", phase.name()), + U.time().timeName(), + U.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + U.mesh(), + dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModel::~kineticTheoryModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::kineticTheoryModel::correct() +{ + // Local references + volScalarField alpha(max(this->alpha_, 0.0)); + const volScalarField& rho = phase_.rho(); + const surfaceScalarField& alphaPhi = this->alphaPhi_; + const volVectorField& U = this->U_; + const volVectorField& Uc_ = phase_.fluid().otherPhase(phase_).U(); + + const scalar sqrtPi = sqrt(constant::mathematical::pi); + dimensionedScalar ThetaSmall("ThetaSmall", Theta_.dimensions(), 1.0e-6); + dimensionedScalar ThetaSmallSqrt(sqrt(ThetaSmall)); + + tmp<volScalarField> tda(phase_.d()); + const volScalarField& da = tda(); + + tmp<volTensorField> tgradU(fvc::grad(this->U_)); + const volTensorField& gradU(tgradU()); + volSymmTensorField D(symm(gradU)); + + // Calculating the radial distribution function + volScalarField gs0(radialModel_->g0(alpha, alphaMinFriction_, alphaMax_)); + + if (!equilibrium_) + { + // particle viscosity (Table 3.2, p.47) + nut_ = viscosityModel_->nu(alpha, Theta_, gs0, rho, da, e_); + + volScalarField ThetaSqrt(sqrt(Theta_)); + + // Bulk viscosity p. 45 (Lun et al. 1984). + lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0*(1.0 + e_)*ThetaSqrt/sqrtPi; + + // Stress tensor, Definitions, Table 3.1, p. 43 + volSymmTensorField tau(2.0*nut_*D + (lambda_ - (2.0/3.0)*nut_)*tr(D)*I); + + // Dissipation (Eq. 3.24, p.50) + volScalarField gammaCoeff + ( + 12.0*(1.0 - sqr(e_)) + *max(sqr(alpha), phase_.fluid().residualPhaseFraction()) + *gs0*(1.0/da)*ThetaSqrt/sqrtPi + ); + + // NB, drag = K*alpha*alpha2, + // (the alpha and alpha2 has been extracted from the drag function for + // numerical reasons) + volScalarField magUr(mag(U - Uc_)); + + volScalarField alpha2Prim + ( + max + ( + alpha*(1.0 - alpha), + phase_.fluid().residualPhaseFraction() + )*draga_.K(magUr + phase_.fluid().residualSlip())/rho + ); + + // Eq. 3.25, p. 50 Js = J1 - J2 + volScalarField J1(3.0*alpha2Prim); + volScalarField J2 + ( + 0.25*sqr(alpha2Prim)*da*sqr(magUr) + /( + max(alpha, phase_.fluid().residualPhaseFraction()) + *sqrtPi*(ThetaSqrt + ThetaSmallSqrt) + ) + ); + + // particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45) + volScalarField PsCoeff + ( + granularPressureModel_->granularPressureCoeff + ( + alpha, + gs0, + rho, + e_ + )/rho + ); + + // 'thermal' conductivity (Table 3.3, p. 49) + volScalarField kappa + ( + conductivityModel_->kappa(alpha, Theta_, gs0, rho, da, e_) + ); + + // Construct the granular temperature equation (Eq. 3.20, p. 44) + // NB. note that there are two typos in Eq. 3.20: + // Ps should be without grad + // the laplacian has the wrong sign + fvScalarMatrix ThetaEqn + ( + 1.5* + ( + fvm::ddt(alpha, Theta_) + + fvm::div(alphaPhi, Theta_) + - fvc::Sp(fvc::ddt(alpha) + fvc::div(alphaPhi), Theta_) + ) + - fvm::laplacian(kappa, Theta_, "laplacian(kappa, Theta)") + == + fvm::SuSp(-((PsCoeff*I) && gradU), Theta_) + + (tau && gradU) + + fvm::Sp(-gammaCoeff, Theta_) + + fvm::Sp(-J1, Theta_) + + fvm::Sp(J2/(Theta_ + ThetaSmall), Theta_) + ); + + ThetaEqn.relax(); + ThetaEqn.solve(); + } + else + { + // Equilibrium => dissipation == production + // Eq. 4.14, p.82 + volScalarField K1(2.0*(1.0 + e_)*rho*gs0); + volScalarField K3 + ( + 0.5*da*rho* + ( + (sqrtPi/(3.0*(3.0-e_))) + *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha*gs0) + +1.6*alpha*gs0*(1.0 + e_)/sqrtPi + ) + ); + + volScalarField K2 + ( + 4.0*da*rho*(1.0 + e_)*alpha*gs0/(3.0*sqrtPi) - 2.0*K3/3.0 + ); + + volScalarField K4(12.0*(1.0 - sqr(e_))*rho*gs0/(da*sqrtPi)); + + volScalarField trD + ( + alpha/(alpha + phase_.fluid().residualPhaseFraction()) + *fvc::div(this->phi_) + ); + volScalarField tr2D(sqr(trD)); + volScalarField trD2(tr(D & D)); + + volScalarField t1(K1*alpha + rho); + volScalarField l1(-t1*trD); + volScalarField l2(sqr(t1)*tr2D); + volScalarField l3 + ( + 4.0 + *K4 + *alpha + *(2.0*K3*trD2 + K2*tr2D) + ); + + Theta_ = sqr + ( + (l1 + sqrt(l2 + l3)) + /(2.0*max(alpha, phase_.fluid().residualPhaseFraction())*K4) + ); + } + + Theta_.max(0); + Theta_.min(100); + + { + // particle viscosity (Table 3.2, p.47) + nut_ = viscosityModel_->nu(alpha, Theta_, gs0, rho, da, e_); + + volScalarField ThetaSqrt(sqrt(Theta_)); + + // Bulk viscosity p. 45 (Lun et al. 1984). + lambda_ = (4.0/3.0)*sqr(alpha)*da*gs0*(1.0 + e_)*ThetaSqrt/sqrtPi; + + // Frictional pressure + volScalarField pf + ( + frictionalStressModel_->frictionalPressure + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); + + // Add frictional shear viscosity, Eq. 3.30, p. 52 + nut_ += frictionalStressModel_->nu + ( + alpha, + alphaMax_, + pf/rho, + D + ); + + // Limit viscosity + nut_.min(100); + } + + if (debug) + { + Info<< typeName << ':' << nl + << " max(Theta) = " << max(Theta_).value() << nl + << " max(nut) = " << max(nut_).value() << endl; + } +} + + +/* +Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pp() const +{ + + // Particle pressure coefficient + // Coefficient in front of Theta (Eq. 3.22, p. 45) + volScalarField PsCoeff + ( + granularPressureModel_->granularPressureCoeff + ( + alpha, + gs0, + rho, + e_ + ) + ); + + // Frictional pressure + volScalarField pf + ( + frictionalStressModel_->frictionalPressure + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); + + // Return total particle pressure + return PsCoeff*Theta_ + pf; +} +*/ + + +Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::pPrime() const +{ + // Local references + const volScalarField& alpha = this->alpha_; + const volScalarField& rho = phase_.rho(); + + return + ( + Theta_ + *granularPressureModel_->granularPressureCoeffPrime + ( + alpha, + radialModel_->g0(alpha, alphaMinFriction_, alphaMax_), + radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_), + rho, + e_ + ) + + frictionalStressModel_->frictionalPressurePrime + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); +} + + +Foam::tmp<Foam::surfaceScalarField> Foam::kineticTheoryModel::pPrimef() const +{ + // Local references + const volScalarField& alpha = this->alpha_; + const volScalarField& rho = phase_.rho(); + + return fvc::interpolate + ( + Theta_ + *granularPressureModel_->granularPressureCoeffPrime + ( + alpha, + radialModel_->g0(alpha, alphaMinFriction_, alphaMax_), + radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_), + rho, + e_ + ) + + frictionalStressModel_->frictionalPressurePrime + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); +} + + +void Foam::kineticTheoryModel::correctNut() +{} + + +Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::k() const +{ + notImplemented("kineticTheoryModel::k()"); + return nut_; +} + + +Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModel::epsilon() const +{ + notImplemented("kineticTheoryModel::epsilon()"); + return nut_; +} + + +Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("R", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + - (this->nut_)*dev(twoSymm(fvc::grad(this->U_))) + - (lambda_*fvc::div(this->phi_))*symmTensor::I + ) + ); +} + + +Foam::tmp<Foam::volSymmTensorField> Foam::kineticTheoryModel::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("devRhoReff", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + - (this->rho_*this->nut_) + *dev(twoSymm(fvc::grad(this->U_))) + - ((this->rho_*lambda_)*fvc::div(this->phi_))*symmTensor::I + ) + ); +} + + +Foam::tmp<Foam::fvVectorMatrix> Foam::kineticTheoryModel::divDevRhoReff +( + volVectorField& U +) const +{ + return + ( + - fvm::laplacian(this->rho_*this->nut_, U) + - fvc::div + ( + (this->rho_*this->nut_)*dev2(T(fvc::grad(U))) + + ((this->rho_*lambda_)*fvc::div(this->phi_)) + *dimensioned<symmTensor>("I", dimless, symmTensor::I) + ) + ); +} + + +bool Foam::kineticTheoryModel::read() +{ + if + ( + RASModels::eddyViscosity + < + PhaseIncompressibleTurbulenceModel<phaseModel> + >::read() + ) + { + this->coeffDict().lookup("equilibrium") >> equilibrium_; + e_.readIfPresent(this->coeffDict()); + alphaMax_.readIfPresent(this->coeffDict()); + alphaMinFriction_.readIfPresent(this->coeffDict()); + + viscosityModel_->read(); + conductivityModel_->read(); + radialModel_->read(); + granularPressureModel_->read(); + frictionalStressModel_->read(); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H new file mode 100644 index 0000000000000000000000000000000000000000..e7146f8e62cedb7a49840a392419fd27b9e6c658 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::kineticTheoryModel + +Description + +SourceFiles + kineticTheoryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kineticTheoryModel_H +#define kineticTheoryModel_H + +#include "eddyViscosity.H" +#include "PhaseIncompressibleTurbulenceModel.H" +#include "dragModel.H" +#include "phaseModel.H" +#include "autoPtr.H" +#include "viscosityModel.H" +#include "conductivityModel.H" +#include "radialModel.H" +#include "granularPressureModel.H" +#include "frictionalStressModel.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class kineticTheoryModel Declaration +\*---------------------------------------------------------------------------*/ + +class kineticTheoryModel +: + public RASModels::eddyViscosity + < + PhaseIncompressibleTurbulenceModel<phaseModel> + > +{ + // Private data + + // Input Fields + + const phaseModel& phase_; + + + //- Drag model + const dragModel& draga_; + + // Sub-models + + //- Run-time selected viscosity model + autoPtr<kineticTheoryModels::viscosityModel> viscosityModel_; + + //- Run-time selected conductivity model + autoPtr<kineticTheoryModels::conductivityModel> conductivityModel_; + + //- Run-time selected radial distribution model + autoPtr<kineticTheoryModels::radialModel> radialModel_; + + //- Run-time selected granular pressure model + autoPtr<kineticTheoryModels::granularPressureModel> + granularPressureModel_; + + //- Run-time selected frictional stress model + autoPtr<kineticTheoryModels::frictionalStressModel> + frictionalStressModel_; + + + // Kinetic Theory Model coefficients + + //- Use equilibrium approximation: generation == dissipation + Switch equilibrium_; + + //- Coefficient of restitution + dimensionedScalar e_; + + //- Maximum packing phase-fraction + dimensionedScalar alphaMax_; + + //- Min value for which the frictional stresses are zero + dimensionedScalar alphaMinFriction_; + + + // Kinetic Theory Model Fields + + //- The granular energy/temperature + volScalarField Theta_; + + //- The granular bulk viscosity + volScalarField lambda_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + kineticTheoryModel(const kineticTheoryModel&); + + //- Disallow default bitwise assignment + void operator=(const kineticTheoryModel&); + + +protected: + + // Protected member functions + + virtual void correctNut(); + + +public: + + //- Runtime type information + TypeName("kineticTheory"); + + + // Constructors + + //- Construct from components + kineticTheoryModel + ( + const volScalarField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const phaseModel& transport, + const word& propertiesName = turbulenceModel::propertiesName, + const word& type = typeName + ); + + + //- Destructor + virtual ~kineticTheoryModel(); + + + // Member Functions + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const + { + return this->nut(); + } + + //- Return the effective viscosity on patch + virtual tmp<scalarField> nuEff(const label patchi) const + { + return this->nut(patchi); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<volScalarField> pPrime() const; + + //- Return the face-phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<surfaceScalarField> pPrimef() const; + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the kinetic theory equations and correct the viscosity + virtual void correct(); + + //- Re-read model coefficients if they have changed + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C similarity index 90% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C index cfe74982a8878a8dfd0ce25a2c8f64058b10b00b..bedc30350001bcf221dfade2df1a2fa3b35da5de 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,6 +70,7 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { @@ -77,7 +78,7 @@ Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0 return 1.0/(1.0 - alpha) + 3.0*alpha/(2.0*sqr(1.0 - alpha)) - + sqr(alpha)/(2.0*pow(1.0 - alpha, 3)); + + sqr(alpha)/(2.0*pow3(1.0 - alpha)); } @@ -85,13 +86,14 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { return 2.5/sqr(1.0 - alpha) - + 4.0*alpha/pow(1.0 - alpha, 3.0) - + 1.5*sqr(alpha)/pow(1.0 - alpha, 4.0); + + 4.0*alpha/pow3(1.0 - alpha) + + 1.5*sqr(alpha)/pow4(1.0 - alpha); } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H similarity index 93% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H index ee61b1809911d29051501b6c5367046eceafa449..77396863eadb5af260174dfb09d3cfeed83954fa 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,12 +76,14 @@ public: tmp<volScalarField> g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; tmp<volScalarField> g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C similarity index 91% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C index 9f029288dd86f5bb37716308ceeefa74afbaf0ac..e9a4cfb522c38ef746853bdb5166e8e511d265ca 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,6 +70,7 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::radialModels::LunSavage::g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { @@ -82,10 +83,11 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::radialModels::LunSavage::g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { - return 2.5*pow(1.0 - alpha/alphaMax, -1.0 - 2.5*alphaMax); + return 2.5*pow(1.0 - alpha/alphaMax, -2.5*alphaMax - 1); } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H similarity index 93% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H index 81333790fdd41e31d348a867e5f6b5d9109981a3..53492c9c659f09e636e08148d6922666ca2d7d61 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,12 +75,14 @@ public: tmp<volScalarField> g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; tmp<volScalarField> g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C similarity index 86% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C index 0109f756b5a95786128c23c68450d1743157ff86..da1d658f5d38d5472629a44cf9112df16ca92747 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,10 +70,11 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::radialModels::SinclairJackson::g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { - return 1.0/(1.0 - pow(alpha/alphaMax, 1.0/3.0)); + return 1.0/(1.0 - cbrt(min(alpha, alphaMinFriction)/alphaMax)); } @@ -81,12 +82,16 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::radialModels::SinclairJackson::g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { - return - (1.0/3.0)*pow(max(alpha, scalar(1.0e-6))/alphaMax, -2.0/3.0) - /(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0))); + volScalarField aByaMax + ( + cbrt(min(max(alpha, 1e-3), alphaMinFriction)/alphaMax) + ); + + return (1.0/(3*alphaMax))/sqr(aByaMax - sqr(aByaMax)); } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H similarity index 93% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H index 56931e9f01b04eced20644f9fd29407d148698de..bc8f44be792354d9d88825cdc2209f3a856cd462 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,12 +75,14 @@ public: tmp<volScalarField> g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; tmp<volScalarField> g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/newRadialModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C similarity index 95% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.C index 7caf81d366f8241ca8df1c79e57a2d39ee8d9839..893117a8116116a8005f51d34101a484153deee4 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H similarity index 93% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H index e67a02c5c633f080c28b72ce03dd5873c7c984a7..fc0a583c44e59d832d94d91894740f7b17f8ac64 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/radialModel/radialModel/radialModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,6 +108,7 @@ public: virtual tmp<volScalarField> g0 ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const = 0; @@ -115,8 +116,14 @@ public: virtual tmp<volScalarField> g0prime ( const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const = 0; + + virtual bool read() + { + return true; + } }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C similarity index 96% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C index e3bf99518c648c847728b0cdd6c083423644436f..22e57614362d7131cb2c4d16a52e2dcc3ef4f1e0 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C @@ -62,7 +62,7 @@ Foam::kineticTheoryModels::viscosityModels::Gidaspow::~Gidaspow() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> -Foam::kineticTheoryModels::viscosityModels::Gidaspow::mu1 +Foam::kineticTheoryModels::viscosityModels::Gidaspow::nu ( const volScalarField& alpha1, const volScalarField& Theta, @@ -74,7 +74,7 @@ Foam::kineticTheoryModels::viscosityModels::Gidaspow::mu1 { const scalar sqrtPi = sqrt(constant::mathematical::pi); - return rho1*da*sqrt(Theta)* + return da*sqrt(Theta)* ( (4.0/5.0)*sqr(alpha1)*g0*(1.0 + e)/sqrtPi + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*sqr(alpha1) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H similarity index 98% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H index 0e3631ac0bf5e5b84a47166d31e8a1145d9ddbd8..325f4f06c03f8a60ce4e2e187f0e04689d573480 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H @@ -71,7 +71,7 @@ public: // Member functions - tmp<volScalarField> mu1 + tmp<volScalarField> nu ( const volScalarField& alpha1, const volScalarField& Theta, diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C similarity index 87% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 9f7fdd22ccb2e20143e98ee25a6bcd0af5aebb15..e1bcc67e92d07d9b667875b8620d3b4f4b4f7e46 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -56,8 +56,8 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair ) : viscosityModel(dict), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - L_(coeffsDict_.lookup("L")) + coeffDict_(dict.subDict(typeName + "Coeffs")), + L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_.lookup("L")) {} @@ -70,7 +70,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::~HrenyaSinclair() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> -Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::mu1 +Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu ( const volScalarField& alpha1, const volScalarField& Theta, @@ -87,7 +87,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::mu1 scalar(1) + da/(6.0*sqrt(2.0)*(alpha1 + scalar(1.0e-5)))/L_ ); - return rho1*da*sqrt(Theta)* + return da*sqrt(Theta)* ( (4.0/5.0)*sqr(alpha1)*g0*(1.0 + e)/sqrtPi + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1)*sqr(alpha1)/(3.0-e) @@ -98,4 +98,14 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::mu1 } +bool Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::read() +{ + coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + + L_.readIfPresent(coeffDict_); + + return true; +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H similarity index 95% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H index 80b0e863ae98347be1c6040d66cabb7ba279fbf5..90fe892f8681714089af5b66be8f2778c22edd44 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H @@ -55,9 +55,9 @@ class HrenyaSinclair { // Private data - dictionary coeffsDict_; + dictionary coeffDict_; - //- characteristic length of geometry + //- Characteristic length of geometry dimensionedScalar L_; @@ -79,7 +79,7 @@ public: // Member functions - tmp<volScalarField> mu1 + tmp<volScalarField> nu ( const volScalarField& alpha1, const volScalarField& Theta, @@ -88,6 +88,8 @@ public: const volScalarField& da, const dimensionedScalar& e ) const; + + virtual bool read(); }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C similarity index 96% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C index fa7ba802d2f25a70f3ac59078a357a129e617e78..ed5df62c86d9e28a4b9eb8bb08b487749b792d8e 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C @@ -62,7 +62,7 @@ Foam::kineticTheoryModels::viscosityModels::Syamlal::~Syamlal() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> -Foam::kineticTheoryModels::viscosityModels::Syamlal::mu1 +Foam::kineticTheoryModels::viscosityModels::Syamlal::nu ( const volScalarField& alpha1, const volScalarField& Theta, @@ -74,7 +74,7 @@ Foam::kineticTheoryModels::viscosityModels::Syamlal::mu1 { const scalar sqrtPi = sqrt(constant::mathematical::pi); - return rho1*da*sqrt(Theta)* + return da*sqrt(Theta)* ( (4.0/5.0)*sqr(alpha1)*g0*(1.0 + e)/sqrtPi + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1.0)*sqr(alpha1)/(3.0 - e) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H similarity index 98% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H index f82ef8af0666488c2bb6049c2b32047083d5b732..7d2583e5616a2f74ad4396bc35af27597a8b6023 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H @@ -72,7 +72,7 @@ public: // Member functions - tmp<volScalarField> mu1 + tmp<volScalarField> nu ( const volScalarField& alpha1, const volScalarField& Theta, diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C similarity index 97% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C index 85f495cca5d137022866105a4d7975110b13e4cb..44c54a5168148a1400fa9205ed56792982866702 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.C @@ -53,7 +53,7 @@ Foam::kineticTheoryModels::noneViscosity::~noneViscosity() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::noneViscosity::mu1 +Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::noneViscosity::nu ( const volScalarField& alpha1, const volScalarField& Theta, @@ -66,7 +66,7 @@ Foam::tmp<Foam::volScalarField> Foam::kineticTheoryModels::noneViscosity::mu1 return dimensionedScalar ( "0", - dimensionSet(1, -1, -1, 0, 0, 0, 0), + dimensionSet(0, 2, -1, 0, 0, 0, 0), 0.0 )*alpha1; } diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H similarity index 98% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H index 641ebe30eb27d582391d82d5841faec6d08dabf7..25fe4ce7b8da8c1d0f0c632e6e9c3a5b3fc3be3b 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/none/noneViscosity.H @@ -70,7 +70,7 @@ public: // Member functions - tmp<volScalarField> mu1 + tmp<volScalarField> nu ( const volScalarField& alpha1, const volScalarField& Theta, diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H similarity index 96% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H index 91007f05381029b00f87587b20178510d78a6d9f..bfd021a4b1f4ac60c009b5ab497fcfe3fd94e8d5 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H @@ -106,7 +106,7 @@ public: // Member Functions - virtual tmp<volScalarField> mu1 + virtual tmp<volScalarField> nu ( const volScalarField& alpha1, const volScalarField& Theta, @@ -115,6 +115,11 @@ public: const volScalarField& da, const dimensionedScalar& e ) const = 0; + + virtual bool read() + { + return true; + } }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C new file mode 100644 index 0000000000000000000000000000000000000000..f47e3943a198d0fc48513ffe5bfb1a5da92bf02b --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "PhaseIncompressibleTurbulenceModel.H" +#include "laminar.H" +#include "RASModel.H" +#include "kEpsilon.H" +#include "LaheyKEpsilon.H" +#include "continuousGasKEpsilon.H" +#include "kineticTheoryModel.H" +#include "phasePressureModel.H" +#include "phaseModel.H" +#include "addToRunTimeSelectionTable.H" + +namespace Foam +{ + typedef TurbulenceModel + < + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + phaseModel + > basePhaseIncompressibleTransportTurbulenceModel; + + defineTemplateRunTimeSelectionTable + ( + basePhaseIncompressibleTransportTurbulenceModel, + dictionary + ); + + typedef PhaseIncompressibleTurbulenceModel<phaseModel> + incompressibleTransportTurbulenceModel; + + typedef laminar<incompressibleTransportTurbulenceModel> + incompressibleLaminar; + + defineNamedTemplateTypeNameAndDebug(incompressibleLaminar, 0); + + addToRunTimeSelectionTable + ( + basePhaseIncompressibleTransportTurbulenceModel, + incompressibleLaminar, + dictionary + ); + + + typedef RASModel<incompressibleTransportTurbulenceModel> + incompressibleRASModel; + + defineNamedTemplateTypeNameAndDebug(incompressibleRASModel, 0); + + defineTemplateRunTimeSelectionTable(incompressibleRASModel, dictionary); + + addToRunTimeSelectionTable + ( + basePhaseIncompressibleTransportTurbulenceModel, + incompressibleRASModel, + dictionary + ); + + namespace RASModels + { + typedef kEpsilon<incompressibleTransportTurbulenceModel> + incompressiblekEpsilon; + + defineNamedTemplateTypeNameAndDebug(incompressiblekEpsilon, 0); + + addToRunTimeSelectionTable + ( + incompressibleRASModel, + incompressiblekEpsilon, + dictionary + ); + } + + namespace RASModels + { + typedef LaheyKEpsilon<incompressibleTransportTurbulenceModel> + incompressibleLaheyKEpsilon; + + defineNamedTemplateTypeNameAndDebug(incompressibleLaheyKEpsilon, 0); + + addToRunTimeSelectionTable + ( + incompressibleRASModel, + incompressibleLaheyKEpsilon, + dictionary + ); + } + + namespace RASModels + { + typedef continuousGasKEpsilon<incompressibleTransportTurbulenceModel> + incompressiblecontinuousGasKEpsilon; + + defineNamedTemplateTypeNameAndDebug + ( + incompressiblecontinuousGasKEpsilon, + 0 + ); + + addToRunTimeSelectionTable + ( + incompressibleRASModel, + incompressiblecontinuousGasKEpsilon, + dictionary + ); + } +} + + +namespace Foam +{ + typedef PhaseIncompressibleTurbulenceModel<phaseModel> + incompressibleTransportTurbulenceModel; + + typedef RASModel<incompressibleTransportTurbulenceModel> + incompressibleRASModel; + + defineTypeNameAndDebug(kineticTheoryModel, 0); + + addToRunTimeSelectionTable + ( + incompressibleRASModel, + kineticTheoryModel, + dictionary + ); +} + + +namespace Foam +{ + typedef PhaseIncompressibleTurbulenceModel<phaseModel> + incompressibleTransportTurbulenceModel; + + typedef RASModel<incompressibleTransportTurbulenceModel> + incompressibleRASModel; + + defineTypeNameAndDebug(phasePressureModel, 0); + + addToRunTimeSelectionTable + ( + incompressibleRASModel, + phasePressureModel, + dictionary + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C new file mode 100644 index 0000000000000000000000000000000000000000..99cc91994c0003d493225f435b8ebabdd109d3a0 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -0,0 +1,219 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "phasePressureModel.H" +#include "surfaceInterpolate.H" +#include "twoPhaseSystem.H" +#include "dimensionedType.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phasePressureModel::phasePressureModel +( + const volScalarField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& phase, + const word& propertiesName, + const word& type +) +: + RASModels::eddyViscosity<PhaseIncompressibleTurbulenceModel<phaseModel> > + ( + type, + alpha, + rho, + U, + alphaPhi, + phi, + phase, + propertiesName + ), + + phase_(phase), + + alphaMax_(readScalar(this->coeffDict_.lookup("alphaMax"))), + preAlphaExp_(readScalar(this->coeffDict_.lookup("preAlphaExp"))), + expMax_(readScalar(this->coeffDict_.lookup("expMax"))), + g0_ + ( + "g0", + dimensionSet(1, -1, -2, 0, 0), + this->coeffDict_.lookup("g0") + ) +{ + this->nut_ == dimensionedScalar("zero", this->nut_.dimensions(), 0.0); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phasePressureModel::~phasePressureModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::phasePressureModel::correct() +{} + + +void Foam::phasePressureModel::correctNut() +{} + + +Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::pPrime() const +{ + return + g0_ + *min + ( + exp(preAlphaExp_*(this->alpha_ - alphaMax_)), + expMax_ + ); +} + + +Foam::tmp<Foam::surfaceScalarField> Foam::phasePressureModel::pPrimef() const +{ + return + g0_ + *min + ( + exp(preAlphaExp_*(fvc::interpolate(this->alpha_) - alphaMax_)), + expMax_ + ); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::k() const +{ + notImplemented("phasePressureModel::k()"); + return nut_; +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePressureModel::epsilon() const +{ + notImplemented("phasePressureModel::epsilon()"); + return nut_; +} + + +Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("R", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensioned<symmTensor> + ( + "R", + dimensionSet(0, 2, -2, 0, 0), + symmTensor::zero + ) + ) + ); +} + + +Foam::tmp<Foam::volSymmTensorField> Foam::phasePressureModel::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("devRhoReff", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensioned<symmTensor> + ( + "R", + this->rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), + symmTensor::zero + ) + ) + ); +} + + +Foam::tmp<Foam::fvVectorMatrix> Foam::phasePressureModel::divDevRhoReff +( + volVectorField& U +) const +{ + return tmp<fvVectorMatrix> + ( + new fvVectorMatrix + ( + U, + this->rho_.dimensions()*dimensionSet(0, 4, -2, 0, 0) + ) + ); +} + + +bool Foam::phasePressureModel::read() +{ + if + ( + RASModels::eddyViscosity + < + PhaseIncompressibleTurbulenceModel<phaseModel> + >::read() + ) + { + this->coeffDict().lookup("alphaMax") >> alphaMax_; + this->coeffDict().lookup("preAlphaExp") >> preAlphaExp_; + this->coeffDict().lookup("expMax") >> expMax_; + g0_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H new file mode 100644 index 0000000000000000000000000000000000000000..1c4028f16a94e885da707699e02984c7522c9fc7 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -0,0 +1,182 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::phasePressureModel + +Description + +SourceFiles + phasePressureModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phasePressureModel_H +#define phasePressureModel_H + +#include "eddyViscosity.H" +#include "PhaseIncompressibleTurbulenceModel.H" +#include "dragModel.H" +#include "phaseModel.H" +#include "autoPtr.H" +#include "viscosityModel.H" +#include "conductivityModel.H" +#include "radialModel.H" +#include "granularPressureModel.H" +#include "frictionalStressModel.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class phasePressureModel Declaration +\*---------------------------------------------------------------------------*/ + +class phasePressureModel +: + public RASModels::eddyViscosity + < + PhaseIncompressibleTurbulenceModel<phaseModel> + > +{ + // Private data + + // Input Fields + + const phaseModel& phase_; + + + // Kinetic Theory Model coefficients + + //- Maximum packing phase-fraction + scalar alphaMax_; + + //- Pre-exponential factor + scalar preAlphaExp_; + + //- Maximum limit of the exponential + scalar expMax_; + + //- g0 + dimensionedScalar g0_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + phasePressureModel(const phasePressureModel&); + + //- Disallow default bitwise assignment + void operator=(const phasePressureModel&); + + +protected: + + // Protected member functions + + virtual void correctNut(); + + +public: + + //- Runtime type information + TypeName("phasePressure"); + + + // Constructors + + //- Construct from components + phasePressureModel + ( + const volScalarField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const phaseModel& transport, + const word& propertiesName = turbulenceModel::propertiesName, + const word& type = typeName + ); + + + //- Destructor + virtual ~phasePressureModel(); + + + // Member Functions + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const + { + return this->nut(); + } + + //- Return the effective viscosity on patch + virtual tmp<scalarField> nuEff(const label patchi) const + { + return this->nut(patchi); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<volScalarField> pPrime() const; + + //- Return the face-phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<surfaceScalarField> pPrimef() const; + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the kinetic theory equations and correct the viscosity + virtual void correct(); + + //- Re-read model coefficients if they have changed + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readPPProperties.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readPPProperties.H index 3acbf758d04105e7d3ec4f6aad60035c7398d082..4f32564a482f0ae76245dcb76b256aefb1ad0c3b 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readPPProperties.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readPPProperties.H @@ -29,8 +29,3 @@ ( ppProperties.lookup("g0") ); - - Switch packingLimiter - ( - ppProperties.lookup("packingLimiter") - ); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H index 9913595cf296cb67ab33cc3e503ef111cd610475..29353a8fa1deea189e0fa017c28ba5685013245c 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H @@ -1,2 +1,7 @@ #include "readTimeControls.H" #include "alphaControls.H" + + Switch implicitPhasePressure + ( + alphaControls.lookupOrDefault<Switch>("implicitPhasePressure", false) + ); diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/kEpsilon.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/kEpsilon.H deleted file mode 100644 index b74e1b18d79c4dac7b21cf3edc8bd56fb3ddb04d..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/kEpsilon.H +++ /dev/null @@ -1,72 +0,0 @@ -if (turbulence) -{ - if (mesh.changing()) - { - y.correct(); - } - - tmp<volTensorField> tgradU2(fvc::grad(U2)); - volScalarField G(2*nut2*(tgradU2() && dev(symm(tgradU2())))); - tgradU2.clear(); - - #include "wallFunctions.H" - - // Dissipation equation - fvScalarMatrix epsEqn - ( - fvm::ddt(alpha2, epsilon) - + fvm::div(alphaPhi2, epsilon) - - // Compressibity correction - - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), epsilon) - - - fvm::laplacian - ( - alpha1Eps*nuEff2, epsilon, - "laplacian(DepsilonEff,epsilon)" - ) - == - C1*alpha2*G*epsilon/k - - fvm::Sp(C2*alpha2*epsilon/k, epsilon) - ); - - #include "wallDissipation.H" - - - - epsEqn.relax(); - epsEqn.solve(); - - epsilon.max(dimensionedScalar("zero", epsilon.dimensions(), 1.0e-15)); - - - // Turbulent kinetic energy equation - fvScalarMatrix kEqn - ( - fvm::ddt(alpha2, k) - + fvm::div(alphaPhi2, k) - - // Compressibity correction - - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), k) - - - fvm::laplacian - ( - alpha1k*nuEff2, k, - "laplacian(DkEff,k)" - ) - == - alpha2*G - - fvm::Sp(alpha2*epsilon/k, k) - ); - kEqn.relax(); - kEqn.solve(); - - k.max(dimensionedScalar("zero", k.dimensions(), 1.0e-8)); - - //- Re-calculate turbulence viscosity - nut2 = Cmu*sqr(k)/epsilon; - - #include "wallViscosity.H" -} - -nuEff2 = nut2 + thermo2.mu()/rho2; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallFunctions.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallFunctions.H deleted file mode 100644 index d85181cba2e020e57fb2063d09d4af4f14b01807..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallFunctions.H +++ /dev/null @@ -1,83 +0,0 @@ -{ - labelList cellBoundaryFaceCount(epsilon.size(), 0); - - scalar Cmu25 = ::pow(Cmu.value(), 0.25); - scalar Cmu75 = ::pow(Cmu.value(), 0.75); - scalar kappa_ = kappa.value(); - - const fvPatchList& patches = mesh.boundary(); - - //- Initialise the near-wall P field to zero - forAll(patches, patchi) - { - const fvPatch& currPatch = patches[patchi]; - - if (isA<wallFvPatch>(currPatch)) - { - forAll(currPatch, facei) - { - label faceCelli = currPatch.faceCells()[facei]; - - epsilon[faceCelli] = 0.0; - G[faceCelli] = 0.0; - } - } - } - - //- Accumulate the wall face contributions to epsilon and G - // Increment cellBoundaryFaceCount for each face for averaging - forAll(patches, patchi) - { - const fvPatch& currPatch = patches[patchi]; - const scalarField& mu2_ = thermo2.mu().boundaryField()[patchi]; - const scalarField& rho2_ = rho2.boundaryField()[patchi]; - - if (isA<wallFvPatch>(currPatch)) - { - const scalarField& nut2w = nut2.boundaryField()[patchi]; - - scalarField magFaceGradU(mag(U2.boundaryField()[patchi].snGrad())); - - forAll(currPatch, facei) - { - label faceCelli = currPatch.faceCells()[facei]; - - // For corner cells (with two boundary or more faces), - // epsilon and G in the near-wall cell are calculated - // as an average - - cellBoundaryFaceCount[faceCelli]++; - - epsilon[faceCelli] += - Cmu75*::pow(k[faceCelli], 1.5) - /(kappa_*y[patchi][facei]); - - G[faceCelli] += - (nut2w[facei] + mu2_[facei]/rho2_[facei]) - *magFaceGradU[facei] - *Cmu25*::sqrt(k[faceCelli]) - /(kappa_*y[patchi][facei]); - } - } - } - - - // perform the averaging - - forAll(patches, patchi) - { - const fvPatch& curPatch = patches[patchi]; - - if (isA<wallFvPatch>(curPatch)) - { - forAll(curPatch, facei) - { - label faceCelli = curPatch.faceCells()[facei]; - - epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli]; - G[faceCelli] /= cellBoundaryFaceCount[faceCelli]; - cellBoundaryFaceCount[faceCelli] = 1; - } - } - } -} diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallViscosity.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallViscosity.H deleted file mode 100644 index 9aa032149ca51f65d51d412c4dc13b7d61b9c46c..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallViscosity.H +++ /dev/null @@ -1,40 +0,0 @@ -{ - scalar Cmu25 = ::pow(Cmu.value(), 0.25); - scalar kappa_ = kappa.value(); - scalar E_ = E.value(); - - const fvPatchList& patches = mesh.boundary(); - - forAll(patches, patchi) - { - const fvPatch& currPatch = patches[patchi]; - const scalarField& mu2_ = thermo2.mu().boundaryField()[patchi]; - const scalarField& rho2_ = rho2.boundaryField()[patchi]; - - if (isA<wallFvPatch>(currPatch)) - { - scalarField& nutw = nut2.boundaryField()[patchi]; - - forAll(currPatch, facei) - { - label faceCelli = currPatch.faceCells()[facei]; - - // calculate yPlus - scalar yPlus = - Cmu25*y[patchi][facei]*::sqrt(k[faceCelli]) - /(mu2_[facei]/rho2_[facei]); - - if (yPlus > 11.6) - { - nutw[facei] = - (mu2_[facei]/rho2_[facei]) - *(yPlus*kappa_/::log(E_*yPlus) - 1); - } - else - { - nutw[facei] = 0.0; - } - } - } - } -} diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/Make/files similarity index 76% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/Make/files index c465aaa45490c24c1d02030adef6fd4c4f6df65d..fb49c3cef761ab0d94d4b702a807f0378cd0cc74 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/Make/files @@ -4,4 +4,6 @@ diameterModels/diameterModel/newDiameterModel.C diameterModels/constantDiameter/constantDiameter.C diameterModels/isothermalDiameter/isothermalDiameter.C -LIB = $(FOAM_LIBBIN)/libcompressiblePhaseModel +twoPhaseSystem.C + +LIB = $(FOAM_LIBBIN)/libcompressibleTwoPhaseSystem diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/Make/options similarity index 80% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/options rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/Make/options index e441b0417bb82b021ee7e0ae470e030900e43a71..ab3c396f5796ea50f8afd47eeb3a4c6d5c950316 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/Make/options @@ -1,4 +1,6 @@ EXE_INC = \ + -I../twoPhaseSystem \ + -I../interfacialModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/diameterModel/newDiameterModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.C diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.H similarity index 100% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/diameterModels/isothermalDiameter/isothermalDiameter.H diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C similarity index 76% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C index 112a30218896b55c184c7d8740956f602a8b9474..e0275a6238217ba8f88cb5f3ece5495fd14a8b7e 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.C @@ -24,7 +24,10 @@ License \*---------------------------------------------------------------------------*/ #include "phaseModel.H" +#include "twoPhaseSystem.H" #include "diameterModel.H" +#include "dragModel.H" +#include "heatTransferModel.H" #include "fixedValueFvPatchFields.H" #include "slipFvPatchFields.H" #include "surfaceInterpolate.H" @@ -33,8 +36,8 @@ License Foam::phaseModel::phaseModel ( - const fvMesh& mesh, - const dictionary& transportProperties, + const twoPhaseSystem& fluid, + const dictionary& phaseProperties, const word& phaseName ) : @@ -42,48 +45,44 @@ Foam::phaseModel::phaseModel ( IOobject ( - "alpha" + phaseName, - mesh.time().timeName(), - mesh, + IOobject::groupName("alpha", phaseName), + fluid.mesh().time().timeName(), + fluid.mesh(), IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), - mesh, + fluid.mesh(), dimensionedScalar("alpha", dimless, 0) ), + fluid_(fluid), name_(phaseName), phaseDict_ ( - transportProperties.subDict - ( - phaseName == "1" || phaseName == "2" - ? "phase" + phaseName - : word(phaseName) - ) + phaseProperties.subDict(name_) ), - thermo_(rhoThermo::New(mesh, phaseName)), + thermo_(rhoThermo::New(fluid.mesh(), name_)), U_ ( IOobject ( - "U" + phaseName, - mesh.time().timeName(), - mesh, + IOobject::groupName("U", name_), + fluid.mesh().time().timeName(), + fluid.mesh(), IOobject::MUST_READ, IOobject::AUTO_WRITE ), - mesh + fluid.mesh() ) { - thermo_->validate("phaseModel " + phaseName, "h", "e"); + thermo_->validate("phaseModel " + name_, "h", "e"); - const word phiName = "phi" + phaseName; + const word phiName = IOobject::groupName("phi", name_); IOobject phiHeader ( phiName, - mesh.time().timeName(), - mesh, + fluid_.mesh().time().timeName(), + fluid_.mesh(), IOobject::NO_READ ); @@ -98,12 +97,12 @@ Foam::phaseModel::phaseModel IOobject ( phiName, - mesh.time().timeName(), - mesh, + fluid_.mesh().time().timeName(), + fluid_.mesh(), IOobject::MUST_READ, IOobject::AUTO_WRITE ), - mesh + fluid_.mesh() ) ); } @@ -136,12 +135,12 @@ Foam::phaseModel::phaseModel IOobject ( phiName, - mesh.time().timeName(), - mesh, + fluid_.mesh().time().timeName(), + fluid_.mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), - fvc::interpolate(U_) & mesh.Sf(), + fvc::interpolate(U_) & fluid_.mesh().Sf(), phiTypes ) ); @@ -155,20 +154,6 @@ Foam::phaseModel::phaseModel } -Foam::autoPtr<Foam::phaseModel> Foam::phaseModel::New -( - const fvMesh& mesh, - const dictionary& transportProperties, - const word& phaseName -) -{ - return autoPtr<phaseModel> - ( - new phaseModel(mesh, transportProperties, phaseName) - ); -} - - // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::phaseModel::~phaseModel() diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H similarity index 86% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.H rename to applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H index 87c6f0b562946864dd76683f4a8a50fb634ca612..ed2a6115462185851dc9f52857231cd65dfa8c46 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/phaseModel/phaseModel.H @@ -36,6 +36,7 @@ SourceFiles #include "dimensionedScalar.H" #include "volFields.H" #include "surfaceFields.H" +#include "transportModel.H" #include "rhoThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,18 +45,24 @@ namespace Foam { // Forward declarations +class twoPhaseSystem; class diameterModel; + /*---------------------------------------------------------------------------*\ Class phaseModel Declaration \*---------------------------------------------------------------------------*/ class phaseModel : - public volScalarField + public volScalarField, + public transportModel { // Private data + //- Reference to the twoPhaseSystem to which this phase belongs + const twoPhaseSystem& fluid_; + //- Name of phase word name_; @@ -80,19 +87,8 @@ public: phaseModel ( - const fvMesh& mesh, - const dictionary& transportProperties, - const word& phaseName - ); - - - // Selectors - - //- Return a reference to the selected turbulence model - static autoPtr<phaseModel> New - ( - const fvMesh& mesh, - const dictionary& transportProperties, + const twoPhaseSystem& fluid, + const dictionary& phaseProperties, const word& phaseName ); @@ -103,6 +99,12 @@ public: // Member Functions + //- Return the twoPhaseSystem to which this phase belongs + const twoPhaseSystem& fluid() const + { + return fluid_; + } + const word& name() const { return name_; @@ -165,6 +167,16 @@ public: { return phiPtr_(); } + + //- Dummy correct + void correct() + {} + + //- Dummy read + bool read() + { + return true; + } }; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C new file mode 100644 index 0000000000000000000000000000000000000000..83902a7b7d7385b1c5619d769e11287a05ca8c0f --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -0,0 +1,390 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "twoPhaseSystem.H" +#include "surfaceInterpolate.H" +#include "fixedValueFvsPatchFields.H" +#include "fvcCurl.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::twoPhaseSystem::twoPhaseSystem +( + const fvMesh& mesh +) +: + IOdictionary + ( + IOobject + ( + "phaseProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ), + + mesh_(mesh), + + phase1_ + ( + *this, + *this, + wordList(lookup("phases"))[0] + ), + + phase2_ + ( + *this, + *this, + wordList(lookup("phases"))[1] + ), + + Cvm_ + ( + "Cvm", + dimless, + lookup("Cvm") + ), + + Cl_ + ( + "Cl", + dimless, + lookup("Cl") + ), + + drag1_ + ( + dragModel::New + ( + subDict("drag"), + phase1_, + phase1_, + phase2_ + ) + ), + + drag2_ + ( + dragModel::New + ( + subDict("drag"), + phase2_, + phase2_, + phase1_ + ) + ), + + heatTransfer1_ + ( + heatTransferModel::New + ( + subDict("heatTransfer"), + phase1_, + phase1_, + phase2_ + ) + ), + + heatTransfer2_ + ( + heatTransferModel::New + ( + subDict("heatTransfer"), + phase2_, + phase2_, + phase1_ + ) + ), + + dispersedPhase_(lookup("dispersedPhase")), + + residualPhaseFraction_ + ( + readScalar(lookup("residualPhaseFraction")) + ), + + residualSlip_ + ( + "residualSlip", + dimVelocity, + lookup("residualSlip") + ) +{ + if + ( + !( + dispersedPhase_ == phase1_.name() + || dispersedPhase_ == phase2_.name() + || dispersedPhase_ == "both" + ) + ) + { + FatalErrorIn("twoPhaseSystem::twoPhaseSystem(const fvMesh& mesh)") + << "invalid dispersedPhase " << dispersedPhase_ + << exit(FatalError); + } + + Info << "dispersedPhase is " << dispersedPhase_ << endl; + + // Ensure the phase-fractions sum to 1 + phase2_.volScalarField::operator=(scalar(1) - phase1_); +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::rho() const +{ + return phase1_*phase1_.thermo().rho() + phase2_*phase2_.thermo().rho(); +} + + +Foam::tmp<Foam::volVectorField> Foam::twoPhaseSystem::U() const +{ + return phase1_*phase1_.U() + phase2_*phase2_.U(); +} + + +Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseSystem::phi() const +{ + return + fvc::interpolate(phase1_)*phase1_.phi() + + fvc::interpolate(phase2_)*phase2_.phi(); +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::dragCoeff() const +{ + tmp<volScalarField> tdragCoeff + ( + new volScalarField + ( + IOobject + ( + "dragCoeff", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("dragCoeff", dimensionSet(1, -3, -1, 0, 0), 0) + ) + ); + volScalarField& dragCoeff = tdragCoeff(); + + volVectorField Ur(phase1_.U() - phase2_.U()); + volScalarField magUr(mag(Ur) + residualSlip_); + + if (dispersedPhase_ == phase1_.name()) + { + dragCoeff = drag1().K(magUr); + } + else if (dispersedPhase_ == phase2_.name()) + { + dragCoeff = drag2().K(magUr); + } + else if (dispersedPhase_ == "both") + { + dragCoeff = + ( + phase2_*drag1().K(magUr) + + phase1_*drag2().K(magUr) + ); + } + else + { + FatalErrorIn("twoPhaseSystem::dragCoeff()") + << "dispersedPhase: " << dispersedPhase_ << " is incorrect" + << exit(FatalError); + } + + volScalarField alphaCoeff(max(phase1_*phase2_, residualPhaseFraction_)); + dragCoeff *= alphaCoeff; + + // Remove drag at fixed-flux boundaries + forAll(phase1_.phi().boundaryField(), patchi) + { + if + ( + isA<fixedValueFvsPatchScalarField> + ( + phase1_.phi().boundaryField()[patchi] + ) + ) + { + dragCoeff.boundaryField()[patchi] = 0.0; + } + } + + return tdragCoeff; +} + + +Foam::tmp<Foam::volVectorField> Foam::twoPhaseSystem::liftForce +( + const volVectorField& U +) const +{ + tmp<volVectorField> tliftForce + ( + new volVectorField + ( + IOobject + ( + "liftForce", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector + ( + "liftForce", + dimensionSet(1, -2, -2, 0, 0), + vector::zero + ) + ) + ); + volVectorField& liftForce = tliftForce(); + + volVectorField Ur(phase1_.U() - phase2_.U()); + + liftForce = + Cl_*(phase1_*phase1_.rho() + phase2_*phase2_.rho()) + *(Ur ^ fvc::curl(U)); + + // Remove lift at fixed-flux boundaries + forAll(phase1_.phi().boundaryField(), patchi) + { + if + ( + isA<fixedValueFvsPatchScalarField> + ( + phase1_.phi().boundaryField()[patchi] + ) + ) + { + liftForce.boundaryField()[patchi] = vector::zero; + } + } + + return tliftForce; +} + + +Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::heatTransferCoeff() const +{ + tmp<volScalarField> theatTransferCoeff + ( + new volScalarField + ( + IOobject + ( + "heatTransferCoeff", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar + ( + "heatTransferCoeff", + dimensionSet(1, -1, -3, -1, 0), + 0 + ) + ) + ); + volScalarField& heatTransferCoeff = theatTransferCoeff(); + + volVectorField Ur(phase1_.U() - phase2_.U()); + volScalarField magUr(mag(Ur) + residualSlip_); + + if (dispersedPhase_ == phase1_.name()) + { + heatTransferCoeff = heatTransfer1().K(magUr); + } + else if (dispersedPhase_ == phase2_.name()) + { + heatTransferCoeff = heatTransfer2().K(magUr); + } + else if (dispersedPhase_ == "both") + { + heatTransferCoeff = + ( + phase2_*heatTransfer1().K(magUr) + + phase1_*heatTransfer2().K(magUr) + ); + } + else + { + FatalErrorIn("twoPhaseSystem::heatTransferCoeff()") + << "dispersedPhase: " << dispersedPhase_ << " is incorrect" + << exit(FatalError); + } + + volScalarField alphaCoeff(max(phase1_*phase2_, residualPhaseFraction_)); + heatTransferCoeff *= alphaCoeff; + + // Remove heatTransfer at fixed-flux boundaries + forAll(phase1_.phi().boundaryField(), patchi) + { + if + ( + isA<fixedValueFvsPatchScalarField> + ( + phase1_.phi().boundaryField()[patchi] + ) + ) + { + heatTransferCoeff.boundaryField()[patchi] = 0.0; + } + } + + return theatTransferCoeff; +} + + +bool Foam::twoPhaseSystem::read() +{ + if (regIOobject::read()) + { + bool readOK = true; + + readOK &= phase1_.read(); + readOK &= phase2_.read(); + + lookup("Cvm") >> Cvm_; + lookup("Cl") >> Cl_; + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H new file mode 100644 index 0000000000000000000000000000000000000000..3a7896ea02b13a5e41563b6ee6bc29b39b508687 --- /dev/null +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H @@ -0,0 +1,228 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::twoPhaseSystem + +Description + Incompressible multi-phase mixture with built in solution for the + phase fractions with interface compression for interface-capturing. + + Derived from transportModel so that it can be unsed in conjunction with + the incompressible turbulence models. + + Surface tension and contact-angle is handled for the interface + between each phase-pair. + +SourceFiles + twoPhaseSystem.C + +\*---------------------------------------------------------------------------*/ + +#ifndef twoPhaseSystem_H +#define twoPhaseSystem_H + +#include "IOdictionary.H" +#include "phaseModel.H" +#include "dragModel.H" +#include "heatTransferModel.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declarations +class dragModel; +class heatTransferModel; + + +/*---------------------------------------------------------------------------*\ + Class twoPhaseSystem Declaration +\*---------------------------------------------------------------------------*/ + +class twoPhaseSystem +: + public IOdictionary +{ + // Private data + + const fvMesh& mesh_; + + phaseModel phase1_; + phaseModel phase2_; + + dimensionedScalar Cvm_; + dimensionedScalar Cl_; + + autoPtr<dragModel> drag1_; + autoPtr<dragModel> drag2_; + + autoPtr<heatTransferModel> heatTransfer1_; + autoPtr<heatTransferModel> heatTransfer2_; + + word dispersedPhase_; + scalar residualPhaseFraction_; + dimensionedScalar residualSlip_; + + +public: + + // Constructors + + //- Construct from fvMesh + twoPhaseSystem(const fvMesh&); + + + //- Destructor + virtual ~twoPhaseSystem() + {} + + + // Member Functions + + const fvMesh& mesh() const + { + return mesh_; + } + + const phaseModel& phase1() const + { + return phase1_; + } + + const phaseModel& phase2() const + { + return phase2_; + } + + const phaseModel& otherPhase(const phaseModel& phase) const + { + if (&phase == &phase1_) + { + return phase2_; + } + else + { + return phase1_; + } + } + + phaseModel& phase1() + { + return phase1_; + } + + phaseModel& phase2() + { + return phase2_; + } + + const dragModel& drag1() const + { + return drag1_(); + } + + const dragModel& drag2() const + { + return drag2_(); + } + + const dragModel& drag(const phaseModel& phase) const + { + if (&phase == &phase1_) + { + return drag1_(); + } + else + { + return drag2_(); + } + } + + scalar residualPhaseFraction() const + { + return residualPhaseFraction_; + } + + const dimensionedScalar& residualSlip() const + { + return residualSlip_; + } + + tmp<volScalarField> dragCoeff() const; + tmp<volVectorField> liftForce(const volVectorField& U) const; + + const heatTransferModel& heatTransfer1() const + { + return heatTransfer1_(); + } + + const heatTransferModel& heatTransfer2() const + { + return heatTransfer2_(); + } + + tmp<volScalarField> heatTransferCoeff() const; + + //- Return the mixture density + tmp<volScalarField> rho() const; + + //- Return the mixture velocity + tmp<volVectorField> U() const; + + //- Return the mixture flux + tmp<surfaceScalarField> phi() const; + + //- Return the virtual-mass coefficient + dimensionedScalar Cvm() const + { + return Cvm_; + } + + //- Return the lift coefficient + dimensionedScalar Cl() const + { + return Cl_; + } + + //- Dummy correct + void correct() + {} + + //- Read base phaseProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/test/PisoFoam/Make/options b/applications/test/PisoFoam/Make/options index 259f95f7b93158e2925f06bb839bba3ffb502079..8e32793a194fe9d414bfbade1903814f1199bcb1 100644 --- a/applications/test/PisoFoam/Make/options +++ b/applications/test/PisoFoam/Make/options @@ -1,13 +1,13 @@ EXE_INC = \ - -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lincompressibleTurbulenceModel \ - -lincompressibleRASModels \ - -lincompressibleLESModels \ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/test/PisoFoam/PisoFoam.C b/applications/test/PisoFoam/PisoFoam.C index 1713e9747c77b09aa357ff547f9bf34743f40ea4..bbd28e6f88aaa50cb5cdb5d0c0f9044389fb6dc9 100644 --- a/applications/test/PisoFoam/PisoFoam.C +++ b/applications/test/PisoFoam/PisoFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,12 +33,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" -#include "turbulenceModel.H" - -#include "LduMatrix.H" -#include "diagTensorField.H" - -typedef LduMatrix<vector, scalar, scalar> lduVectorMatrix; +#include "IncompressibleTurbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,50 +68,12 @@ int main(int argc, char *argv[]) + turbulence->divDevReff(U) ); - //UEqn.relax(); - - fvVectorMatrix UEqnp(UEqn == -fvc::grad(p)); - - lduVectorMatrix U3Eqnp(mesh); - U3Eqnp.diag() = UEqnp.diag(); - U3Eqnp.upper() = UEqnp.upper(); - U3Eqnp.lower() = UEqnp.lower(); - U3Eqnp.source() = UEqnp.source(); - - UEqnp.addBoundaryDiag(U3Eqnp.diag(), 0); - UEqnp.addBoundarySource(U3Eqnp.source(), false); - - U3Eqnp.interfaces() = U.boundaryField().interfaces(); - U3Eqnp.interfacesUpper() = UEqnp.boundaryCoeffs().component(0); - U3Eqnp.interfacesLower() = UEqnp.internalCoeffs().component(0); + UEqn.relax(); - autoPtr<lduVectorMatrix::solver> U3EqnpSolver = - lduVectorMatrix::solver::New - ( - U.name(), - U3Eqnp, - dictionary - ( - IStringStream - ( - "{" - " /*solver SmoothSolver;*/" - " smoother GaussSeidel;" - " solver PBiCCCG;" - " preconditioner none;" - " tolerance (1e-7 1e-7 1);" - " relTol (0 0 0);" - "}" - )() - ) - ); - - //for (int i=0; i<3; i++) + if (momentumPredictor) { - U3EqnpSolver->solve(U).print(Info); - U.correctBoundaryConditions(); + solve(UEqn == -fvc::grad(p)); } - //solve(UEqnp); // --- PISO loop @@ -173,6 +130,7 @@ int main(int argc, char *argv[]) } } + laminarTransport.correct(); turbulence->correct(); runTime.write(); diff --git a/applications/test/PisoFoam/createFields.H b/applications/test/PisoFoam/createFields.H index 7cae304f6f6d018824d5dba8ebbf3598fff7c3ad..d543396a8d57b5fde321b59134c8bf13ab656a79 100644 --- a/applications/test/PisoFoam/createFields.H +++ b/applications/test/PisoFoam/createFields.H @@ -26,7 +26,7 @@ mesh ); -# include "createPhi.H" + #include "createPhi.H" label pRefCell = 0; @@ -36,7 +36,13 @@ singlePhaseTransportModel laminarTransport(U, phi); - autoPtr<incompressible::turbulenceModel> turbulence + autoPtr<IncompressibleTurbulenceModel<transportModel> > + turbulence ( - incompressible::turbulenceModel::New(U, phi, laminarTransport) + IncompressibleTurbulenceModel<transportModel>::New + ( + U, + phi, + laminarTransport + ) ); diff --git a/applications/test/RhoPimpleFoam/EEqn.H b/applications/test/RhoPimpleFoam/EEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..9972bdfff7b295d03e939b29996330d22c832a4e --- /dev/null +++ b/applications/test/RhoPimpleFoam/EEqn.H @@ -0,0 +1,33 @@ +{ + volScalarField& he = thermo.he(); + + fvScalarMatrix EEqn + ( + fvm::ddt(rho, he) + fvm::div(phi, he) + + fvc::ddt(rho, K) + fvc::div(phi, K) + + ( + he.name() == "e" + ? fvc::div + ( + fvc::absolute(phi/fvc::interpolate(rho), U), + p, + "div(phiv,p)" + ) + : -dpdt + ) + //- fvm::laplacian(turbulence->alphaEff(), he) + - fvm::laplacian(turbulence->muEff(), he) + == + fvOptions(rho, he) + ); + + EEqn.relax(); + + fvOptions.constrain(EEqn); + + EEqn.solve(); + + fvOptions.correct(he); + + thermo.correct(); +} diff --git a/applications/test/RhoPimpleFoam/Make/files b/applications/test/RhoPimpleFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..087a67d2136b2dcc3ca9580c4af54021e0244e17 --- /dev/null +++ b/applications/test/RhoPimpleFoam/Make/files @@ -0,0 +1,3 @@ +rhoPimpleFoam.C + +EXE = $(FOAM_USER_APPBIN)/RhoPimpleFoam diff --git a/applications/test/RhoPimpleFoam/Make/options b/applications/test/RhoPimpleFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..cc667ece05958b37358e128065b7fa0c25f65c49 --- /dev/null +++ b/applications/test/RhoPimpleFoam/Make/options @@ -0,0 +1,20 @@ +EXE_INC = \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude + +EXE_LIBS = \ + -lfluidThermophysicalModels \ + -lspecie \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools \ + -lsampling \ + -lfvOptions diff --git a/applications/test/RhoPimpleFoam/UEqn.H b/applications/test/RhoPimpleFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..1adabbc1f09d365005cd7d09e0663f1052702160 --- /dev/null +++ b/applications/test/RhoPimpleFoam/UEqn.H @@ -0,0 +1,22 @@ +// Solve the Momentum equation + +tmp<fvVectorMatrix> UEqn +( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + fvOptions(rho, U) +); + +UEqn().relax(); + +fvOptions.constrain(UEqn()); + +if (pimple.momentumPredictor()) +{ + solve(UEqn() == -fvc::grad(p)); + + fvOptions.correct(U); + K = 0.5*magSqr(U); +} diff --git a/applications/test/RhoPimpleFoam/createFields.H b/applications/test/RhoPimpleFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..3a94360376f5c53578494fdbd0b3d686593e9c30 --- /dev/null +++ b/applications/test/RhoPimpleFoam/createFields.H @@ -0,0 +1,73 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<psiThermo> pThermo + ( + psiThermo::New(mesh) + ); + psiThermo& thermo = pThermo(); + thermo.validate(args.executable(), "h", "e"); + + volScalarField& p = thermo.p(); + const volScalarField& psi = thermo.psi(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + thermo.rho() + ); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "compressibleCreatePhi.H" + + dimensionedScalar rhoMax(pimple.dict().lookup("rhoMax")); + dimensionedScalar rhoMin(pimple.dict().lookup("rhoMin")); + + Info<< "Creating turbulence model\n" << endl; + + autoPtr<CompressibleTurbulenceModel<fluidThermo> > + turbulence + ( + CompressibleTurbulenceModel<fluidThermo>::New + ( + rho, + U, + phi, + thermo + ) + ); + + Info<< "Creating field dpdt\n" << endl; + volScalarField dpdt + ( + IOobject + ( + "dpdt", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("dpdt", p.dimensions()/dimTime, 0) + ); + + Info<< "Creating field kinetic energy K\n" << endl; + volScalarField K("K", 0.5*magSqr(U)); diff --git a/applications/test/RhoPimpleFoam/pEqn.H b/applications/test/RhoPimpleFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..78f4ddb0316da812837722fde3d8baba8540512b --- /dev/null +++ b/applications/test/RhoPimpleFoam/pEqn.H @@ -0,0 +1,113 @@ +rho = thermo.rho(); +rho = max(rho, rhoMin); +rho = min(rho, rhoMax); +rho.relax(); + +volScalarField rAU(1.0/UEqn().A()); +volVectorField HbyA("HbyA", U); +HbyA = rAU*UEqn().H(); + +if (pimple.nCorrPISO() <= 1) +{ + UEqn.clear(); +} + +if (pimple.transonic()) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(psi) + *( + (fvc::interpolate(HbyA) & mesh.Sf()) + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ) + ); + + fvOptions.relativeFlux(fvc::interpolate(psi), phid); + + volScalarField Dp("Dp", rho*rAU); + + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvm::div(phid, p) + - fvm::laplacian(Dp, p) + == + fvOptions(psi, p, rho.name()) + ); + + fvOptions.constrain(pEqn); + + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); + + if (pimple.finalNonOrthogonalIter()) + { + phi == pEqn.flux(); + } + } +} +else +{ + surfaceScalarField phiHbyA + ( + "phiHbyA", + fvc::interpolate(rho) + *( + (fvc::interpolate(HbyA) & mesh.Sf()) + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ) + ); + + fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA); + + volScalarField Dp("Dp", rho*rAU); + + while (pimple.correctNonOrthogonal()) + { + // Pressure corrector + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvc::div(phiHbyA) + - fvm::laplacian(Dp, p) + == + fvOptions(psi, p, rho.name()) + ); + + fvOptions.constrain(pEqn); + + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); + + if (pimple.finalNonOrthogonalIter()) + { + phi = phiHbyA + pEqn.flux(); + } + } +} + +#include "rhoEqn.H" +#include "compressibleContinuityErrs.H" + +// Explicitly relax pressure for momentum corrector +p.relax(); + +// Recalculate density from the relaxed pressure +rho = thermo.rho(); +rho = max(rho, rhoMin); +rho = min(rho, rhoMax); +rho.relax(); +Info<< "rho max/min : " << max(rho).value() + << " " << min(rho).value() << endl; + +U = HbyA - rAU*fvc::grad(p); +U.correctBoundaryConditions(); +fvOptions.correct(U); +K = 0.5*magSqr(U); + +if (thermo.dpdt()) +{ + dpdt = fvc::ddt(p); +} diff --git a/applications/test/RhoPimpleFoam/rhoPimpleFoam.C b/applications/test/RhoPimpleFoam/rhoPimpleFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..2a17c938f44b72fc32fc89f6149327d64bf77ebd --- /dev/null +++ b/applications/test/RhoPimpleFoam/rhoPimpleFoam.C @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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/>. + +Application + rhoPimpleFoam + +Description + Transient solver for laminar or turbulent flow of compressible fluids + for HVAC and similar applications. + + Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and + pseudo-transient simulations. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "psiThermo.H" +#include "CompressibleTurbulenceModel.H" +#include "bound.H" +#include "pimpleControl.H" +#include "fvIOoptionList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + + pimpleControl pimple(mesh); + + #include "createFields.H" + #include "createFvOptions.H" + #include "initContinuityErrs.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + if (pimple.nCorrPIMPLE() <= 1) + { + #include "rhoEqn.H" + } + + // --- Pressure-velocity PIMPLE corrector loop + while (pimple.loop()) + { + #include "UEqn.H" + #include "EEqn.H" + + // --- Pressure corrector loop + while (pimple.correct()) + { + #include "pEqn.H" + } + + if (pimple.turbCorr()) + { + turbulence->correct(); + } + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/src/Allwmake b/src/Allwmake index d5177cfafc50a7bc1cd0c52cafc7c730ccc24bfc..bafcd93df7c394d0190f511b0a64cd02f84bda88 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -64,6 +64,7 @@ wmake $makeType randomProcesses thermophysicalModels/Allwmake $* transportModels/Allwmake $* turbulenceModels/Allwmake $* +TurbulenceModels/Allwmake $* wmake $makeType combustionModels regionModels/Allwmake $* lagrangian/Allwmake $* diff --git a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C index 002e4fab5b2866552592314cad524d8d98bbf509..b711b2d17f01be5409002cd83c2892828a670a6d 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C @@ -97,6 +97,8 @@ void Foam::functionObjectFile::createFiles() filePtrs_.set(i, new OFstream(outputDir/(fName + ".dat"))); writeFileHeader(i); + + i++; } } } @@ -240,6 +242,13 @@ Foam::OFstream& Foam::functionObjectFile::file() << endl; } + if (!filePtrs_.set(0)) + { + FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()") + << "File pointer at index " << 0 << " not allocated" + << abort(FatalError); + } + return filePtrs_[0]; } @@ -269,6 +278,13 @@ Foam::OFstream& Foam::functionObjectFile::file(const label i) << abort(FatalError); } + if (!filePtrs_.set(i)) + { + FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()") + << "File pointer at index " << i << " not allocated" + << abort(FatalError); + } + return filePtrs_[i]; } diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H index de339b172e0d00881d2c14e893a021bc1e26e9e3..6e8030c797658bb16108b4d32bad9766d3adaf7f 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H @@ -40,6 +40,7 @@ SourceFiles #include "tensor.H" #include "pointHit.H" #include "Random.H" +#include "cachedRandom.H" #include "FixedList.H" #include "UList.H" #include "linePointRef.H" @@ -162,6 +163,10 @@ public: // distribution inline Point randomPoint(Random& rndGen) const; + //- Return a random point on the triangle from a uniform + // distribution + inline Point randomPoint(cachedRandom& rndGen) const; + //- Calculate the barycentric coordinates of the given // point, in the same order as a, b, c. Returns the // determinant of the solution. diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index 1f4465637f679f82618741c0b3facf5775526e54..fbc5a14286b8d5572dcfadff2d1c0280d4ebcde1 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -244,6 +244,25 @@ inline Point Foam::triangle<Point, PointRef>::randomPoint(Random& rndGen) const } +template<class Point, class PointRef> +inline Point Foam::triangle<Point, PointRef>::randomPoint +( + cachedRandom& rndGen +) const +{ + // Generating Random Points in Triangles + // by Greg Turk + // from "Graphics Gems", Academic Press, 1990 + // http://tog.acm.org/GraphicsGems/gems/TriPoints.c + + scalar s = rndGen.sample01<scalar>(); + + scalar t = sqrt(rndGen.sample01<scalar>()); + + return (1 - t)*a_ + (1 - s)*t*b_ + s*t*c_; +} + + template<class Point, class PointRef> Foam::scalar Foam::triangle<Point, PointRef>::barycentric ( diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake new file mode 100755 index 0000000000000000000000000000000000000000..c0daf57343e8d929344310c7ee1284c350219e8f --- /dev/null +++ b/src/TurbulenceModels/Allwmake @@ -0,0 +1,12 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +makeType=${1:-libso} +set -x + +wmake libso turbulenceModel +wmake libso incompressible +wmake libso compressible +wmakeLnInclude phaseIncompressible +wmakeLnInclude phaseCompressible + +# ----------------------------------------------------------------- end-of-file diff --git a/src/TurbulenceModels/compressible/CompressibleTurbulenceModel/CompressibleTurbulenceModel.C b/src/TurbulenceModels/compressible/CompressibleTurbulenceModel/CompressibleTurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..918331d8ec1f716baca535515af75771f7d745a6 --- /dev/null +++ b/src/TurbulenceModels/compressible/CompressibleTurbulenceModel/CompressibleTurbulenceModel.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "CompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::CompressibleTurbulenceModel<TransportModel>:: +CompressibleTurbulenceModel +( + const geometricOneField& alpha, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + TurbulenceModel + < + geometricOneField, + volScalarField, + compressibleTurbulenceModel, + transportModel + > + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::autoPtr<Foam::CompressibleTurbulenceModel<TransportModel> > +Foam::CompressibleTurbulenceModel<TransportModel>::New +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +{ + return autoPtr<CompressibleTurbulenceModel> + ( + static_cast<CompressibleTurbulenceModel*>( + TurbulenceModel + < + geometricOneField, + volScalarField, + compressibleTurbulenceModel, + transportModel + >::New + ( + geometricOneField(), + rho, + U, + phi, + phi, + transport, + propertiesName + ).ptr()) + ); +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/CompressibleTurbulenceModel/CompressibleTurbulenceModel.H b/src/TurbulenceModels/compressible/CompressibleTurbulenceModel/CompressibleTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..ba118c0b02c71bc2cf74ee6ac912d92755a0e0ac --- /dev/null +++ b/src/TurbulenceModels/compressible/CompressibleTurbulenceModel/CompressibleTurbulenceModel.H @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::CompressibleTurbulenceModel + +Description + Templated abstract base class for single-phase compressible + turbulence models. + +SourceFiles + CompressibleTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CompressibleTurbulenceModel_H +#define CompressibleTurbulenceModel_H + +#include "TurbulenceModel.H" +#include "compressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class CompressibleTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class TransportModel> +class CompressibleTurbulenceModel +: + public TurbulenceModel + < + geometricOneField, + volScalarField, + compressibleTurbulenceModel, + TransportModel + > +{ + +public: + + typedef geometricOneField alphaField; + typedef volScalarField rhoField; + typedef TransportModel transportModel; + + + // Constructors + + //- Construct + CompressibleTurbulenceModel + ( + const geometricOneField& alpha, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& trasport, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<CompressibleTurbulenceModel> New + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const transportModel& trasportModel, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~CompressibleTurbulenceModel() + {} + + + // Member Functions + + //- Return the laminar dynamic viscosity + virtual tmp<volScalarField> mu() const + { + return this->transport_.mu(); + } + + //- Return the laminar dynamic viscosity on patch + virtual tmp<scalarField> mu(const label patchi) const + { + return this->transport_.mu(patchi); + } + + //- Return the turbulence dynamic viscosity + virtual tmp<volScalarField> mut() const + { + return this->rho_*this->nut(); + } + + //- Return the turbulence dynamic viscosity on patch + virtual tmp<scalarField> mut(const label patchi) const + { + return this->rho_.boundaryField()[patchi]*this->nut(patchi); + } + + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const + { + return mut() + mu(); + } + + //- Return the effective dynamic viscosity on patch + virtual tmp<scalarField> muEff(const label patchi) const + { + return mut(patchi) + mu(patchi); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "CompressibleTurbulenceModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/Make/files b/src/TurbulenceModels/compressible/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..c4107f1050164b4542b63b0b355b78efa52585aa --- /dev/null +++ b/src/TurbulenceModels/compressible/Make/files @@ -0,0 +1,4 @@ +compressibleTurbulenceModel.C +compressibleTurbulenceModels.C + +LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModels diff --git a/src/TurbulenceModels/compressible/Make/options b/src/TurbulenceModels/compressible/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..73c2a143ce5da22a7ad336ef2e517f7f7f2ee76c --- /dev/null +++ b/src/TurbulenceModels/compressible/Make/options @@ -0,0 +1,12 @@ +EXE_INC = \ + -I../turbulenceModel/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude + +LIB_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lfluidThermophysicalModels \ + -lspecie diff --git a/src/TurbulenceModels/compressible/compressibleTurbulenceModel.C b/src/TurbulenceModels/compressible/compressibleTurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..a9e7794cff42ba6188d9cc1fed967f49a11455fa --- /dev/null +++ b/src/TurbulenceModels/compressible/compressibleTurbulenceModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "compressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(compressibleTurbulenceModel, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::compressibleTurbulenceModel::compressibleTurbulenceModel +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const word& propertiesName +) +: + turbulenceModel + ( + U, + alphaPhi, + phi, + propertiesName + ), + rho_(rho) +{} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H b/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..d762dc5a05269b164259845043810167a7075bbc --- /dev/null +++ b/src/TurbulenceModels/compressible/compressibleTurbulenceModel.H @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::compressibleTurbulenceModel + +Description + Abstract base class for turbulence models (RAS, LES and laminar). + +SourceFiles + compressibleTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleTurbulenceModel_H +#define compressibleTurbulenceModel_H + +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declarations +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class compressibleTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +class compressibleTurbulenceModel +: + public turbulenceModel +{ + +protected: + + // Protected data + + const volScalarField& rho_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + compressibleTurbulenceModel(const compressibleTurbulenceModel&); + + //- Disallow default bitwise assignment + void operator=(const compressibleTurbulenceModel&); + + +public: + + //- Runtime type information + TypeName("compressibleTurbulenceModel"); + + + // Constructors + + //- Construct from components + compressibleTurbulenceModel + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const word& propertiesName + ); + + + //- Destructor + virtual ~compressibleTurbulenceModel() + {} + + + // Member Functions + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devRhoReff() const = 0; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C b/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C new file mode 100644 index 0000000000000000000000000000000000000000..b8779c591efaae006e6a7a311cc998b0d2fd6dd1 --- /dev/null +++ b/src/TurbulenceModels/compressible/compressibleTurbulenceModels.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "CompressibleTurbulenceModel.H" +#include "laminar.H" +#include "RASModel.H" +#include "kEpsilon.H" +#include "fluidThermo.H" +#include "addToRunTimeSelectionTable.H" + +namespace Foam +{ + typedef TurbulenceModel + < + geometricOneField, + volScalarField, + compressibleTurbulenceModel, + fluidThermo + > baseCompressibleFluidThermoTurbulenceModel; + + defineTemplateRunTimeSelectionTable + ( + baseCompressibleFluidThermoTurbulenceModel, + dictionary + ); + + + typedef CompressibleTurbulenceModel<fluidThermo> + compressibleFluidThermoTurbulenceModel; + + typedef laminar<compressibleFluidThermoTurbulenceModel> compressibleLaminar; + + defineNamedTemplateTypeNameAndDebug(compressibleLaminar, 0); + + addToRunTimeSelectionTable + ( + baseCompressibleFluidThermoTurbulenceModel, + compressibleLaminar, + dictionary + ); + + + typedef RASModel<compressibleFluidThermoTurbulenceModel> + compressibleRASModel; + + defineNamedTemplateTypeNameAndDebug(compressibleRASModel, 0); + + defineTemplateRunTimeSelectionTable(compressibleRASModel, dictionary); + + addToRunTimeSelectionTable + ( + baseCompressibleFluidThermoTurbulenceModel, + compressibleRASModel, + dictionary + ); + + + namespace RASModels + { + typedef kEpsilon<compressibleFluidThermoTurbulenceModel> + compressibleKEpsilon; + + defineNamedTemplateTypeNameAndDebug(compressibleKEpsilon, 0); + + addToRunTimeSelectionTable + ( + compressibleRASModel, + compressibleKEpsilon, + dictionary + ); + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/incompressible/IncompressibleTurbulenceModel/IncompressibleTurbulenceModel.C b/src/TurbulenceModels/incompressible/IncompressibleTurbulenceModel/IncompressibleTurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..96179e22b817318bbade27d36e88d06cfa856e34 --- /dev/null +++ b/src/TurbulenceModels/incompressible/IncompressibleTurbulenceModel/IncompressibleTurbulenceModel.C @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "IncompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::IncompressibleTurbulenceModel<TransportModel>:: +IncompressibleTurbulenceModel +( + const geometricOneField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const TransportModel& transportModel, + const word& propertiesName +) +: + TurbulenceModel + < + geometricOneField, + geometricOneField, + incompressibleTurbulenceModel, + TransportModel + > + ( + alpha, + rho, + U, + alphaPhi, + phi, + transportModel, + propertiesName + ) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::autoPtr<Foam::IncompressibleTurbulenceModel<TransportModel> > +Foam::IncompressibleTurbulenceModel<TransportModel>::New +( + const volVectorField& U, + const surfaceScalarField& phi, + const TransportModel& transportModel, + const word& propertiesName +) +{ + return autoPtr<IncompressibleTurbulenceModel> + ( + static_cast<IncompressibleTurbulenceModel*>( + TurbulenceModel + < + geometricOneField, + geometricOneField, + incompressibleTurbulenceModel, + TransportModel + >::New + ( + geometricOneField(), + geometricOneField(), + U, + phi, + phi, + transportModel, + propertiesName + ).ptr()) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::tmp<Foam::volSymmTensorField> +Foam::IncompressibleTurbulenceModel<TransportModel>::devReff() const +{ + return devRhoReff(); +} + + +template<class TransportModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::IncompressibleTurbulenceModel<TransportModel>::divDevReff +( + volVectorField& U +) const +{ + return divDevRhoReff(U); +} + + +template<class TransportModel> +Foam::tmp<Foam::volSymmTensorField> +Foam::IncompressibleTurbulenceModel<TransportModel>:: +devRhoReff() const +{ + notImplemented + ( + "IncompressibleTurbulenceModel<TransportModel>::" + "devRhoReff()" + ); + + return devReff(); +} + + +template<class TransportModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::IncompressibleTurbulenceModel<TransportModel>:: +divDevRhoReff +( + volVectorField& U +) const +{ + notImplemented + ( + "IncompressibleTurbulenceModel<TransportModel>::" + "divDevRhoReff(volVectorField& U)" + ); + + return divDevReff(U); +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/incompressible/IncompressibleTurbulenceModel/IncompressibleTurbulenceModel.H b/src/TurbulenceModels/incompressible/IncompressibleTurbulenceModel/IncompressibleTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..d774ff9177fda907dcb1af619c67ff69b39045ac --- /dev/null +++ b/src/TurbulenceModels/incompressible/IncompressibleTurbulenceModel/IncompressibleTurbulenceModel.H @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::IncompressibleTurbulenceModel + +Description + Templated abstract base class for single-phase incompressible + turbulence models. + +SourceFiles + IncompressibleTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef IncompressibleTurbulenceModel_H +#define IncompressibleTurbulenceModel_H + +#include "TurbulenceModel.H" +#include "incompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class IncompressibleTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class TransportModel> +class IncompressibleTurbulenceModel +: + public TurbulenceModel + < + geometricOneField, + geometricOneField, + incompressibleTurbulenceModel, + TransportModel + > +{ + +public: + + typedef geometricOneField alphaField; + typedef geometricOneField rhoField; + typedef TransportModel transportModel; + + + // Constructors + + //- Construct + IncompressibleTurbulenceModel + ( + const geometricOneField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const TransportModel& trasportModel, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<IncompressibleTurbulenceModel> New + ( + const volVectorField& U, + const surfaceScalarField& phi, + const TransportModel& trasportModel, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~IncompressibleTurbulenceModel() + {} + + + // Member Functions + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "IncompressibleTurbulenceModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/incompressible/Make/files b/src/TurbulenceModels/incompressible/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..4b3ca65c16bf001f753def92d83733e5a85a32f9 --- /dev/null +++ b/src/TurbulenceModels/incompressible/Make/files @@ -0,0 +1,4 @@ +incompressibleTurbulenceModel.C +incompressibleTurbulenceModels.C + +LIB = $(FOAM_LIBBIN)/libincompressibleTurbulenceModels diff --git a/src/TurbulenceModels/incompressible/Make/options b/src/TurbulenceModels/incompressible/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..0763d29c1666c29a8c65847aab8a488c800462b4 --- /dev/null +++ b/src/TurbulenceModels/incompressible/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I../turbulenceModel/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude + +LIB_LIBS = \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModel.C b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..232a31fc83695d78b85ad195ccab8d84588f16c1 --- /dev/null +++ b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModel.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "incompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(incompressibleTurbulenceModel, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::incompressibleTurbulenceModel::incompressibleTurbulenceModel +( + const geometricOneField&, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const word& propertiesName +) +: + turbulenceModel + ( + U, + alphaPhi, + phi, + propertiesName + ) +{} + + +Foam::tmp<Foam::volScalarField> +Foam::incompressibleTurbulenceModel::mu() const +{ + return nu(); +} + + +Foam::tmp<Foam::scalarField> +Foam::incompressibleTurbulenceModel::mu(const label patchi) const +{ + return nu(patchi); +} + + +Foam::tmp<Foam::volScalarField> +Foam::incompressibleTurbulenceModel::mut() const +{ + return nut(); +} + + +Foam::tmp<Foam::scalarField> +Foam::incompressibleTurbulenceModel::mut(const label patchi) const +{ + return nut(patchi); +} + + +Foam::tmp<Foam::volScalarField> +Foam::incompressibleTurbulenceModel::muEff() const +{ + return nuEff(); +} + + +Foam::tmp<Foam::scalarField> +Foam::incompressibleTurbulenceModel::muEff(const label patchi) const +{ + return nuEff(patchi); +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModel.H b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..6876d88a481fb76615950fc5e9bcc2731c514f27 --- /dev/null +++ b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModel.H @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::incompressibleTurbulenceModel + +Description + Abstract base class for turbulence models (RAS, LES and laminar). + +SourceFiles + incompressibleTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef incompressibleTurbulenceModel_H +#define incompressibleTurbulenceModel_H + +#include "turbulenceModel.H" +#include "geometricOneField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declarations +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class incompressibleTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +class incompressibleTurbulenceModel +: + public turbulenceModel +{ + +protected: + + // Protected data + + geometricOneField rho_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + incompressibleTurbulenceModel(const incompressibleTurbulenceModel&); + + //- Disallow default bitwise assignment + void operator=(const incompressibleTurbulenceModel&); + + +public: + + //- Runtime type information + TypeName("incompressibleTurbulenceModel"); + + + // Constructors + + //- Construct from components + incompressibleTurbulenceModel + ( + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const word& propertiesName + ); + + + //- Destructor + virtual ~incompressibleTurbulenceModel() + {} + + + // Member Functions + + //- Return the laminar dynamic viscosity + virtual tmp<volScalarField> mu() const; + + //- Return the laminar dynamic viscosity on patch + virtual tmp<scalarField> mu(const label patchi) const; + + //- Return the turbulence dynamic viscosity + virtual tmp<volScalarField> mut() const; + + //- Return the turbulence dynamic viscosity on patch + virtual tmp<scalarField> mut(const label patchi) const; + + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const; + + //- Return the effective dynamic viscosity on patch + virtual tmp<scalarField> muEff(const label patchi) const; + + //- Return the effective stress tensor including the laminar stress + virtual tmp<volSymmTensorField> devReff() const = 0; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C new file mode 100644 index 0000000000000000000000000000000000000000..6d3b8aef5fa82577cbdb12a03ff6d9719b663f5a --- /dev/null +++ b/src/TurbulenceModels/incompressible/incompressibleTurbulenceModels.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "IncompressibleTurbulenceModel.H" +#include "laminar.H" +#include "RASModel.H" +#include "kEpsilon.H" +#include "transportModel.H" +#include "addToRunTimeSelectionTable.H" + +namespace Foam +{ + typedef TurbulenceModel + < + geometricOneField, + geometricOneField, + incompressibleTurbulenceModel, + transportModel + > baseIncompressibleTransportTurbulenceModel; + + defineTemplateRunTimeSelectionTable + ( + baseIncompressibleTransportTurbulenceModel, + dictionary + ); + + typedef IncompressibleTurbulenceModel + < + transportModel + > incompressibleTransportTurbulenceModel; + + typedef laminar<incompressibleTransportTurbulenceModel> + incompressibleLaminar; + + defineNamedTemplateTypeNameAndDebug(incompressibleLaminar, 0); + + addToRunTimeSelectionTable + ( + baseIncompressibleTransportTurbulenceModel, + incompressibleLaminar, + dictionary + ); + + + typedef RASModel<incompressibleTransportTurbulenceModel> + incompressibleRASModel; + + defineNamedTemplateTypeNameAndDebug(incompressibleRASModel, 0); + + defineTemplateRunTimeSelectionTable(incompressibleRASModel, dictionary); + + addToRunTimeSelectionTable + ( + baseIncompressibleTransportTurbulenceModel, + incompressibleRASModel, + dictionary + ); + + namespace RASModels + { + typedef kEpsilon<incompressibleTransportTurbulenceModel> + incompressibleKEpsilon; + + defineNamedTemplateTypeNameAndDebug(incompressibleKEpsilon, 0); + + addToRunTimeSelectionTable + ( + incompressibleRASModel, + incompressibleKEpsilon, + dictionary + ); + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseCompressible/PhaseCompressibleTurbulenceModel/PhaseCompressibleTurbulenceModel.C b/src/TurbulenceModels/phaseCompressible/PhaseCompressibleTurbulenceModel/PhaseCompressibleTurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..70b60a64fa7ef315540227e337789ab68de534be --- /dev/null +++ b/src/TurbulenceModels/phaseCompressible/PhaseCompressibleTurbulenceModel/PhaseCompressibleTurbulenceModel.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "PhaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::PhaseCompressibleTurbulenceModel<TransportModel>:: +PhaseCompressibleTurbulenceModel +( + const volScalarField& alpha, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + TurbulenceModel + < + volScalarField, + volScalarField, + compressibleTurbulenceModel, + transportModel + > + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::autoPtr<Foam::PhaseCompressibleTurbulenceModel<TransportModel> > +Foam::PhaseCompressibleTurbulenceModel<TransportModel>::New +( + const volScalarField& alpha, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +{ + return autoPtr<PhaseCompressibleTurbulenceModel> + ( + static_cast<PhaseCompressibleTurbulenceModel*>( + TurbulenceModel + < + volScalarField, + volScalarField, + compressibleTurbulenceModel, + transportModel + >::New + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ).ptr()) + ); +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseCompressible/PhaseCompressibleTurbulenceModel/PhaseCompressibleTurbulenceModel.H b/src/TurbulenceModels/phaseCompressible/PhaseCompressibleTurbulenceModel/PhaseCompressibleTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..5eefb4ea3d7d58a10a727e08b5d7ed6ba59b4e9a --- /dev/null +++ b/src/TurbulenceModels/phaseCompressible/PhaseCompressibleTurbulenceModel/PhaseCompressibleTurbulenceModel.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::PhaseCompressibleTurbulenceModel + +Description + Templated abstract base class for multiphase compressible + turbulence models. + +SourceFiles + PhaseCompressibleTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PhaseCompressibleTurbulenceModel_H +#define PhaseCompressibleTurbulenceModel_H + +#include "TurbulenceModel.H" +#include "compressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PhaseCompressibleTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class TransportModel> +class PhaseCompressibleTurbulenceModel +: + public TurbulenceModel + < + volScalarField, + volScalarField, + compressibleTurbulenceModel, + TransportModel + > +{ + +public: + + typedef volScalarField alphaField; + typedef volScalarField rhoField; + typedef TransportModel transportModel; + + + // Constructors + + //- Construct + PhaseCompressibleTurbulenceModel + ( + const alphaField& alpha, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& trasport, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<PhaseCompressibleTurbulenceModel> New + ( + const alphaField& alpha, + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& trasportModel, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~PhaseCompressibleTurbulenceModel() + {} + + + // Member Functions + + //- Return the laminar dynamic viscosity + virtual tmp<volScalarField> mu() const + { + return this->transport_.mu(); + } + + //- Return the laminar dynamic viscosity on patch + virtual tmp<scalarField> mu(const label patchi) const + { + return this->transport_.mu(patchi); + } + + //- Return the turbulence dynamic viscosity + virtual tmp<volScalarField> mut() const + { + return this->rho_*this->nut(); + } + + //- Return the turbulence dynamic viscosity on patch + virtual tmp<scalarField> mut(const label patchi) const + { + return this->rho_.boundaryField()[patchi]*this->nut(patchi); + } + + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const + { + return mut() + mu(); + } + + //- Return the effective dynamic viscosity on patch + virtual tmp<scalarField> muEff(const label patchi) const + { + return mut(patchi) + mu(patchi); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "PhaseCompressibleTurbulenceModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel/PhaseIncompressibleTurbulenceModel.C b/src/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel/PhaseIncompressibleTurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..003c86794bd7192cb27613b2fce252cf97af73ba --- /dev/null +++ b/src/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel/PhaseIncompressibleTurbulenceModel.C @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "PhaseIncompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>:: +PhaseIncompressibleTurbulenceModel +( + const volScalarField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const TransportModel& transportModel, + const word& propertiesName +) +: + TurbulenceModel + < + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + TransportModel + > + ( + alpha, + rho, + U, + alphaPhi, + phi, + transportModel, + propertiesName + ) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::autoPtr<Foam::PhaseIncompressibleTurbulenceModel<TransportModel> > +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::New +( + const volScalarField& alpha, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const TransportModel& transportModel, + const word& propertiesName +) +{ + return autoPtr<PhaseIncompressibleTurbulenceModel> + ( + static_cast<PhaseIncompressibleTurbulenceModel*>( + TurbulenceModel + < + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + TransportModel + >::New + ( + alpha, + geometricOneField(), + U, + alphaPhi, + phi, + transportModel, + propertiesName + ).ptr()) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class TransportModel> +Foam::tmp<Foam::volScalarField> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::pPrime() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("pPrime", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar("pPrimef", dimPressure, 0.0) + ) + ); +} + + +template<class TransportModel> +Foam::tmp<Foam::surfaceScalarField> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::pPrimef() const +{ + return tmp<surfaceScalarField> + ( + new surfaceScalarField + ( + IOobject + ( + IOobject::groupName("pPrimef", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar("pPrimef", dimPressure, 0.0) + ) + ); +} + + +template<class TransportModel> +Foam::tmp<Foam::volSymmTensorField> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::devReff() const +{ + return devRhoReff(); +} + + +template<class TransportModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>::divDevReff +( + volVectorField& U +) const +{ + return divDevRhoReff(U); +} + + +template<class TransportModel> +Foam::tmp<Foam::volSymmTensorField> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>:: +devRhoReff() const +{ + notImplemented + ( + "PhaseIncompressibleTurbulenceModel<TransportModel>::" + "devRhoReff()" + ); + + return devReff(); +} + + +template<class TransportModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::PhaseIncompressibleTurbulenceModel<TransportModel>:: +divDevRhoReff +( + volVectorField& U +) const +{ + notImplemented + ( + "PhaseIncompressibleTurbulenceModel<TransportModel>::" + "divDevRhoReff(volVectorField& U)" + ); + + return divDevReff(U); +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel/PhaseIncompressibleTurbulenceModel.H b/src/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel/PhaseIncompressibleTurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..c15b54e92a67c713a1ae787b8f9cac4fa67f561d --- /dev/null +++ b/src/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel/PhaseIncompressibleTurbulenceModel.H @@ -0,0 +1,142 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::PhaseIncompressibleTurbulenceModel + +Description + Templated abstract base class for multiphase incompressible + turbulence models. + +SourceFiles + PhaseIncompressibleTurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PhaseIncompressibleTurbulenceModel_H +#define PhaseIncompressibleTurbulenceModel_H + +#include "TurbulenceModel.H" +#include "incompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PhaseIncompressibleTurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class TransportModel> +class PhaseIncompressibleTurbulenceModel +: + public TurbulenceModel + < + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + TransportModel + > +{ + +public: + + typedef volScalarField alphaField; + typedef geometricOneField rhoField; + typedef TransportModel transportModel; + + + // Constructors + + //- Construct + PhaseIncompressibleTurbulenceModel + ( + const alphaField& alpha, + const geometricOneField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const TransportModel& trasportModel, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<PhaseIncompressibleTurbulenceModel> New + ( + const alphaField& alpha, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const TransportModel& trasportModel, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~PhaseIncompressibleTurbulenceModel() + {} + + + // Member Functions + + //- Return the phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<volScalarField> pPrime() const; + + //- Return the face-phase-pressure' + // (derivative of phase-pressure w.r.t. phase-fraction) + virtual tmp<surfaceScalarField> pPrimef() const; + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "PhaseIncompressibleTurbulenceModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C b/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C new file mode 100644 index 0000000000000000000000000000000000000000..21942801747b6a54a457bf3ed1fb761c6a903cb9 --- /dev/null +++ b/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C @@ -0,0 +1,265 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "LaheyKEpsilon.H" +#include "addToRunTimeSelectionTable.H" +#include "twoPhaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +LaheyKEpsilon<BasicTurbulenceModel>::LaheyKEpsilon +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName, + const word& type +) +: + kEpsilon<BasicTurbulenceModel> + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName, + type + ), + + gasTurbulencePtr_(NULL), + + alphaInversion_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaInversion", + this->coeffDict_, + 0.3 + ) + ), + + Cp_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cp", + this->coeffDict_, + 0.25 + ) + ), + + Cmub_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmub", + this->coeffDict_, + 0.6 + ) + ) +{ + if (type == typeName) + { + correctNut(); + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +bool LaheyKEpsilon<BasicTurbulenceModel>::read() +{ + if (kEpsilon<BasicTurbulenceModel>::read()) + { + alphaInversion_.readIfPresent(this->coeffDict()); + Cp_.readIfPresent(this->coeffDict()); + Cmub_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +template<class BasicTurbulenceModel> +const PhaseIncompressibleTurbulenceModel +< + typename BasicTurbulenceModel::transportModel +>& +LaheyKEpsilon<BasicTurbulenceModel>::gasTurbulence() const +{ + if (!gasTurbulencePtr_) + { + const volVectorField& U = this->U_; + + const transportModel& liquid = this->transport(); + const twoPhaseSystem& fluid = liquid.fluid(); + const transportModel& gas = fluid.otherPhase(liquid); + + gasTurbulencePtr_ = + &U.db() + .lookupObject<PhaseIncompressibleTurbulenceModel<transportModel> > + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + gas.name() + ) + ); + } + + return *gasTurbulencePtr_; +} + + +template<class BasicTurbulenceModel> +void LaheyKEpsilon<BasicTurbulenceModel>::correctNut() +{ + const PhaseIncompressibleTurbulenceModel<transportModel>& gasTurbulence = + this->gasTurbulence(); + + this->nut_ = + this->Cmu_*sqr(this->k_)/this->epsilon_ + + Cmub_*gasTurbulence.transport().d()*gasTurbulence.alpha() + *(mag(this->U_ - gasTurbulence.U())); + + this->nut_.correctBoundaryConditions(); +} + + +template<class BasicTurbulenceModel> +tmp<volScalarField> LaheyKEpsilon<BasicTurbulenceModel>::bubbleG() const +{ + const PhaseIncompressibleTurbulenceModel<transportModel>& gasTurbulence = + this->gasTurbulence(); + + const transportModel& liquid = this->transport(); + const twoPhaseSystem& fluid = liquid.fluid(); + const transportModel& gas = fluid.otherPhase(liquid); + + volScalarField magUr(mag(this->U_ - gasTurbulence.U())); + + tmp<volScalarField> bubbleG + ( + Cp_ + *( + pow3(magUr) + + pow(fluid.drag(gas).K(magUr)*gas.d()/liquid.rho(), 3.0/4.0) + *pow(magUr, 9.0/4.0) + ) + *gas + /gas.d() + ); + + return bubbleG; +} + + +template<class BasicTurbulenceModel> +tmp<volScalarField> +LaheyKEpsilon<BasicTurbulenceModel>::phaseTransferCoeff() const +{ + const volVectorField& U = this->U_; + const alphaField& alpha = this->alpha_; + const rhoField& rho = this->rho_; + + const turbulenceModel& gasTurbulence = this->gasTurbulence(); + + return + ( + max(alphaInversion_ - alpha, 0.0) + *rho + *min(gasTurbulence.epsilon()/gasTurbulence.k(), 1.0/U.time().deltaT()) + ); +} + + +template<class BasicTurbulenceModel> +tmp<fvScalarMatrix> LaheyKEpsilon<BasicTurbulenceModel>::kSource() const +{ + const alphaField& alpha = this->alpha_; + const rhoField& rho = this->rho_; + + const PhaseIncompressibleTurbulenceModel<transportModel>& gasTurbulence = + this->gasTurbulence(); + + const volScalarField phaseTransferCoeff(this->phaseTransferCoeff()); + + return + alpha*rho*bubbleG() + + phaseTransferCoeff*gasTurbulence.k() + - fvm::Sp(phaseTransferCoeff, this->k_); +} + + +template<class BasicTurbulenceModel> +tmp<fvScalarMatrix> LaheyKEpsilon<BasicTurbulenceModel>::epsilonSource() const +{ + const alphaField& alpha = this->alpha_; + const rhoField& rho = this->rho_; + + const PhaseIncompressibleTurbulenceModel<transportModel>& gasTurbulence = + this->gasTurbulence(); + + const volScalarField phaseTransferCoeff(this->phaseTransferCoeff()); + + return + alpha*rho*this->C2_*this->epsilon_*bubbleG()/this->k_ + + phaseTransferCoeff*gasTurbulence.epsilon() + - fvm::Sp(phaseTransferCoeff, this->epsilon_); +} + + +template<class BasicTurbulenceModel> +void LaheyKEpsilon<BasicTurbulenceModel>::correct() +{ + kEpsilon<BasicTurbulenceModel>::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.H b/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.H new file mode 100644 index 0000000000000000000000000000000000000000..8766fe454f610901bff9fe86d57f5d6b9981abca --- /dev/null +++ b/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.H @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::RASModels::LaheyKEpsilon + +Group + grpRASTurbulence + +Description + +SourceFiles + LaheyKEpsilon.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LaheyKEpsilon_H +#define LaheyKEpsilon_H + +#include "kEpsilon.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class LaheyKEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasicTurbulenceModel> +class LaheyKEpsilon +: + public kEpsilon<BasicTurbulenceModel> +{ + // Private data + + mutable const PhaseIncompressibleTurbulenceModel + < + typename BasicTurbulenceModel::transportModel + > *gasTurbulencePtr_; + + +protected: + + // Protected data + + // Model coefficients + + dimensionedScalar alphaInversion_; + dimensionedScalar Cp_; + dimensionedScalar Cmub_; + + + // Protected member functions + + virtual void correctNut(); + tmp<volScalarField> bubbleG() const; + tmp<volScalarField> phaseTransferCoeff() const; + virtual tmp<fvScalarMatrix> kSource() const; + virtual tmp<fvScalarMatrix> epsilonSource() const; + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + //- Runtime type information + TypeName("LaheyKEpsilon"); + + + // Constructors + + //- Construct from components + LaheyKEpsilon + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName, + const word& type = typeName + ); + + + //- Destructor + virtual ~LaheyKEpsilon() + {} + + + // Member Functions + + //- Return the turbulence model for the gas phase + const PhaseIncompressibleTurbulenceModel<transportModel>& + gasTurbulence() const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read RASProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "LaheyKEpsilon.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C b/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C new file mode 100644 index 0000000000000000000000000000000000000000..a237a8998ce6f0bf56833dc298dfb1a1f806f807 --- /dev/null +++ b/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C @@ -0,0 +1,280 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "continuousGasKEpsilon.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +continuousGasKEpsilon<BasicTurbulenceModel>::continuousGasKEpsilon +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName, + const word& type +) +: + kEpsilon<BasicTurbulenceModel> + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName, + type + ), + + liquidTurbulencePtr_(NULL), + + nutEff_ + ( + IOobject + ( + IOobject::groupName("nutEff", U.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + this->nut_ + ), + + alphaInversion_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "alphaInversion", + this->coeffDict_, + 0.7 + ) + ) +{ + if (type == typeName) + { + kEpsilon<BasicTurbulenceModel>::correctNut(); + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +bool continuousGasKEpsilon<BasicTurbulenceModel>::read() +{ + if (kEpsilon<BasicTurbulenceModel>::read()) + { + alphaInversion_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +template<class BasicTurbulenceModel> +void continuousGasKEpsilon<BasicTurbulenceModel>::correctNut() +{ + kEpsilon<BasicTurbulenceModel>::correctNut(); + + const turbulenceModel& liquidTurbulence = this->liquidTurbulence(); + const transportModel& gas = this->transport(); + const twoPhaseSystem& fluid = gas.fluid(); + const transportModel& liquid = fluid.otherPhase(gas); + + volScalarField thetal(liquidTurbulence.k()/liquidTurbulence.epsilon()); + volScalarField thetag((1.0/(18*liquid.nu()))*sqr(gas.d())); + volScalarField expThetar(exp(min(thetal/thetag, 50.0))); + volScalarField omega(sqr(expThetar - 1)/(sqr(expThetar) - 1)); + + nutEff_ = omega*liquidTurbulence.nut(); +} + + +template<class BasicTurbulenceModel> +const turbulenceModel& +continuousGasKEpsilon<BasicTurbulenceModel>::liquidTurbulence() const +{ + if (!liquidTurbulencePtr_) + { + const volVectorField& U = this->U_; + + const transportModel& gas = this->transport(); + const twoPhaseSystem& fluid = gas.fluid(); + const transportModel& liquid = fluid.otherPhase(gas); + + liquidTurbulencePtr_ = + &U.db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + liquid.name() + ) + ); + } + + return *liquidTurbulencePtr_; +} + + +template<class BasicTurbulenceModel> +tmp<Foam::volScalarField> +continuousGasKEpsilon<BasicTurbulenceModel>::nuEff() const +{ + volScalarField blend + ( + max(min((this->alpha_ - 0.5)/(alphaInversion_ - 0.5), 1.0), 0.0) + ); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject::groupName("nuEff", this->U_.group()), + blend*this->nut_ + + (1.0 - blend)*rhoEff()*nutEff_/this->transport().rho() + + this->nu() + ) + ); +} + + +template<class BasicTurbulenceModel> +tmp<Foam::volScalarField> +continuousGasKEpsilon<BasicTurbulenceModel>::rhoEff() const +{ + const transportModel& gas = this->transport(); + const twoPhaseSystem& fluid = gas.fluid(); + const transportModel& liquid = fluid.otherPhase(gas); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject::groupName("rhoEff", this->U_.group()), + gas.rho() + (fluid.Cvm() + 3.0/20.0)*liquid.rho() + ) + ); +} + + +template<class BasicTurbulenceModel> +tmp<volScalarField> +continuousGasKEpsilon<BasicTurbulenceModel>::phaseTransferCoeff() const +{ + const volVectorField& U = this->U_; + const alphaField& alpha = this->alpha_; + const rhoField& rho = this->rho_; + + const turbulenceModel& liquidTurbulence = this->liquidTurbulence(); + + return + ( + max(alphaInversion_ - alpha, 0.0) + *rho + *min + ( + liquidTurbulence.epsilon()/liquidTurbulence.k(), + 1.0/U.time().deltaT() + ) + ); +} + + +template<class BasicTurbulenceModel> +tmp<fvScalarMatrix> +continuousGasKEpsilon<BasicTurbulenceModel>::kSource() const +{ + const turbulenceModel& liquidTurbulence = this->liquidTurbulence(); + const volScalarField phaseTransferCoeff(this->phaseTransferCoeff()); + + return + phaseTransferCoeff*liquidTurbulence.k() + - fvm::Sp(phaseTransferCoeff, this->k_); +} + + +template<class BasicTurbulenceModel> +tmp<fvScalarMatrix> +continuousGasKEpsilon<BasicTurbulenceModel>::epsilonSource() const +{ + const turbulenceModel& liquidTurbulence = this->liquidTurbulence(); + const volScalarField phaseTransferCoeff(this->phaseTransferCoeff()); + + return + phaseTransferCoeff*liquidTurbulence.epsilon() + - fvm::Sp(phaseTransferCoeff, this->epsilon_); +} + + +template<class BasicTurbulenceModel> +tmp<volSymmTensorField> +continuousGasKEpsilon<BasicTurbulenceModel>::R() const +{ + tmp<volScalarField> tk(this->k()); + + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("R", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*tk() - (nutEff_)*dev(twoSymm(fvc::grad(this->U_))), + tk().boundaryField().types() + ) + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.H b/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.H new file mode 100644 index 0000000000000000000000000000000000000000..ecb9486339de7785221c069e4948bb12d4db46af --- /dev/null +++ b/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.H @@ -0,0 +1,148 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::RASModels::continuousGasKEpsilon + +Group + grpRASTurbulence + +Description + +SourceFiles + continuousGasKEpsilon.C + +\*---------------------------------------------------------------------------*/ + +#ifndef continuousGasKEpsilon_H +#define continuousGasKEpsilon_H + +#include "kEpsilon.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class continuousGasKEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasicTurbulenceModel> +class continuousGasKEpsilon +: + public kEpsilon<BasicTurbulenceModel> +{ + // Private data + + mutable const turbulenceModel *liquidTurbulencePtr_; + + volScalarField nutEff_; + + +protected: + + // Protected data + + // Model coefficients + + dimensionedScalar alphaInversion_; + + + // Protected member functions + + virtual void correctNut(); + tmp<volScalarField> phaseTransferCoeff() const; + virtual tmp<fvScalarMatrix> kSource() const; + virtual tmp<fvScalarMatrix> epsilonSource() const; + + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + //- Runtime type information + TypeName("continuousGasKEpsilon"); + + + // Constructors + + //- Construct from components + continuousGasKEpsilon + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName, + const word& type = typeName + ); + + + //- Destructor + virtual ~continuousGasKEpsilon() + {} + + + // Member Functions + + //- Return the turbulence model for the liquid phase + const turbulenceModel& liquidTurbulence() const; + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const; + + //- Return the effective density for the stress + virtual tmp<volScalarField> rhoEff() const; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Read RASProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "continuousGasKEpsilon.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/Make/files b/src/TurbulenceModels/turbulenceModel/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..b1b166316cb4f3bcf698df3c17bb771c6e27a1bc --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/Make/files @@ -0,0 +1,49 @@ +turbulenceModel.C + +derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C + +/* Wall functions */ +wallFunctions = RAS/derivedFvPatchFields/wallFunctions + +nutWallFunctions = $(wallFunctions)/nutWallFunctions +$(nutWallFunctions)/nutWallFunction/nutWallFunctionFvPatchScalarField.C + +$(nutWallFunctions)/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C + +$(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +$(nutWallFunctions)/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C + +epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions +$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +$(epsilonWallFunctions)/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C + +omegaWallFunctions = $(wallFunctions)/omegaWallFunctions +$(omegaWallFunctions)/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C + +kqRWallFunctions = $(wallFunctions)/kqRWallFunctions +$(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C +$(kqRWallFunctions)/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C + +/* +v2WallFunctions = $(wallFunctions)/v2WallFunctions +$(v2WallFunctions)/v2WallFunction/v2WallFunctionFvPatchScalarField.C + +fWallFunctions = $(wallFunctions)/fWallFunctions +$(fWallFunctions)/fWallFunction/fWallFunctionFvPatchScalarField.C +*/ + +/* Patch fields */ +RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C + +/* backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C */ + +LIB = $(FOAM_LIBBIN)/libturbulenceModels diff --git a/src/TurbulenceModels/turbulenceModel/Make/options b/src/TurbulenceModels/turbulenceModel/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..a3ae8da833177387e9eecf75b5e2675fc7b481f5 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/TurbulenceModels/turbulenceModel/RAS/RASModel/RASModel.C b/src/TurbulenceModels/turbulenceModel/RAS/RASModel/RASModel.C new file mode 100644 index 0000000000000000000000000000000000000000..44a46a97bbfa7b8fc9cbbc2c6e301e70634d6302 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/RASModel/RASModel.C @@ -0,0 +1,184 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "RASModel.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template<class BasicTurbulenceModel> +void Foam::RASModel<BasicTurbulenceModel>::printCoeffs(const word& type) +{ + if (printCoeffs_) + { + Info<< type << "Coeffs" << coeffDict_ << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +Foam::RASModel<BasicTurbulenceModel>::RASModel +( + const word& type, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + BasicTurbulenceModel + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ), + + RASDict_(this->subOrEmptyDict("RAS")), + turbulence_(RASDict_.lookup("turbulence")), + printCoeffs_(RASDict_.lookupOrDefault<Switch>("printCoeffs", false)), + coeffDict_(RASDict_.subOrEmptyDict(type + "Coeffs")), + + kMin_("kMin", sqr(dimVelocity), SMALL), + epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL), + omegaMin_("omegaMin", dimless/dimTime, SMALL) +{ + kMin_.readIfPresent(RASDict_); + epsilonMin_.readIfPresent(RASDict_); + omegaMin_.readIfPresent(RASDict_); + + // Force the construction of the mesh deltaCoeffs which may be needed + // for the construction of the derived models and BCs + this->mesh_.deltaCoeffs(); +} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +Foam::autoPtr<Foam::RASModel<BasicTurbulenceModel> > +Foam::RASModel<BasicTurbulenceModel>::New +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +{ + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary + ( + IOobject + ( + IOobject::groupName(propertiesName, U.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ).subDict("RAS").lookup("RASModel") + ); + + Info<< "Selecting RAS turbulence model " << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "RASModel::New" + "(" + "const volScalarField&, " + "const volVectorField&, " + "const surfaceScalarField&, " + "transportModel&, " + "const word&" + ")" + ) << "Unknown RASModel type " + << modelType << nl << nl + << "Valid RASModel types:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<RASModel> + ( + cstrIter()(alpha, rho, U, alphaPhi, phi, transport, propertiesName) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +void Foam::RASModel<BasicTurbulenceModel>::correct() +{ + BasicTurbulenceModel::correct(); +} + + +template<class BasicTurbulenceModel> +bool Foam::RASModel<BasicTurbulenceModel>::read() +{ + if (turbulenceModel::read()) + { + RASDict_ <<= this->subDict("RAS"); + RASDict_.lookup("turbulence") >> turbulence_; + + if (const dictionary* dictPtr = RASDict_.subDictPtr(type() + "Coeffs")) + { + coeffDict_ <<= *dictPtr; + } + + kMin_.readIfPresent(RASDict_); + epsilonMin_.readIfPresent(RASDict_); + omegaMin_.readIfPresent(RASDict_); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/RASModel/RASModel.H b/src/TurbulenceModels/turbulenceModel/RAS/RASModel/RASModel.H new file mode 100644 index 0000000000000000000000000000000000000000..61aefd784fc7fbcb9b122d3813c70400d1306807 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/RASModel/RASModel.H @@ -0,0 +1,267 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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/>. + +Namespace + Foam::RASModels + +Description + Namespace for RAS turbulence models. + +Class + Foam::RASModel + +Description + Templated abstract base class for RAS turbulence models + +SourceFiles + RASModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RASModel_H +#define RASModel_H + +#include "TurbulenceModel.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "fvm.H" +#include "fvc.H" +#include "fvMatrices.H" +#include "IOdictionary.H" +#include "Switch.H" +#include "bound.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class RASModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasicTurbulenceModel> +class RASModel +: + public BasicTurbulenceModel +{ + +protected: + + // Protected data + + //- RAS coefficients dictionary + dictionary RASDict_; + + //- Turbulence on/off flag + Switch turbulence_; + + //- Flag to print the model coeffs at run-time + Switch printCoeffs_; + + //- Model coefficients dictionary + dictionary coeffDict_; + + //- Lower limit of k + dimensionedScalar kMin_; + + //- Lower limit of epsilon + dimensionedScalar epsilonMin_; + + //- Lower limit for omega + dimensionedScalar omegaMin_; + + + // Protected Member Functions + + //- Print model coefficients + virtual void printCoeffs(const word& type); + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + RASModel(const RASModel&); + + //- Disallow default bitwise assignment + void operator=(const RASModel&); + + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + //- Runtime type information + TypeName("RAS"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + RASModel, + dictionary, + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ), + (alpha, rho, U, alphaPhi, phi, transport, propertiesName) + ); + + + // Constructors + + //- Construct from components + RASModel + ( + const word& type, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected RAS model + static autoPtr<RASModel> New + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~RASModel() + {} + + + // Member Functions + + // Access + + //- Return the lower allowable limit for k (default: SMALL) + const dimensionedScalar& kMin() const + { + return kMin_; + } + + //- Return the lower allowable limit for epsilon (default: SMALL) + const dimensionedScalar& epsilonMin() const + { + return epsilonMin_; + } + + //- Return the lower allowable limit for omega (default: SMALL) + const dimensionedScalar& omegaMin() const + { + return omegaMin_; + } + + //- Allow kMin to be changed + dimensionedScalar& kMin() + { + return kMin_; + } + + //- Allow epsilonMin to be changed + dimensionedScalar& epsilonMin() + { + return epsilonMin_; + } + + //- Allow omegaMin to be changed + dimensionedScalar& omegaMin() + { + return omegaMin_; + } + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const + { + return coeffDict_; + } + + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject::groupName("nuEff", this->U_.group()), + this->nut() + this->nu() + ) + ); + } + + //- Return the effective viscosity on patch + virtual tmp<scalarField> nuEff(const label patchi) const + { + return this->nut(patchi) + this->nu(patchi); + } + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Read RASProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "RASModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..d621d8884506bf9dfd4d8a54ca15e4bfe3d9d837 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "atmBoundaryLayerInletEpsilonFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +atmBoundaryLayerInletEpsilonFvPatchScalarField:: +atmBoundaryLayerInletEpsilonFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + z_(vector::zero), + kappa_(0.41), + Uref_(0), + Href_(0), + z0_(0), + zGround_(0), + Ustar_(0) +{} + + +atmBoundaryLayerInletEpsilonFvPatchScalarField:: +atmBoundaryLayerInletEpsilonFvPatchScalarField +( + const atmBoundaryLayerInletEpsilonFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + z_(ptf.z_), + kappa_(ptf.kappa_), + Uref_(ptf.Uref_), + Href_(ptf.Href_), + z0_(ptf.z0_, mapper), + zGround_(ptf.zGround_, mapper), + Ustar_(ptf.Ustar_, mapper) +{} + + +atmBoundaryLayerInletEpsilonFvPatchScalarField:: +atmBoundaryLayerInletEpsilonFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF), + z_(dict.lookup("z")), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + Uref_(readScalar(dict.lookup("Uref"))), + Href_(readScalar(dict.lookup("Href"))), + z0_("z0", dict, p.size()), + zGround_("zGround", dict, p.size()), + Ustar_(p.size()) +{ + if (mag(z_) < SMALL) + { + FatalErrorIn + ( + "atmBoundaryLayerInletEpsilonFvPatchScalarField" + "(" + "const fvPatch&, " + "const DimensionedField<scalar, volMesh>&, " + "const dictionary&" + ")" + ) + << "magnitude of z vector must be greater than zero" + << abort(FatalError); + } + + forAll (Ustar_, i) + { + Ustar_[i] = kappa_*Uref_/(log((Href_ + z0_[i])/max(z0_[i] , 0.001))); + } + + z_ /= mag(z_); + + const vectorField& c = patch().Cf(); + scalarField::operator=(pow3(Ustar_)/(kappa_*((c & z_) - zGround_ + z0_))); +} + + +atmBoundaryLayerInletEpsilonFvPatchScalarField:: +atmBoundaryLayerInletEpsilonFvPatchScalarField +( + const atmBoundaryLayerInletEpsilonFvPatchScalarField& blpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(blpsf, iF), + z_(blpsf.z_), + kappa_(blpsf.kappa_), + Uref_(blpsf.Uref_), + Href_(blpsf.Href_), + z0_(blpsf.z0_), + zGround_(blpsf.zGround_), + Ustar_(blpsf.Ustar_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void atmBoundaryLayerInletEpsilonFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchScalarField::autoMap(m); + z0_.autoMap(m); + zGround_.autoMap(m); + Ustar_.autoMap(m); +} + + +void atmBoundaryLayerInletEpsilonFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + + const atmBoundaryLayerInletEpsilonFvPatchScalarField& blptf = + refCast<const atmBoundaryLayerInletEpsilonFvPatchScalarField>(ptf); + + z0_.rmap(blptf.z0_, addr); + zGround_.rmap(blptf.zGround_, addr); + Ustar_.rmap(blptf.Ustar_, addr); +} + + +void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("z") + << z_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") + << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("Uref") + << Uref_ << token::END_STATEMENT << nl; + os.writeKeyword("Href") + << Href_ << token::END_STATEMENT << nl; + z0_.writeEntry("z0", os); + zGround_.writeEntry("zGround", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + atmBoundaryLayerInletEpsilonFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..f18ce28dba99cd9947a1124af7ed8a66168988ee --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.H @@ -0,0 +1,249 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::atmBoundaryLayerInletEpsilonFvPatchScalarField + +Group + grpRASBoundaryConditions grpInletBoundaryConditions + +Description + This boundary condition specifies an inlet value for the turbulence + dissipation, \f$\epsilon\f$ (\c epsilon), appropriate for atmospheric + boundary layers (ABL), and designed to be used in conjunction with the + \c ABLInletVelocity inlet velocity boundary condition. + + \f[ + \epsilon = \frac{(U^*)^3}{K(z - z_g + z_0)} + \f] + + where + \vartable + U^* | frictional velocity + K | Karman's constant + z | vertical co-ordinate [m] + z_0 | surface roughness length [m] + z_g | minimum vlaue in z direction [m] + \endvartable + + and: + + \f[ + U^* = K \frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)} + \f] + + where: + \vartable + U_{ref} | reference velocity at \f$Z_{ref}\f$ [m/s] + Z_{ref} | reference height [m] + \endvartable + + \heading Patch usage + + \table + Property | Description | Required | Default value + z | vertical co-ordinate [m] | yes | + kappa | Karman's constanat | no | 0.41 + Uref | reference velocity [m/s] | yes | + Href | reference height [m] | yes | + z0 | surface roughness length [m] | yes | + zGround | minimum z co-ordinate [m] | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type atmBoundaryLayerInletEpsilon; + z 1.0; + kappa 0.41; + Uref 1.0; + Href 0.0; + z0 uniform 0.0; + zGround uniform 0.0; + } + \endverbatim + + Reference: + D.M. Hargreaves and N.G. Wright, "On the use of the k-epsilon model + in commercial CFD software to model the neutral atmospheric boundary + layer", Journal of Wind Engineering and Industrial Aerodynamics + 95(2007), pp 355-369. + +SourceFiles + atmBoundaryLayerInletEpsilonFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef atmBoundaryLayerInletEpsilonFvPatchScalarField_H +#define atmBoundaryLayerInletEpsilonFvPatchScalarField_H + +#include "fvPatchFields.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class atmBoundaryLayerInletEpsilonFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class atmBoundaryLayerInletEpsilonFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Direction of the z-coordinate + vector z_; + + //- Von Karman constant + const scalar kappa_; + + //- Reference velocity + const scalar Uref_; + + //- Reference height + const scalar Href_; + + //- Surface roughness length + scalarField z0_; + + //- Minimum co-ordinate value in z direction + scalarField zGround_; + + //- Frictional velocity + scalarField Ustar_; + + +public: + + //- Runtime type information + TypeName("atmBoundaryLayerInletEpsilon"); + + + // Constructors + + //- Construct from patch and internal field + atmBoundaryLayerInletEpsilonFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + atmBoundaryLayerInletEpsilonFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // atmBoundaryLayerInletEpsilonFvPatchScalarField onto a new patch + atmBoundaryLayerInletEpsilonFvPatchScalarField + ( + const atmBoundaryLayerInletEpsilonFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new atmBoundaryLayerInletEpsilonFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + atmBoundaryLayerInletEpsilonFvPatchScalarField + ( + const atmBoundaryLayerInletEpsilonFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new atmBoundaryLayerInletEpsilonFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return max value + const scalarField& Ustar() const + { + return Ustar_; + } + + //- Return z direction + const vector& z() const + { + return z_; + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C new file mode 100644 index 0000000000000000000000000000000000000000..0966e506076e3806813d2c7a286c276b3c8d339b --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -0,0 +1,223 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "atmBoundaryLayerInletVelocityFvPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +atmBoundaryLayerInletVelocityFvPatchVectorField:: +atmBoundaryLayerInletVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchVectorField(p, iF), + Ustar_(0), + n_(pTraits<vector>::zero), + z_(pTraits<vector>::zero), + z0_(0), + kappa_(0.41), + Uref_(0), + Href_(0), + zGround_(0) +{} + + +atmBoundaryLayerInletVelocityFvPatchVectorField:: +atmBoundaryLayerInletVelocityFvPatchVectorField +( + const atmBoundaryLayerInletVelocityFvPatchVectorField& ptf, + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchVectorField(ptf, p, iF, mapper), + Ustar_(ptf.Ustar_, mapper), + n_(ptf.n_), + z_(ptf.z_), + z0_(ptf.z0_, mapper), + kappa_(ptf.kappa_), + Uref_(ptf.Uref_), + Href_(ptf.Href_), + zGround_(ptf.zGround_, mapper) +{} + + +atmBoundaryLayerInletVelocityFvPatchVectorField:: +atmBoundaryLayerInletVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchVectorField(p, iF), + Ustar_(p.size()), + n_(dict.lookup("n")), + z_(dict.lookup("z")), + z0_("z0", dict, p.size()), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + Uref_(readScalar(dict.lookup("Uref"))), + Href_(readScalar(dict.lookup("Href"))), + zGround_("zGround", dict, p.size()) +{ + if (mag(n_) < SMALL || mag(z_) < SMALL) + { + FatalErrorIn + ( + "atmBoundaryLayerInletVelocityFvPatchVectorField" + "(" + "const fvPatch&, " + "const DimensionedField<vector, volMesh>&, " + "onst dictionary&" + ")" + ) + << "magnitude of n or z must be greater than zero" + << abort(FatalError); + } + + n_ /= mag(n_); + z_ /= mag(z_); + + forAll (Ustar_, i) + { + Ustar_[i] = kappa_*Uref_/(log((Href_ + z0_[i])/max(z0_[i] , 0.001))); + } + + const vectorField& c = patch().Cf(); + const scalarField coord(c & z_); + scalarField Un(coord.size()); + + forAll(coord, i) + { + if ((coord[i] - zGround_[i]) < Href_) + { + Un[i] = + (Ustar_[i]/kappa_) + * log((coord[i] - zGround_[i] + z0_[i])/max(z0_[i], 0.001)); + } + else + { + Un[i] = Uref_; + } + } + + vectorField::operator=(n_*Un); +} + + +atmBoundaryLayerInletVelocityFvPatchVectorField:: +atmBoundaryLayerInletVelocityFvPatchVectorField +( + const atmBoundaryLayerInletVelocityFvPatchVectorField& blpvf, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchVectorField(blpvf, iF), + Ustar_(blpvf.Ustar_), + n_(blpvf.n_), + z_(blpvf.z_), + z0_(blpvf.z0_), + kappa_(blpvf.kappa_), + Uref_(blpvf.Uref_), + Href_(blpvf.Href_), + zGround_(blpvf.zGround_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void atmBoundaryLayerInletVelocityFvPatchVectorField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchVectorField::autoMap(m); + z0_.autoMap(m); + zGround_.autoMap(m); + Ustar_.autoMap(m); +} + + +void atmBoundaryLayerInletVelocityFvPatchVectorField::rmap +( + const fvPatchVectorField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchVectorField::rmap(ptf, addr); + + const atmBoundaryLayerInletVelocityFvPatchVectorField& blptf = + refCast<const atmBoundaryLayerInletVelocityFvPatchVectorField>(ptf); + + z0_.rmap(blptf.z0_, addr); + zGround_.rmap(blptf.zGround_, addr); + Ustar_.rmap(blptf.Ustar_, addr); +} + + +void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const +{ + fvPatchVectorField::write(os); + z0_.writeEntry("z0", os) ; + os.writeKeyword("n") + << n_ << token::END_STATEMENT << nl; + os.writeKeyword("z") + << z_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") + << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("Uref") + << Uref_ << token::END_STATEMENT << nl; + os.writeKeyword("Href") + << Href_ << token::END_STATEMENT << nl; + zGround_.writeEntry("zGround", os) ; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchVectorField, + atmBoundaryLayerInletVelocityFvPatchVectorField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H new file mode 100644 index 0000000000000000000000000000000000000000..b2f7245ccbd78c9196d2e4df937bc0458ee76d35 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.H @@ -0,0 +1,266 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::atmBoundaryLayerInletVelocityFvPatchVectorField + +Group + grpRASBoundaryConditions grpInletBoundaryConditions + +Description + This boundary condition specifies a velocity inlet profile appropriate + for atmospheric boundary layers (ABL). The profile is derived from the + friction velocity, flow direction and the direction of the parabolic + co-ordinate \c z. + + \f[ + U = \frac{U^*}{K} ln\left(\frac{z - z_g + z_0}{z_0}\right) + \f] + + where + \vartable + U^* | frictional velocity + K | Karman's constant + z | vertical co-ordinate [m] + z_0 | surface roughness length [m] + z_g | minimum vlaue in z direction [m] + \endvartable + + and: + + \f[ + U^* = K \frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)} + \f] + + where: + \vartable + U_{ref} | reference velocity at \f$Z_{ref}\f$ [m/s] + Z_{ref} | reference height [m] + \endvartable + + Reference: + D.M. Hargreaves and N.G. Wright, "On the use of the k-epsilon model + in commercial CFD software to model the neutral atmospheric boundary + layer", Journal of Wind Engineering and Industrial Aerodynamics + 95(2007), pp 355-369. + + \heading Patch usage + + \table + Property | Description | Required | Default value + n | flow direction | yes | + z | vertical co-ordinate [m] | yes | + kappa | Karman's constanat | no | 0.41 + Uref | reference velocity [m/s] | yes | + Href | reference height [m] | yes | + z0 | surface roughness length [m] | yes | + zGround | minimum z co-ordinate [m] | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type atmBoundaryLayerInletVelocity; + n (0 1 0); + z 1.0; + kappa 0.41; + Uref 1.0; + Href 0.0; + z0 uniform 0.0; + zGround uniform 0.0; + } + \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 + +\*---------------------------------------------------------------------------*/ + +#ifndef atmBoundaryLayerInletVelocityFvPatchVectorField_H +#define atmBoundaryLayerInletVelocityFvPatchVectorField_H + +#include "fvPatchFields.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class atmBoundaryLayerInletVelocityFvPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class atmBoundaryLayerInletVelocityFvPatchVectorField +: + public fixedValueFvPatchVectorField +{ + // Private data + + //- Frictional velocity + scalarField Ustar_; + + //- Flow direction + vector n_; + + //- Direction of the z-coordinate + vector z_; + + //- Surface roughness lenght + scalarField z0_; + + //- Von Karman constant + const scalar kappa_; + + //- Reference velocity + const scalar Uref_; + + //- Reference hight + const scalar Href_; + + //- Minimum corrdinate value in z direction + scalarField zGround_; + + +public: + + //- Runtime type information + TypeName("atmBoundaryLayerInletVelocity"); + + + // Constructors + + //- Construct from patch and internal field + atmBoundaryLayerInletVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + atmBoundaryLayerInletVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch + atmBoundaryLayerInletVelocityFvPatchVectorField + ( + const atmBoundaryLayerInletVelocityFvPatchVectorField&, + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct and return a clone + virtual tmp<fvPatchVectorField> clone() const + { + return tmp<fvPatchVectorField> + ( + new atmBoundaryLayerInletVelocityFvPatchVectorField(*this) + ); + } + + //- Construct as copy setting internal field reference + atmBoundaryLayerInletVelocityFvPatchVectorField + ( + const atmBoundaryLayerInletVelocityFvPatchVectorField&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchVectorField> clone + ( + const DimensionedField<vector, volMesh>& iF + ) const + { + return tmp<fvPatchVectorField> + ( + new atmBoundaryLayerInletVelocityFvPatchVectorField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return Ustar + const scalarField& Ustar() const + { + return Ustar_; + } + + //- Return flow direction + const vector& n() const + { + return n_; + } + + //- Return z direction + const vector& z() const + { + return z_; + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchVectorField&, + const labelList& + ); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/doc/incompressibleRASBoundaryConditionsDoc.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/doc/incompressibleRASBoundaryConditionsDoc.H new file mode 100644 index 0000000000000000000000000000000000000000..3cdbb45d35d20c3059902a1d958993dd7d27eb4d --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/doc/incompressibleRASBoundaryConditionsDoc.H @@ -0,0 +1,39 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012-2013 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/>. + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +\defgroup grpRASBoundaryConditions RAS boundary conditions +@{ + \ingroup grpRASTurbulence + This group contains RAS turbulence model boundary conditions +@} + +\defgroup grpWallFunctions RAS wall functions +@{ + \ingroup grpRASBoundaryConditions + This group contains RAS turbulence model wall functions +@} + + +\*---------------------------------------------------------------------------*/ diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..4714ec09eda84542630b1054d79f82bff6eef07d --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -0,0 +1,186 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + inletOutletFvPatchScalarField(p, iF), + mixingLength_(0.0), + phiName_("phi"), + kName_("k") +{ + this->refValue() = 0.0; + this->refGrad() = 0.0; + this->valueFraction() = 0.0; +} + + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + inletOutletFvPatchScalarField(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_), + phiName_(ptf.phiName_), + kName_(ptf.kName_) +{} + + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + inletOutletFvPatchScalarField(p, iF), + mixingLength_(readScalar(dict.lookup("mixingLength"))), + phiName_(dict.lookupOrDefault<word>("phi", "phi")), + kName_(dict.lookupOrDefault<word>("k", "k")) +{ + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); + + this->refValue() = 0.0; + this->refGrad() = 0.0; + this->valueFraction() = 0.0; +} + + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf +) +: + inletOutletFvPatchScalarField(ptf), + mixingLength_(ptf.mixingLength_), + phiName_(ptf.phiName_), + kName_(ptf.kName_) +{} + + +turbulentMixingLengthDissipationRateInletFvPatchScalarField:: +turbulentMixingLengthDissipationRateInletFvPatchScalarField +( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + inletOutletFvPatchScalarField(ptf, iF), + mixingLength_(ptf.mixingLength_), + phiName_(ptf.phiName_), + kName_(ptf.kName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + const scalar Cmu = + turbulence.coeffDict().lookupOrDefault<scalar>("Cmu", 0.09); + + const scalar Cmu75 = pow(Cmu, 0.75); + + const fvPatchScalarField& kp = + patch().lookupPatchField<volScalarField, scalar>(kName_); + + const fvsPatchScalarField& phip = + patch().lookupPatchField<surfaceScalarField, scalar>(phiName_); + + this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_; + this->valueFraction() = 1.0 - pos(phip); + + inletOutletFvPatchScalarField::updateCoeffs(); +} + + +void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthDissipationRateInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..d9b5e481c06fc9ea9f71a92e40be20dd52fde638 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -0,0 +1,202 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::turbulentMixingLengthDissipationRateInletFvPatchScalarField + +Group + grpRASBoundaryConditions grpInletBoundaryConditions + +Description + This boundary condition provides a turbulence dissipation, \f$\epsilon\f$ + (epsilon) inlet condition based on a specified mixing length. The patch + values are calculated using: + + \f[ + \epsilon_p = \frac{C_{\mu}^{0.75} k^{1.5}}{L} + \f] + + where + + \vartable + \epsilon_p | patch epsilon values + C_{\mu} | Model coefficient, set to 0.09 + k | turbulence kinetic energy + L | length scale + \endvartable + + \heading Patch usage + + \table + Property | Description | Required | Default value + mixingLength | Length scale [m] | yes | + phi | flux field name | no | phi + k | turbulence kinetic energy field name | no | k + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.005; + value uniform 200; // placeholder + } + \endverbatim + +Note + In the event of reverse flow, a zero-gradient condition is applied + +SeeAlso + Foam::inletOutletFvPatchField + +SourceFiles + turbulentMixingLengthDissipationRateInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentMixingLengthDissipationRateInlet_H +#define turbulentMixingLengthDissipationRateInlet_H + +#include "inletOutletFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthDissipationRateInletFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthDissipationRateInletFvPatchScalarField +: + public inletOutletFvPatchScalarField +{ + // Private data + + //- turbulent length scale + scalar mixingLength_; + + //- Name of the flux field + word phiName_; + + //- Name of the turbulent kinetic energy field + word kName_; + + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthDissipationRateInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthDissipationRateInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + const turbulentMixingLengthDissipationRateInletFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthDissipationRateInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..0ce1cd676331e75b452929b5e1fca0181283cf5c --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -0,0 +1,182 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "turbulentMixingLengthFrequencyInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + inletOutletFvPatchScalarField(p, iF), + mixingLength_(0.0), + phiName_("undefined-phi"), + kName_("undefined-k") +{ + this->refValue() = 0.0; + this->refGrad() = 0.0; + this->valueFraction() = 0.0; +} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + inletOutletFvPatchScalarField(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_), + phiName_(ptf.phiName_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + inletOutletFvPatchScalarField(p, iF), + mixingLength_(readScalar(dict.lookup("mixingLength"))), + phiName_(dict.lookupOrDefault<word>("phi", "phi")), + kName_(dict.lookupOrDefault<word>("k", "k")) +{ + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); + + this->refValue() = 0.0; + this->refGrad() = 0.0; + this->valueFraction() = 0.0; +} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf +) +: + inletOutletFvPatchScalarField(ptf), + mixingLength_(ptf.mixingLength_), + phiName_(ptf.phiName_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + inletOutletFvPatchScalarField(ptf, iF), + mixingLength_(ptf.mixingLength_), + phiName_(ptf.phiName_), + kName_(ptf.kName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + const scalar Cmu = + turbulence.coeffDict().lookupOrDefault<scalar>("Cmu", 0.09); + + const scalar Cmu25 = pow(Cmu, 0.25); + + const fvPatchScalarField& kp = + patch().lookupPatchField<volScalarField, scalar>(kName_); + + const fvsPatchScalarField& phip = + patch().lookupPatchField<surfaceScalarField, scalar>(phiName_); + + this->refValue() = sqrt(kp)/(Cmu25*mixingLength_); + this->valueFraction() = 1.0 - pos(phip); + + inletOutletFvPatchScalarField::updateCoeffs(); +} + + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthFrequencyInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..f16d5a4648c6d9079f5f5f376f2c6e0f05fe1982 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -0,0 +1,203 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::turbulentMixingLengthFrequencyInletFvPatchScalarField + +Group + grpRASBoundaryConditions grpInletBoundaryConditions + +Description + This boundary condition provides a turbulence specific dissipation, + \f$\omega\f$ (omega) inlet condition based on a specified mixing length. + The patch values are calculated using: + + \f[ + \omega_p = \frac{k^{0.5}}{C_{\mu}^{0.25} L} + \f] + + where + + \vartable + \omega_p | patch omega values + C_{\mu} | Model coefficient, set to 0.09 + k | turbulence kinetic energy + L | length scale + \endvartable + + \heading Patch usage + + \table + Property | Description | Required | Default value + mixingLength | Length scale [m] | yes | + phi | flux field name | no | phi + k | turbulence kinetic energy field name | no | k + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type turbulentMixingLengthFrequencyInlet; + mixingLength 0.005; + value uniform 200; // placeholder + } + \endverbatim + +Note + In the event of reverse flow, a zero-gradient condition is applied + +SeeAlso + Foam::inletOutletFvPatchField + + +SourceFiles + turbulentMixingLengthFrequencyInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentMixingLengthFrequencyInletFvPatchScalarField_H +#define turbulentMixingLengthFrequencyInletFvPatchScalarField_H + +#include "inletOutletFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthFrequencyInletFvPatchScalarField +: + public inletOutletFvPatchScalarField +{ + // Private data + + //- Turbulent length scale + scalar mixingLength_; + + //- Name of the flux field + word phiName_; + + //- Name of the turbulent kinetic energy field + word kName_; + + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthFrequencyInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthFrequencyInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..85ff9c446a6a847901f363bd58804d237d2dcf3a --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C @@ -0,0 +1,189 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012-2013 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 "epsilonLowReWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +scalar epsilonLowReWallFunctionFvPatchScalarField::yPlusLam +( + const scalar kappa, + const scalar E +) +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(max(E*ypl, 1))/kappa; + } + + return ypl; +} + + +void epsilonLowReWallFunctionFvPatchScalarField::calculate +( + const turbulenceModel& turbulence, + const List<scalar>& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& epsilon +) +{ + const label patchi = patch.index(); + + const scalarField& y = turbulence.y()[patchi]; + + const scalar Cmu25 = pow025(Cmu_); + const scalar Cmu75 = pow(Cmu_, 0.75); + + const tmp<volScalarField> tk = turbulence.k(); + const volScalarField& k = tk(); + + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const tmp<scalarField> tnutw = turbulence.nut(patchi); + const scalarField& nutw = tnutw(); + + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchi]; + + const scalarField magGradUw(mag(Uw.snGrad())); + + // Set epsilon and G + forAll(nutw, faceI) + { + label cellI = patch.faceCells()[faceI]; + + scalar yPlus = Cmu25*sqrt(k[cellI])*y[faceI]/nuw[faceI]; + + scalar w = cornerWeights[faceI]; + + if (yPlus > yPlusLam_) + { + epsilon[cellI] = w*Cmu75*pow(k[cellI], 1.5)/(kappa_*y[faceI]); + } + else + { + epsilon[cellI] = w*2.0*k[cellI]*nuw[faceI]/sqr(y[faceI]); + } + + G[cellI] = + w + *(nutw[faceI] + nuw[faceI]) + *magGradUw[faceI] + *Cmu25*sqrt(k[cellI]) + /(kappa_*y[faceI]); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +epsilonLowReWallFunctionFvPatchScalarField:: +epsilonLowReWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + epsilonWallFunctionFvPatchScalarField(p, iF), + yPlusLam_(yPlusLam(kappa_, E_)) +{} + + +epsilonLowReWallFunctionFvPatchScalarField:: +epsilonLowReWallFunctionFvPatchScalarField +( + const epsilonLowReWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + epsilonWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + yPlusLam_(ptf.yPlusLam_) +{} + + +epsilonLowReWallFunctionFvPatchScalarField:: +epsilonLowReWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + epsilonWallFunctionFvPatchScalarField(p, iF, dict), + yPlusLam_(yPlusLam(kappa_, E_)) +{} + + +epsilonLowReWallFunctionFvPatchScalarField:: +epsilonLowReWallFunctionFvPatchScalarField +( + const epsilonLowReWallFunctionFvPatchScalarField& ewfpsf +) +: + epsilonWallFunctionFvPatchScalarField(ewfpsf), + yPlusLam_(ewfpsf.yPlusLam_) +{} + + +epsilonLowReWallFunctionFvPatchScalarField:: +epsilonLowReWallFunctionFvPatchScalarField +( + const epsilonLowReWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + epsilonWallFunctionFvPatchScalarField(ewfpsf, iF), + yPlusLam_(ewfpsf.yPlusLam_) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + epsilonLowReWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..ac9f3650a2b15604119b6ba31855f805861562c2 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012-2013 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::epsilonLowReWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulence dissipation wall function + condition for low- and high-Reynolds number turbulent flow cases. + + The condition can be applied to wall boundaries, whereby it inserts near + wall epsilon values directly into the epsilon equation to act as a + constraint. + + The model operates in two modes, based on the computed laminar-to-turbulent + switch-over y+ value derived from kappa and E. + + \heading Patch usage + + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type epsilonLowReWallFunction; + } + \endverbatim + +SeeAlso + Foam::epsilonWallFunctionFvPatchScalarField + +SourceFiles + epsilonLowReWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef epsilonLowReWallFunctionFvPatchScalarField_H +#define epsilonLowReWallFunctionFvPatchScalarField_H + +#include "epsilonWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class epsilonLowReWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class epsilonLowReWallFunctionFvPatchScalarField +: + public epsilonWallFunctionFvPatchScalarField +{ + +protected: + + // Protected data + + //- Y+ at the edge of the laminar sublayer + scalar yPlusLam_; + + + // Protected Member Functions + + //- Calculate the Y+ at the edge of the laminar sublayer + scalar yPlusLam(const scalar kappa, const scalar E); + + //- Calculate the epsilon and G + virtual void calculate + ( + const turbulenceModel& turbulence, + const List<scalar>& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& epsilon + ); + + +public: + + //- Runtime type information + TypeName("epsilonLowReWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + epsilonLowReWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + epsilonLowReWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // epsilonLowReWallFunctionFvPatchScalarField + // onto a new patch + epsilonLowReWallFunctionFvPatchScalarField + ( + const epsilonLowReWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + epsilonLowReWallFunctionFvPatchScalarField + ( + const epsilonLowReWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new epsilonLowReWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + epsilonLowReWallFunctionFvPatchScalarField + ( + const epsilonLowReWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new epsilonLowReWallFunctionFvPatchScalarField(*this, iF) + ); + } + + //- Destructor + virtual ~epsilonLowReWallFunctionFvPatchScalarField() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..8cffac6db699db03a722512f6cc70969fef0cd1a --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -0,0 +1,590 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "epsilonWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "fvMatrix.H" +#include "volFields.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +void epsilonWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("epsilonWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const +{ + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; +} + + +void epsilonWallFunctionFvPatchScalarField::setMaster() +{ + if (master_ != -1) + { + return; + } + + const volScalarField& epsilon = + static_cast<const volScalarField&>(this->dimensionedInternalField()); + + const volScalarField::GeometricBoundaryField& bf = epsilon.boundaryField(); + + label master = -1; + forAll(bf, patchi) + { + if (isA<epsilonWallFunctionFvPatchScalarField>(bf[patchi])) + { + epsilonWallFunctionFvPatchScalarField& epf = epsilonPatch(patchi); + + if (master == -1) + { + master = patchi; + } + + epf.master() = master; + } + } +} + + +void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() +{ + if (initialised_) + { + return; + } + + const volScalarField& epsilon = + static_cast<const volScalarField&>(this->dimensionedInternalField()); + + const volScalarField::GeometricBoundaryField& bf = epsilon.boundaryField(); + + const fvMesh& mesh = epsilon.mesh(); + + volScalarField weights + ( + IOobject + ( + "weights", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false // do not register + ), + mesh, + dimensionedScalar("zero", dimless, 0.0) + ); + + DynamicList<label> epsilonPatches(bf.size()); + forAll(bf, patchi) + { + if (isA<epsilonWallFunctionFvPatchScalarField>(bf[patchi])) + { + epsilonPatches.append(patchi); + + const labelUList& faceCells = bf[patchi].patch().faceCells(); + forAll(faceCells, i) + { + weights[faceCells[i]]++; + } + } + } + + cornerWeights_.setSize(bf.size()); + forAll(epsilonPatches, i) + { + label patchi = epsilonPatches[i]; + const fvPatchScalarField& wf = weights.boundaryField()[patchi]; + cornerWeights_[patchi] = 1.0/wf.patchInternalField(); + } + + G_.setSize(dimensionedInternalField().size(), 0.0); + epsilon_.setSize(dimensionedInternalField().size(), 0.0); + + initialised_ = true; +} + + +epsilonWallFunctionFvPatchScalarField& +epsilonWallFunctionFvPatchScalarField::epsilonPatch(const label patchi) +{ + const volScalarField& epsilon = + static_cast<const volScalarField&>(this->dimensionedInternalField()); + + const volScalarField::GeometricBoundaryField& bf = epsilon.boundaryField(); + + const epsilonWallFunctionFvPatchScalarField& epf = + refCast<const epsilonWallFunctionFvPatchScalarField>(bf[patchi]); + + return const_cast<epsilonWallFunctionFvPatchScalarField&>(epf); +} + + +void epsilonWallFunctionFvPatchScalarField::calculateTurbulenceFields +( + const turbulenceModel& turbulence, + scalarField& G0, + scalarField& epsilon0 +) +{ + // accumulate all of the G and epsilon contributions + forAll(cornerWeights_, patchi) + { + if (!cornerWeights_[patchi].empty()) + { + epsilonWallFunctionFvPatchScalarField& epf = epsilonPatch(patchi); + + const List<scalar>& w = cornerWeights_[patchi]; + + epf.calculate(turbulence, w, epf.patch(), G0, epsilon0); + } + } + + // apply zero-gradient condition for epsilon + forAll(cornerWeights_, patchi) + { + if (!cornerWeights_[patchi].empty()) + { + epsilonWallFunctionFvPatchScalarField& epf = epsilonPatch(patchi); + + epf == scalarField(epsilon0, epf.patch().faceCells()); + } + } +} + + +void epsilonWallFunctionFvPatchScalarField::calculate +( + const turbulenceModel& turbulence, + const List<scalar>& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& epsilon +) +{ + const label patchi = patch.index(); + + const scalarField& y = turbulence.y()[patchi]; + + const scalar Cmu25 = pow025(Cmu_); + const scalar Cmu75 = pow(Cmu_, 0.75); + + const tmp<volScalarField> tk = turbulence.k(); + const volScalarField& k = tk(); + + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const tmp<scalarField> tnutw = turbulence.nut(patchi); + const scalarField& nutw = tnutw(); + + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchi]; + + const scalarField magGradUw(mag(Uw.snGrad())); + + // Set epsilon and G + forAll(nutw, facei) + { + label celli = patch.faceCells()[facei]; + + scalar w = cornerWeights[facei]; + + epsilon[celli] += w*Cmu75*pow(k[celli], 1.5)/(kappa_*y[facei]); + + G[celli] += + w + *(nutw[facei] + nuw[facei]) + *magGradUw[facei] + *Cmu25*sqrt(k[celli]) + /(kappa_*y[facei]); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + Cmu_(0.09), + kappa_(0.41), + E_(9.8), + G_(), + epsilon_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_), + G_(), + epsilon_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.8)), + G_(), + epsilon_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); + + // apply zero-gradient condition on start-up + this->operator==(patchInternalField()); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ewfpsf +) +: + fixedValueFvPatchField<scalar>(ewfpsf), + Cmu_(ewfpsf.Cmu_), + kappa_(ewfpsf.kappa_), + E_(ewfpsf.E_), + G_(), + epsilon_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField +( + const epsilonWallFunctionFvPatchScalarField& ewfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(ewfpsf, iF), + Cmu_(ewfpsf.Cmu_), + kappa_(ewfpsf.kappa_), + E_(ewfpsf.E_), + G_(), + epsilon_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +scalarField& epsilonWallFunctionFvPatchScalarField::G(bool init) +{ + if (patch().index() == master_) + { + if (init) + { + G_ = 0.0; + } + + return G_; + } + + return epsilonPatch(master_).G(); +} + + +scalarField& epsilonWallFunctionFvPatchScalarField::epsilon(bool init) +{ + if (patch().index() == master_) + { + if (init) + { + epsilon_ = 0.0; + } + + return epsilon_; + } + + return epsilonPatch(master_).epsilon(init); +} + + +void epsilonWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + setMaster(); + + if (patch().index() == master_) + { + createAveragingWeights(); + calculateTurbulenceFields(turbModel, G(true), epsilon(true)); + } + + const scalarField& G0 = this->G(); + const scalarField& epsilon0 = this->epsilon(); + + typedef DimensionedField<scalar, volMesh> FieldType; + + FieldType& G = + const_cast<FieldType&> + ( + db().lookupObject<FieldType>(turbModel.GName()) + ); + + FieldType& epsilon = const_cast<FieldType&>(dimensionedInternalField()); + + forAll(*this, facei) + { + label celli = patch().faceCells()[facei]; + + G[celli] = G0[celli]; + epsilon[celli] = epsilon0[celli]; + } + + fvPatchField<scalar>::updateCoeffs(); +} + + +void epsilonWallFunctionFvPatchScalarField::updateCoeffs +( + const scalarField& weights +) +{ + if (updated()) + { + return; + } + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + setMaster(); + + if (patch().index() == master_) + { + createAveragingWeights(); + calculateTurbulenceFields(turbModel, G(true), epsilon(true)); + } + + const scalarField& G0 = this->G(); + const scalarField& epsilon0 = this->epsilon(); + + typedef DimensionedField<scalar, volMesh> FieldType; + + FieldType& G = + const_cast<FieldType&> + ( + db().lookupObject<FieldType>(turbModel.GName()) + ); + + FieldType& epsilon = const_cast<FieldType&>(dimensionedInternalField()); + + scalarField& epsilonf = *this; + + // only set the values if the weights are < 1 - tolerance + forAll(weights, facei) + { + scalar w = weights[facei]; + + if (w < 1.0 - 1e-6) + { + label celli = patch().faceCells()[facei]; + + G[celli] = w*G[celli] + (1.0 - w)*G0[celli]; + epsilon[celli] = w*epsilon[celli] + (1.0 - w)*epsilon0[celli]; + epsilonf[facei] = epsilon[celli]; + } + } + + fvPatchField<scalar>::updateCoeffs(); +} + + +void epsilonWallFunctionFvPatchScalarField::manipulateMatrix +( + fvMatrix<scalar>& matrix +) +{ + if (manipulatedMatrix()) + { + return; + } + + matrix.setValues(patch().faceCells(), patchInternalField()); + + fvPatchField<scalar>::manipulateMatrix(matrix); +} + + +void epsilonWallFunctionFvPatchScalarField::manipulateMatrix +( + fvMatrix<scalar>& matrix, + const Field<scalar>& weights +) +{ + if (manipulatedMatrix()) + { + return; + } + + // filter weights so that we only apply the constraint where the + // weight > SMALL + DynamicList<label> constraintCells(weights.size()); + DynamicList<scalar> constraintEpsilon(weights.size()); + const labelUList& faceCells = patch().faceCells(); + + const DimensionedField<scalar, volMesh>& epsilon + = dimensionedInternalField(); + + label nConstrainedCells = 0; + + + forAll(weights, facei) + { + // only set the values if the weights are < 1 - tolerance + if (weights[facei] < (1.0 - 1e-6)) + { + nConstrainedCells++; + + label celli = faceCells[facei]; + + constraintCells.append(celli); + constraintEpsilon.append(epsilon[celli]); + } + } + + if (debug) + { + Pout<< "Patch: " << patch().name() + << ": number of constrained cells = " << nConstrainedCells + << " out of " << patch().size() + << endl; + } + + matrix.setValues + ( + constraintCells, + scalarField(constraintEpsilon.xfer()) + ); + + fvPatchField<scalar>::manipulateMatrix(matrix); +} + + +void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedValueFvPatchField<scalar>::write(os); + writeLocalEntries(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + epsilonWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..fe06b44fcba2bd0362291aec5ae9c15442a5174f --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -0,0 +1,285 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::epsilonWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulence dissipation wall function + condition for high Reynolds number, turbulent flow cases. + + The condition can be applied to wall boundaries, whereby it + - calculates \c epsilon and \c G + - inserts near wall epsilon values directly into the epsilon equation + to act as a constraint + + where + + \vartable + epsilon | turblence dissipation field + G | turblence generation field + \endvartable + + \heading Patch usage + + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type epsilonWallFunction; + } + \endverbatim + +SeeAlso + Foam::fixedInternalValueFvPatchField + +SourceFiles + epsilonWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef epsilonWallFunctionFvPatchScalarField_H +#define epsilonWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class turbulenceModel; + +/*---------------------------------------------------------------------------*\ + Class epsilonWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class epsilonWallFunctionFvPatchScalarField +: + public fixedValueFvPatchField<scalar> +{ +protected: + + // Protected data + + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + //- Local copy of turbulence G field + scalarField G_; + + //- Local copy of turbulence epsilon field + scalarField epsilon_; + + //- Initialised flag + bool initialised_; + + //- Master patch ID + label master_; + + //- List of averaging corner weights + List<List<scalar> > cornerWeights_; + + + // Protected Member Functions + + //- Check the type of the patch + virtual void checkType(); + + //- Write local wall function variables + virtual void writeLocalEntries(Ostream&) const; + + //- Set the master patch - master is responsible for updating all + // wall function patches + virtual void setMaster(); + + //- Create the averaging weights for cells which are bounded by + // multiple wall function faces + virtual void createAveragingWeights(); + + //- Helper function to return non-const access to an epsilon patch + virtual epsilonWallFunctionFvPatchScalarField& epsilonPatch + ( + const label patchi + ); + + //- Main driver to calculate the turbulence fields + virtual void calculateTurbulenceFields + ( + const turbulenceModel& turbulence, + scalarField& G0, + scalarField& epsilon0 + ); + + //- Calculate the epsilon and G + virtual void calculate + ( + const turbulenceModel& turbulence, + const List<scalar>& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& epsilon + ); + + //- Return non-const access to the master patch ID + virtual label& master() + { + return master_; + } + + +public: + + //- Runtime type information + TypeName("epsilonWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + epsilonWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + epsilonWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // epsilonWallFunctionFvPatchScalarField + // onto a new patch + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new epsilonWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + epsilonWallFunctionFvPatchScalarField + ( + const epsilonWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new epsilonWallFunctionFvPatchScalarField(*this, iF) + ); + } + + //- Destructor + virtual ~epsilonWallFunctionFvPatchScalarField() + {} + + + // Member functions + + // Access + + //- Return non-const access to the master's G field + scalarField& G(bool init = false); + + //- Return non-const access to the master's epsilon field + scalarField& epsilon(bool init = false); + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(const scalarField& weights); + + //- Manipulate matrix + virtual void manipulateMatrix(fvMatrix<scalar>& matrix); + + //- Manipulate matrix with given weights + virtual void manipulateMatrix + ( + fvMatrix<scalar>& matrix, + const scalarField& weights + ); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..0163fc5b3eb05f295148e6d3f0fde15dd5ebee59 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -0,0 +1,259 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "fWallFunctionFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "wallFvPatch.H" +#include "v2f.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void fWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("fWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +scalar fWallFunctionFvPatchScalarField::yPlusLam +( + const scalar kappa, + const scalar E +) +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(max(E*ypl, 1))/kappa; + } + + return ypl; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + Cmu_(0.09), + kappa_(0.41), + E_(9.8), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField +( + const fWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_), + yPlusLam_(ptf.yPlusLam_) +{ + checkType(); +} + + +fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.8)), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField +( + const fWallFunctionFvPatchScalarField& v2wfpsf +) +: + fixedValueFvPatchField<scalar>(v2wfpsf), + Cmu_(v2wfpsf.Cmu_), + kappa_(v2wfpsf.kappa_), + E_(v2wfpsf.E_), + yPlusLam_(v2wfpsf.yPlusLam_) +{ + checkType(); +} + + +fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField +( + const fWallFunctionFvPatchScalarField& v2wfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(v2wfpsf, iF), + Cmu_(v2wfpsf.Cmu_), + kappa_(v2wfpsf.kappa_), + E_(v2wfpsf.E_), + yPlusLam_(v2wfpsf.yPlusLam_) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void fWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const label patchi = patch().index(); + + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const v2f& v2fModel = refCast<const v2f>(turbulence); + + const scalarField& y = v2fModel.y()[patchi]; + + const tmp<volScalarField> tk = v2fModel.k(); + const volScalarField& k = tk(); + + const tmp<volScalarField> tepsilon = v2fModel.epsilon(); + const volScalarField& epsilon = tepsilon(); + + const tmp<volScalarField> tv2 = v2fModel.v2(); + const volScalarField& v2 = tv2(); + + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalar Cmu25 = pow025(Cmu_); + + scalarField& f = *this; + + // Set f wall values + forAll(f, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uTau = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = uTau*y[faceI]/nuw[faceI]; + + if (yPlus > yPlusLam_) + { + scalar N = 6.0; + scalar v2c = v2[faceCellI]; + scalar epsc = epsilon[faceCellI]; + scalar kc = k[faceCellI]; + + f[faceI] = N*v2c*epsc/(sqr(kc) + ROOTVSMALL); + f[faceI] /= sqr(uTau) + ROOTVSMALL; + } + else + { + f[faceI] = 0.0; + } + } + + fixedValueFvPatchField<scalar>::updateCoeffs(); + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void fWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes commsType +) +{ + fixedValueFvPatchField<scalar>::evaluate(commsType); +} + + +void fWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedValueFvPatchField<scalar>::write(os); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + fWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..f5222527d7c8d0617440be9d32339ab1a72b4212 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H @@ -0,0 +1,203 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + Foam::RASModels::fWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulence damping function, f, wall + function condition for low- and high Reynolds number, turbulent flow cases + + The model operates in two modes, based on the computed laminar-to-turbulent + switch-over y+ value derived from kappa and E. + + \heading Patch usage + + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fWallFunction; + } + \endverbatim + +SeeAlso + Foam::fixedValueFvPatchField + +SourceFiles + fWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef fWallFunctionFvPatchScalarField_H +#define fWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class fWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class fWallFunctionFvPatchScalarField +: + public fixedValueFvPatchField<scalar> +{ +protected: + + // Protected data + + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + //- Y+ at the edge of the laminar sublayer + scalar yPlusLam_; + + + // Protected Member Functions + + //- Check the type of the patch + virtual void checkType(); + + //- Calculate the Y+ at the edge of the laminar sublayer + scalar yPlusLam(const scalar kappa, const scalar E); + + +public: + + //- Runtime type information + TypeName("fWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + fWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + fWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given fWallFunctionFvPatchScalarField + // onto a new patch + fWallFunctionFvPatchScalarField + ( + const fWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + fWallFunctionFvPatchScalarField + ( + const fWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new fWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + fWallFunctionFvPatchScalarField + ( + const fWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new fWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Evaluate the patchField + virtual void evaluate(const Pstream::commsTypes); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..dc1a5ea7904a1aaeb5308304ad14bf9978693837 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -0,0 +1,256 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "kLowReWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void kLowReWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("kLowReWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +scalar kLowReWallFunctionFvPatchScalarField::yPlusLam +( + const scalar kappa, + const scalar E +) +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(max(E*ypl, 1))/kappa; + } + + return ypl; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + Cmu_(0.09), + kappa_(0.41), + E_(9.8), + Ceps2_(1.9), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField +( + const kLowReWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_), + Ceps2_(ptf.Ceps2_), + yPlusLam_(ptf.yPlusLam_) +{ + checkType(); +} + + +kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.8)), + Ceps2_(dict.lookupOrDefault<scalar>("Ceps2", 1.9)), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField +( + const kLowReWallFunctionFvPatchScalarField& kwfpsf +) +: + fixedValueFvPatchField<scalar>(kwfpsf), + Cmu_(kwfpsf.Cmu_), + kappa_(kwfpsf.kappa_), + E_(kwfpsf.E_), + Ceps2_(kwfpsf.Ceps2_), + yPlusLam_(kwfpsf.yPlusLam_) +{ + checkType(); +} + + +kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField +( + const kLowReWallFunctionFvPatchScalarField& kwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(kwfpsf, iF), + Cmu_(kwfpsf.Cmu_), + kappa_(kwfpsf.kappa_), + E_(kwfpsf.E_), + Ceps2_(kwfpsf.Ceps2_), + yPlusLam_(kwfpsf.yPlusLam_) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void kLowReWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const label patchi = patch().index(); + + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbulence.y()[patchi]; + + const tmp<volScalarField> tk = turbulence.k(); + const volScalarField& k = tk(); + + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalar Cmu25 = pow025(Cmu_); + + scalarField& kw = *this; + + // Set k wall values + forAll(kw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uTau = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = uTau*y[faceI]/nuw[faceI]; + + if (yPlus > yPlusLam_) + { + scalar Ck = -0.416; + scalar Bk = 8.366; + kw[faceI] = Ck/kappa_*log(yPlus) + Bk; + } + else + { + scalar C = 11.0; + scalar Cf = (1.0/sqr(yPlus + C) + 2.0*yPlus/pow3(C) - 1.0/sqr(C)); + kw[faceI] = 2400.0/sqr(Ceps2_)*Cf; + } + + kw[faceI] *= sqr(uTau); + } + + fixedValueFvPatchField<scalar>::updateCoeffs(); + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void kLowReWallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes commsType +) +{ + fixedValueFvPatchField<scalar>::evaluate(commsType); +} + + +void kLowReWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedValueFvPatchField<scalar>::write(os); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + os.writeKeyword("Ceps2") << Ceps2_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + kLowReWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..e08295493f51c82b14ca91ae5af49d14ce2ab686 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + Foam::kLowReWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulence kinetic energy wall function + condition for low- and high-Reynolds number turbulent flow cases. + + The model operates in two modes, based on the computed laminar-to-turbulent + switch-over y+ value derived from kappa and E. + + \heading Patch usage + + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + Ceps2 | model coefficient | no | 1.9 + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type kLowReWallFunction; + } + \endverbatim + +SeeAlso + Foam::fixedValueFvPatchField + +SourceFiles + kLowReWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kLowReWallFunctionFvPatchScalarField_H +#define kLowReWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class kLowReWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class kLowReWallFunctionFvPatchScalarField +: + public fixedValueFvPatchField<scalar> +{ +protected: + + // Protected data + + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + //- Ceps2 coefficient + scalar Ceps2_; + + //- Y+ at the edge of the laminar sublayer + scalar yPlusLam_; + + + // Protected Member Functions + + //- Check the type of the patch + virtual void checkType(); + + //- Calculate the Y+ at the edge of the laminar sublayer + scalar yPlusLam(const scalar kappa, const scalar E); + + +public: + + //- Runtime type information + TypeName("kLowReWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + kLowReWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + kLowReWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given kLowReWallFunctionFvPatchScalarField + // onto a new patch + kLowReWallFunctionFvPatchScalarField + ( + const kLowReWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + kLowReWallFunctionFvPatchScalarField + ( + const kLowReWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new kLowReWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + kLowReWallFunctionFvPatchScalarField + ( + const kLowReWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new kLowReWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Evaluate the patchField + virtual void evaluate(const Pstream::commsTypes); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..e3d6cf052d174871c25fc365c6d8242d8f7ca979 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "kqRWallFunctionFvPatchField.H" +#include "fvPatchFieldMapper.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class Type> +void kqRWallFunctionFvPatchField<Type>::checkType() +{ + if (!isA<wallFvPatch>(this->patch())) + { + FatalErrorIn("kqRWallFunctionFvPatchField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << this->patch().name() + << " must be wall" << nl + << " Current patch type is " << this->patch().type() + << nl << endl + << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + zeroGradientFvPatchField<Type>(p, iF) +{ + checkType(); +} + + +template<class Type> +kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField +( + const kqRWallFunctionFvPatchField& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + zeroGradientFvPatchField<Type>(ptf, p, iF, mapper) +{ + checkType(); +} + + +template<class Type> +kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + zeroGradientFvPatchField<Type>(p, iF, dict) +{ + checkType(); +} + + +template<class Type> +kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField +( + const kqRWallFunctionFvPatchField& tkqrwfpf +) +: + zeroGradientFvPatchField<Type>(tkqrwfpf) +{ + checkType(); +} + + +template<class Type> +kqRWallFunctionFvPatchField<Type>::kqRWallFunctionFvPatchField +( + const kqRWallFunctionFvPatchField& tkqrwfpf, + const DimensionedField<Type, volMesh>& iF +) +: + zeroGradientFvPatchField<Type>(tkqrwfpf, iF) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void kqRWallFunctionFvPatchField<Type>::evaluate +( + const Pstream::commsTypes commsType +) +{ + zeroGradientFvPatchField<Type>::evaluate(commsType); +} + + +template<class Type> +void kqRWallFunctionFvPatchField<Type>::write(Ostream& os) const +{ + zeroGradientFvPatchField<Type>::write(os); + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..4dcd51e5210c21b4a46baadd7fa19ca319b251bd --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H @@ -0,0 +1,182 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::kqRWallFunctionFvPatchField + +Group + grpWallFunctions + +Description + This boundary condition provides a suitable condition for turbulence + \c k, \c q, and \c R fields for the case of high Reynolds number flow using + wall functions. + + It is a simple wrapper around the zero-gradient condition. + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type kqRWallFunction; + } + \endverbatim + +SeeAlso + Foam::zeroGradientFvPatchField + +SourceFiles + kqRWallFunctionFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kqRWallFunctionFvPatchField_H +#define kqRWallFunctionFvPatchField_H + +#include "zeroGradientFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class kqRWallFunctionFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class kqRWallFunctionFvPatchField +: + public zeroGradientFvPatchField<Type> +{ + + // Private Member Functions + + //- Check the type of the patch + void checkType(); + + +public: + + //- Runtime type information + TypeName("kqRWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + kqRWallFunctionFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + kqRWallFunctionFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // kqRWallFunctionFvPatchField + // onto a new patch + kqRWallFunctionFvPatchField + ( + const kqRWallFunctionFvPatchField&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + kqRWallFunctionFvPatchField + ( + const kqRWallFunctionFvPatchField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<Type> > clone() const + { + return tmp<fvPatchField<Type> > + ( + new kqRWallFunctionFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + kqRWallFunctionFvPatchField + ( + const kqRWallFunctionFvPatchField&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<Type> > clone + ( + const DimensionedField<Type, volMesh>& iF + ) const + { + return tmp<fvPatchField<Type> > + ( + new kqRWallFunctionFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Evaluate the patchField + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::Pstream::blocking + ); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "kqRWallFunctionFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallDissipation.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C similarity index 69% rename from applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallDissipation.H rename to src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C index 14224fd646a3ec4ab00de7ffb2eb05035893bdf9..928a04b3858328d980e742bd9d40d7e13c2c1abb 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/turbulenceModel/wallDissipation.H +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.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 @@ -21,30 +21,24 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -Global - wallDissipation +\*---------------------------------------------------------------------------*/ -Description - Set wall dissipation in the epsilon matrix +#include "kqRWallFunctionFvPatchFields.H" +#include "fvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" -\*---------------------------------------------------------------------------*/ +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam { - const fvPatchList& patches = mesh.boundary(); - - forAll(patches, patchi) - { - const fvPatch& p = patches[patchi]; - - if (isA<wallFvPatch>(p)) - { - epsEqn.setValues - ( - p.faceCells(), - epsilon.boundaryField()[patchi].patchInternalField() - ); - } - } -} + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(kqRWallFunction); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam // ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H new file mode 100644 index 0000000000000000000000000000000000000000..232ac1d7af1bfc7d0a9f3ae633c34af81ca7a305 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef kqRWallFunctionFvPatchFields_H +#define kqRWallFunctionFvPatchFields_H + +#include "kqRWallFunctionFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(kqRWallFunction); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..ee377e29571103ed3187b6afbee9f2b61ba3edc4 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutLowReWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutLowReWallFunctionFvPatchScalarField::calcNut() const +{ + return tmp<scalarField>(new scalarField(patch().size(), 0.0)); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF) +{} + + +nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField +( + const nutLowReWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField +( + const nutLowReWallFunctionFvPatchScalarField& nlrwfpsf +) +: + nutWallFunctionFvPatchScalarField(nlrwfpsf) +{} + + +nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField +( + const nutLowReWallFunctionFvPatchScalarField& nlrwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(nlrwfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<scalarField> nutLowReWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + + return y*sqrt(nuw*mag(Uw.snGrad()))/nuw; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutLowReWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..7457f77c8834e735f5805fa66320b99e4e325fd5 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H @@ -0,0 +1,163 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutLowReWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + for use with low Reynolds number models. It sets \c nut to zero, and + provides an access function to calculate y+. + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutLowReWallFunction; + } + \endverbatim + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutLowReWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutLowReWallFunctionFvPatchScalarField_H +#define nutLowReWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutLowReWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutLowReWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutLowReWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutLowReWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutLowReWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutLowReWallFunctionFvPatchScalarField + // onto a new patch + nutLowReWallFunctionFvPatchScalarField + ( + const nutLowReWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutLowReWallFunctionFvPatchScalarField + ( + const nutLowReWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutLowReWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutLowReWallFunctionFvPatchScalarField + ( + const nutLowReWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutLowReWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..f23039924a76d347e2a89c7865ddd93fe48135e6 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,319 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutURoughWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + // The flow velocity at the adjacent cell centre + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + tmp<scalarField> tyPlus = calcYPlus(magUp); + scalarField& yPlus = tyPlus(); + + tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); + scalarField& nutw = tnutw(); + + forAll(yPlus, facei) + { + if (yPlus[facei] > yPlusLam_) + { + const scalar Re = magUp[facei]*y[facei]/nuw[facei] + ROOTVSMALL; + nutw[facei] = nuw[facei]*(sqr(yPlus[facei])/Re - 1); + } + } + + return tnutw; +} + + +tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus +( + const scalarField& magUp +) const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); + scalarField& yPlus = tyPlus(); + + if (roughnessHeight_ > 0.0) + { + // Rough Walls + const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; + static const scalar c_2 = 2.25/(90 - 2.25); + static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); + static const scalar c_4 = c_3*log(2.25); + + //if (KsPlusBasedOnYPlus_) + { + // If KsPlus is based on YPlus the extra term added to the law + // of the wall will depend on yPlus + forAll(yPlus, facei) + { + const scalar magUpara = magUp[facei]; + const scalar Re = magUpara*y[facei]/nuw[facei]; + const scalar kappaRe = kappa_*Re; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + int iter = 0; + scalar yPlusLast = 0.0; + scalar dKsPlusdYPlus = roughnessHeight_/y[facei]; + + // Additional tuning parameter - nominally = 1 + dKsPlusdYPlus *= roughnessFactor_; + + do + { + yPlusLast = yp; + + // The non-dimensional roughness height + scalar KsPlus = yp*dKsPlusdYPlus; + + // The extra term in the law-of-the-wall + scalar G = 0.0; + + scalar yPlusGPrime = 0.0; + + if (KsPlus >= 90) + { + const scalar t_1 = 1 + roughnessConstant_*KsPlus; + G = log(t_1); + yPlusGPrime = roughnessConstant_*KsPlus/t_1; + } + else if (KsPlus > 2.25) + { + const scalar t_1 = c_1*KsPlus - c_2; + const scalar t_2 = c_3*log(KsPlus) - c_4; + const scalar sint_2 = sin(t_2); + const scalar logt_1 = log(t_1); + G = logt_1*sint_2; + yPlusGPrime = + (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); + } + + scalar denom = 1.0 + log(E_*yp) - G - yPlusGPrime; + if (mag(denom) > VSMALL) + { + yp = (kappaRe + yp*(1 - yPlusGPrime))/denom; + } + } while + ( + mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 + && ++iter < 10 + && yp > VSMALL + ); + + yPlus[facei] = max(0.0, yp); + } + } + } + else + { + // Smooth Walls + forAll(yPlus, facei) + { + const scalar magUpara = magUp[facei]; + const scalar Re = magUpara*y[facei]/nuw[facei]; + const scalar kappaRe = kappa_*Re; + + scalar yp = yPlusLam_; + const scalar ryPlusLam = 1.0/yp; + + int iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yp; + yp = (kappaRe + yp)/(1.0 + log(E_*yp)); + + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.0001 && ++iter < 10); + + yPlus[facei] = max(0.0, yp); + } + } + + return tyPlus; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF), + roughnessHeight_(pTraits<scalar>::zero), + roughnessConstant_(pTraits<scalar>::zero), + roughnessFactor_(pTraits<scalar>::zero) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const nutURoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + roughnessHeight_(ptf.roughnessHeight_), + roughnessConstant_(ptf.roughnessConstant_), + roughnessFactor_(ptf.roughnessFactor_) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict), + roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), + roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), + roughnessFactor_(readScalar(dict.lookup("roughnessFactor"))) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const nutURoughWallFunctionFvPatchScalarField& rwfpsf +) +: + nutWallFunctionFvPatchScalarField(rwfpsf), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFactor_(rwfpsf.roughnessFactor_) +{} + + +nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField +( + const nutURoughWallFunctionFvPatchScalarField& rwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(rwfpsf, iF), + roughnessHeight_(rwfpsf.roughnessHeight_), + roughnessConstant_(rwfpsf.roughnessConstant_), + roughnessFactor_(rwfpsf.roughnessFactor_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + tmp<scalarField> magUp = mag(Uw.patchInternalField() - Uw); + + return calcYPlus(magUp()); +} + + +void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeLocalEntries(os); + os.writeKeyword("roughnessHeight") + << roughnessHeight_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessConstant") + << roughnessConstant_ << token::END_STATEMENT << nl; + os.writeKeyword("roughnessFactor") + << roughnessFactor_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutURoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..4a7101ef6b2dedbfad1a859ae3a48d23f0336505 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,238 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutURoughWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions for rough walls, based on velocity. + + \heading Patch usage + + \table + Property | Description | Required | Default value + roughnessHeight | roughness height | yes | + roughnessConstant | roughness constanr | yes | + roughnessFactor | scaling factor | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutURoughWallFunction; + roughnessHeight 1e-5; + roughnessConstant 0.5; + roughnessFactor 1; + } + \endverbatim + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutURoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutURoughWallFunctionFvPatchScalarField_H +#define nutURoughWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutURoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutURoughWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ + // Private data + + // Roughness model parameters + + //- Height + scalar roughnessHeight_; + + //- Constant + scalar roughnessConstant_; + + //- Scale factor + scalar roughnessFactor_; + + + // Protected Member Functions + + //- Calculate yPLus + virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const; + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutURoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutURoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutURoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutURoughWallFunctionFvPatchScalarField + // onto a new patch + nutURoughWallFunctionFvPatchScalarField + ( + const nutURoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutURoughWallFunctionFvPatchScalarField + ( + const nutURoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutURoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutURoughWallFunctionFvPatchScalarField + ( + const nutURoughWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutURoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the roughness height + scalar roughnessHeight() const + { + return roughnessHeight_; + } + + //- Return reference to the roughness height to allow adjustment + scalar& roughnessHeight() + { + return roughnessHeight_; + } + + + //- Return the roughness constant scale + scalar roughnessConstant() const + { + return roughnessConstant_; + } + + //- Return reference to the roughness constant to allow adjustment + scalar& roughnessConstant() + { + return roughnessConstant_; + } + + //- Return the roughness scale factor + scalar roughnessFactor() const + { + return roughnessFactor_; + } + + //- Return reference to the roughness scale factor to allow + // adjustment + scalar& roughnessFactor() + { + return roughnessFactor_; + } + + + // I-O + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..1f3a7c5457a7bc6dfd872b1505d14d590b5daf55 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -0,0 +1,232 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutUSpaldingWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magGradU(mag(Uw.snGrad())); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + return max + ( + scalar(0), + sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - nuw + ); +} + + +tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau +( + const scalarField& magGradU +) const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalarField& nutw = *this; + + tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0)); + scalarField& uTau = tuTau(); + + forAll(uTau, faceI) + { + scalar ut = sqrt((nutw[faceI] + nuw[faceI])*magGradU[faceI]); + + if (ut > ROOTVSMALL) + { + int iter = 0; + scalar err = GREAT; + + do + { + scalar kUu = min(kappa_*magUp[faceI]/ut, 50); + scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); + + scalar f = + - ut*y[faceI]/nuw[faceI] + + magUp[faceI]/ut + + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); + + scalar df = + y[faceI]/nuw[faceI] + + magUp[faceI]/sqr(ut) + + 1/E_*kUu*fkUu/ut; + + scalar uTauNew = ut + f/df; + err = mag((ut - uTauNew)/ut); + ut = uTauNew; + + } while (ut > ROOTVSMALL && err > 0.01 && ++iter < 10); + + uTau[faceI] = max(0.0, ut); + } + } + + return tuTau; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutUSpaldingWallFunctionFvPatchScalarField:: +nutUSpaldingWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF) +{} + + +nutUSpaldingWallFunctionFvPatchScalarField:: +nutUSpaldingWallFunctionFvPatchScalarField +( + const nutUSpaldingWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutUSpaldingWallFunctionFvPatchScalarField:: +nutUSpaldingWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +nutUSpaldingWallFunctionFvPatchScalarField:: +nutUSpaldingWallFunctionFvPatchScalarField +( + const nutUSpaldingWallFunctionFvPatchScalarField& wfpsf +) +: + nutWallFunctionFvPatchScalarField(wfpsf) +{} + + +nutUSpaldingWallFunctionFvPatchScalarField:: +nutUSpaldingWallFunctionFvPatchScalarField +( + const nutUSpaldingWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(wfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + return y*calcUTau(mag(Uw.snGrad()))/nuw; +} + + +void nutUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeLocalEntries(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutUSpaldingWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..82d1f3a127f863975d1ff5fa387f2c61fb65c1f3 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H @@ -0,0 +1,187 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutUSpaldingWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions for rough walls, based on velocity, using + Spalding's law to give a continuous nut profile to the wall (y+ = 0) + + \f[ + y^+ = u^+ + \frac{1}{E} \left[exp(\kappa u^+) - 1 - \kappa u^+\, + - 0.5 (\kappa u^+)^2 - \frac{1}{6} (\kappa u^+)^3\right] + \f] + + where + \vartable + y^+ | non-dimensional position + u^+ | non-dimensional velocity + \kappa | Von Karman constant + \endvartable + + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutUSpaldingWallFunction; + } + \endverbatim + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutUSpaldingWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutUSpaldingWallFunctionFvPatchScalarField_H +#define nutUSpaldingWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutUSpaldingWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutUSpaldingWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + //- Calculate the friction velocity + virtual tmp<scalarField> calcUTau(const scalarField& magGradU) const; + + +public: + + //- Runtime type information + TypeName("nutUSpaldingWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutUSpaldingWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutUSpaldingWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutUSpaldingWallFunctionFvPatchScalarField + // onto a new patch + nutUSpaldingWallFunctionFvPatchScalarField + ( + const nutUSpaldingWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutUSpaldingWallFunctionFvPatchScalarField + ( + const nutUSpaldingWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutUSpaldingWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutUSpaldingWallFunctionFvPatchScalarField + ( + const nutUSpaldingWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutUSpaldingWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..7d618bf855d9718cf82dc92ea4bb065316a45fee --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -0,0 +1,225 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutUTabulatedWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField magGradU(mag(Uw.snGrad())); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + return + max + ( + scalar(0), + sqr(magUp/(calcUPlus(magUp*y/nuw) + ROOTVSMALL)) + /(magGradU + ROOTVSMALL) + - nuw + ); +} + + +tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus +( + const scalarField& Rey +) const +{ + tmp<scalarField> tuPlus(new scalarField(patch().size(), 0.0)); + scalarField& uPlus = tuPlus(); + + forAll(uPlus, faceI) + { + uPlus[faceI] = uPlusTable_.interpolateLog10(Rey[faceI]); + } + + return tuPlus; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutUTabulatedWallFunctionFvPatchScalarField:: +nutUTabulatedWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF), + uPlusTableName_("undefined-uPlusTableName"), + uPlusTable_ + ( + IOobject + ( + uPlusTableName_, + patch().boundaryMesh().mesh().time().constant(), + patch().boundaryMesh().mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + false + ) +{} + + +nutUTabulatedWallFunctionFvPatchScalarField:: +nutUTabulatedWallFunctionFvPatchScalarField +( + const nutUTabulatedWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + uPlusTableName_(ptf.uPlusTableName_), + uPlusTable_(ptf.uPlusTable_) +{} + + +nutUTabulatedWallFunctionFvPatchScalarField:: +nutUTabulatedWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict), + uPlusTableName_(dict.lookup("uPlusTable")), + uPlusTable_ + ( + IOobject + ( + uPlusTableName_, + patch().boundaryMesh().mesh().time().constant(), + patch().boundaryMesh().mesh(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ), + true + ) +{} + + +nutUTabulatedWallFunctionFvPatchScalarField:: +nutUTabulatedWallFunctionFvPatchScalarField +( + const nutUTabulatedWallFunctionFvPatchScalarField& wfpsf +) +: + nutWallFunctionFvPatchScalarField(wfpsf), + uPlusTableName_(wfpsf.uPlusTableName_), + uPlusTable_(wfpsf.uPlusTable_) +{} + + +nutUTabulatedWallFunctionFvPatchScalarField:: +nutUTabulatedWallFunctionFvPatchScalarField +( + const nutUTabulatedWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(wfpsf, iF), + uPlusTableName_(wfpsf.uPlusTableName_), + uPlusTable_(wfpsf.uPlusTable_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + const scalarField Rey(magUp*y/nuw); + + return Rey/(calcUPlus(Rey) + ROOTVSMALL); +} + + +void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + os.writeKeyword("uPlusTable") << uPlusTableName_ + << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutUTabulatedWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..8881eeb09403749ebbbca0b117b5097bfe6d9679 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H @@ -0,0 +1,195 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutUTabulatedWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions. As input, the user specifies a look-up table + of U+ as a function of near-wall Reynolds number. The table should be + located in the $FOAM_CASE/constant folder. + + \heading Patch usage + + \table + Property | Description | Required | Default value + uPlusTable | U+ as a function of Re table name | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutTabulatedWallFunction; + uPlusTable myUPlusTable; + } + \endverbatim + +Note + The tables are not registered since the same table object may be used for + more than one patch. + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutUTabulatedWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutUTabulatedWallFunctionFvPatchScalarField_H +#define nutUTabulatedWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" +#include "uniformInterpolationTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutUTabulatedWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutUTabulatedWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected data + + //- Name of u+ table + word uPlusTableName_; + + //- U+ table + uniformInterpolationTable<scalar> uPlusTable_; + + + // Protected Member Functions + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + //- Calculate wall u+ from table + virtual tmp<scalarField> calcUPlus(const scalarField& Rey) const; + + +public: + + //- Runtime type information + TypeName("nutTabulatedWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutUTabulatedWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutUTabulatedWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutUTabulatedWallFunctionFvPatchScalarField + // onto a new patch + nutUTabulatedWallFunctionFvPatchScalarField + ( + const nutUTabulatedWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutUTabulatedWallFunctionFvPatchScalarField + ( + const nutUTabulatedWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutUTabulatedWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutUTabulatedWallFunctionFvPatchScalarField + ( + const nutUTabulatedWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutUTabulatedWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..2c83c1b81f90bee4f375431523c58fcb5460444c --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -0,0 +1,215 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutUWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + tmp<scalarField> tyPlus = calcYPlus(magUp); + scalarField& yPlus = tyPlus(); + + tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); + scalarField& nutw = tnutw(); + + forAll(yPlus, facei) + { + if (yPlus[facei] > yPlusLam_) + { + nutw[facei] = + nuw[facei]*(yPlus[facei]*kappa_/log(E_*yPlus[facei]) - 1.0); + } + } + + return tnutw; +} + + +tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus +( + const scalarField& magUp +) const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0)); + scalarField& yPlus = tyPlus(); + + forAll(yPlus, facei) + { + scalar kappaRe = kappa_*magUp[facei]*y[facei]/nuw[facei]; + + scalar yp = yPlusLam_; + scalar ryPlusLam = 1.0/yp; + + int iter = 0; + scalar yPlusLast = 0.0; + + do + { + yPlusLast = yp; + yp = (kappaRe + yp)/(1.0 + log(E_*yp)); + + } while (mag(ryPlusLam*(yp - yPlusLast)) > 0.01 && ++iter < 10 ); + + yPlus[facei] = max(0.0, yp); + } + + return tyPlus; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const nutUWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const nutUWallFunctionFvPatchScalarField& sawfpsf +) +: + nutWallFunctionFvPatchScalarField(sawfpsf) +{} + + +nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField +( + const nutUWallFunctionFvPatchScalarField& sawfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(sawfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<scalarField> nutUWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + + return calcYPlus(magUp); +} + + +void nutUWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeLocalEntries(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutUWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..14b801628b651b77907647c5907acb27356ec977 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H @@ -0,0 +1,173 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutUWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions, based on velocity. + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutUWallFunction; + } + \endverbatim + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutUWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutUWallFunctionFvPatchScalarField_H +#define nutUWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutUWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutUWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate yPLus + virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const; + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutUWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutUWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutUWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutUWallFunctionFvPatchScalarField + // onto a new patch + nutUWallFunctionFvPatchScalarField + ( + const nutUWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutUWallFunctionFvPatchScalarField + ( + const nutUWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutUWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutUWallFunctionFvPatchScalarField + ( + const nutUWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutUWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..3e2f1d7afaf04e019e0b1973d1e4c11562cd3cdf --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------* \ + ========= | + \\ / 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 "nutWallFunctionFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0); + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void nutWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("nutWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +void nutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const +{ + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + Cmu_(0.09), + kappa_(0.41), + E_(9.8), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +( + const nutWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_), + yPlusLam_(ptf.yPlusLam_) +{ + checkType(); +} + + +nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.8)), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +( + const nutWallFunctionFvPatchScalarField& wfpsf +) +: + fixedValueFvPatchScalarField(wfpsf), + Cmu_(wfpsf.Cmu_), + kappa_(wfpsf.kappa_), + E_(wfpsf.E_), + yPlusLam_(wfpsf.yPlusLam_) +{ + checkType(); +} + + +nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField +( + const nutWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(wfpsf, iF), + Cmu_(wfpsf.Cmu_), + kappa_(wfpsf.kappa_), + E_(wfpsf.E_), + yPlusLam_(wfpsf.yPlusLam_) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +scalar nutWallFunctionFvPatchScalarField::yPlusLam +( + const scalar kappa, + const scalar E +) +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(max(E*ypl, 1))/kappa; + } + + return ypl; +} + + +void nutWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + operator==(calcNut()); + + fixedValueFvPatchScalarField::updateCoeffs(); +} + + +void nutWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeLocalEntries(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..efd9dc94a26ce8a1099ea624f8385aa432125a02 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions, based on turbulence kinetic energy. + - replicates OpenFOAM v1.5 (and earlier) behaviour + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutWallFunction; + } + \endverbatim + +SeeAlso + Foam::fixedValueFvPatchField + +SourceFiles + nutWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutWallFunctionFvPatchScalarField_H +#define nutWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ +protected: + + // Protected data + + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + //- Y+ at the edge of the laminar sublayer + scalar yPlusLam_; + + + // Protected Member Functions + + //- Check the type of the patch + virtual void checkType(); + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const = 0; + + //- Write local wall function variables + virtual void writeLocalEntries(Ostream&) const; + + +public: + + //- Runtime type information + TypeName("nutWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutWallFunctionFvPatchScalarField + // onto a new patch + nutWallFunctionFvPatchScalarField + ( + const nutWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutWallFunctionFvPatchScalarField + ( + const nutWallFunctionFvPatchScalarField& + ); + + //- Construct as copy setting internal field reference + nutWallFunctionFvPatchScalarField + ( + const nutWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + + // Member functions + + //- Calculate the Y+ at the edge of the laminar sublayer + static scalar yPlusLam(const scalar kappa, const scalar E); + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const = 0; + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..d83fa571d219d5a8cb7d4fc6edb6122c27693418 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutkAtmRoughWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbulence.y()[patchi]; + const tmp<volScalarField> tk = turbulence.k(); + const volScalarField& k = tk(); + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalar Cmu25 = pow025(Cmu_); + + tmp<scalarField> tnutw(new scalarField(*this)); + scalarField& nutw = tnutw(); + + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uStar = Cmu25*sqrt(k[faceCellI]); + scalar yPlus = uStar*y[faceI]/nuw[faceI]; + + scalar Edash = (y[faceI] + z0_[faceI])/z0_[faceI]; + + nutw[faceI] = + nuw[faceI]*(yPlus*kappa_/log(max(Edash, 1+1e-4)) - 1); + + if (debug) + { + Info<< "yPlus = " << yPlus + << ", Edash = " << Edash + << ", nutw = " << nutw[faceI] + << endl; + } + } + + return tnutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutkWallFunctionFvPatchScalarField(p, iF), + z0_(p.size(), 0.0) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const nutkAtmRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + z0_(ptf.z0_, mapper) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutkWallFunctionFvPatchScalarField(p, iF, dict), + z0_("z0", dict, p.size()) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf +) +: + nutkWallFunctionFvPatchScalarField(rwfpsf), + z0_(rwfpsf.z0_) +{} + + +nutkAtmRoughWallFunctionFvPatchScalarField:: +nutkAtmRoughWallFunctionFvPatchScalarField +( + const nutkAtmRoughWallFunctionFvPatchScalarField& rwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutkWallFunctionFvPatchScalarField(rwfpsf, iF), + z0_(rwfpsf.z0_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutkAtmRoughWallFunctionFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + nutkWallFunctionFvPatchScalarField::autoMap(m); + z0_.autoMap(m); +} + + +void nutkAtmRoughWallFunctionFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + nutkWallFunctionFvPatchScalarField::rmap(ptf, addr); + + const nutkAtmRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast<const nutkAtmRoughWallFunctionFvPatchScalarField>(ptf); + + z0_.rmap(nrwfpsf.z0_, addr); +} + + +void nutkAtmRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeLocalEntries(os); + z0_.writeEntry("z0", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutkAtmRoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..0de128748b021b8908c68e4a04caf9a802e30f56 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutkAtmRoughWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity for + atmospheric velocity profiles. It is desinged to be used in conjunction + with the atmBoundaryLayerInletVelocity boundary condition. The values + are calculated using: + + \f[ + U = frac{U_f}{K} ln(\frac{z + z_0}{z_0}) + \f] + + where + + \vartable + U_f | frictional velocity + K | Von Karman's constant + z_0 | surface roughness length + z | vertical co-ordinate + \endvartable + + \heading Patch usage + + \table + Property | Description | Required | Default value + z0 | surface roughness length| yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutkAtmRoughWallFunction; + z0 uniform 0; + } + \endverbatim + +SeeAlso + Foam::nutkWallFunctionFvPatchField + +SourceFiles + nutkAtmRoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutkAtmRoughWallFunctionFvPatchScalarField_H +#define nutkAtmRoughWallFunctionFvPatchScalarField_H + +#include "nutkWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutkAtmRoughWallFunctionFvPatchScalarField +: + public nutkWallFunctionFvPatchScalarField +{ +protected: + + // Protected data + + //- Surface roughness length + scalarField z0_; + + + // Protected Member Functions + + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutkAtmRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutkAtmRoughWallFunctionFvPatchScalarField + // onto a new patch + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const nutkAtmRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const nutkAtmRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutkAtmRoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutkAtmRoughWallFunctionFvPatchScalarField + ( + const nutkAtmRoughWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutkAtmRoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Acces functions + + // Return z0 + scalarField& z0() + { + return z0_; + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..d216c08a8aafe1fd73d591786d76a2bcc0aa54f5 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -0,0 +1,243 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "nutkRoughWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +scalar nutkRoughWallFunctionFvPatchScalarField::fnRough +( + const scalar KsPlus, + const scalar Cs +) const +{ + // Return fn based on non-dimensional roughness height + + if (KsPlus < 90.0) + { + return pow + ( + (KsPlus - 2.25)/87.75 + Cs*KsPlus, + sin(0.4258*(log(KsPlus) - 0.811)) + ); + } + else + { + return (1.0 + Cs*KsPlus); + } +} + + +tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbModel.y()[patchi]; + const tmp<volScalarField> tk = turbModel.k(); + const volScalarField& k = tk(); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalar Cmu25 = pow025(Cmu_); + + tmp<scalarField> tnutw(new scalarField(*this)); + scalarField& nutw = tnutw(); + + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uStar = Cmu25*sqrt(k[faceCellI]); + scalar yPlus = uStar*y[faceI]/nuw[faceI]; + scalar KsPlus = uStar*Ks_[faceI]/nuw[faceI]; + + scalar Edash = E_; + if (KsPlus > 2.25) + { + Edash /= fnRough(KsPlus, Cs_[faceI]); + } + + scalar limitingNutw = max(nutw[faceI], nuw[faceI]); + + // To avoid oscillations limit the change in the wall viscosity + // which is particularly important if it temporarily becomes zero + nutw[faceI] = + max + ( + min + ( + nuw[faceI] + *(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1), + 2*limitingNutw + ), 0.5*limitingNutw + ); + + if (debug) + { + Info<< "yPlus = " << yPlus + << ", KsPlus = " << KsPlus + << ", Edash = " << Edash + << ", nutw = " << nutw[faceI] + << endl; + } + } + + return tnutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutkWallFunctionFvPatchScalarField(p, iF), + Ks_(p.size(), 0.0), + Cs_(p.size(), 0.0) +{} + + +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField +( + const nutkRoughWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + Ks_(ptf.Ks_, mapper), + Cs_(ptf.Cs_, mapper) +{} + + +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutkWallFunctionFvPatchScalarField(p, iF, dict), + Ks_("Ks", dict, p.size()), + Cs_("Cs", dict, p.size()) +{} + + +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField +( + const nutkRoughWallFunctionFvPatchScalarField& rwfpsf +) +: + nutkWallFunctionFvPatchScalarField(rwfpsf), + Ks_(rwfpsf.Ks_), + Cs_(rwfpsf.Cs_) +{} + + +nutkRoughWallFunctionFvPatchScalarField::nutkRoughWallFunctionFvPatchScalarField +( + const nutkRoughWallFunctionFvPatchScalarField& rwfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutkWallFunctionFvPatchScalarField(rwfpsf, iF), + Ks_(rwfpsf.Ks_), + Cs_(rwfpsf.Cs_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void nutkRoughWallFunctionFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + nutkWallFunctionFvPatchScalarField::autoMap(m); + Ks_.autoMap(m); + Cs_.autoMap(m); +} + + +void nutkRoughWallFunctionFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + nutkWallFunctionFvPatchScalarField::rmap(ptf, addr); + + const nutkRoughWallFunctionFvPatchScalarField& nrwfpsf = + refCast<const nutkRoughWallFunctionFvPatchScalarField>(ptf); + + Ks_.rmap(nrwfpsf.Ks_, addr); + Cs_.rmap(nrwfpsf.Cs_, addr); +} + + +void nutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField<scalar>::write(os); + writeLocalEntries(os); + Cs_.writeEntry("Cs", os); + Ks_.writeEntry("Ks", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutkRoughWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..35bc074c67bf6bb78a79428a5e6eb44702e13566 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H @@ -0,0 +1,218 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::nutkRoughWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions for rough walls, based on turbulence kinetic + energy. The condition manipulates the E parameter to account for roughness + effects. + + Parameter ranges + - roughness height = sand-grain roughness (0 for smooth walls) + - roughness constant = 0.5-1.0 + + \heading Patch usage + + \table + Property | Description | Required | Default value + Ks | sand-grain roughness height | yes | + Cs | roughness constant | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutkRoughWallFunction; + Ks uniform 0; + Cs uniform 0.5; + } + \endverbatim + +SeeAlso + Foam::nutkRoughWallFunctionFvPatchScalarField + +SourceFiles + nutkRoughWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutkRoughWallFunctionFvPatchScalarField_H +#define nutkRoughWallFunctionFvPatchScalarField_H + +#include "nutkWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutkRoughWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutkRoughWallFunctionFvPatchScalarField +: + public nutkWallFunctionFvPatchScalarField +{ +protected: + + // Protected data + + //- Roughness height + scalarField Ks_; + + //- Roughness constant + scalarField Cs_; + + + // Protected Member Functions + + //- Compute the roughness function + virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const; + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutkRoughWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutkRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutkRoughWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutkRoughWallFunctionFvPatchScalarField + // onto a new patch + nutkRoughWallFunctionFvPatchScalarField + ( + const nutkRoughWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutkRoughWallFunctionFvPatchScalarField + ( + const nutkRoughWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutkRoughWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutkRoughWallFunctionFvPatchScalarField + ( + const nutkRoughWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutkRoughWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Acces functions + + // Return Ks + scalarField& Ks() + { + return Ks_; + } + + // Return Cs + scalarField& Cs() + { + return Cs_; + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..91c14690dcd8a5d580d71a4aed135bfb8ced6c20 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -0,0 +1,173 @@ +/*---------------------------------------------------------------------------* \ + ========= | + \\ / 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 "nutkWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "wallFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + const scalarField& y = turbModel.y()[patchi]; + const tmp<volScalarField> tk = turbModel.k(); + const volScalarField& k = tk(); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalar Cmu25 = pow025(Cmu_); + + tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0)); + scalarField& nutw = tnutw(); + + forAll(nutw, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI]; + + if (yPlus > yPlusLam_) + { + nutw[faceI] = nuw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1.0); + } + } + + return tnutw; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(p, iF) +{} + + +nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField +( + const nutkWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper) +{} + + +nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + nutWallFunctionFvPatchScalarField(p, iF, dict) +{} + + +nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField +( + const nutkWallFunctionFvPatchScalarField& wfpsf +) +: + nutWallFunctionFvPatchScalarField(wfpsf) +{} + + +nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField +( + const nutkWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + nutWallFunctionFvPatchScalarField(wfpsf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchi = patch().index(); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + const scalarField& y = turbModel.y()[patchi]; + + const tmp<volScalarField> tk = turbModel.k(); + const volScalarField& k = tk(); + tmp<scalarField> kwc = k.boundaryField()[patchi].patchInternalField(); + const tmp<scalarField> tnuw = turbModel.nu(patchi); + const scalarField& nuw = tnuw(); + + return pow025(Cmu_)*y*sqrt(kwc)/nuw; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + nutkWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..9283da357671bfe1988180fb9491d0dc29642baf --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H @@ -0,0 +1,163 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::nutkWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulent kinematic viscosity condition + when using wall functions, based on turbulence kinetic energy. + - replicates OpenFOAM v1.5 (and earlier) behaviour + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type nutkWallFunction; + } + \endverbatim + +SeeAlso + Foam::nutWallFunctionFvPatchScalarField + +SourceFiles + nutkWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef nutkWallFunctionFvPatchScalarField_H +#define nutkWallFunctionFvPatchScalarField_H + +#include "nutWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class nutkWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class nutkWallFunctionFvPatchScalarField +: + public nutWallFunctionFvPatchScalarField +{ +protected: + + // Protected Member Functions + + //- Calculate the turbulence viscosity + virtual tmp<scalarField> calcNut() const; + + +public: + + //- Runtime type information + TypeName("nutkWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + nutkWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + nutkWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // nutkWallFunctionFvPatchScalarField + // onto a new patch + nutkWallFunctionFvPatchScalarField + ( + const nutkWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + nutkWallFunctionFvPatchScalarField + ( + const nutkWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new nutkWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + nutkWallFunctionFvPatchScalarField + ( + const nutkWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new nutkWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Calculate and return the yPlus at the boundary + virtual tmp<scalarField> yPlus() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..2d8a0b4586d77085cfc56b0b64bd59bde20b4644 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -0,0 +1,606 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "omegaWallFunctionFvPatchScalarField.H" +#include "turbulenceModel.H" +#include "fvPatchFieldMapper.H" +#include "fvMatrix.H" +#include "volFields.H" +#include "wallFvPatch.H" +#include "nutkWallFunctionFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void omegaWallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("omegaWallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const +{ + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + os.writeKeyword("beta1") << beta1_ << token::END_STATEMENT << nl; +} + + +void omegaWallFunctionFvPatchScalarField::setMaster() +{ + if (master_ != -1) + { + return; + } + + const volScalarField& omega = + static_cast<const volScalarField&>(this->dimensionedInternalField()); + + const volScalarField::GeometricBoundaryField& bf = omega.boundaryField(); + + label master = -1; + forAll(bf, patchi) + { + if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchi])) + { + omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchi); + + if (master == -1) + { + master = patchi; + } + + epf.master() = master; + } + } +} + + +void omegaWallFunctionFvPatchScalarField::createAveragingWeights() +{ + if (initialised_) + { + return; + } + + const volScalarField& omega = + static_cast<const volScalarField&>(this->dimensionedInternalField()); + + const volScalarField::GeometricBoundaryField& bf = omega.boundaryField(); + + const fvMesh& mesh = omega.mesh(); + + volScalarField weights + ( + IOobject + ( + "weights", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false // do not register + ), + mesh, + dimensionedScalar("zero", dimless, 0.0) + ); + + DynamicList<label> omegaPatches(bf.size()); + forAll(bf, patchi) + { + if (isA<omegaWallFunctionFvPatchScalarField>(bf[patchi])) + { + omegaPatches.append(patchi); + + const labelUList& faceCells = bf[patchi].patch().faceCells(); + forAll(faceCells, i) + { + label cellI = faceCells[i]; + weights[cellI]++; + } + } + } + + cornerWeights_.setSize(bf.size()); + forAll(omegaPatches, i) + { + label patchi = omegaPatches[i]; + const fvPatchScalarField& wf = weights.boundaryField()[patchi]; + cornerWeights_[patchi] = 1.0/wf.patchInternalField(); + } + + G_.setSize(dimensionedInternalField().size(), 0.0); + omega_.setSize(dimensionedInternalField().size(), 0.0); + + initialised_ = true; +} + + +omegaWallFunctionFvPatchScalarField& +omegaWallFunctionFvPatchScalarField::omegaPatch(const label patchi) +{ + const volScalarField& omega = + static_cast<const volScalarField&>(this->dimensionedInternalField()); + + const volScalarField::GeometricBoundaryField& bf = omega.boundaryField(); + + const omegaWallFunctionFvPatchScalarField& epf = + refCast<const omegaWallFunctionFvPatchScalarField>(bf[patchi]); + + return const_cast<omegaWallFunctionFvPatchScalarField&>(epf); +} + + +void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields +( + const turbulenceModel& turbulence, + scalarField& G0, + scalarField& omega0 +) +{ + // accumulate all of the G and omega contributions + forAll(cornerWeights_, patchi) + { + if (!cornerWeights_[patchi].empty()) + { + omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchi); + + const List<scalar>& w = cornerWeights_[patchi]; + + epf.calculate(turbulence, w, epf.patch(), G0, omega0); + } + } + + // apply zero-gradient condition for omega + forAll(cornerWeights_, patchi) + { + if (!cornerWeights_[patchi].empty()) + { + omegaWallFunctionFvPatchScalarField& epf = omegaPatch(patchi); + + epf == scalarField(omega0, epf.patch().faceCells()); + } + } +} + + +void omegaWallFunctionFvPatchScalarField::calculate +( + const turbulenceModel& turbulence, + const List<scalar>& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& omega +) +{ + const label patchi = patch.index(); + + const scalarField& y = turbulence.y()[patchi]; + + const scalar Cmu25 = pow025(Cmu_); + + const tmp<volScalarField> tk = turbulence.k(); + const volScalarField& k = tk(); + + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const tmp<scalarField> tnutw = turbulence.nut(patchi); + const scalarField& nutw = tnutw(); + + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchi]; + + const scalarField magGradUw(mag(Uw.snGrad())); + + // Set omega and G + forAll(nutw, faceI) + { + label cellI = patch.faceCells()[faceI]; + + scalar w = cornerWeights[faceI]; + + scalar omegaVis = 6.0*nuw[faceI]/(beta1_*sqr(y[faceI])); + + scalar omegaLog = sqrt(k[cellI])/(Cmu25*kappa_*y[faceI]); + + omega[cellI] += w*sqrt(sqr(omegaVis) + sqr(omegaLog)); + + G[cellI] += + w + *(nutw[faceI] + nuw[faceI]) + *magGradUw[faceI] + *Cmu25*sqrt(k[cellI]) + /(kappa_*y[faceI]); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + Cmu_(0.09), + kappa_(0.41), + E_(9.8), + beta1_(0.075), + yPlusLam_(nutkWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_)), + G_(), + omega_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_), + beta1_(ptf.beta1_), + yPlusLam_(ptf.yPlusLam_), + G_(), + omega_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.8)), + beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)), + yPlusLam_(nutkWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_)), + G_(), + omega_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); + + // apply zero-gradient condition on start-up + this->operator==(patchInternalField()); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& owfpsf +) +: + fixedValueFvPatchField<scalar>(owfpsf), + Cmu_(owfpsf.Cmu_), + kappa_(owfpsf.kappa_), + E_(owfpsf.E_), + beta1_(owfpsf.beta1_), + yPlusLam_(owfpsf.yPlusLam_), + G_(), + omega_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField +( + const omegaWallFunctionFvPatchScalarField& owfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(owfpsf, iF), + Cmu_(owfpsf.Cmu_), + kappa_(owfpsf.kappa_), + E_(owfpsf.E_), + beta1_(owfpsf.beta1_), + yPlusLam_(owfpsf.yPlusLam_), + G_(), + omega_(), + initialised_(false), + master_(-1), + cornerWeights_() +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +scalarField& omegaWallFunctionFvPatchScalarField::G(bool init) +{ + if (patch().index() == master_) + { + if (init) + { + G_ = 0.0; + } + + return G_; + } + + return omegaPatch(master_).G(); +} + + +scalarField& omegaWallFunctionFvPatchScalarField::omega(bool init) +{ + if (patch().index() == master_) + { + if (init) + { + omega_ = 0.0; + } + + return omega_; + } + + return omegaPatch(master_).omega(init); +} + + +void omegaWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + setMaster(); + + if (patch().index() == master_) + { + createAveragingWeights(); + calculateTurbulenceFields(turbulence, G(true), omega(true)); + } + + const scalarField& G0 = this->G(); + const scalarField& omega0 = this->omega(); + + typedef DimensionedField<scalar, volMesh> FieldType; + + FieldType& G = + const_cast<FieldType&> + ( + db().lookupObject<FieldType>(turbulence.GName()) + ); + + FieldType& omega = const_cast<FieldType&>(dimensionedInternalField()); + + forAll(*this, faceI) + { + label cellI = patch().faceCells()[faceI]; + + G[cellI] = G0[cellI]; + omega[cellI] = omega0[cellI]; + } + + fvPatchField<scalar>::updateCoeffs(); +} + + +void omegaWallFunctionFvPatchScalarField::updateCoeffs +( + const scalarField& weights +) +{ + if (updated()) + { + return; + } + + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + setMaster(); + + if (patch().index() == master_) + { + createAveragingWeights(); + calculateTurbulenceFields(turbulence, G(true), omega(true)); + } + + const scalarField& G0 = this->G(); + const scalarField& omega0 = this->omega(); + + typedef DimensionedField<scalar, volMesh> FieldType; + + FieldType& G = + const_cast<FieldType&> + ( + db().lookupObject<FieldType>(turbulence.GName()) + ); + + FieldType& omega = const_cast<FieldType&>(dimensionedInternalField()); + + scalarField& omegaf = *this; + + // only set the values if the weights are < 1 - tolerance + forAll(weights, faceI) + { + scalar w = weights[faceI]; + + if (w < 1.0 - 1e-6) + { + label cellI = patch().faceCells()[faceI]; + + G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; + omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI]; + omegaf[faceI] = omega[cellI]; + } + } + + fvPatchField<scalar>::updateCoeffs(); +} + + +void omegaWallFunctionFvPatchScalarField::manipulateMatrix +( + fvMatrix<scalar>& matrix +) +{ + if (manipulatedMatrix()) + { + return; + } + + matrix.setValues(patch().faceCells(), patchInternalField()); + + fvPatchField<scalar>::manipulateMatrix(matrix); +} + + +void omegaWallFunctionFvPatchScalarField::manipulateMatrix +( + fvMatrix<scalar>& matrix, + const Field<scalar>& weights +) +{ + if (manipulatedMatrix()) + { + return; + } + + // filter weights so that we only apply the constraint where the + // weight > SMALL + DynamicList<label> constraintCells(weights.size()); + DynamicList<scalar> constraintomega(weights.size()); + const labelUList& faceCells = patch().faceCells(); + + const DimensionedField<scalar, volMesh>& omega + = dimensionedInternalField(); + + label nConstrainedCells = 0; + + + forAll(weights, faceI) + { + // only set the values if the weights are < 1 - tolerance + if (weights[faceI] < (1.0 - 1e-6)) + { + nConstrainedCells++; + + label cellI = faceCells[faceI]; + + constraintCells.append(cellI); + constraintomega.append(omega[cellI]); + } + } + + if (debug) + { + Pout<< "Patch: " << patch().name() + << ": number of constrained cells = " << nConstrainedCells + << " out of " << patch().size() + << endl; + } + + matrix.setValues + ( + constraintCells, + scalarField(constraintomega.xfer()) + ); + + fvPatchField<scalar>::manipulateMatrix(matrix); +} + + +void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedValueFvPatchField<scalar>::write(os); + writeLocalEntries(os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + omegaWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..123d47fc4e05398e7efa2b7cd405c3eda3691af4 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -0,0 +1,292 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::omegaWallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a wall function constraint on turbulnce + specific dissipation, omega. The values are computed using: + + \f[ + \omega = sqrt(\omega_{vis}^2 + \omega_{log}^2) + \f] + + where + + \vartable + \omega_{vis} | omega in viscous region + \omega_{log} | omega in logarithmic region + \endvartable + + Model described by Eq.(15) of: + \verbatim + Menter, F., Esch, T. + "Elements of Industrial Heat Transfer Prediction" + 16th Brazilian Congress of Mechanical Engineering (COBEM), + Nov. 2001 + \endverbatim + + \heading Patch usage + + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + beta1 | model coefficient | no | 0.075 + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type omegaWallFunction; + } + \endverbatim + +SourceFiles + omegaWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef omegaWallFunctionFvPatchScalarField_H +#define omegaWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class turbulenceModel; + +/*---------------------------------------------------------------------------*\ + Class omegaWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class omegaWallFunctionFvPatchScalarField +: + public fixedValueFvPatchField<scalar> +{ +protected: + + // Protected data + + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + //- beta1 coefficient + scalar beta1_; + + //- Y+ at the edge of the laminar sublayer + scalar yPlusLam_; + + //- Local copy of turbulence G field + scalarField G_; + + //- Local copy of turbulence omega field + scalarField omega_; + + //- Initialised flag + bool initialised_; + + //- Master patch ID + label master_; + + //- List of averaging corner weights + List<List<scalar> > cornerWeights_; + + + // Protected Member Functions + + //- Check the type of the patch + virtual void checkType(); + + //- Write local wall function variables + virtual void writeLocalEntries(Ostream&) const; + + //- Set the master patch - master is responsible for updating all + // wall function patches + virtual void setMaster(); + + //- Create the averaging weights for cells which are bounded by + // multiple wall function faces + virtual void createAveragingWeights(); + + //- Helper function to return non-const access to an omega patch + virtual omegaWallFunctionFvPatchScalarField& omegaPatch + ( + const label patchi + ); + + //- Main driver to calculate the turbulence fields + virtual void calculateTurbulenceFields + ( + const turbulenceModel& turbulence, + scalarField& G0, + scalarField& omega0 + ); + + //- Calculate the omega and G + virtual void calculate + ( + const turbulenceModel& turbulence, + const List<scalar>& cornerWeights, + const fvPatch& patch, + scalarField& G, + scalarField& omega + ); + + //- Return non-const access to the master patch ID + virtual label& master() + { + return master_; + } + + +public: + + //- Runtime type information + TypeName("omegaWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + omegaWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + omegaWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // omegaWallFunctionFvPatchScalarField + // onto a new patch + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new omegaWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + omegaWallFunctionFvPatchScalarField + ( + const omegaWallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new omegaWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return non-const access to the master's G field + scalarField& G(bool init = false); + + //- Return non-const access to the master's omega field + scalarField& omega(bool init = false); + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(const scalarField& weights); + + //- Manipulate matrix + virtual void manipulateMatrix(fvMatrix<scalar>& matrix); + + //- Manipulate matrix with given weights + virtual void manipulateMatrix + ( + fvMatrix<scalar>& matrix, + const scalarField& weights + ); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..ec604d11c84cf9f89f25734db25b99105d2c8708 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -0,0 +1,249 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "v2WallFunctionFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void v2WallFunctionFvPatchScalarField::checkType() +{ + if (!isA<wallFvPatch>(patch())) + { + FatalErrorIn("v2WallFunctionFvPatchScalarField::checkType()") + << "Invalid wall function specification" << nl + << " Patch type for patch " << patch().name() + << " must be wall" << nl + << " Current patch type is " << patch().type() << nl << endl + << abort(FatalError); + } +} + + +scalar v2WallFunctionFvPatchScalarField::yPlusLam +( + const scalar kappa, + const scalar E +) +{ + scalar ypl = 11.0; + + for (int i=0; i<10; i++) + { + ypl = log(max(E*ypl, 1))/kappa; + } + + return ypl; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(p, iF), + Cmu_(0.09), + kappa_(0.41), + E_(9.8), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField +( + const v2WallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<scalar>(ptf, p, iF, mapper), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + E_(ptf.E_), + yPlusLam_(ptf.yPlusLam_) +{ + checkType(); +} + + +v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<scalar>(p, iF, dict), + Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)), + kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)), + E_(dict.lookupOrDefault<scalar>("E", 9.8)), + yPlusLam_(yPlusLam(kappa_, E_)) +{ + checkType(); +} + + +v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField +( + const v2WallFunctionFvPatchScalarField& v2wfpsf +) +: + fixedValueFvPatchField<scalar>(v2wfpsf), + Cmu_(v2wfpsf.Cmu_), + kappa_(v2wfpsf.kappa_), + E_(v2wfpsf.E_), + yPlusLam_(v2wfpsf.yPlusLam_) +{ + checkType(); +} + + +v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField +( + const v2WallFunctionFvPatchScalarField& v2wfpsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchField<scalar>(v2wfpsf, iF), + Cmu_(v2wfpsf.Cmu_), + kappa_(v2wfpsf.kappa_), + E_(v2wfpsf.E_), + yPlusLam_(v2wfpsf.yPlusLam_) +{ + checkType(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void v2WallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const label patchi = patch().index(); + + const turbulenceModel& turbulence = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + const scalarField& y = turbulence.y()[patchi]; + + const tmp<volScalarField> tk = turbulence.k(); + const volScalarField& k = tk(); + + const tmp<scalarField> tnuw = turbulence.nu(patchi); + const scalarField& nuw = tnuw(); + + const scalar Cmu25 = pow025(Cmu_); + + scalarField& v2 = *this; + + // Set v2 wall values + forAll(v2, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uTau = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = uTau*y[faceI]/nuw[faceI]; + + if (yPlus > yPlusLam_) + { + scalar Cv2 = 0.193; + scalar Bv2 = -0.94; + v2[faceI] = Cv2/kappa_*log(yPlus) + Bv2; + } + else + { + scalar Cv2 = 0.193; + v2[faceI] = Cv2*pow4(yPlus); + } + + v2[faceI] *= sqr(uTau); + } + + fixedValueFvPatchField<scalar>::updateCoeffs(); + + // TODO: perform averaging for cells sharing more than one boundary face +} + + +void v2WallFunctionFvPatchScalarField::evaluate +( + const Pstream::commsTypes commsType +) +{ + fixedValueFvPatchField<scalar>::evaluate(commsType); +} + + +void v2WallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fixedValueFvPatchField<scalar>::write(os); + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + v2WallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..55047848b27e3dd66d55b83562bd2107c8af4688 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H @@ -0,0 +1,205 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 + Foam::RASModels::v2WallFunctionFvPatchScalarField + +Group + grpWallFunctions + +Description + This boundary condition provides a turbulence stress normal to streamlines + wall function condition for low- and high-Reynolds number, turbulent flow + cases. + + The model operates in two modes, based on the computed laminar-to-turbulent + switch-over y+ value derived from kappa and E. + + + \heading Patch usage + + \table + Property | Description | Required | Default value + Cmu | model coefficient | no | 0.09 + kappa | Von Karman constant | no | 0.41 + E | model coefficient | no | 9.8 + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type v2WallFunction; + } + \endverbatim + +SeeAlso + Foam::fixedValueFvPatchField + +SourceFiles + v2WallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef v2WallFunctionFvPatchScalarField_H +#define v2WallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class v2WallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class v2WallFunctionFvPatchScalarField +: + public fixedValueFvPatchField<scalar> +{ +protected: + + // Protected data + + //- Cmu coefficient + scalar Cmu_; + + //- Von Karman constant + scalar kappa_; + + //- E coefficient + scalar E_; + + //- Y+ at the edge of the laminar sublayer + scalar yPlusLam_; + + + // Protected Member Functions + + //- Check the type of the patch + virtual void checkType(); + + //- Calculate the Y+ at the edge of the laminar sublayer + scalar yPlusLam(const scalar kappa, const scalar E); + + +public: + + //- Runtime type information + TypeName("v2WallFunction"); + + + // Constructors + + //- Construct from patch and internal field + v2WallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + v2WallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given v2WallFunctionFvPatchScalarField + // onto a new patch + v2WallFunctionFvPatchScalarField + ( + const v2WallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + v2WallFunctionFvPatchScalarField + ( + const v2WallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new v2WallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + v2WallFunctionFvPatchScalarField + ( + const v2WallFunctionFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new v2WallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Evaluate the patchField + virtual void evaluate(const Pstream::commsTypes); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/eddyViscosity/eddyViscosity.C b/src/TurbulenceModels/turbulenceModel/RAS/eddyViscosity/eddyViscosity.C new file mode 100644 index 0000000000000000000000000000000000000000..938ff106aca7db1a8a162998d27e3912de6f62af --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/eddyViscosity/eddyViscosity.C @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "eddyViscosity.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +eddyViscosity<BasicTurbulenceModel>::eddyViscosity +( + const word& modelName, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + RASModel<BasicTurbulenceModel> + ( + modelName, + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ), + + nut_ + ( + IOobject + ( + IOobject::groupName("nut", U.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + this->mesh_ + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +tmp<volSymmTensorField> eddyViscosity<BasicTurbulenceModel>::R() const +{ + tmp<volScalarField> tk(k()); + + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("R", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ((2.0/3.0)*I)*tk() - (nut_)*dev(twoSymm(fvc::grad(this->U_))), + tk().boundaryField().types() + ) + ); +} + + +template<class BasicTurbulenceModel> +tmp<volSymmTensorField> eddyViscosity<BasicTurbulenceModel>::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("devRhoReff", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + (-(this->alpha_*this->rho_*this->nuEff())) + *dev(twoSymm(fvc::grad(this->U_))) + ) + ); +} + + +template<class BasicTurbulenceModel> +tmp<fvVectorMatrix> eddyViscosity<BasicTurbulenceModel>::divDevRhoReff +( + volVectorField& U +) const +{ + return + ( + - fvm::laplacian(this->alpha_*this->rho_*this->nuEff(), U) + - fvc::div((this->alpha_*this->rho_*this->nuEff())*dev2(T(fvc::grad(U)))) + ); +} + + +template<class BasicTurbulenceModel> +bool eddyViscosity<BasicTurbulenceModel>::read() +{ + return RASModel<BasicTurbulenceModel>::read(); +} + + +template<class BasicTurbulenceModel> +void eddyViscosity<BasicTurbulenceModel>::correct() +{ + RASModel<BasicTurbulenceModel>::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/eddyViscosity/eddyViscosity.H b/src/TurbulenceModels/turbulenceModel/RAS/eddyViscosity/eddyViscosity.H new file mode 100644 index 0000000000000000000000000000000000000000..4d1c6ca87143cd21d5a77da07ea76140b7a561db --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/eddyViscosity/eddyViscosity.H @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::RASModels::eddyViscosity + +Group + grpRASTurbulence + +Description + Eddy viscosity turbulence model base class + +SourceFiles + eddyViscosity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef eddyViscosity_H +#define eddyViscosity_H + +#include "RASModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class eddyViscosity Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasicTurbulenceModel> +class eddyViscosity +: + public RASModel<BasicTurbulenceModel> +{ + +protected: + + // Protected data + + // Fields + + volScalarField nut_; + + + // Protected member functions + + virtual void correctNut() = 0; + + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + // Constructors + + //- Construct from components + eddyViscosity + ( + const word& modelName, + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ); + + + //- Destructor + virtual ~eddyViscosity() + {} + + + // Member Functions + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const + { + return nut_; + } + + //- Return the turbulence viscosity on patch + virtual tmp<scalarField> nut(const label patchi) const + { + return nut_.boundaryField()[patchi]; + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor + virtual tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct() = 0; + + //- Read RASProperties dictionary + virtual bool read() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "eddyViscosity.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/kEpsilon/kEpsilon.C b/src/TurbulenceModels/turbulenceModel/RAS/kEpsilon/kEpsilon.C new file mode 100644 index 0000000000000000000000000000000000000000..01ae01a594a485ea868dbee3189ba55112690ba6 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/kEpsilon/kEpsilon.C @@ -0,0 +1,293 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "kEpsilon.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +kEpsilon<BasicTurbulenceModel>::kEpsilon +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName, + const word& type +) +: + eddyViscosity<BasicTurbulenceModel> + ( + type, + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ), + + Cmu_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "Cmu", + this->coeffDict_, + 0.09 + ) + ), + C1_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C1", + this->coeffDict_, + 1.44 + ) + ), + C2_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C2", + this->coeffDict_, + 1.92 + ) + ), + C3_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "C3", + this->coeffDict_, + 0 + ) + ), + sigmak_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "sigmak", + this->coeffDict_, + 1.0 + ) + ), + sigmaEps_ + ( + dimensioned<scalar>::lookupOrAddToDict + ( + "sigmaEps", + this->coeffDict_, + 1.3 + ) + ), + + k_ + ( + IOobject + ( + IOobject::groupName("k", U.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + this->mesh_ + ), + epsilon_ + ( + IOobject + ( + IOobject::groupName("epsilon", U.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + this->mesh_ + ) +{ + bound(k_, this->kMin_); + bound(epsilon_, this->epsilonMin_); + + if (type == typeName) + { + correctNut(); + this->printCoeffs(type); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +bool kEpsilon<BasicTurbulenceModel>::read() +{ + if (eddyViscosity<BasicTurbulenceModel>::read()) + { + Cmu_.readIfPresent(this->coeffDict()); + C1_.readIfPresent(this->coeffDict()); + C2_.readIfPresent(this->coeffDict()); + C3_.readIfPresent(this->coeffDict()); + sigmak_.readIfPresent(this->coeffDict()); + sigmaEps_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } +} + + +template<class BasicTurbulenceModel> +void kEpsilon<BasicTurbulenceModel>::correctNut() +{ + this->nut_ = Cmu_*sqr(k_)/epsilon_; + this->nut_.correctBoundaryConditions(); +} + + +template<class BasicTurbulenceModel> +tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::kSource() const +{ + return tmp<fvScalarMatrix> + ( + new fvScalarMatrix + ( + k_, + dimVolume*this->rho_.dimensions()*k_.dimensions() + /dimTime + ) + ); +} + + +template<class BasicTurbulenceModel> +tmp<fvScalarMatrix> kEpsilon<BasicTurbulenceModel>::epsilonSource() const +{ + return tmp<fvScalarMatrix> + ( + new fvScalarMatrix + ( + epsilon_, + dimVolume*this->rho_.dimensions()*epsilon_.dimensions() + /dimTime + ) + ); +} + + +template<class BasicTurbulenceModel> +void kEpsilon<BasicTurbulenceModel>::correct() +{ + // Local references + const alphaField& alpha = this->alpha_; + const rhoField& rho = this->rho_; + const surfaceScalarField& alphaPhi = this->alphaPhi_; + const surfaceScalarField& phi = this->phi_; + const volVectorField& U = this->U_; + volScalarField& nut = this->nut_; + + if (!this->turbulence_) + { + correctNut(); + return; + } + + eddyViscosity<BasicTurbulenceModel>::correct(); + + volScalarField divU(fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U))); + + tmp<volTensorField> tgradU = fvc::grad(U); + volScalarField G(this->GName(), nut*(tgradU() && dev(twoSymm(tgradU())))); + tgradU.clear(); + + // Update epsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + + // Dissipation equation + tmp<fvScalarMatrix> epsEqn + ( + fvm::ddt(alpha, rho, epsilon_) + + fvm::div(alphaPhi, epsilon_) + - fvm::Sp(fvc::ddt(alpha, rho) + fvc::div(alphaPhi), epsilon_) + - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) + == + C1_*alpha*rho*G*epsilon_/k_ + - fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha*rho*divU, epsilon_) + - fvm::Sp(C2_*alpha*rho*epsilon_/k_, epsilon_) + + epsilonSource() + ); + + epsEqn().relax(); + + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + + solve(epsEqn); + bound(epsilon_, this->epsilonMin_); + + + // Turbulent kinetic energy equation + + tmp<fvScalarMatrix> kEqn + ( + fvm::ddt(alpha, rho, k_) + + fvm::div(alphaPhi, k_) + - fvm::Sp(fvc::ddt(alpha, rho) + fvc::div(alphaPhi), k_) + - fvm::laplacian(alpha*rho*DkEff(), k_) + == + alpha*rho*G + - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_) + - fvm::Sp(alpha*rho*epsilon_/k_, k_) + + kSource() + ); + + kEqn().relax(); + solve(kEqn); + bound(k_, this->kMin_); + + correctNut(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/RAS/kEpsilon/kEpsilon.H b/src/TurbulenceModels/turbulenceModel/RAS/kEpsilon/kEpsilon.H new file mode 100644 index 0000000000000000000000000000000000000000..8d32770fe12121b437dcf3a6bc11cb8dea5c8f40 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/RAS/kEpsilon/kEpsilon.H @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::RASModels::kEpsilon + +Group + grpRASTurbulence + +Description + Standard k-epsilon turbulence model + + The default model coefficients correspond to the following: + \verbatim + kEpsilonCoeffs + { + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + sigmak 1.0; + sigmaEps 1.3; + } + \endverbatim + +SourceFiles + kEpsilon.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kEpsilon_H +#define kEpsilon_H + +#include "eddyViscosity.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class kEpsilon Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasicTurbulenceModel> +class kEpsilon +: + public eddyViscosity<BasicTurbulenceModel> +{ + +protected: + + // Protected data + + // Model coefficients + + dimensionedScalar Cmu_; + dimensionedScalar C1_; + dimensionedScalar C2_; + dimensionedScalar C3_; + dimensionedScalar sigmak_; + dimensionedScalar sigmaEps_; + + // Fields + + volScalarField k_; + volScalarField epsilon_; + + + // Protected member functions + + virtual void correctNut(); + virtual tmp<fvScalarMatrix> kSource() const; + virtual tmp<fvScalarMatrix> epsilonSource() const; + + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + //- Runtime type information + TypeName("kEpsilon"); + + + // Constructors + + //- Construct from components + kEpsilon + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName, + const word& type = typeName + ); + + + //- Destructor + virtual ~kEpsilon() + {} + + + // Member Functions + + //- Return the effective diffusivity for k + tmp<volScalarField> DkEff() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + "DkEff", + (this->nut_/sigmak_ + this->nu()) + ) + ); + } + + //- Return the effective diffusivity for epsilon + tmp<volScalarField> DepsilonEff() const + { + return tmp<volScalarField> + ( + new volScalarField + ( + "DepsilonEff", + (this->nut_/sigmaEps_ + this->nu()) + ) + ); + } + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const + { + return k_; + } + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const + { + return epsilon_; + } + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct(); + + //- Re-read model coefficients if they have changed + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "kEpsilon.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/TurbulenceModel/TurbulenceModel.C b/src/TurbulenceModels/turbulenceModel/TurbulenceModel/TurbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..5d31063bc73abf9c69c4f66caa2713041e207b05 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/TurbulenceModel/TurbulenceModel.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "TurbulenceModel.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +< + class Alpha, + class Rho, + class BasicTurbulenceModel, + class TransportModel +> +Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>:: +TurbulenceModel +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + BasicTurbulenceModel + ( + rho, + U, + alphaPhi, + phi, + propertiesName + ), + alpha_(alpha), + transport_(transport) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template +< + class Alpha, + class Rho, + class BasicTurbulenceModel, + class TransportModel +> +Foam::autoPtr +< + Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel> +> +Foam::TurbulenceModel<Alpha, Rho, BasicTurbulenceModel, TransportModel>::New +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +{ + // get model name, but do not register the dictionary + // otherwise it is registered in the database twice + const word modelType + ( + IOdictionary + ( + IOobject + ( + IOobject::groupName(propertiesName, U.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ).lookup("simulationType") + ); + + Info<< "Selecting turbulence model type " << modelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "TurbulenceModel::New" + "(const alphaField&, const rhoField&, " + "const volVectorField&, const surfaceScalarField&, " + "transportModel&, const word&)" + ) << "Unknown TurbulenceModel type " + << modelType << nl << nl + << "Valid TurbulenceModel types:" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr<TurbulenceModel> + ( + cstrIter()(alpha, rho, U, alphaPhi, phi, transport, propertiesName) + ); +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/TurbulenceModel/TurbulenceModel.H b/src/TurbulenceModels/turbulenceModel/TurbulenceModel/TurbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..484fa8b552b09f2c0924cda34f1db282193eff7a --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/TurbulenceModel/TurbulenceModel.H @@ -0,0 +1,188 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::TurbulenceModel + +Description + Templated abstract base class for turbulence models + +SourceFiles + TurbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TurbulenceModel_H +#define TurbulenceModel_H + +#include "turbulenceModel.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class TurbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +template +< + class Alpha, + class Rho, + class BasicTurbulenceModel, + class TransportModel +> +class TurbulenceModel +: + public BasicTurbulenceModel +{ + +public: + + typedef Alpha alphaField; + typedef Rho rhoField; + typedef TransportModel transportModel; + + +protected: + + // Protected data + + const alphaField& alpha_; + const transportModel& transport_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + TurbulenceModel(const TurbulenceModel&); + + //- Disallow default bitwise assignment + void operator=(const TurbulenceModel&); + + +public: + + // Declare run-time constructor selection table + + declareRunTimeNewSelectionTable + ( + autoPtr, + TurbulenceModel, + dictionary, + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ), + (alpha, rho, U, alphaPhi, phi, transport, propertiesName) + ); + + + // Constructors + + //- Construct + TurbulenceModel + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<TurbulenceModel> New + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~TurbulenceModel() + {} + + + // Member Functions + + //- Access function to phase fraction + const alphaField& alpha() const + { + return alpha_; + } + + //- Access function to incompressible transport model + const transportModel& transport() const + { + return transport_; + } + + //- Return the laminar viscosity + tmp<volScalarField> nu() const + { + return transport_.nu(); + } + + //- Return the laminar viscosity on patchi + tmp<scalarField> nu(const label patchi) const + { + return transport_.nu(patchi); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "TurbulenceModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C new file mode 100644 index 0000000000000000000000000000000000000000..1e3e193cf0d2bb4c27d74c627ff22e1e852e08a5 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "fixedShearStressFvPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "turbulenceModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchVectorField(p, iF), + phiName_("phi"), + rhoName_("rho"), + tau0_(vector::zero) +{} + + +Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchVectorField(p, iF), + phiName_(dict.lookupOrDefault<word>("phi", "phi")), + rhoName_(dict.lookupOrDefault<word>("rho", "rho")), + tau0_(dict.lookupOrDefault<vector>("tau", vector::zero)) +{ + fvPatchField<vector>::operator=(patchInternalField()); +} + + +Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField +( + const fixedShearStressFvPatchVectorField& ptf, + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchVectorField(ptf, p, iF, mapper), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_), + tau0_(ptf.tau0_) +{} + + +Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField +( + const fixedShearStressFvPatchVectorField& ptf +) +: + fixedValueFvPatchVectorField(ptf), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_), + tau0_(ptf.tau0_) +{} + + +Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField +( + const fixedShearStressFvPatchVectorField& ptf, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchVectorField(ptf, iF), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_), + tau0_(ptf.tau0_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::fixedShearStressFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + scalarField nuEff(turbModel.nuEff()()[patch().index()]); + + const vectorField Uc(patchInternalField()); + + vector tauHat = tau0_/(mag(tau0_) + ROOTVSMALL); + + const scalarField& ry = patch().deltaCoeffs(); + + operator==(tauHat*(tauHat & (tau0_*(1.0/(ry*nuEff)) + Uc))); + + fixedValueFvPatchVectorField::updateCoeffs(); +} + + +void Foam::fixedShearStressFvPatchVectorField::write(Ostream& os) const +{ + fixedValueFvPatchVectorField::write(os); + writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); + writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); + os.writeKeyword("tau") << tau0_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchVectorField, + fixedShearStressFvPatchVectorField + ); +} + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H new file mode 100644 index 0000000000000000000000000000000000000000..a399ff07eb2d87ce8bb956a2e8406442d23ebd19 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.H @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::fixedShearStressFvPatchVectorField + +Group + grpWallBoundaryConditions + +Description + Set a constant shear stress as tau0 = -nuEff dU/dn. + +SourceFiles + fixedShearStressFvPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedShearStressFvPatchVectorField_H +#define fixedShearStressFvPatchVectorField_H + +#include "fvPatchFields.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class fixedShearStressFvPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class fixedShearStressFvPatchVectorField +: + public fixedValueFvPatchVectorField +{ + // Private data + + //- Name of flux field (default = phi) + const word phiName_; + + //- Name of density field (default = rho) + const word rhoName_; + + //- Constant shear stress + const vector tau0_; + + +public: + + //- Runtime type information + TypeName("fixedShearStress"); + + + // Constructors + + //- Construct from patch and internal field + fixedShearStressFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + fixedShearStressFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + fixedShearStressFvPatchVectorField + ( + const fixedShearStressFvPatchVectorField&, + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + fixedShearStressFvPatchVectorField + ( + const fixedShearStressFvPatchVectorField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchVectorField> clone() const + { + return tmp<fvPatchVectorField> + ( + new fixedShearStressFvPatchVectorField(*this) + ); + } + + //- Construct as copy setting internal field reference + fixedShearStressFvPatchVectorField + ( + const fixedShearStressFvPatchVectorField&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchVectorField> clone + ( + const DimensionedField<vector, volMesh>& iF + ) const + { + return tmp<fvPatchVectorField> + ( + new fixedShearStressFvPatchVectorField(*this, iF) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..c3e93912f5cdf01cb8d2570dfda31e145d7fbf4e --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "porousBafflePressureFvPatchField.H" +#include "surfaceFields.H" +#include "turbulenceModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedJumpFvPatchField<scalar>(p, iF), + D_(0), + I_(0), + length_(0) +{} + + +Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField +( + const porousBafflePressureFvPatchField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper), + D_(ptf.D_), + I_(ptf.I_), + length_(ptf.length_) +{} + + +Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedJumpFvPatchField<scalar>(p, iF), + D_(readScalar(dict.lookup("D"))), + I_(readScalar(dict.lookup("I"))), + length_(readScalar(dict.lookup("length"))) +{ + fvPatchField<scalar>::operator= + ( + Field<scalar>("value", dict, p.size()) + ); +} + + +Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField +( + const porousBafflePressureFvPatchField& ptf +) +: + cyclicLduInterfaceField(), + fixedJumpFvPatchField<scalar>(ptf), + D_(ptf.D_), + I_(ptf.I_), + length_(ptf.length_) +{} + + +Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField +( + const porousBafflePressureFvPatchField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedJumpFvPatchField<scalar>(ptf, iF), + D_(ptf.D_), + I_(ptf.I_), + length_(ptf.length_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::porousBafflePressureFvPatchField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const surfaceScalarField& phi = + db().lookupObject<surfaceScalarField>("phi"); + + const fvsPatchField<scalar>& phip = + patch().patchField<surfaceScalarField, scalar>(phi); + + scalarField Un(phip/patch().magSf()); + + scalarField magUn(mag(Un)); + + const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> + ( + IOobject::groupName + ( + turbulenceModel::propertiesName, + dimensionedInternalField().group() + ) + ); + + jump_ = + -sign(Un) + *( + I_*turbModel.nuEff(patch().index()) + + D_*0.5*magUn + )*magUn*length_; + + if (debug) + { + scalar avePressureJump = gAverage(jump_); + scalar aveVelocity = gAverage(mag(Un)); + + Info<< patch().boundaryMesh().mesh().name() << ':' + << patch().name() << ':' + << " Average pressure drop :" << avePressureJump + << " Average velocity :" << aveVelocity + << endl; + } + + fixedJumpFvPatchField<scalar>::updateCoeffs(); +} + + +void Foam::porousBafflePressureFvPatchField::write(Ostream& os) const +{ + fixedJumpFvPatchField<scalar>::write(os); + os.writeKeyword("D") << D_ << token::END_STATEMENT << nl; + os.writeKeyword("I") << I_ << token::END_STATEMENT << nl; + os.writeKeyword("length") << length_ << token::END_STATEMENT << nl; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + porousBafflePressureFvPatchField + ); +} + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..917711e2436e92d709e50b76482337cea3a223c7 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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::porousBafflePressureFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a jump condition, using the \cyclic + condition as a base. + + The porous baffle introduces a pressure jump defined by: + + \f[ + \Delta p = -(I \mu U + 0.5 D \rho |U|^2 )L + \f] + + where + + \vartable + p | pressure [Pa] + \rho | density [kg/m3] + \mu | viscosity [Pa s] + I | inertial coefficient + D | Darcy coefficient + L | porous media length in the flow direction + \endvartable + + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + D | Darcy coefficient | yes | + I | inertial coefficient | yes | + L | porous media length in the flow direction | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type porousBafflePressure; + patchType cyclic; + jump uniform 0; + D 1000000; + I 0.001; + L 0.1; + value uniform 0; + } + \endverbatim + +Note + The underlying \c patchType should be set to \c cyclic + +SourceFiles + porousBafflePressureFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef porousBafflePressureFvPatchField_H +#define porousBafflePressureFvPatchField_H + +#include "fixedJumpFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class porousBafflePressureFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +class porousBafflePressureFvPatchField +: + public fixedJumpFvPatchField<scalar> +{ + // Private data + + //- Darcy pressure loss coefficient + scalar D_; + + //- Inertia pressure lost coefficient + scalar I_; + + //- Porous media length + scalar length_; + + +public: + + //- Runtime type information + TypeName("porousBafflePressure"); + + + // Constructors + + //- Construct from patch and internal field + porousBafflePressureFvPatchField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + porousBafflePressureFvPatchField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given porousBafflePressureFvPatchField + // onto a new patch + porousBafflePressureFvPatchField + ( + const porousBafflePressureFvPatchField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + porousBafflePressureFvPatchField + ( + const porousBafflePressureFvPatchField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<scalar> > clone() const + { + return tmp<fvPatchField<scalar> > + ( + new porousBafflePressureFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + porousBafflePressureFvPatchField + ( + const porousBafflePressureFvPatchField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<scalar> > clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchField<scalar> > + ( + new porousBafflePressureFvPatchField(*this, iF) + ); + } + + + // Member functions + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFieldFwd.H b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFieldFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..946f45d0762a167f5c0e26d852e339e728599424 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFieldFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 porousBafflePressureFvPatchFieldsFwd_H +#define porousBafflePressureFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class porousBafflePressureFvPatchField; + +makePatchTypeFieldTypedefs(porousBafflePressure); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/laminar/laminar.C b/src/TurbulenceModels/turbulenceModel/laminar/laminar.C new file mode 100644 index 0000000000000000000000000000000000000000..c2799e5cc13014221bceb9d436dcdd5a9778cb3c --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/laminar/laminar.C @@ -0,0 +1,286 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "laminar.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "fvcGrad.H" +#include "fvcDiv.H" +#include "fvmLaplacian.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +Foam::laminar<BasicTurbulenceModel>::laminar +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +: + BasicTurbulenceModel + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ) +{} + + +// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +Foam::autoPtr<Foam::laminar<BasicTurbulenceModel> > +Foam::laminar<BasicTurbulenceModel>::New +( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName +) +{ + return autoPtr<laminar> + ( + new laminar + ( + alpha, + rho, + U, + alphaPhi, + phi, + transport, + propertiesName + ) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class BasicTurbulenceModel> +const Foam::dictionary& +Foam::laminar<BasicTurbulenceModel>::coeffDict() const +{ + return dictionary::null; +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::volScalarField> +Foam::laminar<BasicTurbulenceModel>::nut() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("nut", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar("nut", dimViscosity, 0.0) + ) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::scalarField> +Foam::laminar<BasicTurbulenceModel>::nut +( + const label patchi +) const +{ + return tmp<scalarField> + ( + new scalarField(this->mesh_.boundary()[patchi].size(), 0.0) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::volScalarField> +Foam::laminar<BasicTurbulenceModel>::nuEff() const +{ + return tmp<volScalarField> + ( + new volScalarField("nuEff", this->nu()) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::scalarField> +Foam::laminar<BasicTurbulenceModel>::nuEff +( + const label patchi +) const +{ + return this->nu(patchi); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::volScalarField> +Foam::laminar<BasicTurbulenceModel>::k() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("k", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar("k", sqr(this->U_.dimensions()), 0.0) + ) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::volScalarField> +Foam::laminar<BasicTurbulenceModel>::epsilon() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + IOobject::groupName("epsilon", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar + ( + "epsilon", sqr(this->U_.dimensions())/dimTime, 0.0 + ) + ) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::volSymmTensorField> +Foam::laminar<BasicTurbulenceModel>::R() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("R", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedSymmTensor + ( + "R", sqr(this->U_.dimensions()), symmTensor::zero + ) + ) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::volSymmTensorField> +Foam::laminar<BasicTurbulenceModel>::devRhoReff() const +{ + return tmp<volSymmTensorField> + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("devRhoReff", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -(this->alpha_*this->rho_*nuEff())*dev(twoSymm(fvc::grad(this->U_))) + ) + ); +} + + +template<class BasicTurbulenceModel> +Foam::tmp<Foam::fvVectorMatrix> +Foam::laminar<BasicTurbulenceModel>::divDevRhoReff +( + volVectorField& U +) const +{ + return + ( + - fvm::laplacian(this->alpha_*this->rho_*nuEff(), U) + - fvc::div(this->alpha_*this->rho_*nuEff()*dev2(T(fvc::grad(U)))) + ); +} + + +template<class BasicTurbulenceModel> +void Foam::laminar<BasicTurbulenceModel>::correct() +{ + BasicTurbulenceModel::correct(); +} + + +template<class BasicTurbulenceModel> +bool Foam::laminar<BasicTurbulenceModel>::read() +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/laminar/laminar.H b/src/TurbulenceModels/turbulenceModel/laminar/laminar.H new file mode 100644 index 0000000000000000000000000000000000000000..e0cd8157fa9e66af0a0f16d6e1d3b071b9b81788 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/laminar/laminar.H @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::laminar + +Description + Turbulence model for laminar flow. + +SourceFiles + laminar.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminar_H +#define laminar_H + +#include "TurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------* \ + Class laminar Declaration +\*---------------------------------------------------------------------------*/ + +template<class BasicTurbulenceModel> +class laminar +: + public BasicTurbulenceModel +{ + +public: + + typedef typename BasicTurbulenceModel::alphaField alphaField; + typedef typename BasicTurbulenceModel::rhoField rhoField; + typedef typename BasicTurbulenceModel::transportModel transportModel; + + + //- Runtime type information + TypeName("laminar"); + + + // Constructors + + //- Construct from components + laminar + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + // Selectors + + //- Return a reference to the selected turbulence model + static autoPtr<laminar> New + ( + const alphaField& alpha, + const rhoField& rho, + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const transportModel& transport, + const word& propertiesName = turbulenceModel::propertiesName + ); + + + //- Destructor + virtual ~laminar() + {} + + + // Member Functions + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const; + + //- Return the turbulence viscosity, i.e. 0 for laminar flow + virtual tmp<volScalarField> nut() const; + + //- Return the turbulence viscosity on patch + virtual tmp<scalarField> nut(const label patchi) const; + + //- Return the effective viscosity, i.e. the laminar viscosity + virtual tmp<volScalarField> nuEff() const; + + //- Return the effective viscosity on patch + virtual tmp<scalarField> nuEff(const label patchi) const; + + //- Return the turbulence kinetic energy, i.e. 0 for laminar flow + virtual tmp<volScalarField> k() const; + + //- Return the turbulence kinetic energy dissipation rate, + // i.e. 0 for laminar flow + virtual tmp<volScalarField> epsilon() const; + + //- Return the Reynolds stress tensor, i.e. 0 for laminar flow + virtual tmp<volSymmTensorField> R() const; + + //- Return the effective stress tensor, i.e. the laminar stress + virtual tmp<volSymmTensorField> devRhoReff() const; + + //- Return the source term for the momentum equation + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- Correct the laminar viscosity + virtual void correct(); + + //- Read turbulenceProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "laminar.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/turbulenceModel.C b/src/TurbulenceModels/turbulenceModel/turbulenceModel.C new file mode 100644 index 0000000000000000000000000000000000000000..b6485f5cf58f55bb2f41ab261631d687f77dc5b7 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/turbulenceModel.C @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "turbulenceModel.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "wallFvPatch.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(turbulenceModel, 0); +} + +const Foam::word Foam::turbulenceModel::propertiesName("turbulenceProperties"); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::turbulenceModel::turbulenceModel +( + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const word& propertiesName +) +: + IOdictionary + ( + IOobject + ( + IOobject::groupName(propertiesName, U.group()), + U.time().constant(), + U.db(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ), + + runTime_(U.time()), + mesh_(U.mesh()), + + U_(U), + alphaPhi_(alphaPhi), + phi_(phi), + y_(mesh_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::turbulenceModel::read() +{ + return regIOobject::read(); +} + + +void Foam::turbulenceModel::correct() +{ + if (mesh_.changing()) + { + y_.correct(); + } +} + + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/turbulenceModel.H b/src/TurbulenceModels/turbulenceModel/turbulenceModel.H new file mode 100644 index 0000000000000000000000000000000000000000..31385546e4e3403a1c3f28fcd9145dfbcbe3bc81 --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/turbulenceModel.H @@ -0,0 +1,227 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::turbulenceModel + +Description + Abstract base class for turbulence models (RAS, LES and laminar). + +SourceFiles + turbulenceModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulenceModel_H +#define turbulenceModel_H + +#include "IOdictionary.H" +#include "primitiveFieldsFwd.H" +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "fvMatricesFwd.H" +#include "nearWallDist.H" +#include "geometricOneField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declarations +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class turbulenceModel Declaration +\*---------------------------------------------------------------------------*/ + +class turbulenceModel +: + public IOdictionary +{ + +protected: + + // Protected data + + const Time& runTime_; + const fvMesh& mesh_; + + const volVectorField& U_; + const surfaceScalarField& alphaPhi_; + const surfaceScalarField& phi_; + + //- Near wall distance boundary field + nearWallDist y_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + turbulenceModel(const turbulenceModel&); + + //- Disallow default bitwise assignment + void operator=(const turbulenceModel&); + + +public: + + //- Runtime type information + TypeName("turbulenceModel"); + + //- Default name of the turbulence properties dictionary + static const word propertiesName; + + + // Constructors + + //- Construct from components + turbulenceModel + ( + const volVectorField& U, + const surfaceScalarField& alphaPhi, + const surfaceScalarField& phi, + const word& propertiesName + ); + + + //- Destructor + virtual ~turbulenceModel() + {} + + + // Member Functions + + const Time& time() const + { + return runTime_; + } + + const fvMesh& mesh() const + { + return mesh_; + } + + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const = 0; + + //- Helper function to return the nam eof the turbulence G field + inline word GName() const + { + return word(type() + ":G"); + } + + //- Access function to velocity field + inline const volVectorField& U() const + { + return U_; + } + + //- Access function to phase flux field + inline const surfaceScalarField& alphaPhi() const + { + return alphaPhi_; + } + + //- Access function to flux field + inline const surfaceScalarField& phi() const + { + return phi_; + } + + //- Return the near wall distances + const nearWallDist& y() const + { + return y_; + } + + //- Return the laminar viscosity + virtual tmp<volScalarField> nu() const = 0; + + //- Return the laminar viscosity on patch + virtual tmp<scalarField> nu(const label patchi) const = 0; + + //- Return the turbulence viscosity + virtual tmp<volScalarField> nut() const = 0; + + //- Return the turbulence viscosity on patch + virtual tmp<scalarField> nut(const label patchi) const = 0; + + //- Return the effective viscosity + virtual tmp<volScalarField> nuEff() const = 0; + + //- Return the effective viscosity on patch + virtual tmp<scalarField> nuEff(const label patchi) const = 0; + + //- Return the laminar dynamic viscosity + virtual tmp<volScalarField> mu() const = 0; + + //- Return the laminar dynamic viscosity on patch + virtual tmp<scalarField> mu(const label patchi) const = 0; + + //- Return the turbulence dynamic viscosity + virtual tmp<volScalarField> mut() const = 0; + + //- Return the turbulence dynamic viscosity on patch + virtual tmp<scalarField> mut(const label patchi) const = 0; + + //- Return the effective dynamic viscosity + virtual tmp<volScalarField> muEff() const = 0; + + //- Return the effective dynamic viscosity on patch + virtual tmp<scalarField> muEff(const label patchi) const = 0; + + //- Return the turbulence kinetic energy + virtual tmp<volScalarField> k() const = 0; + + //- Return the turbulence kinetic energy dissipation rate + virtual tmp<volScalarField> epsilon() const = 0; + + //- Return the Reynolds stress tensor + virtual tmp<volSymmTensorField> R() const = 0; + + //- Solve the turbulence equations and correct the turbulence viscosity + virtual void correct() = 0; + + //- Read LESProperties or RASProperties dictionary + virtual bool read() = 0; + + //- Default dummy write function + virtual bool writeData(Ostream&) const + { + return true; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/TurbulenceModels/turbulenceModel/turbulenceModelDoc.H b/src/TurbulenceModels/turbulenceModel/turbulenceModelDoc.H new file mode 100644 index 0000000000000000000000000000000000000000..739af7388e3ec6bdf896fb637ca17e6cadd0b78f --- /dev/null +++ b/src/TurbulenceModels/turbulenceModel/turbulenceModelDoc.H @@ -0,0 +1,31 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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/>. + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +\defgroup grpIcoTurbulence Incompressible turbulence +@{ + This group contains incompressible turbulence models. +@} + +\*---------------------------------------------------------------------------*/ diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index b0051e4689f4fdb20df233c9cc35fd9b24c00b87..8cf2f031719f96f5b59fef7eb628dd507805125e 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -42,7 +42,7 @@ Foam::combustionModels::PaSR<Type>::PaSR ( IOobject ( - "PaSR::kappa", + typeName + ":kappa", mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -166,7 +166,7 @@ Foam::combustionModels::PaSR<Type>::dQ() const ( IOobject ( - "dQ", + typeName + ":dQ", this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, @@ -199,7 +199,7 @@ Foam::combustionModels::PaSR<Type>::Sh() const ( IOobject ( - "Sh", + typeName + ":Sh", this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C index fed1b4403a7892e8059a0e1657799b02a800c6f9..15b24c8b1a74206bea0ec71f2bd868bafd7cb0fc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.C @@ -28,7 +28,6 @@ License #include "volFields.H" #include "IFstream.H" #include "globalIndex.H" -#include "ListListOps.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -43,10 +42,7 @@ Foam::externalCoupledMixedFvPatchField<Type>::patchKey = "# Patch: "; // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class Type> -Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::baseDir -( - const word& patchName -) const +Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::baseDir() const { word regionName(this->dimensionedInternalField().mesh().name()); if (regionName == polyMesh::defaultRegion) @@ -57,29 +53,16 @@ Foam::fileName Foam::externalCoupledMixedFvPatchField<Type>::baseDir fileName result(commsDir_/regionName); result.clean(); - if (collate_) - { - return result; - } - else - { - if (patchName == word::null) - { - return fileName(result/this->patch().name()); - } - else - { - return fileName(result/patchName); - } - } + return result; } template<class Type> -void Foam::externalCoupledMixedFvPatchField<Type>::setMaster() +void Foam::externalCoupledMixedFvPatchField<Type>::setMaster +( + const labelList& patchIDs +) { - typedef GeometricField<Type, fvPatchField, volMesh> volFieldType; - const volFieldType& cvf = static_cast<const volFieldType&>(this->dimensionedInternalField()); @@ -87,63 +70,60 @@ void Foam::externalCoupledMixedFvPatchField<Type>::setMaster() typename volFieldType::GeometricBoundaryField& bf = vf.boundaryField(); - if (collate_) + // number of patches can be different in parallel... + label nPatch = bf.size(); + reduce(nPatch, maxOp<label>()); + + offsets_.setSize(nPatch); + forAll(offsets_, i) { - bool found = false; - forAll(bf, patchI) + offsets_[i].setSize(Pstream::nProcs()); + offsets_[i] = 0; + } + + // set the master patch + forAll(patchIDs, i) + { + label patchI = patchIDs[i]; + + patchType& pf = refCast<patchType>(bf[patchI]); + + offsets_[patchI][Pstream::myProcNo()] = pf.size(); + + if (i == 0) { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) - { - externalCoupledMixedFvPatchField<Type>& pf = - refCast<externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); - - // only attempt to change master flags of BCs that have not - // been set (or at least only the master) - if (pf.master()) - { - if (!found) - { - pf.master() = true; - found = true; - } - else - { - pf.master() = false; - } - } - } + pf.master() = true; + } + else + { + pf.master() = false; } } - else + + // set the patch offsets + int tag = Pstream::msgType() + 1; + forAll(offsets_, i) + { + Pstream::gatherList(offsets_[i], tag); + Pstream::scatterList(offsets_[i], tag); + } + + label patchOffset = 0; + forAll(offsets_, patchI) { - // check that collated flag is not set on any other patches - forAll(bf, patchI) + label sumOffset = 0; + List<label>& procOffsets = offsets_[patchI]; + + forAll(procOffsets, procI) { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) + label o = procOffsets[procI]; + if (o > 0) { - const externalCoupledMixedFvPatchField<Type>& pf = - refCast<const externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); - - if (pf.collate()) - { - FatalErrorIn - ( - "void Foam::externalCoupledMixedFvPatchField<Type>::" - "setMaster()" - ) << "All " << type() << " patches should either use " - << "collate = true OR false, but not a mix of both" - << exit(FatalError); - } + procOffsets[procI] = patchOffset + sumOffset; + sumOffset += o; } } - - master_ = true; + patchOffset += sumOffset; } } @@ -259,40 +239,26 @@ void Foam::externalCoupledMixedFvPatchField<Type>::removeLockFile() const template<class Type> void Foam::externalCoupledMixedFvPatchField<Type>::startWait() const { - if (collate_) - { - // only wait on master patch + // only wait on master patch - typedef GeometricField<Type, fvPatchField, volMesh> volFieldType; + const volFieldType& cvf = + static_cast<const volFieldType&>(this->dimensionedInternalField()); - const volFieldType& cvf = - static_cast<const volFieldType&>(this->dimensionedInternalField()); + const typename volFieldType::GeometricBoundaryField& bf = + cvf.boundaryField(); - const typename volFieldType::GeometricBoundaryField& bf = - cvf.boundaryField(); + forAll(coupledPatchIDs_, i) + { + label patchI = coupledPatchIDs_[i]; - forAll(bf, patchI) - { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) - { - const externalCoupledMixedFvPatchField<Type>& pf = - refCast<const externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); + const patchType& pf = refCast<const patchType>(bf[patchI]); - if (pf.master()) - { - pf.wait(); - break; - } - } + if (pf.master()) + { + pf.wait(); + break; } } - else - { - wait(); - } } @@ -300,7 +266,7 @@ template<class Type> void Foam::externalCoupledMixedFvPatchField<Type>::wait() const { const fileName fName(lockFile()); - bool found = false; + label found = 0; label totalTime = 0; if (log_) @@ -308,39 +274,47 @@ void Foam::externalCoupledMixedFvPatchField<Type>::wait() const Info<< type() << ": beginning wait for lock file " << fName << endl; } - while (!found) + while (found == 0) { - if (totalTime > timeOut_) + if (Pstream::master()) { - FatalErrorIn - ( - "void " - "Foam::externalCoupledMixedFvPatchField<Type>::wait() const" - ) - << "Wait time exceeded time out time of " << timeOut_ - << " s" << abort(FatalError); - } + if (totalTime > timeOut_) + { + FatalErrorIn + ( + "void " + "Foam::externalCoupledMixedFvPatchField<Type>::wait() " + "const" + ) + << "Wait time exceeded time out time of " << timeOut_ + << " s" << abort(FatalError); + } - IFstream is(fName); + IFstream is(fName); - if (is.good()) - { - if (log_) + if (is.good()) { - Info<< type() << ": found lock file " << fName << endl; + found++; + + if (log_) + { + Info<< type() << ": found lock file " << fName << endl; + } } + else + { + sleep(waitInterval_); + totalTime += waitInterval_; - found = true; - break; + if (log_) + { + Info<< type() << ": wait time = " << totalTime << endl; + } + } } - sleep(waitInterval_); - totalTime += waitInterval_; - - if (log_) - { - Info<< type() << ": wait time = " << totalTime << endl; - } + // prevent other procs from racing ahead + reduce(found, sumOp<label>()); } } @@ -356,79 +330,90 @@ void Foam::externalCoupledMixedFvPatchField<Type>::initialiseRead FatalErrorIn ( "void Foam::externalCoupledMixedFvPatchField<Type>::" - "initialiseRead()" + "initialiseRead" + "(" + "IFstream&" + ") const" ) - << "Unable to open data transfer file " << is.name().caseName() + << "Unable to open data transfer file " << is.name() << " for patch " << this->patch().name() << exit(FatalError); } - string line; - - // scan forward to the line that starts '# Patch: <myPatchName>' - const string searchStr(patchKey + this->patch().name()); + label offset = offsets_[this->patch().index()][Pstream::myProcNo()]; - bool scan = true; - while (is.good() && scan) + // scan forward to start reading at relevant line/position + string line; + for (label i = 0; i < offset; i++) { - is.getLine(line); - - if (line.rfind(searchStr) != std::string::npos) + if (is.good()) { - scan = false; + is.getLine(line); + } + else + { + FatalErrorIn + ( + "void Foam::externalCoupledMixedFvPatchField<Type>::" + "initialiseRead" + "(" + "IFstream&" + ") const" + ) + << "Unable to scan forward to appropriate read position for " + << "data transfer file " << is.name() + << " for patch " << this->patch().name() + << exit(FatalError); } } +} - if (scan) - { - FatalErrorIn - ( - "void Foam::externalCoupledMixedFvPatchField<Type>::" - "initialiseRead" - "(" - "IFstream&" - ") const" - ) - << "Unable to find data starting with " << searchStr - << " in file" << nl - << " " << is.name().caseName() << abort(FatalError); - } - if (Pstream::parRun()) - { - // fast-forward to relevant point in file - globalIndex gi(this->patch().size()); +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - if (this->patch().size()) +template<class Type> +void Foam::externalCoupledMixedFvPatchField<Type>::readData +( + const fileName& transferFile +) +{ + // read data passed back from external source + IFstream is(transferFile + ".in"); + + // pre-process the input transfer file + initialiseRead(is); + + // read data from file + forAll(this->patch(), faceI) + { + if (is.good()) { - const label offset = gi.offset(Pstream::myProcNo()); - for (label i = 0; i < offset; i++) - { - if (is.good()) - { - is.getLine(line); - } - else - { - FatalErrorIn - ( - "void Foam::externalCoupledMixedFvPatchField<Type>::" - "initialiseRead" - "(" - "IFstream&" - ") const" - ) - << "Unable to distribute parallel data for file " - << is.name().caseName() << " for patch " - << this->patch().name() << exit(FatalError); - } - } + is >> this->refValue()[faceI] + >> this->refGrad()[faceI] + >> this->valueFraction()[faceI]; + } + else + { + FatalErrorIn + ( + "void Foam::externalCoupledMixedFvPatchField<Type>::readData" + "(" + "const fileName&" + ")" + ) + << "Insufficient data for patch " + << this->patch().name() + << " in file " << is.name() + << exit(FatalError); } } -} + initialised_ = true; + + // update the value from the mixed condition + mixedFvPatchField<Type>::evaluate(); +} -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template<class Type> void Foam::externalCoupledMixedFvPatchField<Type>::writeData @@ -445,36 +430,19 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeData writeHeader(os); - if (collate_) - { - typedef GeometricField<Type, fvPatchField, volMesh> volFieldType; + const volFieldType& cvf = + static_cast<const volFieldType&>(this->dimensionedInternalField()); - const volFieldType& cvf = - static_cast<const volFieldType&>(this->dimensionedInternalField()); + const typename volFieldType::GeometricBoundaryField& bf = + cvf.boundaryField(); - volFieldType& vf = const_cast<volFieldType&>(cvf); + forAll(coupledPatchIDs_, i) + { + label patchI = coupledPatchIDs_[i]; - typename volFieldType::GeometricBoundaryField& bf = vf.boundaryField(); + const patchType& pf = refCast<const patchType>(bf[patchI]); - forAll(bf, patchI) - { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) - { - const externalCoupledMixedFvPatchField<Type>& pf = - refCast<const externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); - - os << patchKey.c_str() << pf.patch().name() << nl; - pf.transferData(os); - } - } - } - else - { - os << patchKey.c_str() << this->patch().name() << nl; - transferData(os); + pf.transferData(os); } } @@ -492,7 +460,8 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeHeader // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class Type> -Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField +Foam::externalCoupledMixedFvPatchField<Type>:: +externalCoupledMixedFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF @@ -501,12 +470,15 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField mixedFvPatchField<Type>(p, iF), commsDir_("unknown-commsDir"), fName_("unknown-fName"), - collate_(false), waitInterval_(0), timeOut_(0), calcFrequency_(0), + initByExternal_(false), log_(false), - master_(false) + master_(false), + offsets_(), + initialised_(false), + coupledPatchIDs_() { this->refValue() = pTraits<Type>::zero; this->refGrad() = pTraits<Type>::zero; @@ -515,7 +487,8 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField template<class Type> -Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField +Foam::externalCoupledMixedFvPatchField<Type>:: +externalCoupledMixedFvPatchField ( const externalCoupledMixedFvPatchField& ptf, const fvPatch& p, @@ -526,17 +499,21 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField mixedFvPatchField<Type>(ptf, p, iF, mapper), commsDir_(ptf.commsDir_), fName_(ptf.fName_), - collate_(ptf.collate_), waitInterval_(ptf.waitInterval_), timeOut_(ptf.timeOut_), calcFrequency_(ptf.calcFrequency_), + initByExternal_(ptf.initByExternal_), log_(ptf.log_), - master_(ptf.master_) + master_(ptf.master_), + offsets_(ptf.offsets_), + initialised_(ptf.initialised_), + coupledPatchIDs_(ptf.coupledPatchIDs_) {} template<class Type> -Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField +Foam::externalCoupledMixedFvPatchField<Type>:: +externalCoupledMixedFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, @@ -546,12 +523,15 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField mixedFvPatchField<Type>(p, iF), commsDir_(dict.lookup("commsDir")), fName_(dict.lookup("fileName")), - collate_(readBool(dict.lookup("collate"))), waitInterval_(dict.lookupOrDefault("waitInterval", 1)), timeOut_(dict.lookupOrDefault("timeOut", 100*waitInterval_)), calcFrequency_(dict.lookupOrDefault("calcFrequency", 1)), + initByExternal_(readBool(dict.lookup("initByExternal"))), log_(dict.lookupOrDefault("log", false)), - master_(true) + master_(true), + offsets_(), + initialised_(false), + coupledPatchIDs_() { if (dict.found("value")) { @@ -565,13 +545,17 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField fvPatchField<Type>::operator=(this->patchInternalField()); } + commsDir_.expand(); + if (Pstream::master()) { - commsDir_.expand(); mkDir(baseDir()); } - createLockFile(); + if (!initByExternal_) + { + createLockFile(); + } // initialise as a fixed value this->refValue() = *this; @@ -581,7 +565,8 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField template<class Type> -Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField +Foam::externalCoupledMixedFvPatchField<Type>:: +externalCoupledMixedFvPatchField ( const externalCoupledMixedFvPatchField& ecmpf ) @@ -589,17 +574,21 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField mixedFvPatchField<Type>(ecmpf), commsDir_(ecmpf.commsDir_), fName_(ecmpf.fName_), - collate_(ecmpf.collate_), waitInterval_(ecmpf.waitInterval_), timeOut_(ecmpf.timeOut_), calcFrequency_(ecmpf.calcFrequency_), + initByExternal_(ecmpf.initByExternal_), log_(ecmpf.log_), - master_(ecmpf.master_) + master_(ecmpf.master_), + offsets_(ecmpf.offsets_), + initialised_(ecmpf.initialised_), + coupledPatchIDs_(ecmpf.coupledPatchIDs_) {} template<class Type> -Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField +Foam::externalCoupledMixedFvPatchField<Type>:: +externalCoupledMixedFvPatchField ( const externalCoupledMixedFvPatchField& ecmpf, const DimensionedField<Type, volMesh>& iF @@ -608,12 +597,15 @@ Foam::externalCoupledMixedFvPatchField<Type>::externalCoupledMixedFvPatchField mixedFvPatchField<Type>(ecmpf, iF), commsDir_(ecmpf.commsDir_), fName_(ecmpf.fName_), - collate_(ecmpf.collate_), waitInterval_(ecmpf.waitInterval_), timeOut_(ecmpf.timeOut_), calcFrequency_(ecmpf.calcFrequency_), + initByExternal_(ecmpf.initByExternal_), log_(ecmpf.log_), - master_(ecmpf.master_) + master_(ecmpf.master_), + offsets_(ecmpf.offsets_), + initialised_(ecmpf.initialised_), + coupledPatchIDs_(ecmpf.coupledPatchIDs_) {} @@ -628,18 +620,90 @@ Foam::externalCoupledMixedFvPatchField<Type>:: // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void Foam::externalCoupledMixedFvPatchField<Type>::updateCoeffs() +void Foam::externalCoupledMixedFvPatchField<Type>::initialise +( + const fileName& transferFile +) { - if (this->updated()) + if (initialised_) { return; } - setMaster(); + const volFieldType& cvf = + static_cast<const volFieldType&>(this->dimensionedInternalField()); + + volFieldType& vf = const_cast<volFieldType&>(cvf); + + typename volFieldType::GeometricBoundaryField& bf = vf.boundaryField(); + + // identify all coupled patches + DynamicList<label> coupledPatchIDs(bf.size()); + + forAll(bf, patchI) + { + if (isA<patchType>(bf[patchI])) + { + coupledPatchIDs.append(patchI); + } + } + + coupledPatchIDs_.transfer(coupledPatchIDs); + + + // initialise by external solver, or just set the master patch + if (initByExternal_) + { + // remove lock file, signalling external source to execute +// removeLockFile(); + + forAll(coupledPatchIDs_, i) + { + label patchI = coupledPatchIDs_[i]; + + patchType& pf = refCast<patchType>(bf[patchI]); + + pf.setMaster(coupledPatchIDs_); + } + + + // wait for initial data to be made available + startWait(); + + // read the initial data + if (master_) + { + forAll(coupledPatchIDs_, i) + { + label patchI = coupledPatchIDs_[i]; + + patchType& pf = refCast<patchType>(bf[patchI]); + + pf.readData(transferFile); + } + } + } + else + { + setMaster(coupledPatchIDs_); + } + + initialised_ = true; +} + - if (this->db().time().timeIndex() % calcFrequency_ == 0) +template<class Type> +void Foam::externalCoupledMixedFvPatchField<Type>::evaluate +( + const Pstream::commsTypes comms +) +{ + if (!initialised_ || this->db().time().timeIndex() % calcFrequency_ == 0) { - fileName transferFile(baseDir()/fName_); + const fileName transferFile(baseDir()/fName_); + + // initialise the coupling + initialise(transferFile); // write data for external source writeData(transferFile + ".out"); @@ -657,37 +721,11 @@ void Foam::externalCoupledMixedFvPatchField<Type>::updateCoeffs() } // read data passed back from external source - IFstream is(transferFile + ".in"); - - // pre-process the input transfer file - initialiseRead(is); - - // read data from file - forAll(this->patch(), faceI) - { - if (is.good()) - { - is >> this->refValue()[faceI] - >> this->refGrad()[faceI] - >> this->valueFraction()[faceI]; - } - else - { - FatalErrorIn - ( - "void Foam::externalCoupledMixedFvPatchField<Type>::" - "updateCoeffs()" - ) - << "Insufficient data for patch " << this->patch().name() - << " in file " << is.name().caseName() << exit(FatalError); - } - } + readData(transferFile); // create lock file for external source createLockFile(); } - - mixedFvPatchField<Type>::updateCoeffs(); } @@ -699,7 +737,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::transferData { if (log_) { - Info<< type() << ": writing data to " << os.name().caseName() << endl; + Info<< type() << ": writing data to " << os.name() << endl; } if (Pstream::parRun()) @@ -761,68 +799,28 @@ void Foam::externalCoupledMixedFvPatchField<Type>::transferData template<class Type> void Foam::externalCoupledMixedFvPatchField<Type>::writeGeometry() const { - typedef GeometricField<Type, fvPatchField, volMesh> volFieldType; - const volFieldType& cvf = static_cast<const volFieldType&>(this->dimensionedInternalField()); const typename volFieldType::GeometricBoundaryField& bf = cvf.boundaryField(); - if (collate_) - { - OFstream osPoints(baseDir()/"patchPoints"); - OFstream osFaces(baseDir()/"patchFaces"); - - if (log_) - { - Info<< "writing collated patch points to: " - << osPoints.name().caseName() << endl; - Info<< "writing collated patch faces to: " - << osFaces.name().caseName() << endl; - } - - forAll(bf, patchI) - { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) - { - const externalCoupledMixedFvPatchField<Type>& pf = - refCast<const externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); + OFstream osPoints(baseDir()/"patchPoints"); + OFstream osFaces(baseDir()/"patchFaces"); - pf.writeGeometry(osPoints, osFaces); - } - } + if (log_) + { + Info<< "writing collated patch points to: " << osPoints.name() << nl + << "writing collated patch faces to: " << osFaces.name() << endl; } - else + + forAll(bf, patchI) { - forAll(bf, patchI) + if (isA<patchType>(bf[patchI])) { - if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI])) - { - const word& patchName = this->patch().name(); - - OFstream osPoints(baseDir(patchName)/"patchPoints"); - OFstream osFaces(baseDir(patchName)/"patchFaces"); + const patchType& pf = refCast<const patchType>(bf[patchI]); - if (log_) - { - Info<< "writing patch " << patchName << " points to: " - << osPoints.name().caseName() << endl; - Info<< "writing patch " << patchName << " faces to: " - << osFaces.name().caseName() << endl; - } - - const externalCoupledMixedFvPatchField<Type>& pf = - refCast<const externalCoupledMixedFvPatchField<Type> > - ( - bf[patchI] - ); - - pf.writeGeometry(osPoints, osFaces); - } + pf.writeGeometry(osPoints, osFaces); } } } @@ -835,12 +833,13 @@ void Foam::externalCoupledMixedFvPatchField<Type>::write(Ostream& os) const os.writeKeyword("commsDir") << commsDir_ << token::END_STATEMENT << nl; os.writeKeyword("fileName") << fName_ << token::END_STATEMENT << nl; - os.writeKeyword("collate") << collate_ << token::END_STATEMENT << nl; os.writeKeyword("waitInterval") << waitInterval_ << token::END_STATEMENT << nl; os.writeKeyword("timeOut") << timeOut_ << token::END_STATEMENT << nl; os.writeKeyword("calcFrequency") << calcFrequency_ << token::END_STATEMENT << nl; + os.writeKeyword("initByExternal") << initByExternal_ << token::END_STATEMENT + << nl; os.writeKeyword("log") << log_ << token::END_STATEMENT << nl; this->writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H index cfe08cd78eb9d78f427774d6296090385ef599be..0680f6443bd44684eabd2a164b293fc6062dd12d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/externalCoupledMixed/externalCoupledMixedFvPatchField.H @@ -29,7 +29,7 @@ Group Description This boundary condition provides an interface to an external application. - Values are transferred as plain text files, where OperFOAM data is written + Values are transferred as plain text files, where OpenFOAM data is written as: # Patch: <patch name> @@ -48,13 +48,7 @@ Description ... <valueN> <gradientN> <valueFracionN> - Data is either sent/received as one file per patch, or as a single file - for all patches, based on the \c collate flag. In the former case, the - folder used for communications is: - - $FOAM_CASE/<commsDir>/patchName - - and when using the \c collate option: + Data is sent/received as a single file for all patches from the folder $FOAM_CASE/<commsDir> @@ -83,10 +77,10 @@ Description Property | Description | Required | Default value commsDir | communications folder | yes | fileName | transfer file name | yes | - collate | collate all patch data into single file | yes | waitInterval | interval [s] between file checks | no | 1 timeOut | time after which error invoked [s] |no |100*waitInterval calcFrequency | calculation frequency | no | 1 + initByExternal | external app to initialises values | yes | log | log program control | no | no \endtable @@ -97,8 +91,8 @@ Description type externalCoupled; commsDir "$FOAM_CASE/comms"; fileName data; - collate yes; calcFrequency 1; + initByExternal yes; } \endverbatim @@ -137,15 +131,16 @@ private: // Private data + //- Convenience typedefs + typedef externalCoupledMixedFvPatchField<Type> patchType; + typedef GeometricField<Type, fvPatchField, volMesh> volFieldType; + //- Path to communications folder fileName commsDir_; //- Name of data file word fName_; - //- Flag to collate all data into single transfer file - bool collate_; - //- Interval time between checking for return data [s] label waitInterval_; @@ -155,6 +150,9 @@ private: //- Calculation frequency label calcFrequency_; + //- Flag to indicate values are initialised by external application + bool initByExternal_; + //- Log flag bool log_; @@ -162,14 +160,26 @@ private: // Note: only valid when collate option is selected bool master_; + //- Offsets in data file to start reading at correct position + List<List<label> > offsets_; + + //- Initialised flag + bool initialised_; + + //- List of coupled patch IDs + List<label> coupledPatchIDs_; + // Private Member Functions + //- Initialise + void initialise(const fileName& transferFile); + //- Set the master flag when collate option is selected - void setMaster(); + void setMaster(const labelList& patchIDs); //- Return the file path to the base communications folder - fileName baseDir(const word& patchName = word::null) const; + fileName baseDir() const; //- Write the geometry to the comms dir void writeGeometry(OFstream& osPoints, OFstream& osFaces) const; @@ -197,6 +207,9 @@ protected: // Protected Member Functions + //- Read data from external source + virtual void readData(const fileName& transferFile); + //- Write data for external source - calls transferData virtual void writeData(const fileName& transferFile) const; @@ -292,12 +305,6 @@ public: return log_; } - //- Return the collate flag - bool collate() const - { - return collate_; - } - //- Return the master flag bool master() const { @@ -313,8 +320,11 @@ public: // Evaluation functions - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); + //- Evaluate the patch field + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); //- Transfer data for external source virtual void transferData(OFstream& os) const; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index f5cd4413b1a3b59bb6dc74c6fe83704ef81d9fd6..c59d8d89ee43617be7a238f83b7a176e39cba1a8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -172,6 +172,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs // mass flow-rate operator==(n*avgU/uniformRho); } + + fixedValueFvPatchVectorField::updateCoeffs(); } @@ -223,7 +225,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() } } - fixedValueFvPatchField<vector>::updateCoeffs(); + fixedValueFvPatchVectorField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H index 05bd6b180045533d77f4109d60599fa18a56021d..5c4070733451070f677ad982e4126b0489d537a8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ Description 4. compressible supersonic (\gamma > 1): \f[ - p_T = \frac{p_0}{(1 + 0.5 \psi G)^{\frac{1}{G}}} + p_T = \frac{p_0}{(1 + 0.5 \psi G |U|^2)^{\frac{1}{G}}} \f] where \vartable diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C index 9ce537b7663b9ca23a1f4ea8df812655672966cf..f37570ec7e8725b38007b9d8a292ceec7049df0f 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C @@ -610,7 +610,7 @@ void Foam::fv::rotorDiskSource::addSup ( IOobject ( - "rotorForce", + name_ + ":rotorForce", mesh_.time().timeName(), mesh_, IOobject::NO_READ, diff --git a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C index 705cd97f20da54f3feb56b16b666a9fb45fbe2d3..f2e5ac09657af49c238d698542de2f07184eaf09 100644 --- a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.C +++ b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,4 +94,10 @@ Foam::scalar Foam::distributionModels::RosinRammler::maxValue() const } +Foam::scalar Foam::distributionModels::RosinRammler::meanValue() const +{ + return d_; +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H index 2ec0325ce6368db052c51cb938c241b3c1b50892..64cc13ca3f929437e36acd51ac2e5791212ca40e 100644 --- a/src/lagrangian/distributionModels/RosinRammler/RosinRammler.H +++ b/src/lagrangian/distributionModels/RosinRammler/RosinRammler.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,6 +108,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the mean value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/distributionModels/distributionModel/distributionModel.C b/src/lagrangian/distributionModels/distributionModel/distributionModel.C index ea332b9e1e22402ac362e71d0d05e41537b4c24e..83772fc77bda3ae7268ea0e184343d838e85b120 100644 --- a/src/lagrangian/distributionModels/distributionModel/distributionModel.C +++ b/src/lagrangian/distributionModels/distributionModel/distributionModel.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -124,4 +124,15 @@ Foam::scalar Foam::distributionModels::distributionModel::maxValue() const } +Foam::scalar Foam::distributionModels::distributionModel::meanValue() const +{ + notImplemented + ( + "Foam::scalar " + "Foam::distributionModels::distributionModel::meanValue() const" + ); + return 0.0; +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/distributionModel/distributionModel.H b/src/lagrangian/distributionModels/distributionModel/distributionModel.H index a9099eb3f70dafc029644bbe052608060d9e0d85..efc7f2b1add643c4f083ef087360e847a5df9d89 100644 --- a/src/lagrangian/distributionModels/distributionModel/distributionModel.H +++ b/src/lagrangian/distributionModels/distributionModel/distributionModel.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,6 +149,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the maximum value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/distributionModels/exponential/exponential.C b/src/lagrangian/distributionModels/exponential/exponential.C index 72df563826687e789fc5efbb7a0c822e6eabd169..01298de33c54c99fb0a182a00ef3ef4e0a2cdfcf 100644 --- a/src/lagrangian/distributionModels/exponential/exponential.C +++ b/src/lagrangian/distributionModels/exponential/exponential.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,4 +91,10 @@ Foam::scalar Foam::distributionModels::exponential::maxValue() const } +Foam::scalar Foam::distributionModels::exponential::meanValue() const +{ + return 1.0/lambda_; +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/exponential/exponential.H b/src/lagrangian/distributionModels/exponential/exponential.H index c19d0ac0026b14fe0d11636981d23f8be6e4dba0..0bcadfc0b8a2d5213495345855cbe8f84da7c240 100644 --- a/src/lagrangian/distributionModels/exponential/exponential.H +++ b/src/lagrangian/distributionModels/exponential/exponential.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,6 +101,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the mean value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/distributionModels/fixedValue/fixedValue.C b/src/lagrangian/distributionModels/fixedValue/fixedValue.C index 44d4a07d677f13faa1a309311dd1d4b2d46035c5..048a9482f3090e648494ce7a48751bec9328ccfc 100644 --- a/src/lagrangian/distributionModels/fixedValue/fixedValue.C +++ b/src/lagrangian/distributionModels/fixedValue/fixedValue.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,4 +83,10 @@ Foam::scalar Foam::distributionModels::fixedValue::fixedValue::maxValue() const } +Foam::scalar Foam::distributionModels::fixedValue::fixedValue::meanValue() const +{ + return value_; +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/fixedValue/fixedValue.H b/src/lagrangian/distributionModels/fixedValue/fixedValue.H index 8ed5e612114ac2e2da3963d0d0b9b75e4ce06504..3de10f43b621d24bcb6b6140118ee3b71c493c16 100644 --- a/src/lagrangian/distributionModels/fixedValue/fixedValue.H +++ b/src/lagrangian/distributionModels/fixedValue/fixedValue.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,6 +92,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the mean value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/distributionModels/general/general.C b/src/lagrangian/distributionModels/general/general.C index 98e3336f25ce06581ff692db37807b2f73cb90fa..5199ff807454ff233bcc826581dc795e51a78ff3 100644 --- a/src/lagrangian/distributionModels/general/general.C +++ b/src/lagrangian/distributionModels/general/general.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,6 +50,7 @@ Foam::distributionModels::general::general nEntries_(xy_.size()), minValue_(xy_[0][0]), maxValue_(xy_[nEntries_-1][0]), + meanValue_(0.0), integral_(nEntries_) { check(); @@ -69,10 +70,14 @@ Foam::distributionModels::general::general integral_[i] = area + integral_[i-1]; } + scalar sumArea = integral_.last(); + + meanValue_ = sumArea/(maxValue_ - minValue_); + for (label i=0; i<nEntries_; i++) { - xy_[i][1] /= integral_[nEntries_-1]; - integral_[i] /= integral_[nEntries_-1]; + xy_[i][1] /= sumArea; + integral_[i] /= sumArea; } } @@ -153,4 +158,10 @@ Foam::scalar Foam::distributionModels::general::maxValue() const } +Foam::scalar Foam::distributionModels::general::meanValue() const +{ + return meanValue_; +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/general/general.H b/src/lagrangian/distributionModels/general/general.H index 89ec2251a9bb9b996063c8d8b34d7c854e477c30..53ee4716a2b191a0722d88e3458d0c39b59e00da 100644 --- a/src/lagrangian/distributionModels/general/general.H +++ b/src/lagrangian/distributionModels/general/general.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,6 +66,8 @@ class general scalar minValue_; scalar maxValue_; + scalar meanValue_; + List<scalar> integral_; @@ -104,6 +106,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the mean value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/distributionModels/multiNormal/multiNormal.C b/src/lagrangian/distributionModels/multiNormal/multiNormal.C index 7a5f6ea9e9077553d170c2250f171b0a025cbc51..9a8bf423ec8d9304fe359edef2baa313743dd4fc 100644 --- a/src/lagrangian/distributionModels/multiNormal/multiNormal.C +++ b/src/lagrangian/distributionModels/multiNormal/multiNormal.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,4 +145,16 @@ Foam::scalar Foam::distributionModels::multiNormal::maxValue() const } +Foam::scalar Foam::distributionModels::multiNormal::meanValue() const +{ + scalar mean = 0.0; + forAll(strength_, i) + { + mean += strength_[i]*expectation_[i]; + } + + return mean; +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/multiNormal/multiNormal.H b/src/lagrangian/distributionModels/multiNormal/multiNormal.H index 90c2a8334d38361913ba00d126aab875ebae29f2..c1fc3adf7914213e10f845417cfb74623797e54b 100644 --- a/src/lagrangian/distributionModels/multiNormal/multiNormal.H +++ b/src/lagrangian/distributionModels/multiNormal/multiNormal.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,6 +111,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the mean value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/distributionModels/normal/normal.C b/src/lagrangian/distributionModels/normal/normal.C index 627ea6e9eaf903d386d442b227c3cfab0407e119..c9e4cc0184d7413189dcb740e79b56fe8859f89c 100644 --- a/src/lagrangian/distributionModels/normal/normal.C +++ b/src/lagrangian/distributionModels/normal/normal.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,6 +120,12 @@ Foam::scalar Foam::distributionModels::normal::maxValue() const } +Foam::scalar Foam::distributionModels::normal::meanValue() const +{ + return expectation_; +} + + Foam::scalar Foam::distributionModels::normal::erfInv(const scalar y) const { scalar k = 2.0/(constant::mathematical::pi*a_) + 0.5*log(1.0 - y*y); diff --git a/src/lagrangian/distributionModels/normal/normal.H b/src/lagrangian/distributionModels/normal/normal.H index b9559f0c2984e64d6fef2cb28a2e2892ea20bfed..01ecdb04ed91591cf2698c793cb48e0096cbf746 100644 --- a/src/lagrangian/distributionModels/normal/normal.H +++ b/src/lagrangian/distributionModels/normal/normal.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + //- Return the mean value + virtual scalar meanValue() const; + virtual scalar erfInv(const scalar y) const; }; diff --git a/src/lagrangian/distributionModels/uniform/uniform.C b/src/lagrangian/distributionModels/uniform/uniform.C index 83284905887d3fbe4527788f0ccb1c1a00fc796c..05f7a21befbef52e3d67badabd11dc2ad2aac205 100644 --- a/src/lagrangian/distributionModels/uniform/uniform.C +++ b/src/lagrangian/distributionModels/uniform/uniform.C @@ -87,4 +87,10 @@ Foam::scalar Foam::distributionModels::uniform::maxValue() const } +Foam::scalar Foam::distributionModels::uniform::meanValue() const +{ + return 0.5*(minValue_ + maxValue_); +} + + // ************************************************************************* // diff --git a/src/lagrangian/distributionModels/uniform/uniform.H b/src/lagrangian/distributionModels/uniform/uniform.H index cd4a6733a0465db228871bd336d2e332cf7cd29d..21d0e1c14bdee9519d59c07223264acc7c54092e 100644 --- a/src/lagrangian/distributionModels/uniform/uniform.H +++ b/src/lagrangian/distributionModels/uniform/uniform.H @@ -96,6 +96,9 @@ public: //- Return the maximum value virtual scalar maxValue() const; + + //- Return the mean value + virtual scalar meanValue() const; }; diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 9165621d6c9826698e074934e1a5831f6055c35b..6d4e26a441dcd9f13941acab665720065132887d 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -54,13 +54,13 @@ KINEMATICINJECTION=submodels/Kinematic/InjectionModel $(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionData.C $(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionDataIO.C $(KINEMATICINJECTION)/KinematicLookupTableInjection/kinematicParcelInjectionDataIOList.C +$(KINEMATICINJECTION)/PatchInjection/patchInjectionBase.C THERMOINJECTION=submodels/Thermodynamic/InjectionModel $(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionData.C $(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionDataIO.C $(THERMOINJECTION)/ThermoLookupTableInjection/thermoParcelInjectionDataIOList.C - REACTINGINJECTION=submodels/Reacting/InjectionModel $(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionData.C $(REACTINGINJECTION)/ReactingLookupTableInjection/reactingParcelInjectionDataIO.C diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 94eb19932e63af60c1c1a0aecf522ee08e78e055..f49e79086747921c1cb373e2b902ba43c365019a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -72,7 +72,9 @@ bool Foam::InjectionModel<CloudType>::prepareForNextTimeStep newParcels = this->parcelsToInject(t0, t1); // Volume of parcels to inject - newVolumeFraction = this->volumeToInject(t0, t1)/volumeTotal_; + newVolumeFraction = + this->volumeToInject(t0, t1) + /(volumeTotal_ + ROOTVSMALL); if (newVolumeFraction > 0) { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H index a5492a12b6116ed715b49a166725658888c4a1c0..70948c356c401c9d9d36ea5541f28f2427ce70c2 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H @@ -292,7 +292,7 @@ public: ); //- Return the average parcel mass over the injection period - scalar averageParcelMass(); + virtual scalar averageParcelMass(); // Counters diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C index af9fd37d036507852cc2892731deb26ba1ed9e90..8499589784c0298e06c3148418c1d5441f07d7c8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "TimeDataEntry.H" #include "distributionModel.H" #include "mathematicalConstants.H" +#include "surfaceFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -39,19 +40,23 @@ Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection ) : InjectionModel<CloudType>(dict, owner, modelName,typeName), - patchName_(this->coeffDict().lookup("patchName")), - patchId_(owner.mesh().boundaryMesh().findPatchID(patchName_)), - patchArea_(0.0), - patchNormal_(vector::zero), + patchInjectionBase(owner.mesh(), this->coeffDict().lookup("patchName")), 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_ + concentration_ ( - readScalar(this->coeffDict().lookup("parcelsPerSecond")) + TimeDataEntry<scalar> + ( + owner.db().time(), + "concentration", + this->coeffDict() + ) + ), + parcelConcentration_ + ( + readScalar(this->coeffDict().lookup("parcelConcentration")) ), - U0_(vector::zero), sizeDistribution_ ( distributionModels::distributionModel::New @@ -59,45 +64,11 @@ Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection 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_); + patchInjectionBase::updateMesh(owner.mesh()); // Re-initialise total mass/volume to inject to zero // - will be reset during each injection @@ -113,20 +84,13 @@ Foam::PatchFlowRateInjection<CloudType>::PatchFlowRateInjection ) : InjectionModel<CloudType>(im), - patchName_(im.patchName_), - patchId_(im.patchId_), - patchArea_(im.patchArea_), - patchNormal_(im.patchNormal_), + patchInjectionBase(im), 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_) + parcelConcentration_(im.parcelConcentration_), + sizeDistribution_(im.sizeDistribution_().clone().ptr()) {} @@ -142,9 +106,7 @@ Foam::PatchFlowRateInjection<CloudType>::~PatchFlowRateInjection() template<class CloudType> void Foam::PatchFlowRateInjection<CloudType>::updateMesh() { - // Set/cache the injector cells - const polyPatch& patch = this->owner().mesh().boundaryMesh()[patchId_]; - cellOwners_ = patch.faceCells(); + patchInjectionBase::updateMesh(this->owner().mesh()); } @@ -155,6 +117,36 @@ Foam::scalar Foam::PatchFlowRateInjection<CloudType>::timeEnd() const } +template<class CloudType> +Foam::scalar Foam::PatchFlowRateInjection<CloudType>::flowRate() const +{ + const polyMesh& mesh = this->owner().mesh(); + + const surfaceScalarField& phi = + mesh.lookupObject<surfaceScalarField>(phiName_); + + const scalarField& phip = phi.boundaryField()[patchId_]; + + scalar flowRateIn = 0.0; + if (phi.dimensions() == dimVelocity*dimArea) + { + flowRateIn = max(0.0, -sum(phip)); + } + else + { + const volScalarField& rho = + mesh.lookupObject<volScalarField>(rhoName_); + const scalarField& rhop = rho.boundaryField()[patchId_]; + + flowRateIn = max(0.0, -sum(phip/rhop)); + } + + reduce(flowRateIn, sumOp<scalar>()); + + return flowRateIn; +} + + template<class CloudType> Foam::label Foam::PatchFlowRateInjection<CloudType>::parcelsToInject ( @@ -164,10 +156,11 @@ Foam::label Foam::PatchFlowRateInjection<CloudType>::parcelsToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - scalar nParcels = fraction_*(time1 - time0)*parcelsPerSecond_; + scalar dt = time1 - time0; - cachedRandom& rnd = this->owner().rndGen(); + scalar c = concentration_.value(0.5*(time0 + time1)); + scalar nParcels = fraction_*parcelConcentration_*c*flowRate()*dt; label nParcelsToInject = floor(nParcels); // Inject an additional parcel with a probability based on the @@ -177,7 +170,7 @@ Foam::label Foam::PatchFlowRateInjection<CloudType>::parcelsToInject nParcelsToInject > 0 && ( nParcels - scalar(nParcelsToInject) - > rnd.position(scalar(0), scalar(1)) + > this->owner().rndGen().position(scalar(0), scalar(1)) ) ) { @@ -204,38 +197,11 @@ Foam::scalar Foam::PatchFlowRateInjection<CloudType>::volumeToInject 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; + scalar c = concentration_.value(0.5*(time0 + time1)); - volume = pMeanVolume_*newParticles; + volume = c*(time1 - time0)*flowRate(); } - reduce(volume, sumOp<scalar>()); - this->volumeTotal_ = volume; this->massTotal_ = volume*this->owner().constProps().rho0(); @@ -255,39 +221,15 @@ void Foam::PatchFlowRateInjection<CloudType>::setPositionAndCell 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; - } + patchInjectionBase::setPositionAndCell + ( + this->owner().mesh(), + this->owner().rndGen(), + position, + cellOwner, + tetFaceI, + tetPtI + ); } @@ -300,8 +242,8 @@ void Foam::PatchFlowRateInjection<CloudType>::setProperties typename CloudType::parcelType& parcel ) { - // set particle velocity - parcel.U() = U0_; + // set particle velocity to carrier velocity + parcel.U() = this->owner().U()[parcel.cell()]; // set particle diameter parcel.d() = sizeDistribution_->sample(); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H index e6822a76d7d537d201cc6bfbc54bff5ba237cef4..c666a9264853c2e05bc771d14bd4eaa5b97abb0f 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,10 +32,10 @@ Description - Total mass to inject - Name of patch - Injection duration - - Initial parcel velocity - Injection target concentration/carrier volume flow rate + - Initial parcel velocity given by local flow velocity - Parcel diameters obtained by distribution model - - Parcels injected at cell centres adjacent to patch + - Parcels injected randomly across the patch SourceFiles PatchFlowRateInjection.C @@ -46,15 +46,14 @@ SourceFiles #define PatchFlowRateInjection_H #include "InjectionModel.H" +#include "patchInjectionBase.H" +#include "TimeDataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -template<class Type> -class TimeDataEntry; - class distributionModel; /*---------------------------------------------------------------------------*\ @@ -64,22 +63,11 @@ class distributionModel; template<class CloudType> class PatchFlowRateInjection : - public InjectionModel<CloudType> + public InjectionModel<CloudType>, + public patchInjectionBase { // 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_; @@ -89,27 +77,15 @@ class PatchFlowRateInjection //- Injection duration [s] scalar duration_; - //- Concentration of particles to carrier [] (particles/m3) - const scalar concentration_; + //- Concentration profile of particle volume to carrier volume [-] + const TimeDataEntry<scalar> concentration_; - //- Number of parcels to introduce per second [] - const label parcelsPerSecond_; - - //- Initial parcel velocity [m/s] - vector U0_; + //- Parcels to introduce per unit volume flow rate m3 [n/m3] + const scalar parcelConcentration_; //- 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: @@ -152,6 +128,9 @@ public: //- Return the end-of-injection time scalar timeEnd() const; + //- Return the total volumetric flow rate across the patch [m3/s] + virtual scalar flowRate() const; + //- Number of parcels to introduce relative to SOI virtual label parcelsToInject(const scalar time0, const scalar time1); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index 9744364ca19e31c53969b286c5ea0bacf5596b1c..184c026b924e237e25d8174c72a5e4dbb9758da8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,8 +38,7 @@ Foam::PatchInjection<CloudType>::PatchInjection ) : InjectionModel<CloudType>(dict, owner, modelName, typeName), - patchName_(this->coeffDict().lookup("patchName")), - patchId_(owner.mesh().boundaryMesh().findPatchID(patchName_)), + patchInjectionBase(owner.mesh(), this->coeffDict().lookup("patchName")), duration_(readScalar(this->coeffDict().lookup("duration"))), parcelsPerSecond_ ( @@ -62,32 +61,11 @@ Foam::PatchInjection<CloudType>::PatchInjection this->coeffDict().subDict("sizeDistribution"), owner.rndGen() ) - ), - cellOwners_(), - fraction_(1.0) + ) { - if (patchId_ < 0) - { - FatalErrorIn - ( - "PatchInjection<CloudType>::PatchInjection" - "(" - "const dictionary&, " - "CloudType&" - ")" - ) << "Requested patch " << patchName_ << " not found" << nl - << "Available patches are: " << owner.mesh().boundaryMesh().names() - << nl << exit(FatalError); - } - duration_ = owner.db().time().userTimeToTime(duration_); - updateMesh(); - - label patchSize = cellOwners_.size(); - label totalPatchSize = patchSize; - reduce(totalPatchSize, sumOp<label>()); - fraction_ = scalar(patchSize)/totalPatchSize; + patchInjectionBase::updateMesh(owner.mesh()); // Set total volume/mass to inject this->volumeTotal_ = fraction_*flowRateProfile_.integrate(0.0, duration_); @@ -102,15 +80,12 @@ Foam::PatchInjection<CloudType>::PatchInjection ) : InjectionModel<CloudType>(im), - patchName_(im.patchName_), - patchId_(im.patchId_), + patchInjectionBase(im), duration_(im.duration_), parcelsPerSecond_(im.parcelsPerSecond_), U0_(im.U0_), flowRateProfile_(im.flowRateProfile_), - sizeDistribution_(im.sizeDistribution_().clone().ptr()), - cellOwners_(im.cellOwners_), - fraction_(im.fraction_) + sizeDistribution_(im.sizeDistribution_().clone().ptr()) {} @@ -126,9 +101,7 @@ Foam::PatchInjection<CloudType>::~PatchInjection() template<class CloudType> void Foam::PatchInjection<CloudType>::updateMesh() { - // Set/cache the injector cells - const polyPatch& patch = this->owner().mesh().boundaryMesh()[patchId_]; - cellOwners_ = patch.faceCells(); + patchInjectionBase::updateMesh(this->owner().mesh()); } @@ -148,7 +121,7 @@ Foam::label Foam::PatchInjection<CloudType>::parcelsToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - scalar nParcels = fraction_*(time1 - time0)*parcelsPerSecond_; + scalar nParcels = this->fraction_*(time1 - time0)*parcelsPerSecond_; cachedRandom& rnd = this->owner().rndGen(); @@ -186,7 +159,7 @@ Foam::scalar Foam::PatchInjection<CloudType>::volumeToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - return fraction_*flowRateProfile_.integrate(time0, time1); + return this->fraction_*flowRateProfile_.integrate(time0, time1); } else { @@ -207,39 +180,15 @@ void Foam::PatchInjection<CloudType>::setPositionAndCell 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; - } + patchInjectionBase::setPositionAndCell + ( + this->owner().mesh(), + this->owner().rndGen(), + position, + cellOwner, + tetFaceI, + tetPtI + ); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H index a9d5d60a36941e921c817aa9fed53f03db834ded..95a6b50b71ed563e64a343fdc7047b8a82c0842c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ Description - Initial parcel velocity - Injection volume flow rate - Parcel diameters obtained by distribution model - - Parcels injected at cell centres adjacent to patch + - Parcels injected randomly across the patch SourceFiles PatchInjection.C @@ -44,6 +44,7 @@ SourceFiles #define PatchInjection_H #include "InjectionModel.H" +#include "patchInjectionBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,16 +63,11 @@ class distributionModel; template<class CloudType> class PatchInjection : - public InjectionModel<CloudType> + public InjectionModel<CloudType>, + public patchInjectionBase { // Private data - //- Name of patch - const word patchName_; - - //- Id of patch - const label patchId_; - //- Injection duration [s] scalar duration_; @@ -87,12 +83,6 @@ class PatchInjection //- 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_; - public: @@ -133,7 +123,7 @@ public: virtual void updateMesh(); //- Return the end-of-injection time - scalar timeEnd() const; + virtual scalar timeEnd() const; //- Number of parcels to introduce relative to SOI virtual label parcelsToInject(const scalar time0, const scalar time1); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C new file mode 100644 index 0000000000000000000000000000000000000000..cecceba932765915d3c404e2db0588934a2a8b8c --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C @@ -0,0 +1,244 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "patchInjectionBase.H" +#include "polyMesh.H" +#include "SubField.H" +#include "cachedRandom.H" +#include "triPointRef.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::patchInjectionBase::patchInjectionBase +( + const polyMesh& mesh, + const word& patchName +) +: + patchName_(patchName), + patchId_(mesh.boundaryMesh().findPatchID(patchName_)), + patchArea_(0.0), + patchNormal_(), + cellOwners_(), + fraction_(1.0), + triFace_(), + triToFace_(), + triCumulativeMagSf_(), + sumTriMagSf_(Pstream::nProcs() + 1, 0.0) +{ + if (patchId_ < 0) + { + FatalErrorIn + ( + "Foam::patchInjectionBase::patchInjectionBase" + "(" + "const polyMesh&, " + "const word&" + ")" + ) << "Requested patch " << patchName_ << " not found" << nl + << "Available patches are: " << mesh.boundaryMesh().names() + << nl << exit(FatalError); + } + + updateMesh(mesh); +} + + +Foam::patchInjectionBase::patchInjectionBase(const patchInjectionBase& pib) +: + patchName_(pib.patchName_), + patchId_(pib.patchId_), + patchArea_(pib.patchArea_), + patchNormal_(pib.patchNormal_), + cellOwners_(pib.cellOwners_), + fraction_(pib.fraction_), + triFace_(pib.triFace_), + triToFace_(pib.triToFace_), + triCumulativeMagSf_(pib.triCumulativeMagSf_), + sumTriMagSf_(pib.sumTriMagSf_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::patchInjectionBase::~patchInjectionBase() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh) +{ + // Set/cache the injector cells + const polyPatch& patch = mesh.boundaryMesh()[patchId_]; + const pointField& points = patch.points(); + + cellOwners_ = patch.faceCells(); + + // triangulate the patch faces and create addressing + DynamicList<label> triToFace(2*patch.size()); + DynamicList<scalar> triMagSf(2*patch.size()); + DynamicList<face> triFace(2*patch.size()); + DynamicList<face> tris(5); + + forAll(patch, faceI) + { + const face& f = patch[faceI]; + + tris.clear(); + f.triangles(points, tris); + + forAll(tris, i) + { + triToFace.append(faceI); + triFace.append(tris[i]); + triMagSf.append(tris[i].mag(points)); + } + } + + forAll(sumTriMagSf_, i) + { + sumTriMagSf_[i] = 0.0; + } + + sumTriMagSf_[Pstream::myProcNo() + 1] = sum(triMagSf); + + Pstream::listCombineGather(sumTriMagSf_, maxEqOp<scalar>()); + Pstream::listCombineScatter(sumTriMagSf_); + + for (label i = 1; i < triMagSf.size(); i++) + { + triMagSf[i] += triMagSf[i-1]; + } + + // transfer to persistent storage + triFace_.transfer(triFace); + triToFace_.transfer(triToFace); + triCumulativeMagSf_.transfer(triMagSf); + + // fraction of injection volume to be injected by this patch + fraction_ = sumTriMagSf_[Pstream::myProcNo() + 1]/sum(sumTriMagSf_); + + // convert sumTriMagSf_ into cumulative sum of areas per proc + for (label i = 1; i < sumTriMagSf_.size(); i++) + { + sumTriMagSf_[i] += sumTriMagSf_[i - 1]; + } + + const scalarField magSf(mag(patch.faceAreas())); + patchArea_ = sum(magSf); + patchNormal_ = patch.faceAreas()/magSf; + reduce(patchArea_, sumOp<scalar>()); +} + + +void Foam::patchInjectionBase::setPositionAndCell +( + const polyMesh& mesh, + cachedRandom& rnd, + vector& position, + label& cellOwner, + label& tetFaceI, + label& tetPtI +) +{ + if (cellOwners_.size() > 0) + { + // determine which processor to inject from + scalar areaFraction = rnd.position<scalar>(0, patchArea_); + + label procI = 0; + forAllReverse(sumTriMagSf_, i) + { + if (areaFraction > sumTriMagSf_[i]) + { + procI = i; + break; + } + } + + if (Pstream::myProcNo() == procI) + { + // find corresponding decomposed face triangle + label triI = 0; + scalar offset = sumTriMagSf_[procI]; + forAllReverse(triCumulativeMagSf_, i) + { + if (areaFraction > triCumulativeMagSf_[i] + offset) + { + triI = i; + break; + } + } + + // set cellOwner + label faceI = triToFace_[triI]; + cellOwner = cellOwners_[faceI]; + + // find random point in triangle + const polyPatch& patch = mesh.boundaryMesh()[patchId_]; + const pointField& points = patch.points(); + const face& tf = triFace_[triI]; + const triPointRef tri(points[tf[0]], points[tf[1]], points[tf[2]]); + const point pf(tri.randomPoint(rnd)); + + // position perturbed away from face (into domain) + const scalar a = rnd.position(0.1, 0.5); + const vector& pc = mesh.cellCentres()[cellOwner]; + const vector d = mag(pf - pc)*patchNormal_[faceI]; + + position = pf - a*d; + + // 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 first tracking step + tetFaceI = mesh.cells()[cellOwner][0]; + tetPtI = 1; + } + else + { + cellOwner = -1; + tetFaceI = -1; + tetPtI = -1; + + // dummy position + position = pTraits<vector>::max; + } + } + else + { + cellOwner = -1; + tetFaceI = -1; + tetPtI = -1; + + // dummy position + position = pTraits<vector>::max; + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H new file mode 100644 index 0000000000000000000000000000000000000000..f3185316145fb1b6f62e2affaf3d5c7282c5c782 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::PatchInjectionBase + +Description + Base class for patch-based injection models. + + Class handles injecting at a random point adjacent to the patch faces to + provide a more stochsatic view of the injection process. Patch faces are + triangulated, and area fractions accumulated. The fractional areas are + then applied to determine across which face a parcel is to be injected. + +SourceFiles + PatchInjectionBase.C + +\*---------------------------------------------------------------------------*/ + +#ifndef patchInjectionBase_H +#define patchInjectionBase_H + +#include "word.H" +#include "labelList.H" +#include "scalarList.H" +#include "vectorList.H" +#include "faceList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward class declarations +class polyMesh; +class cachedRandom; + +/*---------------------------------------------------------------------------*\ + Class patchInjectionBase Declaration +\*---------------------------------------------------------------------------*/ + +class patchInjectionBase +{ +protected: + + // Protected data + + //- Patch name + const word patchName_; + + //- Patch ID + const label patchId_; + + //- Patch area - total across all processors + scalar patchArea_; + + //- Patch face normal directions + vectorList patchNormal_; + + //- List of cell labels corresponding to injector positions + labelList cellOwners_; + + //- Fraction of injection controlled by this processor + scalar fraction_; + + //- Decomposed patch faces as a list of triangles + faceList triFace_; + + //- Addressing from per triangle to patch face + labelList triToFace_; + + //- Cumulative triangle area per triangle face + scalarList triCumulativeMagSf_; + + //- Cumulative area fractions per processor + scalarList sumTriMagSf_; + + +public: + + // Constructors + + //- Construct from mesh and patch name + patchInjectionBase(const polyMesh& mesh, const word& patchName); + + //- Copy constructor + patchInjectionBase(const patchInjectionBase& pib); + + + //- Destructor + virtual ~patchInjectionBase(); + + + // Member Functions + + //- Update patch geometry and derived info for injection locations + virtual void updateMesh(const polyMesh& mesh); + + //- Set the injection position and owner cell, tetFace and tetPt + virtual void setPositionAndCell + ( + const polyMesh& mesh, + cachedRandom& rnd, + vector& position, + label& cellOwner, + label& tetFaceI, + label& tetPtI + ); +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // end namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index daf56a94d14938af0c60278cee691a2edba94b38..ff37610fadaa92a7ef814b55a7c0b05551452e9f 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,7 +30,7 @@ License #include "triSurfaceSearch.H" #include "cellClassification.H" #include "cpuTime.H" - +#include "demandDrivenData.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -443,14 +443,8 @@ Foam::surfaceToCell::~surfaceToCell() { if (IOwnPtrs_) { - if (surfPtr_) - { - delete surfPtr_; - } - if (querySurfPtr_) - { - delete querySurfPtr_; - } + deleteDemandDrivenData(surfPtr_); + deleteDemandDrivenData(querySurfPtr_); } } @@ -463,7 +457,7 @@ void Foam::surfaceToCell::applyToSet topoSet& set ) const { - if ( (action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) { Info<< " Adding cells in relation to surface " << surfName_ << " ..." << endl; diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.H b/src/meshTools/triSurface/orientedSurface/orientedSurface.H index 54b416e590bad5dafd5f7d454e4fb8f2198e71e6..59268d6f41fc3d726405c1f7b8900eeacc43f23a 100644 --- a/src/meshTools/triSurface/orientedSurface/orientedSurface.H +++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -131,6 +131,8 @@ class orientedSurface //- Make surface surface has consistent orientation across connected // triangles. static bool orientConsistent(triSurface& s); + + public: ClassName("orientedSurface"); diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C index f4b03dd4b4a2ced4d6c060b2bea8781c7302ba02..184df72a9c9b152d1c92867c83fdbdb7f6cebd4b 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverageTemplates.C @@ -78,7 +78,7 @@ void Foam::fieldAverage::addMeanField IOobject ( meanFieldName, - obr_.time().timeName(), + obr_.time().timeName(obr_.time().startTime().value()), obr_, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE @@ -145,7 +145,7 @@ void Foam::fieldAverage::addPrime2MeanField IOobject ( meanFieldName, - obr_.time().timeName(), + obr_.time().timeName(obr_.time().startTime().value()), obr_, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index 5a29b54bc003a11f6dd7c2759fc6a58dba6da067..7494702f5f8ae49e19d1cc133abe7f38b76cec36 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -37,6 +37,52 @@ defineTypeNameAndDebug(forceCoeffs, 0); } +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::forceCoeffs::writeFileHeader(const label i) +{ + if (i == 0) + { + // force coeff data + + file(i) + << "# liftDir : " << liftDir_ << nl + << "# dragDir : " << dragDir_ << nl + << "# pitchAxis : " << pitchAxis_ << nl + << "# magUInf : " << magUInf_ << nl + << "# lRef : " << lRef_ << nl + << "# Aref : " << Aref_ << nl + << "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab + << "Cl(f)" << tab << "Cl(r)"; + } + else if (i == 1) + { + // bin coeff data + + file(i) + << "# bins : " << nBin_ << nl + << "# start : " << binMin_ << nl + << "# delta : " << binDx_ << nl + << "# direction : " << binDir_ << nl; + + file(i) + << "# Time" + << tab << "bin" + << tab << "Cm" + << tab << "Cd" + << tab << "Cl"; + } + else + { + FatalErrorIn("void Foam::forces::writeFileHeader(const label)") + << "Unhandled file index: " << i + << abort(FatalError); + } + + file(i)<< endl; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::forceCoeffs::forceCoeffs @@ -88,14 +134,6 @@ void Foam::forceCoeffs::read(const dictionary& dict) } -void Foam::forceCoeffs::writeFileHeader(const label i) -{ - file() - << "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab - << "Cl(f)" << "Cl(r)" << endl; -} - - void Foam::forceCoeffs::execute() { // Do nothing - only valid on write @@ -116,93 +154,82 @@ void Foam::forceCoeffs::timeSet() void Foam::forceCoeffs::write() { - if (active_) + forces::calcForcesMoment(); + + if (!active_) { - forces::calcForcesMoment(); + return; + } - if (Pstream::master()) - { - functionObjectFile::write(); + if (Pstream::master()) + { + functionObjectFile::write(); - scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_; + scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_; - Field<vector> totForce(force_[0] + force_[1] + force_[2]); - Field<vector> totMoment(moment_[0] + moment_[1] + moment_[2]); + Field<vector> totForce(force_[0] + force_[1] + force_[2]); + Field<vector> totMoment(moment_[0] + moment_[1] + moment_[2]); - List<Field<scalar> > coeffs(3); - coeffs[0].setSize(nBin_); - coeffs[1].setSize(nBin_); - coeffs[2].setSize(nBin_); + List<Field<scalar> > coeffs(3); + coeffs[0].setSize(nBin_); + coeffs[1].setSize(nBin_); + coeffs[2].setSize(nBin_); - // lift, drag and moment - coeffs[0] = (totForce & liftDir_)/(Aref_*pDyn); - coeffs[1] = (totForce & dragDir_)/(Aref_*pDyn); - coeffs[2] = (totMoment & pitchAxis_)/(Aref_*lRef_*pDyn); + // lift, drag and moment + coeffs[0] = (totForce & liftDir_)/(Aref_*pDyn); + coeffs[1] = (totForce & dragDir_)/(Aref_*pDyn); + coeffs[2] = (totMoment & pitchAxis_)/(Aref_*lRef_*pDyn); - scalar Cl = sum(coeffs[0]); - scalar Cd = sum(coeffs[1]); - scalar Cm = sum(coeffs[2]); + scalar Cl = sum(coeffs[0]); + scalar Cd = sum(coeffs[1]); + scalar Cm = sum(coeffs[2]); - scalar Clf = Cl/2.0 + Cm; - scalar Clr = Cl/2.0 - Cm; + scalar Clf = Cl/2.0 + Cm; + scalar Clr = Cl/2.0 - Cm; - file() - << obr_.time().value() << tab - << Cm << tab << Cd << tab << Cl << tab << Clf << tab << Clr - << endl; + file(0) + << obr_.time().value() << tab + << Cm << tab << Cd << tab << Cl << tab << Clf << tab << Clr + << endl; - if (log_) - { - Info<< type() << " output:" << nl - << " Cm = " << Cm << nl - << " Cd = " << Cd << nl - << " Cl = " << Cl << nl - << " Cl(f) = " << Clf << nl - << " Cl(r) = " << Clr << endl; - } + if (log_) + { + Info<< type() << " output:" << nl + << " Cm = " << Cm << nl + << " Cd = " << Cd << nl + << " Cl = " << Cl << nl + << " Cl(f) = " << Clf << nl + << " Cl(r) = " << Clr << endl; + } - if (nBin_ > 1) + if (nBin_ > 1) + { + if (binCumulative_) { - autoPtr<writer<scalar> > - binWriterPtr(writer<scalar>::New(binFormat_)); - wordList fieldNames(IStringStream("(lift drag moment)")()); - - coordSet axis - ( - "forceCoeffs", - "distance", - binPoints_, - mag(binPoints_) - ); - - fileName forcesDir = baseTimeDir(); - mkDir(forcesDir); - - if (log_) - { - Info<< " Writing bins to " << forcesDir << endl; - } - - OFstream osCoeffs(forcesDir/"forceCoeffs_bins"); - - if (binCumulative_) + for (label i = 1; i < coeffs[0].size(); i++) { - for (label i = 1; i < coeffs[0].size(); i++) - { - coeffs[0][i] += coeffs[0][i-1]; - coeffs[1][i] += coeffs[1][i-1]; - coeffs[2][i] += coeffs[2][i-1]; - } + coeffs[0][i] += coeffs[0][i-1]; + coeffs[1][i] += coeffs[1][i-1]; + coeffs[2][i] += coeffs[2][i-1]; } - - binWriterPtr->write(axis, fieldNames, coeffs, osCoeffs); } - if (log_) + forAll(coeffs[0], i) { - Info<< endl; + file(1) + << obr_.time().value() + << tab << i + << tab << coeffs[2][i] + << tab << coeffs[1][i] + << tab << coeffs[0][i] + << endl; } } + + if (log_) + { + Info<< endl; + } } } diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index eefc82844457f5e75314e36ca92177c3224b8e6c..ee739be63e92e8190f49a8a913449fc7c2c09c08 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -45,22 +45,127 @@ defineTypeNameAndDebug(forces, 0); // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // +Foam::wordList Foam::forces::createFileNames(const dictionary& dict) const +{ + DynamicList<word> names(1); + + const word forceType(dict.lookup("type")); + + if (dict.found("binData")) + { + const dictionary& binDict(dict.subDict("binData")); + label nb = readLabel(binDict.lookup("nBin")); + if (nb > 0) + { + names.append(forceType + "_bins"); + } + } + + names.append(forceType); + + return names; +} + + void Foam::forces::writeFileHeader(const label i) { - file() - << "# Time" << tab - << "forces(pressure, viscous, porous) " - << "moment(pressure, viscous, porous)"; + if (i == 0) + { + // force data - if (localSystem_) + file(i) + << "# Time" << tab + << "forces(pressure,viscous,porous) " + << "moment(pressure,viscous,porous)"; + + if (localSystem_) + { + file(i) + << tab + << "localForces(pressure,viscous,porous) " + << "localMoments(pressure,viscous,porous)"; + } + } + else if (i == 1) + { + // bin data + + file(i) + << "# bins : " << nBin_ << nl + << "# start : " << binMin_ << nl + << "# delta : " << binDx_ << nl + << "# direction : " << binDir_ << nl; + + file(i) + << "# Time" + << tab << "bin" + << tab << "forces(pressure,viscous,porous)" + << tab << "moment(pressure,viscous,porous)"; + + if (localSystem_) + { + file(i) + << tab << "localForces(pressure,viscous,porous)" + << tab << "localMoment(pressure,viscous,porous)"; + } + } + else + { + FatalErrorIn("void Foam::forces::writeFileHeader(const label)") + << "Unhandled file index: " << i + << abort(FatalError); + } + + file(i)<< endl; +} + + +void Foam::forces::initialise() +{ + if (initialised_ || !active_) { - file() - << tab - << "local forces(pressure, viscous, porous) " - << "local moment(pressure, viscous, porous)"; + return; } - file()<< endl; + if (directForceDensity_) + { + if (!obr_.foundObject<volVectorField>(fDName_)) + { + active_ = false; + WarningIn("void Foam::forces::initialise()") + << "Could not find " << fDName_ << " in database." << nl + << " De-activating forces." + << endl; + } + } + else + { + if + ( + !obr_.foundObject<volVectorField>(UName_) + || !obr_.foundObject<volScalarField>(pName_) + || ( + rhoName_ != "rhoInf" + && !obr_.foundObject<volScalarField>(rhoName_) + ) + ) + { + active_ = false; + + WarningIn("void Foam::forces::initialise()") + << "Could not find " << UName_ << ", " << pName_; + + if (rhoName_ != "rhoInf") + { + Info<< " or " << rhoName_; + } + + Info<< " in database." << nl + << " De-activating forces." << endl; + } + } + + initialised_ = true; } @@ -249,25 +354,66 @@ void Foam::forces::applyBins } -void Foam::forces::writeBins() const +void Foam::forces::writeForces() { - if (nBin_ == 1) + if (log_) { - return; + Info<< type() << " output:" << nl + << " forces(pressure,viscous,porous) = (" + << sum(force_[0]) << "," + << sum(force_[1]) << "," + << sum(force_[2]) << ")" << nl + << " moment(pressure,viscous,porous) = (" + << sum(moment_[0]) << "," + << sum(moment_[1]) << "," + << sum(moment_[2]) << ")" + << nl; } - autoPtr<writer<vector> > binWriterPtr(writer<vector>::New(binFormat_)); - coordSet axis("forces", "distance", binPoints_, mag(binPoints_)); + file(0) << obr_.time().value() << tab + << "(" + << sum(force_[0]) << "," + << sum(force_[1]) << "," + << sum(force_[2]) + << ") " + << "(" + << sum(moment_[0]) << "," + << sum(moment_[1]) << "," + << sum(moment_[2]) + << ")" + << endl; - fileName forcesDir = baseTimeDir(); - mkDir(forcesDir); - - if (log_) + if (localSystem_) { - Info<< " Writing bins to " << forcesDir << endl; + vectorField localForceN(coordSys_.localVector(force_[0])); + vectorField localForceT(coordSys_.localVector(force_[1])); + vectorField localForceP(coordSys_.localVector(force_[2])); + vectorField localMomentN(coordSys_.localVector(moment_[0])); + vectorField localMomentT(coordSys_.localVector(moment_[1])); + vectorField localMomentP(coordSys_.localVector(moment_[2])); + + file(0) << obr_.time().value() << tab + << "(" + << sum(localForceN) << "," + << sum(localForceT) << "," + << sum(localForceP) + << ") " + << "(" + << sum(localMomentN) << "," + << sum(localMomentT) << "," + << sum(localMomentP) + << ")" + << endl; } +} - wordList fieldNames(IStringStream("(pressure viscous porous)")()); + +void Foam::forces::writeBins() +{ + if (nBin_ == 1) + { + return; + } List<Field<vector> > f(force_); List<Field<vector> > m(moment_); @@ -279,49 +425,56 @@ void Foam::forces::writeBins() const f[0][i] += f[0][i-1]; f[1][i] += f[1][i-1]; f[2][i] += f[2][i-1]; - m[0][i] += m[0][i-1]; m[1][i] += m[1][i-1]; m[2][i] += m[2][i-1]; } } - OFstream osForce(forcesDir/"force_bins"); - binWriterPtr->write(axis, fieldNames, f, osForce); - - OFstream osMoment(forcesDir/"moment_bins"); - binWriterPtr->write(axis, fieldNames, m, osMoment); - + List<Field<vector> > lf(3); + List<Field<vector> > lm(3); if (localSystem_) { - List<Field<vector> > localForce(3); - List<Field<vector> > localMoment(3); - localForce[0] = coordSys_.localVector(force_[0]); - localForce[1] = coordSys_.localVector(force_[1]); - localForce[2] = coordSys_.localVector(force_[2]); - localMoment[0] = coordSys_.localVector(moment_[0]); - localMoment[1] = coordSys_.localVector(moment_[1]); - localMoment[2] = coordSys_.localVector(moment_[2]); + lf[0] = coordSys_.localVector(force_[0]); + lf[1] = coordSys_.localVector(force_[1]); + lf[2] = coordSys_.localVector(force_[2]); + lm[0] = coordSys_.localVector(moment_[0]); + lm[1] = coordSys_.localVector(moment_[1]); + lm[2] = coordSys_.localVector(moment_[2]); if (binCumulative_) { - for (label i = 1; i < localForce[0].size(); i++) + for (label i = 1; i < lf[0].size(); i++) { - localForce[0][i] += localForce[0][i-1]; - localForce[1][i] += localForce[1][i-1]; - localForce[2][i] += localForce[2][i-1]; - localMoment[0][i] += localMoment[0][i-1]; - localMoment[1][i] += localMoment[1][i-1]; - localMoment[2][i] += localMoment[2][i-1]; + lf[0][i] += lf[0][i-1]; + lf[1][i] += lf[1][i-1]; + lf[2][i] += lf[2][i-1]; + lm[0][i] += lm[0][i-1]; + lm[1][i] += lm[1][i-1]; + lm[2][i] += lm[2][i-1]; } } + } - OFstream osLocalForce(forcesDir/"force_local"); - binWriterPtr->write(axis, fieldNames, localForce, osLocalForce); + forAll(f[0], i) + { + file(1) + << obr_.time().value() + << tab << i + << tab << "(" << f[0][i] << "," << f[1][i] << "," << f[2][i] << ")" + << tab << "(" << m[0][i] << "," << m[1][i] << "," << m[2][i] << ")"; - OFstream osLocalMoment(forcesDir/"moment_local"); - binWriterPtr->write(axis, fieldNames, localMoment, osLocalMoment); + if (localSystem_) + { + file(1) + << tab + << "(" << lf[0][i] << "," << lf[1][i] << "," << lf[2][i] << ")" + << tab + << "(" << lm[0][i] << "," << lm[1][i] << "," << lm[2][i] << ")"; + } + + file(1) << endl; } } @@ -336,7 +489,7 @@ Foam::forces::forces const bool loadFromFiles ) : - functionObjectFile(obr, name, word(dict.lookup("type"))), + functionObjectFile(obr, name, createFileNames(dict)), name_(name), obr_(obr), active_(true), @@ -360,7 +513,8 @@ Foam::forces::forces binMin_(GREAT), binPoints_(), binFormat_("undefined"), - binCumulative_(true) + binCumulative_(true), + initialised_(false) { // Check if the available mesh is an fvMesh otherise deactivate if (!isA<fvMesh>(obr_)) @@ -420,7 +574,8 @@ Foam::forces::forces binMin_(GREAT), binPoints_(), binFormat_("undefined"), - binCumulative_(true) + binCumulative_(true), + initialised_(false) { forAll(force_, i) { @@ -442,6 +597,8 @@ void Foam::forces::read(const dictionary& dict) { if (active_) { + initialised_ = false; + log_ = dict.lookupOrDefault<Switch>("log", false); directForceDensity_ = dict.lookupOrDefault("directForceDensity", false); @@ -454,19 +611,6 @@ void Foam::forces::read(const dictionary& dict) { // Optional entry for fDName fDName_ = dict.lookupOrDefault<word>("fDName", "fD"); - - // Check whether fDName exists, if not deactivate forces - if - ( - !obr_.foundObject<volVectorField>(fDName_) - ) - { - active_ = false; - WarningIn("void forces::read(const dictionary&)") - << "Could not find " << fDName_ << " in database." << nl - << " De-activating forces." - << endl; - } } else { @@ -475,32 +619,6 @@ void Foam::forces::read(const dictionary& dict) UName_ = dict.lookupOrDefault<word>("UName", "U"); rhoName_ = dict.lookupOrDefault<word>("rhoName", "rho"); - // Check whether UName, pName and rhoName exists, - // if not deactivate forces - if - ( - !obr_.foundObject<volVectorField>(UName_) - || !obr_.foundObject<volScalarField>(pName_) - || ( - rhoName_ != "rhoInf" - && !obr_.foundObject<volScalarField>(rhoName_) - ) - ) - { - active_ = false; - - WarningIn("void forces::read(const dictionary&)") - << "Could not find " << UName_ << ", " << pName_; - - if (rhoName_ != "rhoInf") - { - Info<< " or " << rhoName_; - } - - Info<< " in database." << nl - << " De-activating forces." << endl; - } - // Reference density needed for incompressible calculations rhoRef_ = readScalar(dict.lookup("rhoInf")); @@ -631,66 +749,18 @@ void Foam::forces::timeSet() void Foam::forces::write() { + calcForcesMoment(); + if (!active_) { return; } - calcForcesMoment(); - if (Pstream::master()) { functionObjectFile::write(); - if (log_) - { - Info<< type() << " output:" << nl - << " forces(pressure,viscous,porous) = (" - << sum(force_[0]) << "," - << sum(force_[1]) << "," - << sum(force_[2]) << ")" << nl - << " moment(pressure,viscous,porous) = (" - << sum(moment_[0]) << "," - << sum(moment_[1]) << "," - << sum(moment_[2]) << ")" - << nl; - } - - file() << obr_.time().value() << tab - << "(" - << sum(force_[0]) << "," - << sum(force_[1]) << "," - << sum(force_[2]) - << ") " - << "(" - << sum(moment_[0]) << "," - << sum(moment_[1]) << "," - << sum(moment_[2]) - << ")" - << endl; - - if (localSystem_) - { - vectorField localForceN(coordSys_.localVector(force_[0])); - vectorField localForceT(coordSys_.localVector(force_[1])); - vectorField localForceP(coordSys_.localVector(force_[2])); - vectorField localMomentN(coordSys_.localVector(moment_[0])); - vectorField localMomentT(coordSys_.localVector(moment_[1])); - vectorField localMomentP(coordSys_.localVector(moment_[2])); - - file() << obr_.time().value() << tab - << "(" - << sum(localForceN) << "," - << sum(localForceT) << "," - << sum(localForceP) - << ") " - << "(" - << sum(localMomentN) << "," - << sum(localMomentT) << "," - << sum(localMomentP) - << ")" - << endl; - } + writeForces(); writeBins(); @@ -704,6 +774,13 @@ void Foam::forces::write() void Foam::forces::calcForcesMoment() { + initialise(); + + if (!active_) + { + return; + } + force_[0] = vector::zero; force_[1] = vector::zero; force_[2] = vector::zero; diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index 793cf78cbf00e39528cbdcb530d96638df955f1b..ce2bcf4fe76a3a77b875ac255850d4f3c4ae9870 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -32,7 +32,8 @@ Description pressure and skin-friction forces over a given list of patches. Member function forces::write() calculates the forces/moments and - writes the forces/moments into the file \<timeDir\>/forces.dat + writes the forces/moments into the file \<timeDir\>/forces.dat and bin + data (if selected) to the file \<timeDir\>/forces_bin.dat Example of function object specification: \verbatim @@ -45,7 +46,6 @@ Description patches (walls); nBin 20; binDir (1 0 0); - binFormat gnuplot; } \endverbatim @@ -57,7 +57,6 @@ Description patches | patches included in the forces calculation | yes | nBin | number of data bins | no | binDir | direction along which bins are defined | no | - binFormat | output format for bin data | no | pName | pressure field name | no | p UName | velocity field name | no | U rhoName | density field name (see below) | no | rho @@ -216,11 +215,21 @@ protected: bool binCumulative_; + //- Initialised flag + bool initialised_; + + // Protected Member Functions + //- Create file names for forces and bins + wordList createFileNames(const dictionary& dict) const; + //- Output file header information virtual void writeFileHeader(const label i); + //- Initialise the fields + void initialise(); + //- Return the effective viscous stress (laminar + turbulent). tmp<volSymmTensorField> devRhoReff() const; @@ -244,8 +253,11 @@ protected: const vectorField& d ); + //- Helper function to write force data + void writeForces(); + //- Helper function to write bin data - void writeBins() const; + void writeBins(); //- Disallow default bitwise copy construct forces(const forces&); diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index 885e611fa0f879cbde7c1d8b4f7a0e35b1d71cde..681e36fc9eee78af66c952b3139c57a281e2dcf1 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -129,7 +129,6 @@ void Foam::Peclet::end() // Do nothing - only valid on write } - void Foam::Peclet::timeSet() { // Do nothing - only valid on write @@ -163,16 +162,32 @@ void Foam::Peclet::write() nuEff = model.nuEff(); } - else if (mesh.foundObject<transportModel>("transportProperties")) + else if (mesh.foundObject<dictionary>("transportProperties")) { - const transportModel& model = - mesh.lookupObject<transportModel>("transportProperties"); + const dictionary& model = + mesh.lookupObject<dictionary>("transportProperties"); - nuEff = model.nu(); + nuEff = + tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "nuEff", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar(model.lookup("nu")) + ) + ); } else { - FatalErrorIn("void Foam::wallShearStress::write()") + FatalErrorIn("void Foam::Peclet::write()") << "Unable to determine the viscosity" << exit(FatalError); } diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C index 5ea5b9034a8b8914b0b4db60432d434387322829..5082536734f7baa6179eed63467dd21041656c27 100644 --- a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C @@ -268,11 +268,9 @@ void Foam::pressureTools::read(const dictionary& dict) dict.readIfPresent("UName", UName_); dict.readIfPresent("rhoName", rhoName_); - const volScalarField& p = obr_.lookupObject<volScalarField>(pName_); - - if (p.dimensions() != dimPressure) + if (rhoName_ == "rhoInf") { - dict.lookup("rhoRef") >> rhoInf_; + dict.lookup("rhoInf") >> rhoInf_; } dict.lookup("calcTotal") >> calcTotal_; diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C index 0b656b20ac001ce6ccb1f748933492ff9758f0d7..3d85ccda882391bbeb07341a97ad0b575444f17c 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C @@ -116,7 +116,9 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData { if (log()) { - Info<< type() << ": writing data to " << os.name() << endl; + Info<< type() << ": " << this->patch().name() + << ": writing data to " << os.name() + << endl; } const label patchI = patch().index(); @@ -152,11 +154,11 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData FatalErrorIn ( "void Foam::externalCoupledTemperatureMixedFvPatchScalarField::" - "writeData" + "transferData" "(" - "const fileName& transferFile" + "OFstream&" ") const" - ) << "Condition requires either compressibke turbulence and/or " + ) << "Condition requires either compressible turbulence and/or " << "thermo model to be available" << exit(FatalError); } @@ -233,9 +235,12 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData } -void Foam::externalCoupledTemperatureMixedFvPatchScalarField::updateCoeffs() +void Foam::externalCoupledTemperatureMixedFvPatchScalarField::evaluate +( + const Pstream::commsTypes comms +) { - externalCoupledMixedFvPatchField<scalar>::updateCoeffs(); + externalCoupledMixedFvPatchField<scalar>::evaluate(comms); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H index 906f878ed831dc47be49c53047e407a5a5f9e575..29c64541ac5f69813286e6a5a20b9700a8f84a64 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.H @@ -29,7 +29,7 @@ Group Description This boundary condition provides a temperatue interface to an external - application. Values are transferred as plain text files, where OperFOAM + application. Values are transferred as plain text files, where OpenFOAM data is written as: # Patch: <patch name> @@ -48,13 +48,7 @@ Description ... <valueN> <gradientN> <valueFracionN> - Data is either sent/received as one file per patch, or as a single file - for all patches, based on the \c collate flag. In the former case, the - folder used for communications is: - - $FOAM_CASE/<commsDir>/patchName - - and when using the \c collate option: + Data is sent/received as a single file for all patches from the folder $FOAM_CASE/<commsDir> @@ -83,7 +77,6 @@ Description Property | Description | Required | Default value commsDir | communications folder | yes | fileName | transfer file name | yes | - collate | collate all patch data into single file | yes | waitInterval | interval [s] between file checks | no | 1 timeOut | time after which error invoked [s] |no |100*waitInterval calcFrequency | calculation frequency | no | 1 @@ -97,7 +90,6 @@ Description type externalCoupledTemperature; commsDir "$FOAM_CASE/comms"; fileName data; - collate yes; calcFrequency 1; } \endverbatim @@ -220,8 +212,11 @@ public: // Evaluation functions - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); + //- Evaluate the patch field + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); //- Transfer data for external source virtual void transferData(OFstream& os) const; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T new file mode 100644 index 0000000000000000000000000000000000000000..3bf09662bb0a143ba6281b3e9f135607ea59eefe --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/T @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + frontAndBack + { + type zeroGradient; + } + + topAndBottom + { + type zeroGradient; + } + + hot + { + type externalCoupledTemperature; + commsDir "${FOAM_CASE}/comms"; + fileName "data"; + initByExternal yes; + log true; + value uniform 307.75; // 34.6 degC + } + + cold + { + type externalCoupledTemperature; + commsDir "${FOAM_CASE}/comms"; + fileName "data"; + initByExternal yes; + log true; + value uniform 288.15; // 15 degC + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/U b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/U new file mode 100644 index 0000000000000000000000000000000000000000..2d917d036faaa2d227ec7ef69f7338d00b670f22 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/U @@ -0,0 +1,50 @@ +/*--------------------------------*- 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 volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + frontAndBack + { + type fixedValue; + value uniform (0 0 0); + } + + topAndBottom + { + type fixedValue; + value uniform (0 0 0); + } + + hot + { + type fixedValue; + value uniform (0 0 0); + } + + cold + { + type fixedValue; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/alphat b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..9e486ba21571232468addb9c24008bcaebb3be18 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/alphat @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontAndBack + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + topAndBottom + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + hot + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + cold + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/epsilon b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..da6d89154851331611a27d6b49a58efd89858852 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/epsilon @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 4e-06; + +boundaryField +{ + frontAndBack + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } + topAndBottom + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } + hot + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } + cold + { + type compressible::epsilonWallFunction; + value uniform 4e-06; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/k b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/k new file mode 100644 index 0000000000000000000000000000000000000000..886667fb5c3f9345b3bcd01d6af87fd49d640837 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/k @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-04; + +boundaryField +{ + frontAndBack + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } + topAndBottom + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } + hot + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } + cold + { + type compressible::kqRWallFunction; + value uniform 3.75e-04; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/mut b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..0ecb8672d2758749a6119dd49183237cb1bfa503 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/mut @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + frontAndBack + { + type mutUWallFunction; + value uniform 0; + } + topAndBottom + { + type mutUWallFunction; + value uniform 0; + } + hot + { + type mutUWallFunction; + value uniform 0; + } + cold + { + type mutUWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/omega b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/omega new file mode 100644 index 0000000000000000000000000000000000000000..423815a2de8a485bfb7829b7669a7b147a225d3e --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/omega @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 0.12; + +boundaryField +{ + frontAndBack + { + type compressible::omegaWallFunction; + value uniform 0.12; + } + topAndBottom + { + type compressible::omegaWallFunction; + value uniform 0.12; + } + hot + { + type compressible::omegaWallFunction; + value uniform 0.12; + } + cold + { + type compressible::omegaWallFunction; + value uniform 0.12; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/p new file mode 100644 index 0000000000000000000000000000000000000000..9b1e74247bf9946eae6d063aa536d141bee454ad --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/p @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + frontAndBack + { + type calculated; + value $internalField; + } + + topAndBottom + { + type calculated; + value $internalField; + } + + hot + { + type calculated; + value $internalField; + } + + cold + { + type calculated; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..15979d020e33ed2769512df863c4ccb772b6eeca --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/0/p_rgh @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + frontAndBack + { + type fixedFluxPressure; + value uniform 1e5; + } + + topAndBottom + { + type fixedFluxPressure; + value uniform 1e5; + } + + hot + { + type fixedFluxPressure; + value uniform 1e5; + } + + cold + { + type fixedFluxPressure; + value uniform 1e5; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..0dbf345049b678d451db10398a7c52c2f928b88c --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allclean @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf comms + +killall externalSolver > /dev/null 2>&1 + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..484bfa6c525aeb575c18ed505d7dd32af8ee99c6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +./Allrun.pre + +runApplication $(getApplication) & + +./externalSolver + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun-parallel b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun-parallel new file mode 100755 index 0000000000000000000000000000000000000000..5bba5c94401d28061723de9e6f7cfc1f5460a2a4 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun-parallel @@ -0,0 +1,16 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +./Allrun.pre + +runApplication decomposePar + +runParallel $(getApplication) 4 & + +./externalSolver + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun.pre b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun.pre new file mode 100755 index 0000000000000000000000000000000000000000..1964116a40f8c9400516a5dd5b4a2ac013c0bf88 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/Allrun.pre @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication createExternalCoupledPatchGeometry T + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/README b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/README new file mode 100644 index 0000000000000000000000000000000000000000..10d7392eb4814034795d02d08115ce261ce9875a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/README @@ -0,0 +1,5 @@ +Example of an explicit coupling between OpenFOAM and an external application +using the externalCoupled boundary conditions. + +The case is based on the buoyantCavity tutorial case, whereby on each iteration +the 'hot' and 'cold' patch temperatures are incremented by 1K. diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/RASProperties similarity index 89% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/RASProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/RASProperties index 552ecb32c7b2430e061322808c20842dc3e354b8..be86bc1efaab5bb87f00ce3f86915c671b6ef43b 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/RASProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/RASProperties @@ -10,16 +10,14 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; object RASProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -RASModel laminar; +RASModel kOmegaSST; -turbulence off; - -printCoeffs off; +turbulence on; +printCoeffs on; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/g b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/g similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/g rename to tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/g diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..5f2f1e8fd2b5032b4ee3d38fcb0a2d432d1e3077 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/polyMesh/blockMeshDict @@ -0,0 +1,83 @@ +/*--------------------------------*- 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 blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +vertices +( + ( 0 0 -260) + (76 0 -260) + (76 2180 -260) + ( 0 2180 -260) + ( 0 0 260) + (76 0 260) + (76 2180 260) + ( 0 2180 260) +); + +edges +( +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (35 150 15) simpleGrading (1 1 1) +); + +boundary +( + frontAndBack + { + type wall; + faces + ( + (0 1 5 4) + (2 3 7 6) + ); + } + + topAndBottom + { + type wall; + faces + ( + (4 5 6 7) + (3 2 1 0) + ); + } + + hot + { + type wall; + faces + ( + (6 5 1 2) + ); + } + + cold + { + type wall; + faces + ( + (4 7 3 0) + ); + } +); + +mergePatchPairs +( +); diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..7cba6d73ec3f51a6b3060c296fcc3634d9e16846 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + frontAndBack + { + type wall; + nFaces 1050; + startFace 228225; + } + topAndBottom + { + type wall; + nFaces 10500; + startFace 229275; + } + hot + { + type wall; + nFaces 2250; + startFace 239775; + } + cold + { + type wall; + nFaces 2250; + startFace 242025; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..95579e34cb51bd580ceb7debb125ff47a8c7a6aa --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/constant/thermophysicalProperties @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.96; + } + thermodynamics + { + Cp 1004.4; + Hf 0; + } + transport + { + mu 1.831e-05; + Pr 0.705; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/externalSolver b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/externalSolver new file mode 100755 index 0000000000000000000000000000000000000000..ac4b78d3d1553c34ca1a4e8c1a6d282a4b740199 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/externalSolver @@ -0,0 +1,85 @@ +#!/bin/sh +# +# Dummy external solver to communicate with OpenFOAM via externalCoupled +# boundary conditions +# +# Functionality is hard-coded for this particular test case +# - patch temperatures increased by 1K on each step +# +cd ${0%/*} || exit 1 # run from this directory + +echo "*** Executing dummy external solver" + +commsDir="comms" +lockFile="${commsDir}/OpenFOAM.lock" +dataFile="${commsDir}/data" +waitSec=1 +timeOut=10 +refGrad=0 +valueFraction=1 + +function log() +{ + echo "External: $@" +} + +function init() +{ + log "initialisation: creating ${dataFile}.in" + + # Hard-coded for 2 patches of size 2250 + n=2250 + refCold=283 + refHot=303 + touch "${dataFile}.in" + for i in $(seq 1 $n); do + echo "$refHot $refGrad $valueFraction" >> "${dataFile}.in" + done + for i in $(seq 1 $n); do + echo "$refCold $refGrad $valueFraction" >> "${dataFile}.in" + done + + # create lock file to pass control to OF + touch ${lockFile} +} + + +# tutorial case employs the 'initByExternalOption', so we need to provide +# the initial values +init + + +totalWait=0 +step=0 +while [ 1 ]; do + if [ -f $lockFile ]; then + log "found lock file ${lockFile} - waiting" + ((totalWait += waitSec)) + if [ $totalWait -gt $timeOut ]; then + log "timeout" + break + else + sleep $waitSec + fi + else + totalWait=0 + ((step++)) + log "step $step" + log "lock not present - taking control" + + log "sleeping for $waitSec secs to simulate external process" + sleep $waitSec + + log "creating ${dataFile}.in" + + awk '{if( $1 != "#" ){print $2+1 " 0 1"}}' ${dataFile}.out > ${dataFile}.in + + log "creating lock file ${lockFile}" + touch ${lockFile} + fi +done + +log "done" + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/ppProperties b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/controlDict similarity index 66% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/ppProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/controlDict index eddbfd7ad7910a8a85af9c310b1424eb18d3eb1e..afe4591501362f5fd49092722ff1f3fe28c7eb5e 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/ppProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/controlDict @@ -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 | | \*---------------------------------------------------------------------------*/ @@ -10,20 +10,39 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object ppProperties; + object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -preAlphaExp 300; +application buoyantSimpleFoam; -expMax 10; +startFrom startTime; -alphaMax 0.6; +startTime 0; -g0 g0 [ 1 -1 -2 0 0 0 0 ] 0; +stopAt endTime; -packingLimiter off; +endTime 100; + +deltaT 1; + +writeControl timeStep; + +writeInterval 10; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/decomposeParDict b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..9165c030940a7593525d345371ad8611c5f45726 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/decomposeParDict @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n ( 2 2 1 ); + delta 0.001; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..c52c053c84844fb84137797f741b112943bcd03a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSchemes @@ -0,0 +1,67 @@ +/*--------------------------------*- 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 fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss limitedLinear 0.2; + div(phi,K) bounded Gauss limitedLinear 0.2; + div(phi,h) bounded Gauss limitedLinear 0.2; + div(phi,k) bounded Gauss limitedLinear 0.2; + div(phi,epsilon) bounded Gauss limitedLinear 0.2; + div(phi,omega) bounded Gauss limitedLinear 0.2; + div((muEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear orthogonal; + laplacian(Dp,p_rgh) Gauss linear orthogonal; + laplacian(alphaEff,h) Gauss linear orthogonal; + laplacian(DkEff,k) Gauss linear orthogonal; + laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; + laplacian(DomegaEff,omega) Gauss linear orthogonal; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default orthogonal; +} + +fluxRequired +{ + default no; + p_rgh; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..d30cdf20b496e354128a273418811f504df1abed --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/externalCoupledCavity/system/fvSolution @@ -0,0 +1,77 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p_rgh + { + solver GAMG; + tolerance 1e-7; + relTol 0.01; + + smoother DICGaussSeidel; + + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + "(U|h|k|epsilon|omega)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-8; + relTol 0.1; + } +} + +SIMPLE +{ + momentumPredictor yes; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + + residualControl + { + p_rgh 1e-2; + U 1e-3; + h 1e-3; + + // possibly check turbulence fields + "(k|epsilon|omega)" 1e-3; + } +} + +relaxationFactors +{ + fields + { + rho 1.0; + p_rgh 0.7; + } + equations + { + U 0.3; + h 0.3; + "(k|epsilon|omega)" 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties index 62775863dfde602df14efa3dd47a19cfba06e048..a8125605528e41a6e8ae3413ab25cb4f9afd6746 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties @@ -100,37 +100,39 @@ subModels parcelsPerSecond 20000000; flowRateProfile table ( - (0 0.1272) - (4.16667e-05 6.1634) - (8.33333e-05 9.4778) - (0.000125 9.5806) - (0.000166667 9.4184) - (0.000208333 9.0926) - (0.00025 8.7011) - (0.000291667 8.2239) - (0.000333333 8.0401) - (0.000375 8.845) - (0.000416667 8.9174) - (0.000458333 8.8688) - (0.0005 8.8882) - (0.000541667 8.6923) - (0.000583333 8.0014) - (0.000625 7.2582) - (0.000666667 7.2757) - (0.000708333 6.968) - (0.00075 6.7608) - (0.000791667 6.6502) - (0.000833333 6.7695) - (0.000875 5.5774) - (0.000916667 4.8649) - (0.000958333 5.0805) - (0.001 4.9547) - (0.00104167 4.5613) - (0.00108333 4.4536) - (0.001125 5.2651) - (0.00116667 5.256) - (0.00120833 5.1737) - (0.00125 3.9213) + (0 0.1272) + (4.16667e-05 6.1634) + (8.33333e-05 9.4778) + (0.000125 9.5806) + (0.000166667 9.4184) + (0.000208333 9.0926) + (0.00025 8.7011) + (0.000291667 8.2239) + (0.000333333 8.0401) + (0.000375 8.8450) + (0.000416667 8.9174) + (0.000458333 8.8688) + (0.0005 8.8882) + (0.000541667 8.6923) + (0.000583333 8.0014) + (0.000625 7.2582) + (0.000666667 7.2757) + (0.000708333 6.9680) + (0.00075 6.7608) + (0.000791667 6.6502) + (0.000833333 6.7695) + (0.000875 5.5774) + (0.000916667 4.8649) + (0.000958333 5.0805) + (0.001 4.9547) + (0.00104167 4.5613) + (0.00108333 4.4536) + (0.001125 5.2651) + (0.00116667 5.2560) + (0.00120833 5.1737) + (0.00125 3.9213) + (0.001251 0.0000) + (1000 0.0000) ); Cd constant 0.9; @@ -163,14 +165,14 @@ subModels phaseChangeModel liquidEvaporationBoil; - stochasticCollisionModel none; - surfaceFilmModel none; atomizationModel none; breakupModel ReitzDiwakar; // ReitzKHRT; + stochasticCollisionModel none; + radiation off; standardWallInteractionCoeffs diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/kineticTheoryProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/kineticTheoryProperties deleted file mode 100644 index dd434c837468e4c3719d0f21153fa9edc5fd4ab9..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/kineticTheoryProperties +++ /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 dictionary; - location "constant"; - object kineticTheoryProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -kineticTheory off; - -equilibrium on; - -e e [ 0 0 0 0 0 0 0 ] 0.9; - -alphaMax alphaMax [ 0 0 0 0 0 0 0 ] 0.6; - -alphaMinFriction alphaMinFriction [ 0 0 0 0 0 0 0 ] 0.5; - -Fr Fr [ 1 -1 -2 0 0 0 0 ] 0.05; - -eta eta [ 0 0 0 0 0 0 0 ] 2; - -p p [ 0 0 0 0 0 0 0 ] 5; - -phi phi [ 0 0 0 0 0 0 0 ] 25; - -viscosityModel Syamlal; - -conductivityModel HrenyaSinclair; - -granularPressureModel Lun; - -frictionalStressModel JohnsonJackson; - -radialModel SinclairJackson; - -HrenyaSinclairCoeffs -{ - L L [ 0 1 0 0 0 0 0 ] 0.0005; -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon deleted file mode 100644 index 69b3e74c838b2f693281b70c870742448faeb9b8..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon +++ /dev/null @@ -1,50 +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 volScalarField; - object epsilon; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [ 0 2 -3 0 0 0 0 ]; - -internalField uniform 10.0; - -referenceLevel 0; - -boundaryField -{ - inlet - { - type fixedValue; - value uniform 10.0; - } - - outlet - { - type inletOutlet; - phi phi2; - inletValue uniform 10.0; - value uniform 10.0; - } - - walls - { - type zeroGradient; - } - - frontAndBackPlanes - { - type empty; - } -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/interfacialProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/interfacialProperties deleted file mode 100644 index 63efa66a33df1344b571e8b25a15fc48880dd097..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/interfacialProperties +++ /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; - location "constant"; - object interfacialProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dragModel1 GidaspowErgunWenYu; -dragModel2 GidaspowErgunWenYu; - -heatTransferModel1 RanzMarshall; -heatTransferModel2 RanzMarshall; - -dispersedPhase "1"; - -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/kineticTheoryProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/kineticTheoryProperties deleted file mode 100644 index 84660d86278e0440cba0defddad073cfa34caf66..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/kineticTheoryProperties +++ /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 dictionary; - location "constant"; - object kineticTheoryProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -kineticTheory on; - -equilibrium on; - -e e [ 0 0 0 0 0 0 0 ] 0.8; - -alphaMax alphaMax [ 0 0 0 0 0 0 0 ] 0.62; - -alphaMinFriction alphaMinFriction [ 0 0 0 0 0 0 0 ] 0.65; - -Fr Fr [ 1 -1 -2 0 0 0 0 ] 0.05; - -eta eta [ 0 0 0 0 0 0 0 ] 2; - -p p [ 0 0 0 0 0 0 0 ] 5; - -phi phi [ 0 0 0 0 0 0 0 ] 0; - -viscosityModel Gidaspow; - -conductivityModel Gidaspow; - -granularPressureModel Lun; - -frictionalStressModel JohnsonJackson; - -radialModel SinclairJackson; - -HrenyaSinclairCoeffs -{ - L L [ 0 1 0 0 0 0 0 ] 0.0005; -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Tair b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/T.air similarity index 97% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Tair rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/T.air index 25bc08d671014e05362550e22ecd36921d254728..9c0fd4206c19f34a05d8c05da28254b22882ebcf 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Tair +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/T.air @@ -27,7 +27,7 @@ boundaryField outlet { type inletOutlet; - phi phiair; + phi phi.air; inletValue $internalField; value $internalField; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Twater b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/T.water similarity index 97% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Twater rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/T.water index f0f366c7dc27735b261b92c9eb7e2570dcaff136..1cfd38f926516878085292090cf2e55699fef0cb 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Twater +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/T.water @@ -27,7 +27,7 @@ boundaryField outlet { type inletOutlet; - phi phiwater; + phi phi.water; inletValue uniform 300; value $internalField; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Theta b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/Theta similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Theta rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/Theta diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Uair b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/U.air similarity index 95% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Uair rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/U.air index ac6020947e16d1537f7ed05c0878183567bac15c..e81fffac0612e0a20d26f1cb9be4211ba4be9a16 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Uair +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/U.air @@ -10,7 +10,7 @@ FoamFile version 2.0; format binary; class volVectorField; - object Uair; + object U.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -28,7 +28,7 @@ boundaryField outlet { type pressureInletOutletVelocity; - phi phiair; + phi phi.air; value $internalField; } walls diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Uwater b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/U.water similarity index 95% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Uwater rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/U.water index 22ed59a0ef3e78143b36a455a5c2d9f41f09df3a..aab00fd78bb2a097604737fb5b1b77d2ae159967 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/Uwater +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/U.water @@ -10,7 +10,7 @@ FoamFile version 2.0; format binary; class volVectorField; - object Uwater; + object U.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -28,7 +28,7 @@ boundaryField outlet { type pressureInletOutletVelocity; - phi phiwater; + phi phi.water; value $internalField; } walls diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alphaair b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air similarity index 98% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alphaair rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air index a2224f95c3c32f38ce0e3e0dd361b3fabc5bf60f..1b1a35684a06787a1eb3cb75f388563aad1443a1 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alphaair +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air @@ -11,7 +11,7 @@ FoamFile format ascii; class volScalarField; location "0"; - object alpha1; + object alpha.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -1908,7 +1908,7 @@ boundaryField outlet { type inletOutlet; - phi phiair; + phi phi.air; inletValue uniform 1; value uniform 1; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alphaair.org b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air.org similarity index 93% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alphaair.org rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air.org index 62088eca2323cb4b66162a3131679877f60bb945..4472b0c63598b7f95acf8d79fac10b3e9a08ebf7 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alphaair.org +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/alpha.air.org @@ -10,7 +10,8 @@ FoamFile version 2.0; format ascii; class volScalarField; - object alphaair; + location "0"; + object alpha.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -28,7 +29,7 @@ boundaryField outlet { type inletOutlet; - phi phiair; + phi phi.air; inletValue uniform 1; value uniform 1; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/p b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/p similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/p rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/0/p diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/g b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/g similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/g rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/g diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..8e7701bf4cbb55811305ff6b022674cfd2bc6e95 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties @@ -0,0 +1,67 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (air water); + +air +{ + diameterModel isothermal; + isothermalCoeffs + { + d0 3e-3; + p0 1e5; + } +} + +water +{ + diameterModel constant; + constantCoeffs + { + d 1e-4; + } +} + +drag +{ + air SchillerNaumann; + water SchillerNaumann; +} + +heatTransfer +{ + air RanzMarshall; + water RanzMarshall; +} + +dispersedPhase both; + +residualPhaseFraction 1e-3; +residualSlip 1e-2; + +// Virtual-mass ceofficient +Cvm 0.5; + +// Lift coefficient +Cl 0; + +// Minimum allowable pressure +pMin 10000; + + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/polyMesh/blockMeshDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/polyMesh/blockMeshDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/polyMesh/blockMeshDict diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/polyMesh/boundary b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/polyMesh/boundary similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/polyMesh/boundary rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/polyMesh/boundary diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertiesair b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.air similarity index 96% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertiesair rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.air index 11c033af59bbfbf08d2b11244e50f0fd00c1542f..3cac781ab1bf649afe060310f5ea7c898123efd9 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertiesair +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.air @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermophysicalProperties; + object thermophysicalProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water similarity index 95% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water index 789f0427d7c9bd5d4d833f44b0f39359e8ab8bbf..394eb31679cf250cd4f43a40924f257c503e52c1 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties2 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/thermophysicalProperties.water @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermophysicalProperties; + object thermophysicalProperties.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -31,7 +31,7 @@ mixture specie { nMoles 1; - molWeight 28.9; + molWeight 18; } equationOfState { diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/MRFProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/turbulenceProperties.air similarity index 92% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/MRFProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/turbulenceProperties.air index fd749d03963870c76ab4a9d85ad86bd95c33a71f..1296429b72a21953def920b08774aa75e1d048b1 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/MRFProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/turbulenceProperties.air @@ -11,10 +11,10 @@ FoamFile format ascii; class dictionary; location "constant"; - object MRFProperties; + object turbulenceProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// none +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/RASProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/turbulenceProperties.water similarity index 91% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/RASProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/turbulenceProperties.water index bd099a7e258af8451964c7746334da298510e1f0..7f0d75a82fcdc99677fa0be8a4111cfe91e4a82c 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/RASProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/constant/turbulenceProperties.water @@ -11,13 +11,10 @@ FoamFile format ascii; class dictionary; location "constant"; - object RASProperties; + object turbulenceProperties.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -turbulence on; - -printCoeffs on; - +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/controlDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict similarity index 97% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/controlDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict index 24d66f91c7d44dfeb7b24b508c2593511edb6ed9..18bd2e06daecdad9cfcfe4aa17a643d49df8d145 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/controlDict +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/controlDict @@ -60,21 +60,21 @@ functions outputControl outputTime; fields ( - Uair + U.air { mean on; prime2Mean off; base time; } - Uwater + U.water { mean on; prime2Mean off; base time; } - alphaair + alpha.air { mean on; prime2Mean off; diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/fvSchemes b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSchemes similarity index 71% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/fvSchemes rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSchemes index c0ea375341437d614a1cad16c12827f45ec79cdd..549178c4c6d23cc27d375e5f3ec2f1c7084672ee 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/fvSchemes +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSchemes @@ -27,20 +27,19 @@ gradSchemes divSchemes { - default none; + default none; - div(phi,alphaair) Gauss vanLeer; - div(phir,alphaair) Gauss vanLeer; + div(phi,alpha.air) Gauss vanLeer; + div(phir,alpha.air) Gauss vanLeer; - "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; - "div\(phi.*,U.*\)" Gauss limitedLinearV 1; - "div\(\(alpha.*Rc\)\)" Gauss linear; - "div\(phi.*,.*rho.*\)" Gauss linear; + "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,.*rho.*\)" Gauss linear; - "div\(alphaPhi.*,h.*\)" Gauss limitedLinear 1; - "div\(alphaPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(K.*|p)\)" Gauss limitedLinear 1; - "div\(alphaPhi.*,(k|epsilon)\)" Gauss limitedLinear 1; + "div\(\(\(alpha.*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; } laplacianSchemes diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a25ccff8c62a0d6c8289dc37ad95385ffaaaf771 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution @@ -0,0 +1,84 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + alpha.air + { + nAlphaCorr 1; + nAlphaSubCycles 2; + } + + p + { + solver GAMG; + smoother DIC; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + tolerance 1e-08; + relTol 0.01; + } + + pFinal + { + $p; + tolerance 1e-08; + relTol 0; + } + + "U.*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + "h.*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-8; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + fields + { + } + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/setFieldsDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/setFieldsDict similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/setFieldsDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/bubbleColumn/system/setFieldsDict diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/T.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/T.air new file mode 100644 index 0000000000000000000000000000000000000000..5e2332c34b0949d669c8c0309ff964318c1151ce --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/T.air @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type zeroGradient; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/T1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/T.particles similarity index 94% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/T1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/T.particles index 92073f40861cd9e06527253a2f6e9f41379b5477..155187199907bcc1ea0a526baea46812b3b29d63 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/T1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/T.particles @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object T1; + object T.particles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -29,7 +29,7 @@ boundaryField outlet { type inletOutlet; - phi phi1; + phi phi.particles; inletValue $internalField; value $internalField; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/Theta b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/Theta.particles similarity index 89% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/Theta rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/Theta.particles index 549cece590651e084bfff8997b390bfaad694720..c9b385ccd8b7ceba80aa3332b0c25b85d8328566 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/Theta +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/Theta.particles @@ -10,22 +10,22 @@ FoamFile version 2.0; format ascii; class volScalarField; - object Theta; + object Theta.particles; } // ************************************************************************* // dimensions [ 0 2 -2 0 0 0 0 ]; -internalField uniform 1.0e-4; +internalField uniform 0; -referenceLevel 0; +referenceLevel 1e-4; boundaryField { inlet { type fixedValue; - value uniform 1.0e-4; + value uniform 1e-4; } outlet diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/U2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/U.air similarity index 93% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/U2 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/U.air index cacb4e22301f822a04031ca3c8cef99da533ddb1..4896cfb962a47eebb1ef639ae307045472f49060 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/U2 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/U.air @@ -8,9 +8,9 @@ FoamFile { version 2.0; - format binary; + format ascii; class volVectorField; - object U2; + object U.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -29,7 +29,7 @@ boundaryField outlet { type pressureInletOutletVelocity; - phi phi2; + phi phi.air; value $internalField; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/U1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/U.particles similarity index 93% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/U1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/U.particles index 0543b7e78ff70c020c8651d5f413610c0020e04d..95abcf62b37fe1a1613711e17040560e5d1d4ed9 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/U1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/U.particles @@ -8,9 +8,9 @@ FoamFile { version 2.0; - format binary; + format ascii; class volVectorField; - object U1; + object U.particles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -29,7 +29,7 @@ boundaryField outlet { type pressureInletOutletVelocity; - phi phi1; + phi phi.particles; value $internalField; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.air new file mode 100644 index 0000000000000000000000000000000000000000..9a4d3aea6cad96d8401c7af22e2004860edf22c0 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.air @@ -0,0 +1,6048 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField nonuniform List<scalar> +6000 +( +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +) +; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 1; + } + outlet + { + type zeroGradient; + } + walls + { + type zeroGradient; + } + frontAndBackPlanes + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/epsilon b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.air.org similarity index 79% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/epsilon rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.air.org index 3f507afed8ea6ba738e2fc7772a1fe96b57609de..29db06c78367cb29c5f8b9b9bdc7ca58ee1db9c6 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/epsilon +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.air.org @@ -10,39 +10,36 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; - object epsilon; + object alpha.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 0 2 -3 0 0 0 0 ]; +dimensions [0 0 0 0 0 0 0]; -internalField uniform 20; +internalField uniform 0; boundaryField { - rotor + inlet { - type zeroGradient; - value uniform 20; + type fixedValue; + value uniform 1; } - stator + outlet { type zeroGradient; - value uniform 20; } - front + walls { - type empty; + type zeroGradient; } - back + frontAndBackPlanes { type empty; } } - // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/alpha1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.particles similarity index 99% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/alpha1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.particles index a50f9c1e24fd1412c50b3c6f90fa0bdd17024633..7a433521e861c4f7cbbef4f4b0066c5491b41914 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/alpha1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.particles @@ -11,7 +11,7 @@ FoamFile format ascii; class volScalarField; location "0"; - object alpha1; + object alpha.particles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/alpha1.org b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.particles.org similarity index 97% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/alpha1.org rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.particles.org index fdb7e4b86f2155e85eb861ed696f8861302e6fa3..69666444bc1beb16275c2ac20a69f6c41cd4252e 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/alpha1.org +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/alpha.particles.org @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object alpha1; + object alpha.particles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/epsilon.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/epsilon.air new file mode 100644 index 0000000000000000000000000000000000000000..0b5f62a356b3f5a9ce5db5401e0b4f29bc1e4fc9 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/epsilon.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 10; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type epsilonWallFunction; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/k.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/k.air new file mode 100644 index 0000000000000000000000000000000000000000..6d823d53288103b382da9a843830d5b1df37a263 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/k.air @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/nut.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/nut.air new file mode 100644 index 0000000000000000000000000000000000000000..dcb65148ae4e0675d7368e0bea77ff0db7f72e60 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/nut.air @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type nutkWallFunction; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/nut.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/nut.particles new file mode 100644 index 0000000000000000000000000000000000000000..6264a273f79124da66e26f9f2edf102259ac0874 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/nut.particles @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type calculated; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/p b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/p similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/p rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/0/p diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/g b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..e0ac2653b5b370ad62f6770588121d30cac51627 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/transportProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties similarity index 78% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/transportProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties index 22cb823b5e8467166888bc825e56fec8967e53e5..7d994cb3fd15234bf6cd8674e841b546b691b1c1 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/transportProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties @@ -11,11 +11,13 @@ FoamFile format ascii; class dictionary; location "constant"; - object transportProperties; + object phaseProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -phase1 +phases (particles air); + +particles { diameterModel constant; constantCoeffs @@ -24,7 +26,7 @@ phase1 } } -phase2 +air { diameterModel constant; constantCoeffs @@ -33,15 +35,29 @@ phase2 } } +drag +{ + particles GidaspowErgunWenYu; + air GidaspowErgunWenYu; +} + +heatTransfer +{ + particles RanzMarshall; + air RanzMarshall; +} + +dispersedPhase particles; + +residualPhaseFraction 1e-3; +residualSlip 1e-2; + // Virtual-mass ceofficient Cvm 0; // Lift coefficient Cl 0; -// Dispersed-phase turbulence coefficient -Ct 0; - // Minimum allowable pressure pMin 10000; diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/polyMesh/blockMeshDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/polyMesh/blockMeshDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/polyMesh/blockMeshDict diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/polyMesh/boundary b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/polyMesh/boundary similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/polyMesh/boundary rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/polyMesh/boundary diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/thermophysicalProperties2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/thermophysicalProperties.air similarity index 96% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/thermophysicalProperties2 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/thermophysicalProperties.air index e61009c10be927d2af1b6981cc75ad368e85d5c3..befc0aeae449cccc50a24e955083b88b914aba67 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/thermophysicalProperties2 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/thermophysicalProperties.air @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermophysicalProperties; + object thermophysicalProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/thermophysicalProperties1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/thermophysicalProperties.particles similarity index 93% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/thermophysicalProperties1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/thermophysicalProperties.particles index 0ac5f83a42bcfee041ee23060a2d9ba85d476fab..7508b70aa3194312b37a36e71753f74b9cf76166 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/thermophysicalProperties1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/thermophysicalProperties.particles @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermophysicalProperties; + object thermophysicalProperties.particles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,8 +44,8 @@ mixture } transport { - mu 2.5e-03; - Pr 24.47; + mu 0; + Pr 1; } } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/MRFProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/turbulenceProperties.air similarity index 92% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/MRFProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/turbulenceProperties.air index fd749d03963870c76ab4a9d85ad86bd95c33a71f..1296429b72a21953def920b08774aa75e1d048b1 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/MRFProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/turbulenceProperties.air @@ -11,10 +11,10 @@ FoamFile format ascii; class dictionary; location "constant"; - object MRFProperties; + object turbulenceProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// none +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/turbulenceProperties.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/turbulenceProperties.particles new file mode 100644 index 0000000000000000000000000000000000000000..a4b21800313acddd15e33eeb1d0461357e26706b --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/constant/turbulenceProperties.particles @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel phasePressure; + + turbulence on; + + kineticTheoryCoeffs + { + equilibrium on; + + e 0.8; + alphaMax 0.62; + alphaMinFriction 0.5; + + viscosityModel Gidaspow; + conductivityModel Gidaspow; + granularPressureModel Lun; + frictionalStressModel JohnsonJackson; + radialModel SinclairJackson; + + JohnsonJacksonCoeffs + { + Fr 0.05; + eta 2; + p 5; + phi 28.5; + } + } + + phasePressureCoeffs + { + preAlphaExp 500; + expMax 1000; + alphaMax 0.62; + g0 1000; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/controlDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/controlDict similarity index 96% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/controlDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/controlDict index e07be01b0e42f97d8bd948d5362b833c4b35c713..103ff2a9794a349e2a2939e9afb239fcbe9ceae2 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/controlDict +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/controlDict @@ -60,21 +60,21 @@ functions outputControl outputTime; fields ( - U1 + U.particles { mean on; prime2Mean off; base time; } - U2 + U.air { mean on; prime2Mean off; base time; } - alpha1 + alpha.particles { mean on; prime2Mean off; diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/fvSchemes b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/fvSchemes similarity index 67% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/fvSchemes rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/fvSchemes index 6cbee38f7871c73a58663948be4905135d9e649e..9fc65bf8cbc74f0036a8175ef25d5f528fb57565 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/fvSchemes +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/fvSchemes @@ -27,26 +27,25 @@ gradSchemes divSchemes { - default none; + default none; - div(phi,alpha1) Gauss vanLeer; - div(phir,alpha1) Gauss vanLeer; + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; - "div\(alphaPhi.,U.\)" Gauss limitedLinearV 1; - "div\(phi.,U.\)" Gauss limitedLinearV 1; - "div\(\(alpha.*Rc\)\)" Gauss linear; - "div\(phi.*,.*rho.*\)" Gauss linear; + "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,.*rho.*\)" Gauss linear; - "div\(alphaPhi.,(h|e).\)" Gauss limitedLinear 1; - "div\(alphaPhi.,(K.|p)\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(K.*|p)\)" Gauss limitedLinear 1; - div(alphaPhi2,k) Gauss limitedLinear 1; - div(alphaPhi2,epsilon) Gauss limitedLinear 1; + "div\(\(\(alpha.*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; } laplacianSchemes { default Gauss linear uncorrected; + bounded Gauss linear uncorrected; } interpolationSchemes @@ -57,12 +56,14 @@ interpolationSchemes snGradSchemes { default uncorrected; + bounded uncorrected; } fluxRequired { default no; p ; + alpha.particles; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/fvSolution b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution similarity index 80% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/fvSolution rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution index e0cc208e4ef5f8e59ae5a5ce3a4871e631eb1303..03aa48fd9aed26a22ed284a2a0c263191d2d4545 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/fvSolution +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution @@ -17,10 +17,16 @@ FoamFile solvers { - alpha1 + "alpha.*" { nAlphaCorr 1; nAlphaSubCycles 2; + implicitPhasePressure yes; + + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0; } p @@ -57,15 +63,7 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-8; - relTol 0; - } - - "alpha.*" - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-10; + tolerance 1e-6; relTol 0; } @@ -73,19 +71,11 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-05; - relTol 0; - } - - "k.*" - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-05; + tolerance 1e-6; relTol 0; } - "epsilon.*" + "(k|epsilon).*" { solver PBiCG; preconditioner DILU; @@ -108,12 +98,7 @@ relaxationFactors } equations { - "U.*" 1; - "h.*" 1; - "alpha.*" 1; - "Theta.*" 1; - "k.*" 1; - "epsilon.*" 1; + ".*" 1; } } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/interfacialProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/setFieldsDict similarity index 67% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/interfacialProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/setFieldsDict index 5964adcedc85ce4cfb8757b6dd2f652ba6cd9b88..da4c6ee6f2b05ccee47aa322a096b2cacad742a0 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/interfacialProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/fluidisedBed/system/setFieldsDict @@ -10,20 +10,29 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object interfacialProperties; + location "system"; + object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dragModelair SchillerNaumann; -dragModelwater SchillerNaumann; +defaultFieldValues +( + volScalarFieldValue alpha.air 1 + volScalarFieldValue alpha.particles 0 +); -heatTransferModelair RanzMarshall; -heatTransferModelwater RanzMarshall; +regions +( + boxToCell + { + box ( 0 0 -0.1 ) ( 0.15 0.5 0.1 ); + fieldValues + ( + volScalarFieldValue alpha.air 0.45 + volScalarFieldValue alpha.particles 0.55 + ); + } +); -dispersedPhase both; - -residualPhaseFraction 1e-3; -residualSlip 1e-2; // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/T1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/T.air similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/T1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/T.air diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/T2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/T.water similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/T2 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/T.water diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/Theta b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/Theta similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/Theta rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/Theta diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/U1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/U.air similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/U1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/U.air diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/U2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/U.water similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/U2 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/U.water diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/alpha1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/alpha.air similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/alpha1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/alpha.air diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/p b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/p similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/p rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/0/p diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/Allrun b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/Allrun similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/Allrun rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/Allrun diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/MRFProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/MRFProperties similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/MRFProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/MRFProperties diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/g b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/g similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/g rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/g diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/transportProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties similarity index 80% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/transportProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties index 071be244440b0a9f281d63867e87687763209d5f..0046495f912257f66dc73da800577ee976f73f42 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/transportProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties @@ -11,11 +11,13 @@ FoamFile format ascii; class dictionary; location "constant"; - object transportProperties; + object phaseProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -phase1 +phases (air water); + +air { diameterModel isothermal; isothermalCoeffs @@ -25,7 +27,7 @@ phase1 } } -phase2 +water { diameterModel constant; constantCoeffs @@ -34,15 +36,29 @@ phase2 } } +drag +{ + air SchillerNaumann; + water SchillerNaumann; +} + +heatTransfer +{ + air RanzMarshall; + water RanzMarshall; +} + +dispersedPhase both; + +residualPhaseFraction 1e-3; +residualSlip 1e-2; + // Virtual-mass ceofficient Cvm 0.5; // Lift coefficient Cl 0; -// Dispersed-phase turbulence coefficient -Ct 1; - // Minimum allowable pressure pMin 10000; diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/polyMesh/boundary b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/polyMesh/boundary similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/polyMesh/boundary rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/polyMesh/boundary diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air similarity index 96% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties1 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air index 11c033af59bbfbf08d2b11244e50f0fd00c1542f..3cac781ab1bf649afe060310f5ea7c898123efd9 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/thermophysicalProperties1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.air @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermophysicalProperties; + object thermophysicalProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water new file mode 100644 index 0000000000000000000000000000000000000000..394eb31679cf250cd4f43a40924f257c503e52c1 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/thermophysicalProperties.water @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectFluid; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 18; + } + equationOfState + { + R 3000; + rho0 1027; + } + thermodynamics + { + Cp 4195; + Hf 0; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/turbulenceProperties.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/turbulenceProperties.air new file mode 100644 index 0000000000000000000000000000000000000000..1296429b72a21953def920b08774aa75e1d048b1 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/turbulenceProperties.air @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/turbulenceProperties.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/turbulenceProperties.water new file mode 100644 index 0000000000000000000000000000000000000000..7f0d75a82fcdc99677fa0be8a4111cfe91e4a82c --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/constant/turbulenceProperties.water @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/makeMesh b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/makeMesh similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/makeMesh rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/makeMesh diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/controlDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/controlDict similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/controlDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/controlDict diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes similarity index 71% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/fvSchemes rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes index 275907488b4c204290759f85a7003bb66f553902..c29b10072aedbfddf0ac04218b035914f8091684 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSchemes @@ -27,20 +27,19 @@ gradSchemes divSchemes { - default none; + default none; - div(phi,alpha1) Gauss vanLeer; - div(phir,alpha1) Gauss vanLeer; + div(phi,alpha.air) Gauss vanLeer; + div(phir,alpha.air) Gauss vanLeer; - "div\(alphaPhi.,U.\)" Gauss limitedLinearV 1; - "div\(phi.,U.\)" Gauss limitedLinearV 1; - "div\(\(alpha.*Rc\)\)" Gauss linear; - "div\(phi.*,.*rho.*\)" Gauss linear; + "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,.*rho.*\)" Gauss linear; - "div\(alphaPhi.,h.\)" Gauss limitedLinear 1; - "div\(alphaPhi.,K.\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(K.*|p)\)" Gauss limitedLinear 1; - "div\(alphaPhi.,(k|epsilon)\)" Gauss limitedLinear 1; + "div\(\(\(alpha.*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; } laplacianSchemes @@ -62,7 +61,6 @@ fluxRequired { default no; p ; - alpha1; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/fvSolution b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution similarity index 85% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/fvSolution rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution index 5e6a4b0b21269cbbd6cbde062c090325a1bf1e5e..1646b9187f5ab0b3fea14a9744035c7f1f3cd820 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/fvSolution +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alpha1 + alpha.air { nAlphaCorr 1; nAlphaSubCycles 2; @@ -51,14 +51,6 @@ solvers relTol 0.1; } - "alpha.*" - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-10; - relTol 0; - } - "(k|epsilon|Theta|h).*" { solver PBiCG; @@ -85,12 +77,7 @@ relaxationFactors } equations { - "U.*" 1; - "h.*" 1; - "alpha.*" 1; - "Theta.*" 1; - "k.*" 1; - "epsilon.*" 1; + ".*" 1; } } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/topoSetDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict similarity index 100% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/system/topoSetDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/laminar/mixerVessel2D/system/topoSetDict diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/interfacialProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/interfacialProperties deleted file mode 100644 index 06b13a7b3c68ae7a87a4c2f40e232fef99502c7d..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/interfacialProperties +++ /dev/null @@ -1,30 +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; - location "constant"; - object interfacialProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dragModel1 SchillerNaumann; -dragModel2 SchillerNaumann; - -heatTransferModel1 RanzMarshall; -heatTransferModel2 RanzMarshall; - -dispersedPhase both; -dragPhase blended; - -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/kineticTheoryProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/kineticTheoryProperties deleted file mode 100644 index 2df50542e555669990b2caa032cf9aee7f92b8ad..0000000000000000000000000000000000000000 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/kineticTheoryProperties +++ /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 dictionary; - location "constant"; - object kineticTheoryProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -kineticTheory off; - -equilibrium on; - -e e [ 0 0 0 0 0 0 0 ] 0.9; - -alphaMax alphaMax [ 0 0 0 0 0 0 0 ] 0.6; - -alphaMinFriction alphaMinFriction [ 0 0 0 0 0 0 0 ] 0.5; - -Fr Fr [ 1 -1 -2 0 0 0 0 ] 0.05; - -eta eta [ 0 0 0 0 0 0 0 ] 2; - -p p [ 0 0 0 0 0 0 0 ] 5; - -phi phi [ 0 0 0 0 0 0 0 ] 25; - -viscosityModel Syamlal; - -conductivityModel HrenyaSinclair; - -granularPressureModel Lun; - -frictionalStressModel JohnsonJackson; - -radialModel SinclairJackson; - -HrenyaSinclairCoeffs -{ - L L [ 0 1 0 0 0 0 0 ] 0.0005; -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/T2 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/T.air similarity index 95% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/T2 rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/T.air index fc6ae7931a5ba41cf54ac1e03856622d22855d4d..9c0fd4206c19f34a05d8c05da28254b22882ebcf 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/T2 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/T.air @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object T2; + object Tair; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -20,25 +20,22 @@ internalField uniform 300; boundaryField { - inlet + walls { - type fixedValue; - value $internalField; + type zeroGradient; } - outlet { type inletOutlet; - phi phi2; + phi phi.air; inletValue $internalField; value $internalField; } - - walls + inlet { - type zeroGradient; + type fixedValue; + value $internalField; } - frontAndBackPlanes { type empty; diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/T.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/T.water new file mode 100644 index 0000000000000000000000000000000000000000..1cfd38f926516878085292090cf2e55699fef0cb --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/T.water @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object Twater; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField +{ + walls + { + type zeroGradient; + } + outlet + { + type inletOutlet; + phi phi.water; + inletValue uniform 300; + value $internalField; + } + inlet + { + type fixedValue; + value $internalField; + } + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/Theta similarity index 82% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/Theta index 9701bd625c5d07a6522baa8bdfbbc7b42ba0db3c..e45304b83464ea6a9568531b35b570abae0d768f 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/Theta @@ -10,28 +10,27 @@ FoamFile version 2.0; format ascii; class volScalarField; - object k; + object Theta; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0 0 0]; +dimensions [ 0 2 -2 0 0 0 0 ]; -internalField uniform 1e-8; +internalField uniform 0.0; boundaryField { inlet { type fixedValue; - value uniform 1e-8; + value uniform 1.0e-7; } outlet { type inletOutlet; - phi phiwater; - inletValue uniform 1e-8; - value uniform 1e-8; + inletValue uniform 1.0e-7; + value uniform 1.0e-7; } walls diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/U.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/U.air new file mode 100644 index 0000000000000000000000000000000000000000..e81fffac0612e0a20d26f1cb9be4211ba4be9a16 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/U.air @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volVectorField; + object U.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0.1 0); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type pressureInletOutletVelocity; + phi phi.air; + value $internalField; + } + walls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/U.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/U.water new file mode 100644 index 0000000000000000000000000000000000000000..aab00fd78bb2a097604737fb5b1b77d2ae159967 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/U.water @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volVectorField; + object U.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type pressureInletOutletVelocity; + phi phi.water; + value $internalField; + } + walls + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/alpha.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/alpha.air new file mode 100644 index 0000000000000000000000000000000000000000..1b1a35684a06787a1eb3cb75f388563aad1443a1 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/alpha.air @@ -0,0 +1,1926 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField nonuniform List<scalar> +1875 +( +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +) +; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.5; + } + outlet + { + type inletOutlet; + phi phi.air; + inletValue uniform 1; + value uniform 1; + } + walls + { + type zeroGradient; + } + defaultFaces + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/alpha.air.org b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/alpha.air.org new file mode 100644 index 0000000000000000000000000000000000000000..4472b0c63598b7f95acf8d79fac10b3e9a08ebf7 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/alpha.air.org @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.5; + } + outlet + { + type inletOutlet; + phi phi.air; + inletValue uniform 1; + value uniform 1; + } + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/epsilon.air similarity index 80% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/epsilon.air index bb5b3e0a73f083f93109b40e0d3659f5f1466b6d..ed94c59d53a9495e41cc6911c3618799ad0daff1 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/epsilon.air @@ -16,27 +16,28 @@ FoamFile dimensions [0 2 -3 0 0 0 0]; -internalField uniform 0.1; +internalField uniform 1.5e-4; boundaryField { inlet { type fixedValue; - value uniform 0.1; + value $internalField; } outlet { type inletOutlet; - phi phiwater; - inletValue uniform 0.1; - value uniform 0.1; + phi phi.air; + inletValue $internalField; + value $internalField; } walls { - type zeroGradient; + type epsilonWallFunction; + value $internalField; } defaultFaces diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/epsilon.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/epsilon.water new file mode 100644 index 0000000000000000000000000000000000000000..1cd27e448b42cb846648d2fb9e609e6d44c25b78 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/epsilon.water @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1.5e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + walls + { + type epsilonWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/k.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/k.air new file mode 100644 index 0000000000000000000000000000000000000000..b4dd7631087bbf4acdc15b118acf9d03ac9ae048 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/k.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/k.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/k.water new file mode 100644 index 0000000000000000000000000000000000000000..3381282f9ca36cd142af029eacdd2189886c1b52 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/k.water @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 3.75e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.water; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/nut.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/nut.air new file mode 100644 index 0000000000000000000000000000000000000000..475091edaa9d00eaef74cb5e5f0031b7381d4a56 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/nut.air @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type nutkWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/nut.water b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/nut.water new file mode 100644 index 0000000000000000000000000000000000000000..475091edaa9d00eaef74cb5e5f0031b7381d4a56 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/nut.water @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 1e-8; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type nutkWallFunction; + value $internalField; + } + + defaultFaces + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/p b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/p new file mode 100644 index 0000000000000000000000000000000000000000..ae2c14b7460e91d82d3717d540b6a9d33dc087e8 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/0/p @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + value $internalField; + } + outlet + { + type fixedValue; + value $internalField; + } + walls + { + type fixedFluxPressure; + value $internalField; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/g b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..0cc222ca3457ed24bf9753d0926fbee84359e624 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/transportProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/phaseProperties similarity index 83% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/transportProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/phaseProperties index 4109b97fba732b43a9d34b6c3d5b3e6f150495ee..445b31ed27b4c066e571fb74975243250710e8f6 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/transportProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/phaseProperties @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object transportProperties; + object phaseProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -36,6 +36,23 @@ water } } +drag +{ + air SchillerNaumann; + water SchillerNaumann; +} + +heatTransfer +{ + air RanzMarshall; + water RanzMarshall; +} + +dispersedPhase both; + +residualPhaseFraction 1e-3; +residualSlip 1e-2; + // Virtual-mass ceofficient Cvm 0.5; @@ -49,4 +66,5 @@ Ct 1; pMin 10000; + // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/filterProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/polyMesh/blockMeshDict similarity index 64% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/filterProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/polyMesh/blockMeshDict index 19c054ea8c0818836cff1abca6d55e2af619b76c..d03967afdc2ccf7afbecdf32d50159c309a475e3 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/filterProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/polyMesh/blockMeshDict @@ -10,18 +10,52 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object filterProperties; + object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -filter off; +convertToMeters 1; -filterNormal ( 0 0 1 ); +vertices +( + (0 0 0) + (0.15 0 0) + (0.15 1 0) + (0 1 0) + (0 0 0.1) + (0.15 0 0.1) + (0.15 1 0.1) + (0 1 0.1) +); -filterPosition filterPosition [ 0 1 0 0 0 ] ( 0 0 0.02 ); +blocks +( + hex (0 1 2 3 4 5 6 7) (25 75 1) simpleGrading (1 1 1) +); -filterThickness filterThickness [ 0 1 0 0 0 ] 1e-06; +edges +( +); +patches +( + patch inlet + ( + (1 5 4 0) + ) + patch outlet + ( + (3 7 6 2) + ) + wall walls + ( + (0 4 7 3) + (2 6 5 1) + ) +); + +mergePatchPairs +( +); // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/polyMesh/boundary b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..bf47f69643c9925d3a1ef19c6b4ddc67cf604e0a --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/polyMesh/boundary @@ -0,0 +1,47 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + inlet + { + type patch; + nFaces 25; + startFace 3650; + } + outlet + { + type patch; + nFaces 25; + startFace 3675; + } + walls + { + type wall; + nFaces 150; + startFace 3700; + } + defaultFaces + { + type empty; + inGroups 1(empty); + nFaces 3750; + startFace 3850; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/thermophysicalProperties.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/thermophysicalProperties.air new file mode 100644 index 0000000000000000000000000000000000000000..3cac781ab1bf649afe060310f5ea7c898123efd9 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/thermophysicalProperties.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/thermophysicalProperties.water similarity index 96% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/thermophysicalProperties.water index 789f0427d7c9bd5d4d833f44b0f39359e8ab8bbf..935e0715ef3cf71e6fd0cbe435f89c3edce89c87 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/thermophysicalPropertieswater +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/thermophysicalProperties.water @@ -11,7 +11,7 @@ FoamFile format ascii; class dictionary; location "constant"; - object thermophysicalProperties; + object thermophysicalProperties.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/ppProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/turbulenceProperties.air similarity index 84% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/ppProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/turbulenceProperties.air index eddbfd7ad7910a8a85af9c310b1424eb18d3eb1e..6deff0f5921aabff4e42de76f78754a54622b8ca 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/constant/ppProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/turbulenceProperties.air @@ -11,19 +11,19 @@ FoamFile format ascii; class dictionary; location "constant"; - object ppProperties; + object turbulenceProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -preAlphaExp 300; +simulationType RAS; -expMax 10; - -alphaMax 0.6; - -g0 g0 [ 1 -1 -2 0 0 0 0 ] 0; +RAS +{ + RASModel continuousGasKEpsilon; -packingLimiter off; + turbulence on; + printCoeffs on; +} // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/ppProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/turbulenceProperties.water similarity index 80% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/ppProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/turbulenceProperties.water index f6416561c0ae471b7d9191871e2c6bcd33667bda..357bfd4bfa5f7974058e2832f9fec5c93ef60a89 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/constant/ppProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/constant/turbulenceProperties.water @@ -11,19 +11,24 @@ FoamFile format ascii; class dictionary; location "constant"; - object ppProperties; + object turbulenceProperties.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -preAlphaExp 500; +simulationType RAS; -expMax 1000; - -alphaMax 0.62; +RAS +{ + RASModel LaheyKEpsilon; -g0 g0 [ 1 -1 -2 0 0 0 0 ] 0; + turbulence on; -packingLimiter no; + printCoeffs on; + LaheyKEpsilonCoeffs + { + //Cmub 0; + } +} // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/controlDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..18bd2e06daecdad9cfcfe4aa17a643d49df8d145 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/controlDict @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application compressibleTwoPhaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 0.005; + +writeControl runTime; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 0.5; + +maxDeltaT 1; + +functions +{ + fieldAverage1 + { + type fieldAverage; + functionObjectLibs ( "libfieldFunctionObjects.so" ); + outputControl outputTime; + fields + ( + U.air + { + mean on; + prime2Mean off; + base time; + } + + U.water + { + mean on; + prime2Mean off; + base time; + } + + alpha.air + { + mean on; + prime2Mean off; + base time; + } + + p + { + mean on; + prime2Mean off; + base time; + } + ); + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/fvSchemes b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..f55c52ee564855bde82231ad16e98d275780af37 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/fvSchemes @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phi,alpha.air) Gauss vanLeer; + div(phir,alpha.air) Gauss vanLeer; + + "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,.*rho.*\)" Gauss linear; + + "div\(alphaPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(K.*|p)\)" Gauss limitedLinear 1; + + "div\(alphaPhi.*,(k|epsilon).*\)" Gauss limitedLinear 1; + + "div\(\(\(alpha.*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/fvSolution b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/fvSolution similarity index 87% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/fvSolution rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/fvSolution index 1689fc3519883a0af17454b6842bfb264a5690a3..31c23479937af718dd1eb38c7bd6698d9b987645 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - alphaair + alpha.air { nAlphaCorr 1; nAlphaSubCycles 2; @@ -49,7 +49,7 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-05; + tolerance 1e-7; relTol 0; } @@ -57,7 +57,7 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-8; + tolerance 1e-7; relTol 0; } @@ -65,7 +65,7 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-05; + tolerance 1e-7; relTol 0; } } @@ -84,12 +84,7 @@ relaxationFactors } equations { - "U.*" 1; - "h.*" 1; - "alpha.*" 1; - "Theta.*" 1; - "k.*" 1; - "epsilon.*" 1; + ".*" 1; } } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/setFieldsDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/setFieldsDict similarity index 79% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/setFieldsDict rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/setFieldsDict index 8347405ba76b4e99de866bf32c536313cec19d29..93d742ba74a2424f861b51d1c5d2d8211a625715 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/system/setFieldsDict +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/bubbleColumn/system/setFieldsDict @@ -15,9 +15,22 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -defaultFieldValues ( volScalarFieldValue alpha1 0 ); +defaultFieldValues +( + volScalarFieldValue alpha.air 1 +); -regions ( boxToCell { box ( 0 0 -0.1 ) ( 0.15 0.5 0.1 ) ; fieldValues ( volScalarFieldValue alpha1 0.55 ) ; } ); +regions +( + boxToCell + { + box (0 0 -0.1) (0.15 0.701 0.1); + fieldValues + ( + volScalarFieldValue alpha.air 0 + ); + } +); // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/T.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/T.air new file mode 100644 index 0000000000000000000000000000000000000000..5e2332c34b0949d669c8c0309ff964318c1151ce --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/T.air @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type zeroGradient; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/T.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/T.particles new file mode 100644 index 0000000000000000000000000000000000000000..155187199907bcc1ea0a526baea46812b3b29d63 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/T.particles @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 600; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.particles; + inletValue $internalField; + value $internalField; + } + + walls + { + type zeroGradient; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/Theta.particles similarity index 68% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/Theta.particles index 1ae05e468e21b3ba28c4aecccfafa12962e30bce..c9b385ccd8b7ceba80aa3332b0c25b85d8328566 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/Theta.particles @@ -10,30 +10,27 @@ FoamFile version 2.0; format ascii; class volScalarField; - object k; + object Theta.particles; } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // dimensions [ 0 2 -2 0 0 0 0 ]; -internalField uniform 1.0; +internalField uniform 0; -referenceLevel 0; +referenceLevel 1e-4; boundaryField { inlet { type fixedValue; - value uniform 1.0; + value uniform 1e-4; } outlet { - type inletOutlet; - phi phi2; - inletValue uniform 1.0; - value uniform 1.0; + type zeroGradient; } walls @@ -47,4 +44,4 @@ boundaryField } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/U.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/U.air new file mode 100644 index 0000000000000000000000000000000000000000..4896cfb962a47eebb1ef639ae307045472f49060 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/U.air @@ -0,0 +1,48 @@ +/*--------------------------------*- 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 volVectorField; + object U.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0.25 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0 0.25 0); + } + + outlet + { + type pressureInletOutletVelocity; + phi phi.air; + value $internalField; + } + + walls + { + type fixedValue; + value uniform (0 0 0); + } + + frontAndBackPlanes + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/U.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/U.particles new file mode 100644 index 0000000000000000000000000000000000000000..95abcf62b37fe1a1613711e17040560e5d1d4ed9 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/U.particles @@ -0,0 +1,48 @@ +/*--------------------------------*- 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 volVectorField; + object U.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0 0 0); + } + + outlet + { + type pressureInletOutletVelocity; + phi phi.particles; + value $internalField; + } + + walls + { + type fixedValue; + value uniform (0 0 0); + } + + frontAndBackPlanes + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.air new file mode 100644 index 0000000000000000000000000000000000000000..9a4d3aea6cad96d8401c7af22e2004860edf22c0 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.air @@ -0,0 +1,6048 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField nonuniform List<scalar> +6000 +( +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +0.45 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +) +; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 1; + } + outlet + { + type zeroGradient; + } + walls + { + type zeroGradient; + } + frontAndBackPlanes + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.air.org b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.air.org new file mode 100644 index 0000000000000000000000000000000000000000..29db06c78367cb29c5f8b9b9bdc7ca58ee1db9c6 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.air.org @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 1; + } + + outlet + { + type zeroGradient; + } + + walls + { + type zeroGradient; + } + + frontAndBackPlanes + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.particles new file mode 100644 index 0000000000000000000000000000000000000000..7a433521e861c4f7cbbef4f4b0066c5491b41914 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.particles @@ -0,0 +1,6048 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField nonuniform List<scalar> +6000 +( +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0.55 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +) +; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type zeroGradient; + } + walls + { + type zeroGradient; + } + frontAndBackPlanes + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/k b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.particles.org similarity index 85% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/k rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.particles.org index 4704b49c838eb9f1f6c32dad5d2440ad7e7989f6..69666444bc1beb16275c2ac20a69f6c41cd4252e 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/0/k +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/alpha.particles.org @@ -10,39 +10,36 @@ FoamFile version 2.0; format ascii; class volScalarField; - location "0"; - object k; + object alpha.particles; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [ 0 2 -2 0 0 0 0 ]; +dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { - rotor + inlet { - type zeroGradient; + type fixedValue; value uniform 0; } - stator + outlet { type zeroGradient; - value uniform 0; } - front + walls { - type empty; + type zeroGradient; } - back + frontAndBackPlanes { type empty; } } - // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/epsilon.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/epsilon.air new file mode 100644 index 0000000000000000000000000000000000000000..0b5f62a356b3f5a9ce5db5401e0b4f29bc1e4fc9 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/epsilon.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 10; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type epsilonWallFunction; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/k.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/k.air new file mode 100644 index 0000000000000000000000000000000000000000..6d823d53288103b382da9a843830d5b1df37a263 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/k.air @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.air; + inletValue $internalField; + value $internalField; + } + + walls + { + type kqRWallFunction; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/nut.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/nut.air new file mode 100644 index 0000000000000000000000000000000000000000..dcb65148ae4e0675d7368e0bea77ff0db7f72e60 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/nut.air @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type nutkWallFunction; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/nut.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/nut.particles new file mode 100644 index 0000000000000000000000000000000000000000..6264a273f79124da66e26f9f2edf102259ac0874 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/nut.particles @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + walls + { + type calculated; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/p b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/p new file mode 100644 index 0000000000000000000000000000000000000000..08560053d57ba942a2a9776708fdbf73c01af651 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/0/p @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + value $internalField; + } + + outlet + { + type fixedValue; + value $internalField; + } + + walls + { + type fixedFluxPressure; + value $internalField; + } + + frontAndBackPlanes + { + type empty; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/g b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..e0ac2653b5b370ad62f6770588121d30cac51627 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/phaseProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/phaseProperties new file mode 100644 index 0000000000000000000000000000000000000000..7d994cb3fd15234bf6cd8674e841b546b691b1c1 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/phaseProperties @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (particles air); + +particles +{ + diameterModel constant; + constantCoeffs + { + d 3e-4; + } +} + +air +{ + diameterModel constant; + constantCoeffs + { + d 1; + } +} + +drag +{ + particles GidaspowErgunWenYu; + air GidaspowErgunWenYu; +} + +heatTransfer +{ + particles RanzMarshall; + air RanzMarshall; +} + +dispersedPhase particles; + +residualPhaseFraction 1e-3; +residualSlip 1e-2; + +// Virtual-mass ceofficient +Cvm 0; + +// Lift coefficient +Cl 0; + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/polyMesh/blockMeshDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..900f5a585b8a3abd2fd564c7b949035e390640ea --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/polyMesh/blockMeshDict @@ -0,0 +1,66 @@ +/*--------------------------------*- 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 blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 -0.01) + (0.15 0 -0.01) + (0.15 1 -0.01) + (0 1 -0.01) + (0 0 0.01) + (0.15 0 0.01) + (0.15 1 0.01) + (0 1 0.01) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (30 200 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch inlet + ( + (1 5 4 0) + ) + patch outlet + ( + (3 7 6 2) + ) + wall walls + ( + (0 4 7 3) + (2 6 5 1) + ) + empty frontAndBackPlanes + ( + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/polyMesh/boundary b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..a9ee4ff2e652ee07eb4f455a9e47c2de57453c61 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/polyMesh/boundary @@ -0,0 +1,47 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + inlet + { + type patch; + nFaces 30; + startFace 11770; + } + outlet + { + type patch; + nFaces 30; + startFace 11800; + } + walls + { + type wall; + nFaces 400; + startFace 11830; + } + frontAndBackPlanes + { + type empty; + inGroups 1(empty); + nFaces 12000; + startFace 12230; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/thermophysicalProperties.air b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/thermophysicalProperties.air new file mode 100644 index 0000000000000000000000000000000000000000..befc0aeae449cccc50a24e955083b88b914aba67 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/thermophysicalProperties.air @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/thermophysicalProperties.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/thermophysicalProperties.particles new file mode 100644 index 0000000000000000000000000000000000000000..7508b70aa3194312b37a36e71753f74b9cf76166 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/thermophysicalProperties.particles @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 100; + } + equationOfState + { + rho 2500; + } + thermodynamics + { + Cp 6000; + Hf 0; + } + transport + { + mu 0; + Pr 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/RASProperties b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/turbulenceProperties.air similarity index 88% rename from tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/RASProperties rename to tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/turbulenceProperties.air index 41b54318fe41ab6593fd868ca5c080769a1988c1..673e6f8d344ed3f2cec5580af31a02b32ee064f4 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/mixerVessel2D/constant/RASProperties +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/turbulenceProperties.air @@ -11,15 +11,18 @@ FoamFile format ascii; class dictionary; location "constant"; - object RASProperties; + object turbulenceProperties.air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -RASModel kEpsilon; +simulationType RAS; -turbulence off; +RAS +{ + RASModel kEpsilon; -printCoeffs on; + turbulence on; +} // ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/turbulenceProperties.particles b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/turbulenceProperties.particles new file mode 100644 index 0000000000000000000000000000000000000000..d41e1058279efa8cdfd53f1d6354c7bc2e07e6e5 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/constant/turbulenceProperties.particles @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.particles; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kineticTheory; + + turbulence on; + + kineticTheoryCoeffs + { + equilibrium on; + + e 0.8; + alphaMax 0.62; + alphaMinFriction 0.5; + + viscosityModel Gidaspow; + conductivityModel Gidaspow; + granularPressureModel Lun; + frictionalStressModel JohnsonJackson; + radialModel SinclairJackson; + + JohnsonJacksonCoeffs + { + Fr 0.05; + eta 2; + p 5; + phi 28.5; + } + } + + phasePressureCoeffs + { + preAlphaExp 500; + expMax 1000; + alphaMax 0.62; + g0 1000; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/controlDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..103ff2a9794a349e2a2939e9afb239fcbe9ceae2 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/controlDict @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application compressibleTwoPhaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 2; + +deltaT 0.0002; + +writeControl runTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable on; + +adjustTimeStep no; + +maxCo 0.9; + +maxDeltaT 1e-05; + +functions +{ + fieldAverage1 + { + type fieldAverage; + functionObjectLibs ( "libfieldFunctionObjects.so" ); + outputControl outputTime; + fields + ( + U.particles + { + mean on; + prime2Mean off; + base time; + } + + U.air + { + mean on; + prime2Mean off; + base time; + } + + alpha.particles + { + mean on; + prime2Mean off; + base time; + } + + p + { + mean on; + prime2Mean off; + base time; + } + ); + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/fvSchemes b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..2546db411275847e1db31badc51db945562292ac --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/fvSchemes @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,.*rho.*\)" Gauss linear; + + "div\(alphaPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,(K.*|p)\)" Gauss limitedLinear 1; + + div(alphaPhi.particles,Theta.particles) Gauss limitedLinear 1; + + "div\(alphaPhi.*,(k|epsilon).*\)" Gauss limitedLinear 1; + + "div\(\(\(alpha.*nuEff.*\)*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear; + + div(((nut.particles*dev2(T(grad(U.particles))))+((lambda.particles*div(phi.particles))*I))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; + bounded Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; + bounded uncorrected; +} + +fluxRequired +{ + default no; + p ; + alpha.particles; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/fvSolution b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..03aa48fd9aed26a22ed284a2a0c263191d2d4545 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/fvSolution @@ -0,0 +1,106 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 1; + nAlphaSubCycles 2; + implicitPhasePressure yes; + + solver PCG; + preconditioner DIC; + tolerance 1e-6; + relTol 0; + } + + p + { + solver GAMG; + smoother DIC; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + tolerance 1e-08; + relTol 0.01; + } + + pFinal + { + $p; + tolerance 1e-08; + relTol 0; + } + + "U.*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + "(h|e).*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + "Theta.*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + "(k|epsilon).*" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 3; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + fields + { + } + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/setFieldsDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..da4c6ee6f2b05ccee47aa322a096b2cacad742a0 --- /dev/null +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/ras/fluidisedBed/system/setFieldsDict @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.air 1 + volScalarFieldValue alpha.particles 0 +); + +regions +( + boxToCell + { + box ( 0 0 -0.1 ) ( 0.15 0.5 0.1 ); + fieldValues + ( + volScalarFieldValue alpha.air 0.45 + volScalarFieldValue alpha.particles 0.55 + ); + } +); + + +// ************************************************************************* //