diff --git a/applications/solvers/lagrangian/sprayFoam/EEqn.H b/applications/solvers/lagrangian/sprayFoam/EEqn.H new file mode 100644 index 000000000..42185b8af --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/EEqn.H @@ -0,0 +1,40 @@ +{ + volScalarField& he = thermo.he(); + + fvScalarMatrix EEqn + ( + fvm::ddt(rho, he) + mvConvection->fvmDiv(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) + == + rho*(U&g) + + parcels.Sh(he) + + radiation->Sh(thermo, he) + + Qdot + + fvOptions(rho, he) + ); + + EEqn.relax(); + + fvOptions.constrain(EEqn); + + EEqn.solve(); + + fvOptions.correct(he); + + thermo.correct(); + radiation->correct(); + + Info<< "T gas min/max " << min(T).value() << ", " + << max(T).value() << endl; +} diff --git a/applications/solvers/lagrangian/sprayFoam/YEqn.H b/applications/solvers/lagrangian/sprayFoam/YEqn.H new file mode 100644 index 000000000..60a27fec8 --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/YEqn.H @@ -0,0 +1,49 @@ +tmp> mvConvection +( + fv::convectionScheme::New + ( + mesh, + fields, + phi, + mesh.divScheme("div(phi,Yi_h)") + ) +); + +{ + combustion->correct(); + Qdot = combustion->Qdot(); + volScalarField Yt(0.0*Y[0]); + + forAll(Y, i) + { + if (i != inertIndex && composition.active(i)) + { + volScalarField& Yi = Y[i]; + + fvScalarMatrix YEqn + ( + fvm::ddt(rho, Yi) + + mvConvection->fvmDiv(phi, Yi) + - fvm::laplacian(turbulence->muEff(), Yi) + == + parcels.SYi(i, Yi) + + combustion->R(Yi) + + fvOptions(rho, Yi) + ); + + YEqn.relax(); + + fvOptions.constrain(YEqn); + + YEqn.solve(mesh.solver("Yi")); + + fvOptions.correct(Yi); + + Yi.max(0.0); + Yt += Yi; + } + } + + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); +} diff --git a/applications/solvers/lagrangian/sprayFoam/createFieldRefs.H b/applications/solvers/lagrangian/sprayFoam/createFieldRefs.H new file mode 100644 index 000000000..e7f76d845 --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/createFieldRefs.H @@ -0,0 +1,3 @@ +const volScalarField& T = thermo.T(); +const volScalarField& psi = thermo.psi(); +const label inertIndex(composition.species()[inertSpecie]);