pEqn.H
Go to the documentation of this file.
1 volScalarField rAU(1.0/UEqn.A());
4 tUEqn.clear();
5 
6 bool closedVolume = false;
7 
9 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
10 
11 // Update the pressure BCs to ensure flux consistency
13 
14 if (simple.transonic())
15 {
17  (
18  "phid",
20  );
21 
23 
24  while (simple.correctNonOrthogonal())
25  {
26  fvScalarMatrix pEqn
27  (
29  + fvm::div(phid, p)
31  ==
32  fvOptions(psi, p, rho.name())
33  );
34 
35  // Relax the pressure equation to ensure diagonal-dominance
36  pEqn.relax();
37 
38  pEqn.setReference
39  (
40  pressureControl.refCell(),
41  pressureControl.refValue()
42  );
43 
44  pEqn.solve();
45 
46  if (simple.finalNonOrthogonalIter())
47  {
48  phi = phiHbyA + pEqn.flux();
49  }
50  }
51 }
52 else
53 {
55 
56  while (simple.correctNonOrthogonal())
57  {
58  fvScalarMatrix pEqn
59  (
62  ==
63  fvOptions(psi, p, rho.name())
64  );
65 
66  pEqn.setReference
67  (
68  pressureControl.refCell(),
69  pressureControl.refValue()
70  );
71 
72  pEqn.solve();
73 
74  if (simple.finalNonOrthogonalIter())
75  {
76  phi = phiHbyA + pEqn.flux();
77  }
78  }
79 }
80 
82 
83 // Explicitly relax pressure for momentum corrector
84 p.relax();
85 
87 U.correctBoundaryConditions();
88 fvOptions.correct(U);
89 
90 bool pLimited = pressureControl.limit(p);
91 
92 // For closed-volume cases adjust the pressure and density levels
93 // to obey overall mass continuity
95 {
98 }
99 
101 {
102  p.correctBoundaryConditions();
103 }
104 
105 rho = thermo.rho();
106 
107 if (!simple.transonic())
108 {
109  rho.relax();
110 }
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))))
simple
const dictionary & simple
Definition: readFluidMultiRegionSIMPLEControls.H:1
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Foam::fvc::domainIntegrate
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcVolumeIntegrate.C:88
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...
continuityErrs.H
Calculates and prints the continuity errors.
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
HbyA
HbyA
Definition: pEqn.H:4
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
pLimited
bool pLimited
Definition: pEqn.H:102
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
p
p
Definition: pEqn.H:50
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
U
U
Definition: pEqn.H:72
pressureControl
const pressureControl & pressureControl
Definition: setRegionFluidFields.H:69
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
initialMass
dimensionedScalar initialMass
Definition: createFields.H:57
closedVolume
bool closedVolume
Definition: pEqn.H:10
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)