pEqn.H
Go to the documentation of this file.
2 bool compressible = (compressibility.value() > SMALL);
3 
4 rho = thermo.rho();
5 
6 // Thermodynamic density needs to be updated by psi*d(p) after the
7 // pressure solution
9 
10 volScalarField rAU(1.0/UEqn.A());
11 mesh.interpolate(rAU);
12 
15 
17 
19 (
20  "phiHbyA",
22 );
23 
25 {
29 }
30 
31 
32 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
33 
34 // Update the pressure BCs to ensure flux consistency
36 
38 (
40  + fvc::div(phiHbyA)
41  ==
42  fvOptions(psi, p_rgh, rho.name())
43 );
44 
45 while (pimple.correctNonOrthogonal())
46 {
47  fvScalarMatrix p_rghEqn
48  (
51  );
52 
53  p_rghEqn.solve(p_rgh.select(pimple.finalInnerIter()));
54 
55  if (pimple.finalNonOrthogonalIter())
56  {
57  // Calculate the conservative fluxes
58  phi = phiHbyA + p_rghEqn.flux();
59 
60  // Explicitly relax pressure for momentum corrector
61  p_rgh.relax();
62 
63  // Correct the momentum source with the pressure gradient flux
64  // calculated from the relaxed pressure
65  U =
66  cellMask*
67  (
68  HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf)
69  );
70  U.correctBoundaryConditions();
71  fvOptions.correct(U);
72  K = 0.5*magSqr(U);
73  }
74 }
75 
76 p = p_rgh + rho*gh;
77 
78 #include "rhoEqn.H"
79 #include "compressibleContinuityErrs.H"
80 
81 if (p_rgh.needReference())
82 {
83  if (!compressible)
84  {
86  (
87  "p",
88  p.dimensions(),
90  );
91  }
92  else
93  {
96  thermo.correctRho(psi*p - psip0);
97  rho = thermo.rho();
98  p_rgh = p - rho*gh;
99  }
100 }
101 else
102 {
103  thermo.correctRho(psi*p - psip0);
104 }
105 
106 rho = thermo.rho();
107 
108 {
110 }
111 
112 if (thermo.dpdt())
113 {
114  dpdt = fvc::ddt(p);
115 
116  if (mesh.moving())
117  {
118  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
119  }
120 }
121 
122 phi *= faceMask;
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
phiHbyA
Definition: pEqn.H:20
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:40
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:127
CGAL::Exact_predicates_exact_constructions_kernel K
fv::options & fvOptions
dimensionedScalar compressibility
Definition: pEqn.H:1
const surfaceScalarField & ghf
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
psiReactionThermo & thermo
Definition: createFields.H:28
dynamicFvMesh & mesh
IOMRFZoneList & MRF
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
volScalarField & dpdt
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
bool oversetAdjustPhi(surfaceScalarField &phi, const volVectorField &U, const label zoneId=-1)
Adjust the balance of fluxes to obey continuity.
HbyA
Definition: pEqn.H:4
faceMask
Definition: setCellMask.H:43
p_rgh
Definition: pEqn.H:139
bool compressible
Definition: pEqn.H:2
pimpleControl & pimple
const scalar pRefValue
const label pRefCell
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
rhoUf
Definition: pEqn.H:89
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()))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
mesh interpolate(rAU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:109
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:29
const volScalarField & gh
void correctRhoUf(autoPtr< surfaceVectorField > &rhoUf, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:236
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:40
const volScalarField psip0(psi *p)