This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/coupled/MRFPorousFoam/pEqn.H

49 lines
1 KiB
C
Raw Normal View History

2015-04-27 14:34:02 +00:00
// Pressure parts of the continuity equation
2016-03-18 11:44:28 +00:00
tmp<fvScalarMatrix> tpEqn;
tmp<surfaceScalarField> tpresSource;
2015-04-27 14:34:02 +00:00
2016-03-18 11:44:28 +00:00
if (addPorosity)
{
// Collect pressure source with tensorial 1/Ap
const volTensorField& rTU = trTU();
2015-10-29 15:29:08 +00:00
2016-03-18 11:44:28 +00:00
tpresSource =
(
(mesh.Sf() & fvc::interpolate(rTU))
& fvc::interpolate(fvc::grad(p))
2016-03-18 11:44:28 +00:00
);
const surfaceScalarField& presSource = tpresSource();
2015-04-27 14:34:02 +00:00
2016-03-18 11:44:28 +00:00
// Assemble pressure matrix with tensorial 1/Ap
tpEqn =
(
- fvm::laplacian(rTU, p)
==
- fvc::div(presSource)
);
}
else
{
// Collect pressure source with scalar 1/Ap
const volScalarField& rAU = trAU();
2015-04-27 14:34:02 +00:00
2016-03-18 11:44:28 +00:00
tpresSource =
(
fvc::interpolate(rAU)*
(mesh.Sf() & fvc::interpolate(fvc::grad(p, "grad(pSource)")))
);
const surfaceScalarField& presSource = tpresSource();
2015-04-27 14:34:02 +00:00
2016-03-18 11:44:28 +00:00
// Assemble pressure matrix with tensorial 1/Ap
tpEqn =
(
- fvm::laplacian(rAU, p)
==
- fvc::div(presSource)
);
}
tpEqn().setReference(pRefCell, pRefValue);
UpEqn.insertEquation(3, tpEqn());