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