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
simpleFoam
pEqn.H
Go to the documentation of this file.
1
p
.boundaryField().updateCoeffs();
2
3
volScalarField
AU
=
UEqn
().A();
4
U
=
UEqn
().H()/
AU
;
5
UEqn
.clear();
6
phi
=
fvc::interpolate
(
U
) &
mesh
.Sf();
7
adjustPhi
(
phi
,
U
,
p
);
8
9
// Non-orthogonal pressure corrector loop
10
for
(
int
nonOrth=0; nonOrth<=
nNonOrthCorr
; nonOrth++)
11
{
12
fvScalarMatrix
pEqn
13
(
14
fvm::laplacian
(1.0/AU,
p
) ==
fvc::div
(
phi
)
15
);
16
17
pEqn.setReference(
pRefCell
,
pRefValue
);
18
// retain the residual from the first iteration
19
if
(nonOrth == 0)
20
{
21
eqnResidual
= pEqn.solve().initialResidual();
22
maxResidual
=
max
(
eqnResidual
,
maxResidual
);
23
}
24
else
25
{
26
pEqn.solve();
27
}
28
29
if
(nonOrth ==
nNonOrthCorr
)
30
{
31
phi
-= pEqn.flux();
32
}
33
}
34
35
# include <
finiteVolume/continuityErrs.H
>
36
37
// Explicitly relax pressure for momentum corrector
38
p
.relax();
39
40
// Momentum corrector
41
U
-=
fvc::grad
(
p
)/
AU
;
42
U
.correctBoundaryConditions();
43
44
// ************************ vim: set sw=4 sts=4 et: ************************ //