pEqn.H
Go to the documentation of this file.
1 {
2  bool closedVolume = p_rgh.needReference();
4  bool compressible = (compressibility.value() > SMALL);
5 
6  rho = thermo.rho();
7 
8  volScalarField rAU("rAU", 1.0/UEqn.A());
11 
13 
15  (
16  "phiHbyA",
17  (
18  fvc::flux(rho*HbyA)
20  )
21  + phig
22  );
23 
24  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
25 
26  // Update the pressure BCs to ensure flux consistency
28 
29  {
31  (
33  + fvc::div(phiHbyA)
34  );
35 
36  // Thermodynamic density needs to be updated by psi*d(p) after the
37  // pressure solution - done in 2 parts. Part 1:
38  thermo.rho() -= psi*p_rgh;
39 
40  for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
41  {
42  fvScalarMatrix p_rghEqn
43  (
45  - fvm::laplacian(rhorAUf, p_rgh)
46  );
47 
48  p_rghEqn.solve
49  (
50  mesh.solver
51  (
52  p_rgh.select
53  (
54  (
55  oCorr == nOuterCorr-1
56  && corr == nCorr-1
57  && nonOrth == nNonOrthCorr
58  )
59  )
60  )
61  );
62 
63  if (nonOrth == nNonOrthCorr)
64  {
65  phi = phiHbyA + p_rghEqn.flux();
66  U = HbyA
67  + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
68  U.correctBoundaryConditions();
69  fvOptions.correct(U);
70  K = 0.5*magSqr(U);
71  }
72  }
73 
74  // Second part of thermodynamic density update
75  thermo.rho() += psi*p_rgh;
76  }
77 
78  p = p_rgh + rho*gh;
79 
80  // Update pressure time derivative if needed
81  if (thermo.dpdt())
82  {
83  dpdt = fvc::ddt(p);
84  }
85 
86  // Solve continuity
87  #include "rhoEqn.H"
88 
89  // Update continuity errors
91 
92  // For closed-volume cases adjust the pressure and density levels
93  // to obey overall mass continuity
94  if (closedVolume && compressible)
95  {
98  rho = thermo.rho();
99  p_rgh = p - rho*gh;
100  }
101 }
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
dimensionedScalar initialMass
Definition: createFields.H:82
p
Definition: pEqn.H:50
phiHbyA
Definition: pEqn.H:20
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:155
dimensionedScalar compressibility
Definition: pEqn.H:29
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< surfaceScalarField > interpolate(const RhoType &rho)
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
CGAL::Exact_predicates_exact_constructions_kernel K
const int nNonOrthCorr
fv::options & fvOptions
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
const surfaceScalarField & ghf
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
psiReactionThermo & thermo
Definition: createFields.H:31
dynamicFvMesh & mesh
IOMRFZoneList & MRF
const int nOuterCorr
volScalarField & dpdt
surfaceScalarField phig("phig",-rhorAUf *ghf *fvc::snGrad(rho)*mesh.magSf())
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
p_rgh
Definition: pEqn.H:120
dimensioned< scalar > magSqr(const dimensioned< Type > &)
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
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.
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & gh
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
rho
Definition: pEqn.H:1
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
volScalarField rAU(1.0/UEqn.A())