pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 volScalarField rAU(1.0/UEqn.A());
6 
7 if (pimple.transonic())
8 {
10  (
11  "phid",
13  *(
14  (
15  fvc::flux(HbyA)
16  + MRF.zeroFilter
17  (
19  )
20  )
21  )
22  );
23 
24  fvc::makeRelative(phid, psi, U);
25  MRF.makeRelative(fvc::interpolate(psi), phid);
26 
27  while (pimple.correctNonOrthogonal())
28  {
29  fvScalarMatrix pEqn
30  (
31  fvm::ddt(psi, p)
32  + fvm::div(phid, p)
34  ==
35  fvModels.source(psi, p, rho.name())
36  );
37 
38  pEqn.solve();
39 
40  if (pimple.finalNonOrthogonalIter())
41  {
42  phi == pEqn.flux();
43  }
44  }
45 }
46 else
47 {
49  (
50  "phiHbyA",
51  (
52  fvc::flux(rho*HbyA)
53  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf))
54  )
55  );
56 
57  fvc::makeRelative(phiHbyA, rho, U);
58  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
59 
60  // Update the pressure BCs to ensure flux consistency
61  constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
62 
63  while (pimple.correctNonOrthogonal())
64  {
65  fvScalarMatrix pEqn
66  (
67  fvm::ddt(psi, p)
68  + fvc::div(phiHbyA)
70  ==
71  fvModels.source(psi, p, rho.name())
72  );
73 
74  pEqn.solve();
75 
76  if (pimple.finalNonOrthogonalIter())
77  {
78  phi = phiHbyA + pEqn.flux();
79  }
80  }
81 }
82 
83 #include "rhoEqn.H"
85 
86 U = HbyA - rAU*fvc::grad(p);
87 U.correctBoundaryConditions();
89 K = 0.5*magSqr(U);
90 
91 {
93  surfaceVectorField n(mesh.Sf()/mesh.magSf());
94  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
95 }
96 
97 if (thermo.dpdt())
98 {
100 }
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
fluidReactionThermo & thermo
Definition: createFields.H:28
pimpleNoLoopControl & pimple
IOMRFZoneList & MRF
rhoUf
Definition: pEqn.H:94
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
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
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
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:99
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
rho
Definition: pEqn.H:1
Foam::fvConstraints & fvConstraints
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
dimensioned< scalar > magSqr(const dimensioned< Type > &)
MRF makeRelative(phiHbyA)
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.
bool constrain(fvMatrix< Type > &eqn) const
Apply constraints to an equation.
phiHbyA
Definition: pEqn.H:32
Foam::fvModels & fvModels
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:188
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:34
Calculates and prints the continuity errors.
const volScalarField & psi
surfaceVectorField n(mesh.Sf()/mesh.magSf())
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
p
Definition: pEqn.H:101
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
fvVectorMatrix & UEqn
Definition: UEqn.H:13