pEqn.H
Go to the documentation of this file.
1rho = thermo.rho();
2
3// Thermodynamic density needs to be updated by psi*d(p) after the
4// pressure solution
5const volScalarField psip0(psi*p);
6
7volScalarField rAU(1.0/UEqn.A());
8surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
9volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
10
11surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
12
13surfaceScalarField phiHbyA
14(
15 "phiHbyA",
16 (
17 fvc::flux(rho*HbyA)
18 + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
19 )
20 + phig
21);
22
23MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
24
25// Update the pressure BCs to ensure flux consistency
27
28fvScalarMatrix p_rghDDtEqn
29(
30 fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
31 + fvc::div(phiHbyA)
32 ==
33 fvOptions(psi, p_rgh, rho.name())
34);
35
36while (pimple.correctNonOrthogonal())
37{
38 fvScalarMatrix p_rghEqn
39 (
41 - fvm::laplacian(rhorAUf, p_rgh)
42 );
43
44 p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
45
46 if (pimple.finalNonOrthogonalIter())
47 {
48 // Calculate the conservative fluxes
49 phi = phiHbyA + p_rghEqn.flux();
50
51 // Explicitly relax pressure for momentum corrector
52 p_rgh.relax();
53
54 // Correct the momentum source with the pressure gradient flux
55 // calculated from the relaxed pressure
56 U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
57 U.correctBoundaryConditions();
58 fvOptions.correct(U);
59 K = 0.5*magSqr(U);
60 }
61}
62
64
65// Thermodynamic density update
66thermo.correctRho(psi*p - psip0);
67
68if (thermo.dpdt())
69{
70 dpdt = fvc::ddt(p);
71}
72
73#include "rhoEqn.H"
74#include "compressibleContinuityErrs.H"
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
volScalarField & p
const volScalarField & psi
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
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1