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  (fvc::interpolate(HbyA) & mesh.Sf())
16  )
17  );
18 
20  MRF.makeRelative(fvc::interpolate(psi), phid);
21 
22  while (pimple.correctNonOrthogonal())
23  {
24  fvScalarMatrix pEqn
25  (
26  fvm::ddt(psi, p)
27  + fvm::div(phid, p)
29  ==
30  fvOptions(psi, p, rho.name())
31  );
32 
33  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
34 
35  if (pimple.finalNonOrthogonalIter())
36  {
37  phi == pEqn.flux();
38  }
39  }
40 }
41 else
42 {
44  (
45  "phiHbyA",
46  (
47  (fvc::interpolate(rho*HbyA) & mesh.Sf())
49  )
50  );
51 
53  MRF.makeRelative(phiHbyA);
54 
55  // Update the pressure BCs to ensure flux consistency
57 
58  while (pimple.correctNonOrthogonal())
59  {
60  fvScalarMatrix pEqn
61  (
62  fvm::ddt(psi, p)
63  + fvc::div(phiHbyA)
65  ==
66  fvOptions(psi, p, rho.name())
67  );
68 
69  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
70 
71  if (pimple.finalNonOrthogonalIter())
72  {
73  phi = phiHbyA + pEqn.flux();
74  }
75  }
76 }
77 
78 #include "rhoEqn.H"
79 #include "compressibleContinuityErrs.H"
80 
82 U.correctBoundaryConditions();
83 fvOptions.correct(U);
84 K = 0.5*magSqr(U);
85 
86 {
88  surfaceVectorField n(mesh.Sf()/mesh.magSf());
89  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
90 }
91 
92 if (thermo.dpdt())
93 {
94  dpdt = fvc::ddt(p);
95 
96  if (mesh.moving())
97  {
99  }
100 }
rhoUf
rhoUf
Definition: pEqn.H:89
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
phid
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
phiHbyA
phiHbyA
Definition: pEqn.H:20
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::fvc::meshPhi
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:36
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
phi
phi
Definition: pEqn.H:18
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:32
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:59
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
rho
rho
Definition: pEqn.H:1
Foam::fvc::absolute
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:190
interpolate
mesh interpolate(rAU)
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)