pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 // Thermodynamic density needs to be updated by psi*d(p) after the
4 // pressure solution
6 
7 volScalarField rAU(1.0/UEqn.A());
10 
12 
14 (
15  "phiHbyA",
16  (
18  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
19  )
20  + phig
21 );
22 
23 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
24 
25 // Update the pressure BCs to ensure flux consistency
27 
29 (
31  + fvc::div(phiHbyA)
32  ==
33  fvOptions(psi, p_rgh, rho.name())
34 );
35 
36 while (pimple.correctNonOrthogonal())
37 {
38  fvScalarMatrix p_rghEqn
39  (
42  );
43 
44  if (thermo.incompressible())
45  {
46  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
47  }
48 
49  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
50 
51  if (pimple.finalNonOrthogonalIter())
52  {
53  // Calculate the conservative fluxes
54  phi = phiHbyA + p_rghEqn.flux();
55 
56  // Explicitly relax pressure for momentum corrector
57  p_rgh.relax();
58 
59  // Correct the momentum source with the pressure gradient flux
60  // calculated from the relaxed pressure
61  U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
62  U.correctBoundaryConditions();
63  fvOptions.correct(U);
64  K = 0.5*magSqr(U);
65  }
66 }
67 
68 p = p_rgh + rho*gh;
69 
70 // Thermodynamic density update
71 thermo.correctRho(psi*p - psip0);
72 
73 if (thermo.dpdt())
74 {
75  dpdt = fvc::ddt(p);
76 }
77 
78 #include "rhoEqn.H"
79 #include "compressibleContinuityErrs.H"
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
fv::options & fvOptions
rho
Definition: pEqn.H:1
pimpleNoLoopControl & pimple
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
IOMRFZoneList & MRF
phiHbyA
Definition: pEqn.H:20
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:170
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:136
CGAL::Exact_predicates_exact_constructions_kernel K
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
volScalarField & dpdt
dynamicFvMesh & mesh
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
p_rgh
Definition: pEqn.H:152
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const surfaceScalarField & ghf
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
U
Definition: pEqn.H:72
fvScalarMatrix p_rghDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p_rgh))+fvc::div(phiHbyA)==fvOptions(psi, p_rgh, rho.name()))
volVectorField & HbyA
Definition: pEqn.H:13
label pRefCell
Definition: createFields.H:106
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & gh
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
const volScalarField psip0(psi *p)