-
Notifications
You must be signed in to change notification settings - Fork 0
/
UEqn.H
51 lines (45 loc) · 1008 Bytes
/
UEqn.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Solve the Momentum equation
// Add forcing term
const dimensionedScalar forcingTerm(transportProperties.lookup("forcingTerm"));
Info<< "Forcing Term: " <<forcingTerm <<endl;
dimensionedVector forcing("forcing", dimensionSet(0,1,-2,0,0,0,0),vector(forcingTerm.value(),0.0,0.0));
tmp<fvVectorMatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
+ forcing
);
Info<< "Added Forcing to NS Equation" <<endl;
if (oCorr == nOuterCorr - 1)
{
if (mesh.solutionDict().relax("UFinal"))
{
UEqn().relax(mesh.solutionDict().relaxationFactor("UFinal"));
}
else
{
UEqn().relax(1);
}
}
else
{
UEqn().relax();
}
volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor)
{
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solutionDict().solver("UFinal"));
}
else
{
solve(UEqn() == -fvc::grad(p));
}
}
else
{
U = rUA*(UEqn().H() - fvc::grad(p));
U.correctBoundaryConditions();
}