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