pEqn.H
Go to the documentation of this file.
1 {
2  rho = thermo.rho();
3 
4  // Thermodynamic density needs to be updated by psi*d(p) after the
5  // pressure solution - done in 2 parts. Part 1:
6  thermo.rho() -= psi*p;
7 
8  volScalarField rAU(1.0/UEqn.A());
11 
12  if (pimple.transonic())
13  {
15  (
16  "phiHbyA",
17  (
18  fvc::flux(HbyA)
20  )
21  );
22 
23  MRF.makeRelative(phiHbyA);
24 
25  surfaceScalarField phid("phid", fvc::interpolate(thermo.psi())*phiHbyA);
26 
27  phiHbyA *= fvc::interpolate(rho);
28 
30  (
31  fvc::ddt(rho) + fvc::div(phiHbyA)
32  + correction(psi*fvm::ddt(p) + fvm::div(phid, p))
33  );
34 
35  while (pimple.correctNonOrthogonal())
36  {
37  fvScalarMatrix pEqn
38  (
39  pDDtEqn
41  ==
42  fvOptions(psi, p, rho.name())
43  );
44 
45  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
46 
47  if (pimple.finalNonOrthogonalIter())
48  {
49  phi = phiHbyA + pEqn.flux();
50  }
51  }
52  }
53  else
54  {
56  (
57  "phiHbyA",
58  (
59  fvc::flux(rho*HbyA)
61  )
62  );
63 
64  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
65 
66  // Update the pressure BCs to ensure flux consistency
67  constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
68 
70  (
72  + fvc::div(phiHbyA)
73  ==
74  fvOptions(psi, p, rho.name())
75  );
76 
77  while (pimple.correctNonOrthogonal())
78  {
79  fvScalarMatrix pEqn
80  (
81  pDDtEqn
83  );
84 
85  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
86 
87  if (pimple.finalNonOrthogonalIter())
88  {
89  phi = phiHbyA + pEqn.flux();
90  }
91  }
92  }
93 
94  // Second part of thermodynamic density update
95  thermo.rho() += psi*p;
96 
97  #include "rhoEqn.H"
98  #include "compressibleContinuityErrs.H"
99 
100  U = HbyA - rAU*fvc::grad(p);
101  U.correctBoundaryConditions();
102  fvOptions.correct(U);
103  K = 0.5*magSqr(U);
104 
105  if (thermo.dpdt())
106  {
107  dpdt = fvc::ddt(p);
108  }
109 }
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
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
const dictionary & pimple
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
fv::options & fvOptions
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
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
volScalarField & dpdt
fvScalarMatrix pDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p))+fvc::div(phiHbyA)==fvOptions(psi, p, rho.name()))
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
surfaceScalarField phid("phid", fvc::interpolate(psi)*(fvc::flux(HbyA)+rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)))
dimensioned< scalar > magSqr(const dimensioned< Type > &)
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
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
volScalarField rAU(1.0/UEqn.A())