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());
10 
11  volVectorField HbyA("HbyA", U);
12  HbyA = rAU*UEqn.H();
13 
15 
17  (
18  "phiHbyA",
19  (
20  (fvc::interpolate(rho*HbyA) & mesh.Sf())
22  )
23  + phig
24  );
25 
26  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
27 
28  // Update the fixedFluxPressure BCs to ensure flux consistency
30  (
31  p_rgh.boundaryField(),
32  (
33  phiHbyA.boundaryField()
34  - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
35  *rho.boundaryField()
36  )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField())
37  );
38 
40  (
42  + fvc::div(phiHbyA)
43  ==
44  fvOptions(psi, p_rgh, rho.name())
45  );
46 
47  while (pimple.correctNonOrthogonal())
48  {
49  fvScalarMatrix p_rghEqn
50  (
53  );
54 
55  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
56 
57  if (pimple.finalNonOrthogonalIter())
58  {
59  // Calculate the conservative fluxes
60  phi = phiHbyA + p_rghEqn.flux();
61 
62  // Explicitly relax pressure for momentum corrector
63  p_rgh.relax();
64 
65  // Correct the momentum source with the pressure gradient flux
66  // calculated from the relaxed pressure
67  U = HbyA + 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  p = p_rgh + rho*gh;
75 
76  // Second part of thermodynamic density update
77  thermo.rho() += psi*p;
78 
79  if (thermo.dpdt())
80  {
81  dpdt = fvc::ddt(p);
82  }
83 
84  #include "rhoEqn.H"
85  #include "compressibleContinuityErrs.H"
86 }
volScalarField & dpdt
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
phi
Definition: pEqn.H:20
CGAL::Exact_predicates_exact_constructions_kernel K
setSnGrad< fixedFluxPressureFvPatchScalarField >(p_rgh.boundaryField(),( phiHbyA.boundaryField() -MRF.relative(mesh.Sf().boundaryField()&U.boundaryField()) *rho.boundaryField() )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()))
dimensioned< scalar > magSqr(const dimensioned< Type > &)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
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
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
volScalarField & p_rgh
tmp< surfaceScalarField > interpolate(const RhoType &rho)
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
dynamicFvMesh & mesh
surfaceScalarField phig(-rhorAUf *ghf *fvc::snGrad(rho)*mesh.magSf())
const dictionary & pimple
p
Definition: pEqn.H:59
fv::IOoptionList & fvOptions
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
IOMRFZoneList & MRF
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
const volScalarField & psi
Definition: createFields.H:24
phiHbyA
Definition: pEqn.H:21
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
fvScalarMatrix p_rghDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p_rgh))+fvc::div(phiHbyA)==fvOptions(psi, p_rgh, rho.name()))
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
volScalarField rAU(1.0/UEqn.A())
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
rho
Definition: pEqn.H:1
psiReactionThermo & thermo
Definition: createFields.H:32
U
Definition: pEqn.H:82
const surfaceScalarField & ghf
HbyA
Definition: pEqn.H:7
const volScalarField & gh