Commit 4b527e3e authored by andy's avatar andy
Browse files

ENH: Updated solvers using fieldSources

parent 0f865796
......@@ -5,12 +5,13 @@ tmp<fvVectorMatrix> UEqn
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
+ sources(U)
);
sources.apply(UEqn());
UEqn().relax();
sources.constrain(UEqn());
volScalarField rAU(1.0/UEqn().A());
if (pimple.momentumPredictor())
......
......@@ -4,11 +4,12 @@
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
+ sources(U)
);
mrfZones.addCoriolis(UEqn());
sources.apply(UEqn());
sources.constrain(UEqn());
UEqn().relax();
......
......@@ -5,10 +5,11 @@
fvm::div(phi, Urel)
+ turbulence->divDevReff(Urel)
+ SRF->Su()
+ sources(Urel)
);
sources.apply(UrelEqn());
UrelEqn().relax();
sources.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p));
......@@ -4,10 +4,11 @@
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
+ sources(U)
);
sources.apply(UEqn());
UEqn().relax();
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p));
......@@ -4,12 +4,13 @@
(
fvm::div(phi, U)
+ turbulence->divDevReff(U)
+ sources(U)
);
sources.apply(UEqn());
UEqn().relax();
sources.constrain(UEqn());
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal
......
......@@ -4,12 +4,13 @@
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
+ sources(rho, U)
==
rho.dimensionedInternalField()*g
+ parcels.SU(U)
);
sources.apply(UEqn);
sources.constrain(UEqn);
pZones.addResistance(UEqn);
......
......@@ -28,12 +28,13 @@ if (solveSpecies)
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
+ sources(Yi)
==
parcels.SYi(i, Yi)
+ combustion->R(Yi)
);
sources.apply(YEqn);
sources.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
......
......@@ -4,6 +4,7 @@
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
+ sources(rho, hs)
==
DpDt
+ parcels.Sh(hs)
......@@ -11,7 +12,7 @@
+ combustion->Sh()
);
sources.apply(hsEqn);
sources.constrain(hsEqn);
hsEqn.solve();
......
......@@ -27,12 +27,11 @@
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phi)
+ sources(psi, p, rho.name())
==
parcels.Srho()
);
sources.apply(pDDtEqn, rho.name());
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
......@@ -41,6 +40,8 @@
- fvm::laplacian(rho*rAU, p)
);
sources.constrain(pDDtEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
......
......@@ -34,11 +34,12 @@ Description
(
fvm::ddt(rho)
+ fvc::div(phi)
+ sources(rho)
==
parcels.Srho(rho)
);
sources.apply(rhoEqn);
sources.constrain(rhoEqn);
rhoEqn.solve();
......
......@@ -76,7 +76,7 @@ Info<< "Time scales min/max:" << endl;
(
DpDt
+ parcels.hsTrans()/(mesh.V()*runTime.deltaT())
// + energySource.Su()
// + sources(rho, hs)
+ combustion->Sh()()
)
/rho
......
......@@ -3,16 +3,17 @@
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
+ sources(rho, U)
==
rho.dimensionedInternalField()*g
+ coalParcels.SU(U)
+ limestoneParcels.SU(U)
);
sources.apply(UEqn);
UEqn.relax();
sources.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
......
......@@ -27,14 +27,16 @@ tmp<fv::convectionScheme<scalar> > mvConvection
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
+ sources(rho, Yi)
==
coalParcels.SYi(i, Yi)
+ combustion->R(Yi)
);
sources.apply(YiEqn);
YiEqn.relax();
sources.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
Yi.max(0.0);
......
......@@ -4,6 +4,7 @@
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
+ sources(rho, hs)
==
DpDt
+ combustion->Sh()
......@@ -12,9 +13,10 @@
+ radiation->Shs(thermo)
);
sources.apply(hsEqn);
hsEqn.relax();
sources.constrain(hsEqn);
hsEqn.solve();
thermo.correct();
......
......@@ -22,11 +22,12 @@ if (pimple.transonic())
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p)
+ sources(psi, p, rho.name())
==
coalParcels.Srho()
);
sources.apply(pEqn, rho.name());
sources.constrain(pEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......@@ -39,8 +40,8 @@ if (pimple.transonic())
else
{
phi =
fvc::interpolate(rho)*
(
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
......@@ -52,11 +53,12 @@ else
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rAU, p)
+ sources(psi, p, rho.name())
==
coalParcels.Srho()
);
sources.apply(pEqn, rho.name());
sources.constrain(pEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
......
......@@ -34,11 +34,12 @@ Description
(
fvm::ddt(rho)
+ fvc::div(phi)
+ sources(rho)
==
coalParcels.Srho(rho)
);
sources.apply(rhoEqn);
sources.constrain(rhoEqn);
rhoEqn.solve();
}
......
......@@ -4,12 +4,13 @@
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
+ sources(rho, U)
==
rho.dimensionedInternalField()*g
+ parcels.SU(U)
);
sources.apply(UEqn);
sources.constrain(UEqn);
pZones.addResistance(UEqn);
......
......@@ -29,12 +29,13 @@ if (solveSpecies)
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
+ sources(rho, Yi)
==
parcels.SYi(i, Yi)
+ combustion->R(Yi)
);
sources.apply(YiEqn);
sources.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
......
......@@ -34,6 +34,7 @@
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
+ sources(rho, hs)
==
pWork()
+ parcels.Sh(hs)
......@@ -41,7 +42,7 @@
+ combustion->Sh()
);
sources.apply(hsEqn);
sources.constrain(hsEqn);
hsEqn.solve();
......
......@@ -27,11 +27,11 @@
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phi)
+ sources(psi, p, rho.name())
==
parcels.Srho()
);
sources.apply(pDDtEqn, rho.name());
while (pimple.correctNonOrthogonal())
{
......@@ -41,6 +41,8 @@
- fvm::laplacian(rho*rAU, p)
);
sources.constrain(pDDtEqn, rho.name());
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment