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
compressible
rhoPorousSimpleFoam
UEqn.H
Go to the documentation of this file.
1
// Construct the Momentum equation
2
3
tmp<fvVectorMatrix>
UEqn
4
(
5
fvm::div
(
phi
,
U
)
6
+
turbulence
->divDevRhoReff(
U
)
7
);
8
9
UEqn
().relax();
10
11
// Include the porous media resistance and solve the momentum equation
12
// either implicit in the tensorial resistance or transport using by
13
// including the spherical part of the resistance in the momentum diagonal
14
15
tmp<volScalarField>
trAU
;
16
tmp<volTensorField>
trTU
;
17
18
if
(
pressureImplicitPorosity
)
19
{
20
tmp<volTensorField> tTU =
tensor
(
I
)*
UEqn
().A();
21
pZones
.addResistance(
UEqn
(), tTU());
22
trTU =
inv
(tTU());
23
trTU
().rename(
"rAU"
);
24
25
volVectorField
gradp =
fvc::grad
(
p
);
26
27
for
(
int
UCorr=0; UCorr<
nUCorr
; UCorr++)
28
{
29
U
=
trTU
() & (
UEqn
().H() - gradp);
30
}
31
U
.correctBoundaryConditions();
32
}
33
else
34
{
35
pZones
.addResistance(
UEqn
());
36
37
eqnResidual
=
solve
38
(
39
UEqn
() == -
fvc::grad
(
p
)
40
). initialResidual();
41
42
maxResidual
=
max
(
eqnResidual
,
maxResidual
);
43
44
trAU = 1.0/
UEqn
().A();
45
trAU
().rename(
"rAU"
);
46
}
47
48
// ************************ vim: set sw=4 sts=4 et: ************************ //