Loading...
Searching...
No Matches
pEqn.H
Go to the documentation of this file.
1volScalarField rAU(1.0 /
2 Ueqn.A()); // Inverse of the diagonal part of the U equation matrix
3//volScalarField rAU(1.0/Ueqn_global->A()); // For the new "getUmatrix" formulation
4surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho* rAU));
5volVectorField HbyA(constrainHbyA(rAU* Ueqn.H(), U,
6 p)); // H is the extra diagonal part summed to the r.h.s. of the U equation
7//volVectorField HbyA(constrainHbyA(rAU*Ueqn_global->H(), U, p)); // For the new "getUmatrix" formulation
8//tUEqn.clear();
9
10bool closedVolume = false;
11
12surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA));
13MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
14
15// Update the pressure BCs to ensure flux consistency
17
18if (simple.transonic())
19{
20 surfaceScalarField phid
21 (
22 "phid",
23 (fvc::interpolate(psi) / fvc::interpolate(rho))*phiHbyA
24 );
25 phiHbyA -= fvc::interpolate(psi * p) * phiHbyA / fvc::interpolate(rho);
26
27 while (simple.correctNonOrthogonal())
28 {
29 fvScalarMatrix pEqn
30 (
31 fvc::div(phiHbyA)
32 + fvm::div(phid, p)
33 - fvm::laplacian(rhorAUf, p)
34 ==
35 fvOptions(psi, p, rho.name())
36 );
37 // Relax the pressure equation to ensure diagonal-dominance
38 pEqn.relax();
39 pEqn.setReference
40 (
41 pressureControl.refCell(),
42 pressureControl.refValue()
43 );
44 presidual = pEqn.solve().initialResidual();
45
46 if (simple.finalNonOrthogonalIter())
47 {
48 phi = phiHbyA + pEqn.flux();
49 }
50 }
51}
52else
53{
54 //Passa sempre da qui!!
56 //p.storePrevIter();
57
58 while (simple.correctNonOrthogonal())
59 {
60 fvScalarMatrix pEqn
61 (
62 fvc::div(phiHbyA)
63 - fvm::laplacian(rhorAUf, p)
64 ==
65 fvOptions(psi, p, rho.name())
66 );
67 pEqn.setReference
68 (
69 pressureControl.refCell(),
70 pressureControl.refValue()
71 );
72 presidual = pEqn.solve().initialResidual();
73
74 if (simple.finalNonOrthogonalIter())
75 {
76 phi = phiHbyA + pEqn.flux();
77 }
78 }
79}
80
81#include "incompressible/continuityErrs.H"
82
83// Explicitly relax pressure for momentum corrector
84p.relax();
85
86U = HbyA - rAU * fvc::grad(p);
87U.correctBoundaryConditions();
88fvOptions.correct(U);
89
91
92// For closed-volume cases adjust the pressure and density levels
93// to obey overall mass continuity
95{
96 p += (initialMass - fvc::domainIntegrate(psi * p))
97 / fvc::domainIntegrate(psi);
98}
99
101{
102 p.correctBoundaryConditions();
103}
104
105rho = thermo.rho();
106
107if (!simple.transonic())
108{
109 rho.relax();
110}
fv::options & fvOptions
Definition NLsolve.H:25
dimensionedScalar & initialMass
Definition NLsolve.H:32
bool closedVolume
Definition NLsolve.H:33
volScalarField & psi
Definition NLsolve.H:29
scalar presidual
Definition NLsolve.H:38
pressureControl & pressureControl
Definition NLsolve.H:30
fvScalarMatrix pEqn
Definition CFM.H:31
volScalarField rAU(1.0/Ueqn.A())
phiHbyA
Definition pcEqn.H:61
bool pLimited
Definition pcEqn.H:98
HbyA
Definition pcEqn.H:62
simpleControl simple(mesh)
surfaceScalarField & phi
volVectorField & U
volScalarField & p
volScalarField & rho
fluidThermo & thermo
volScalarField rAU(1.0/Ueqn.A())
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
adjustPhi(phiHbyA, U, p)