pEqn.H
Go to the documentation of this file.
1if (!pimple.SIMPLErho())
2{
3 rho = thermo.rho();
4}
5
6// Thermodynamic density needs to be updated by psi*d(p) after the
7// pressure solution
8const volScalarField psip0(psi*p);
9
10volScalarField rAU(1.0/UEqn.A());
11surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
12volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
13
14surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
15
16surfaceScalarField phiHbyA
17(
18 "phiHbyA",
19 (
20 fvc::flux(rho*HbyA)
21 + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
22 )
23 + phig
24);
25
26fvc::makeRelative(phiHbyA, rho, U);
27MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
28
29// Update the pressure BCs to ensure flux consistency
31
32fvScalarMatrix p_rghDDtEqn
33(
34 fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
35 + fvc::div(phiHbyA)
36 ==
37 parcels.Srho()
38 + surfaceFilm.Srho()
39 + fvOptions(psi, p_rgh, rho.name())
40);
41
42while (pimple.correctNonOrthogonal())
43{
44 fvScalarMatrix p_rghEqn
45 (
47 - fvm::laplacian(rhorAUf, p_rgh)
48 );
49
50 p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
51
52 if (pimple.finalNonOrthogonalIter())
53 {
54 phi = phiHbyA + p_rghEqn.flux();
55
56 // Explicitly relax pressure for momentum corrector
57 p_rgh.relax();
58
59 U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
60 U.correctBoundaryConditions();
61 fvOptions.correct(U);
62 K = 0.5*magSqr(U);
63 }
64}
65
67
68// Thermodynamic density update
69thermo.correctRho(psi*p - psip0);
70
71#include "rhoEqn.H"
72#include "compressibleContinuityErrs.H"
73
74if (pressureControl.limit(p))
75{
76 p.correctBoundaryConditions();
77 rho = thermo.rho();
78 p_rgh = p - rho*gh;
79}
80else if (pimple.SIMPLErho())
81{
82 rho = thermo.rho();
83}
84
85// Correct rhoUf if the mesh is moving
86fvc::correctRhoUf(rhoUf, rho, U, phi);
87
88if (thermo.dpdt())
89{
90 dpdt = fvc::ddt(p);
91
92 if (mesh.moving())
93 {
94 dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
95 }
96}
CGAL::Exact_predicates_exact_constructions_kernel K
volScalarField & p_rgh
fv::options & fvOptions
surfaceScalarField & phi
const surfaceScalarField & ghf
IOMRFZoneList & MRF
const volScalarField & gh
pimpleControl & pimple
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
U
Definition: pEqn.H:72
rhoUf
Definition: pEqn.H:89
volScalarField & p
const volScalarField & psi
regionModels::surfaceFilmModel & surfaceFilm
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phiHbyA
Definition: pcEqn.H:73
HbyA
Definition: pcEqn.H:74
const volScalarField psip0(psi *p)
fvScalarMatrix p_rghDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p_rgh))+fvc::div(phiHbyA)==fvOptions(psi, p_rgh, rho.name()))
dynamicFvMesh & mesh
volScalarField & dpdt
const pressureControl & pressureControl
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1
Solve the continuity for density.