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
interPhaseChangeFoam
pEqn.H
Go to the documentation of this file.
1
{
2
volScalarField
rUA
= 1.0/
UEqn
.A();
3
surfaceScalarField
rUAf
=
fvc::interpolate
(rUA);
4
5
U
= rUA*
UEqn
.H();
6
7
surfaceScalarField
phiU
8
(
9
"phiU"
,
10
(
fvc::interpolate
(
U
) &
mesh
.Sf())
11
+
fvc::ddtPhiCorr
(rUA,
rho
,
U
,
phi
)
12
);
13
14
adjustPhi
(
phiU
,
U
,
p_rgh
);
15
16
phi
=
phiU
+
17
(
18
fvc::interpolate
(
interface
.sigmaK())*
fvc::snGrad
(alpha1)
19
-
ghf
*
fvc::snGrad
(
rho
)
20
)*rUAf*
mesh
.magSf();
21
22
Pair<tmp<volScalarField> > vDotP =
twoPhaseProperties
->vDotP();
23
const
volScalarField
& vDotcP = vDotP[0]();
24
const
volScalarField
& vDotvP = vDotP[1]();
25
26
for
(
int
nonOrth=0; nonOrth<=
nNonOrthCorr
; nonOrth++)
27
{
28
fvScalarMatrix
p_rghEqn
29
(
30
fvc::div
(
phi
) -
fvm::laplacian
(rUAf,
p_rgh
)
31
- (vDotvP - vDotcP)*(
pSat
-
rho
*
gh
) +
fvm::Sp
(vDotvP - vDotcP,
p_rgh
)
32
);
33
34
p_rghEqn.setReference(
pRefCell
,
pRefValue
);
35
36
p_rghEqn.solve
37
(
38
mesh
.solver
39
(
40
p_rgh
.select
41
(
42
finalIter
43
&& corr ==
nCorr
-1
44
&& nonOrth ==
nNonOrthCorr
45
)
46
)
47
);
48
49
if
(nonOrth ==
nNonOrthCorr
)
50
{
51
phi
+= p_rghEqn.flux();
52
}
53
}
54
55
U
+= rUA*
fvc::reconstruct
((
phi
-
phiU
)/rUAf);
56
U
.correctBoundaryConditions();
57
58
#include <
finiteVolume/continuityErrs.H
>
59
60
p
==
p_rgh
+
rho
*
gh
;
61
62
if
(
p_rgh
.needReference())
63
{
64
p
+=
dimensionedScalar
65
(
66
"p"
,
67
p
.dimensions(),
68
pRefValue
-
getRefCellValue
(
p
,
pRefCell
)
69
);
70
p_rgh
=
p
-
rho
*
gh
;
71
}
72
}
73
74
// ************************ vim: set sw=4 sts=4 et: ************************ //