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",
50  );
51 
52  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
53 
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 
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
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 }
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:27
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
p
p
Definition: pEqn.H:62
phid
surfaceScalarField phid("phid", fvc::interpolate(psi) *((mesh.Sf() &fvc::interpolate(HbyA))+rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)))
Foam::fvc::domainIntegrate
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcVolumeIntegrate.C:86
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
continuityErrs.H
Calculates and prints the continuity errors.
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:261
phi
phi
Definition: pEqn.H:20
A
simpleMatrix< scalar > A(Nc)
simple
Simple relative velocity model.
U
U
Definition: pEqn.H:46
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
rhoMin
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Foam::Info
messageStream Info
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:15
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
rho
rho
Definition: pEqn.H:3
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
rAU
volScalarField rAU("rAU", 1.0/UEqn().A())
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
adjustPhi
adjustPhi(phiHbyA, U, p)
HbyA
HbyA
Definition: pEqn.H:4
psi
const volScalarField & psi
Definition: setRegionFluidFields.H:13
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
closedVolume
bool closedVolume
Definition: pEqn.H:24
initialMass
dimensionedScalar initialMass
Definition: createFields.H:83
rhoMax
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
phiHbyA
phiHbyA
Definition: pEqn.H:21
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:28
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16