pEqn.H
Go to the documentation of this file.
1 if (!pimple.SIMPLErho())
2 {
3  rho = thermo.rho();
4 }
5 
6 // Thermodynamic density needs to be updated by psi*d(p) after the
7 // pressure solution
9 
10 volScalarField rAU(1.0/UEqn.A());
13 
15 
17 (
18  "phiHbyA",
19  (
21  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
22  )
23  + phig
24 );
25 
27 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
28 
29 // Update the pressure BCs to ensure flux consistency
31 
33 (
35  + fvc::div(phiHbyA)
36  ==
37  parcels.Srho()
38  + surfaceFilm.Srho()
39  + fvOptions(psi, p_rgh, rho.name())
40 );
41 
42 while (pimple.correctNonOrthogonal())
43 {
44  fvScalarMatrix p_rghEqn
45  (
48  );
49 
50  p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
51 
52  if (pimple.finalNonOrthogonalIter())
53  {
54  phi = phiHbyA + p_rghEqn.flux();
55 
56  // Explicitly relax pressure for momentum corrector
57  p_rgh.relax();
58 
59  U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
60  U.correctBoundaryConditions();
61  fvOptions.correct(U);
62  K = 0.5*magSqr(U);
63  }
64 }
65 
66 p = p_rgh + rho*gh;
67 
68 // Thermodynamic density update
69 thermo.correctRho(psi*p - psip0);
70 
71 #include "rhoEqn.H"
72 #include "compressibleContinuityErrs.H"
73 
74 if (pressureControl.limit(p))
75 {
76  p.correctBoundaryConditions();
77  rho = thermo.rho();
78  p_rgh = p - rho*gh;
79 }
80 else if (pimple.SIMPLErho())
81 {
82  rho = thermo.rho();
83 }
84 
85 // Correct rhoUf if the mesh is moving
87 
88 if (thermo.dpdt())
89 {
90  dpdt = fvc::ddt(p);
91 
92  if (mesh.moving())
93  {
95  }
96 }
rhoUf
rhoUf
Definition: pEqn.H:89
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:56
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
psip0
const volScalarField psip0(psi *p)
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
ghf
const surfaceScalarField & ghf
Definition: setRegionFluidFields.H:18
phiHbyA
phiHbyA
Definition: pEqn.H:20
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
rhoEqn.H
Solve the continuity for density.
Foam::fvc::meshPhi
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:36
Foam::correction
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:17
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
surfaceFilm
regionModels::surfaceFilmModel & surfaceFilm
Definition: createFieldRefs.H:3
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
phig
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
pressureControl
const pressureControl & pressureControl
Definition: setRegionFluidFields.H:69
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
p_rghDDtEqn
fvScalarMatrix p_rghDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p_rgh))+fvc::div(phiHbyA)==fvOptions(psi, p_rgh, rho.name()))
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
p_rgh
p_rgh
Definition: pEqn.H:139
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::fvc::correctRhoUf
void correctRhoUf(autoPtr< surfaceVectorField > &rhoUf, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:243
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)