ENH: Updated sources for incompressible solvers

This commit is contained in:
andy
2012-12-10 11:09:08 +00:00
parent 08767723cb
commit b785ae594d
6 changed files with 18 additions and 2 deletions

View File

@ -12,3 +12,5 @@
sources.constrain(UrelEqn()); sources.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p) + sources(Urel)); solve(UrelEqn() == -fvc::grad(p) + sources(Urel));
sources.correct(Urel);

View File

@ -16,4 +16,6 @@ rAU = 1.0/UEqn().A();
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p) + sources(U)); solve(UEqn() == -fvc::grad(p) + sources(U));
sources.correct(U);
} }

View File

@ -13,4 +13,6 @@ sources.constrain(UEqn());
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p_gh) + sources(U)); solve(UEqn() == -fvc::grad(p_gh) + sources(U));
sources.correct(U);
} }

View File

@ -14,3 +14,5 @@
sources.constrain(UrelEqn()); sources.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p)); solve(UrelEqn() == -fvc::grad(p));
sources.correct(Urel);

View File

@ -13,3 +13,5 @@
sources.constrain(UEqn()); sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
sources.correct(U);

View File

@ -12,8 +12,6 @@
UEqn().relax(); UEqn().relax();
sources.constrain(UEqn());
// Include the porous media resistance and solve the momentum equation // Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by // either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal // including the spherical part of the resistance in the momentum diagonal
@ -28,6 +26,8 @@
trTU = inv(tTU()); trTU = inv(tTU());
trTU().rename("rAU"); trTU().rename("rAU");
sources.constrain(UEqn());
volVectorField gradp(fvc::grad(p)); volVectorField gradp(fvc::grad(p));
for (int UCorr=0; UCorr<nUCorr; UCorr++) for (int UCorr=0; UCorr<nUCorr; UCorr++)
@ -35,13 +35,19 @@
U = trTU() & (UEqn().H() - gradp); U = trTU() & (UEqn().H() - gradp);
} }
U.correctBoundaryConditions(); U.correctBoundaryConditions();
sources.correct(U);
} }
else else
{ {
pZones.addResistance(UEqn()); pZones.addResistance(UEqn());
sources.constrain(UEqn());
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));
sources.correct(U);
trAU = 1.0/UEqn().A(); trAU = 1.0/UEqn().A();
trAU().rename("rAU"); trAU().rename("rAU");
} }