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
multiphase
twoLiquidMixingFoam
pEqn.H
Go to the documentation of this file.
1
{
2
volScalarField
rAU = 1.0/
UEqn
.A();
3
surfaceScalarField
rAUf =
fvc::interpolate
(rAU);
4
5
U
= rAU*
UEqn
.H();
6
surfaceScalarField
phiU
7
(
8
"phiU"
,
9
(
fvc::interpolate
(
U
) &
mesh
.Sf())
10
+
fvc::ddtPhiCorr
(rAU,
rho
,
U
,
phi
)
11
);
12
13
adjustPhi
(
phiU
,
U
,
p_rgh
);
14
15
phi
=
phiU
-
ghf
*
fvc::snGrad
(
rho
)*rAUf*
mesh
.magSf();
16
17
for
(
int
nonOrth=0; nonOrth<=
nNonOrthCorr
; nonOrth++)
18
{
19
fvScalarMatrix
p_rghEqn
20
(
21
fvm::laplacian
(rAUf,
p_rgh
) ==
fvc::div
(
phi
)
22
);
23
24
p_rghEqn.setReference(
pRefCell
,
getRefCellValue
(
p_rgh
,
pRefCell
));
25
26
p_rghEqn.solve
27
(
28
mesh
.solver
29
(
30
p_rgh
.select
31
(
32
finalIter
33
&& corr ==
nCorr
-1
34
&& nonOrth ==
nNonOrthCorr
35
)
36
)
37
);
38
39
if
(nonOrth ==
nNonOrthCorr
)
40
{
41
phi
-= p_rghEqn.flux();
42
}
43
}
44
45
U
+= rAU*
fvc::reconstruct
((
phi
-
phiU
)/rAUf);
46
U
.correctBoundaryConditions();
47
48
#include <
finiteVolume/continuityErrs.H
>
49
50
p
==
p_rgh
+
rho
*
gh
;
51
52
if
(
p_rgh
.needReference())
53
{
54
p
+=
dimensionedScalar
55
(
56
"p"
,
57
p
.dimensions(),
58
pRefValue
-
getRefCellValue
(
p
,
pRefCell
)
59
);
60
p_rgh
=
p
-
rho
*
gh
;
61
}
62
}