pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 volScalarField rAU(1.0/UEqn.A());
6 
8 (
9  "phiHbyA",
11  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf))
12 );
13 
14 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
15 
16 // Update the pressure BCs to ensure flux consistency
18 
20 
21 if (pimple.transonic())
22 {
23  const surfaceScalarField phid
24  (
25  "phid",
27  );
28 
29  while (pimple.correctNonOrthogonal())
30  {
31  fvScalarMatrix pEqn
32  (
33  fvm::ddt(psi, p)
34  + fvm::div(phid, p)
36  ==
37  fvModels.source(psi, p, rho.name())
38  );
39 
40  pEqn.solve();
41 
42  if (pimple.finalNonOrthogonalIter())
43  {
44  phi == pEqn.flux();
45  }
46  }
47 }
48 else
49 {
50  while (pimple.correctNonOrthogonal())
51  {
52  fvScalarMatrix pEqn
53  (
54  fvm::ddt(psi, p)
55  + fvc::div(phiHbyA)
57  ==
58  fvModels.source(psi, p, rho.name())
59  );
60 
61  pEqn.solve();
62 
63  if (pimple.finalNonOrthogonalIter())
64  {
65  phi = phiHbyA + pEqn.flux();
66  }
67  }
68 }
69 
70 #include "rhoEqn.H"
72 
73 U = HbyA - rAU*fvc::grad(p);
74 U.correctBoundaryConditions();
76 K = 0.5*magSqr(U);
77 
78 // Correct rhoUf if the mesh is moving
80 
81 if (thermo.dpdt())
82 {
83  dpdt = fvc::ddt(p);
84 
85  if (mesh.moving())
86  {
88  }
89 }
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
U
Definition: pEqn.H:72
mixture MRF().makeRelative(phiHbyA)
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
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:59
fvMesh & mesh
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
p
Definition: pEqn.H:125
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:58
volScalarField & dpdt
phiHbyA
Definition: pEqn.H:30
Foam::fvConstraints & fvConstraints
const volScalarField & psi
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
dimensioned< scalar > magSqr(const dimensioned< Type > &)
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.
Foam::fvModels & fvModels
phi
Definition: pEqn.H:98
void correctRhoUf(autoPtr< surfaceVectorField > &rhoUf, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const MRFType &MRF)
volVectorField & HbyA
Definition: pEqn.H:13
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:34
Calculates and prints the continuity errors.
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
autoPtr< surfaceVectorField > rhoUf
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
rho
Definition: pEqn.H:1
fvVectorMatrix & UEqn
Definition: UEqn.H:13