pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU(1.0/UEqn.A());
5  tUEqn.clear();
6 
7  bool closedVolume = false;
8 
9  if (simple.transonic())
10  {
12  (
13  "phid",
15  *fvc::flux(HbyA)
16  );
17 
18  MRF.makeRelative(fvc::interpolate(psi), phid);
19 
20  while (simple.correctNonOrthogonal())
21  {
22  fvScalarMatrix pEqn
23  (
24  fvm::div(phid, p)
26  ==
27  fvOptions(psi, p, rho.name())
28  );
29 
30  // Relax the pressure equation to ensure diagonal-dominance
31  pEqn.relax();
32 
33  pEqn.setReference(pRefCell, pRefValue);
34 
35  pEqn.solve();
36 
37  if (simple.finalNonOrthogonalIter())
38  {
39  phi == pEqn.flux();
40  }
41  }
42  }
43  else
44  {
45  surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
46  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
47 
48  closedVolume = adjustPhi(phiHbyA, U, p);
49 
50  // Update the pressure BCs to ensure flux consistency
51  constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
52 
53  while (simple.correctNonOrthogonal())
54  {
55  fvScalarMatrix pEqn
56  (
57  fvc::div(phiHbyA)
59  ==
60  fvOptions(psi, p, rho.name())
61  );
62 
63  pEqn.setReference(pRefCell, pRefValue);
64 
65  pEqn.solve();
66 
67  if (simple.finalNonOrthogonalIter())
68  {
69  phi = phiHbyA + pEqn.flux();
70  }
71  }
72  }
73 
74 
76 
77  // Explicitly relax pressure for momentum corrector
78  p.relax();
79 
80  U = HbyA - rAU*fvc::grad(p);
81  U.correctBoundaryConditions();
82  fvOptions.correct(U);
83 
84  // For closed-volume cases adjust the pressure and density levels
85  // to obey overall mass continuity
86  if (closedVolume)
87  {
90  }
91 
92  rho = thermo.rho();
93  rho = max(rho, rhoMin);
94  rho = min(rho, rhoMax);
95 
96  if (!simple.transonic())
97  {
98  rho.relax();
99  }
100 
101  Info<< "rho max/min : "
102  << max(rho).value() << " "
103  << min(rho).value() << endl;
104 }
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
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
U
Definition: pEqn.H:83
dimensionedScalar initialMass
Definition: createFields.H:82
p
Definition: pEqn.H:50
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
phiHbyA
Definition: pEqn.H:20
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Calculates and prints the continuity errors.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< surfaceScalarField > interpolate(const RhoType &rho)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
fv::options & fvOptions
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
IOMRFZoneList & MRF
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
surfaceScalarField phid("phid", fvc::interpolate(psi)*(fvc::flux(HbyA)+rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)))
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
adjustPhi(phiHbyA, U, p_rgh)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const scalar pRefValue
const label pRefCell
const dictionary & simple
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
messageStream Info
phi
Definition: pEqn.H:18
const volScalarField & psi
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
rho
Definition: pEqn.H:1
volScalarField rAU(1.0/UEqn.A())