pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 rho = max(rho, rhoMin);
3 rho = min(rho, rhoMax);
4 rho.relax();
5 
6 volScalarField rAU(1.0/UEqn.A());
9 
10 if (pimple.nCorrPiso() <= 1)
11 {
12  tUEqn.clear();
13 }
14 
15 if (pimple.transonic())
16 {
18  (
19  "phid",
21  *(
23  + MRF.zeroFilter
24  (
26  )
27  )
28  );
29 
30  fvc::makeRelative(phid, psi, U);
31  MRF.makeRelative(fvc::interpolate(psi), phid);
32 
33  while (pimple.correctNonOrthogonal())
34  {
35  fvScalarMatrix pEqn
36  (
37  fvm::ddt(psi, p)
38  + fvm::div(phid, p)
40  ==
41  parcels.Srho()
42  + fvOptions(psi, p, rho.name())
43  );
44 
45  pEqn.solve();
46 
47  if (pimple.finalNonOrthogonalIter())
48  {
49  phi == pEqn.flux();
50  }
51  }
52 }
53 else
54 {
56  (
57  "phiHbyA",
59  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf))
60  );
61 
63  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
64 
65  // Update the pressure BCs to ensure flux consistency
67 
68  while (pimple.correctNonOrthogonal())
69  {
70  fvScalarMatrix pEqn
71  (
72  fvm::ddt(psi, p)
73  + fvc::div(phiHbyA)
75  ==
76  parcels.Srho()
77  + fvOptions(psi, p, rho.name())
78  );
79 
80  pEqn.solve();
81 
82  if (pimple.finalNonOrthogonalIter())
83  {
84  phi = phiHbyA + pEqn.flux();
85  }
86  }
87 }
88 
89 #include "rhoEqn.H"
91 
92 // Explicitly relax pressure for momentum corrector
93 p.relax();
94 
95 // Recalculate density from the relaxed pressure
96 rho = thermo.rho();
97 rho = max(rho, rhoMin);
98 rho = min(rho, rhoMax);
99 rho.relax();
100 Info<< "rho max/min : " << max(rho).value()
101  << " " << min(rho).value() << endl;
102 
103 U = HbyA - rAU*fvc::grad(p);
104 U.correctBoundaryConditions();
105 fvOptions.correct(U);
106 K = 0.5*magSqr(U);
107 
108 // Correct rhoUf if the mesh is moving
110 
111 if (thermo.dpdt())
112 {
113  dpdt = fvc::ddt(p);
114 
115  if (mesh.moving())
116  {
117  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
118  }
119 }
rAU
Definition: pEqn.H:1
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
fv::options & fvOptions
rho
Definition: pEqn.H:1
pimpleNoLoopControl & pimple
p
Definition: pEqn.H:50
IOMRFZoneList & MRF
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
rhoUf
Definition: pEqn.H:94
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:170
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
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
phi
Definition: pEqn.H:104
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:57
volScalarField & dpdt
dynamicFvMesh & mesh
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvOptions(rho, U))
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.
phiHbyA
Definition: pEqn.H:32
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:11
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:34
void correctRhoUf(autoPtr< surfaceVectorField > &rhoUf, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:241
Calculates and prints the continuity errors.
messageStream Info
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
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
Solve the continuity for density.
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
MRF makeRelative(fvc::interpolate(rho), phiHbyA)