Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
applications
solvers
incompressible
porousSimpleFoam
pEqn.H
Go to the documentation of this file.
1
if
(
pressureImplicitPorosity
)
2
{
3
U
=
trTU
()&
UEqn
().H();
4
}
5
else
6
{
7
U
=
trAU
()*
UEqn
().H();
8
}
9
10
UEqn
.clear();
11
phi
=
fvc::interpolate
(
U
) &
mesh
.Sf();
12
adjustPhi
(
phi
,
U
,
p
);
13
14
for
(
int
nonOrth=0; nonOrth<=
nNonOrthCorr
; nonOrth++)
15
{
16
tmp<fvScalarMatrix> tpEqn;
17
18
if
(
pressureImplicitPorosity
)
19
{
20
tpEqn = (
fvm::laplacian
(
trTU
(),
p
) ==
fvc::div
(
phi
));
21
}
22
else
23
{
24
tpEqn = (
fvm::laplacian
(
trAU
(),
p
) ==
fvc::div
(
phi
));
25
}
26
27
tpEqn().setReference(
pRefCell
,
pRefValue
);
28
// retain the residual from the first iteration
29
if
(nonOrth == 0)
30
{
31
eqnResidual
= tpEqn().solve().initialResidual();
32
maxResidual
=
max
(
eqnResidual
,
maxResidual
);
33
}
34
else
35
{
36
tpEqn().solve();
37
}
38
39
if
(nonOrth ==
nNonOrthCorr
)
40
{
41
phi
-= tpEqn().flux();
42
}
43
}
44
45
#include <
finiteVolume/continuityErrs.H
>
46
47
// Explicitly relax pressure for momentum corrector
48
p
.relax();
49
50
if
(
pressureImplicitPorosity
)
51
{
52
U
-=
trTU
()&
fvc::grad
(
p
);
53
}
54
else
55
{
56
U
-=
trAU
()*
fvc::grad
(
p
);
57
}
58
59
U
.correctBoundaryConditions();