pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU("rAU", 1.0/UEqn.A());
5  //tUEqn.clear();
6 
8 
10  (
11  "phiHbyA",
13  );
14 
15  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
16 
18 
20 
21  // Update the pressure BCs to ensure flux consistency
23 
25  bool compressible = (compressibility.value() > SMALL);
26 
27  // Solve pressure
28  for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
29  {
30  fvScalarMatrix p_rghEqn
31  (
33  );
34 
35  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
36 
37  p_rghEqn.solve();
38 
39  if (nonOrth == nNonOrthCorr)
40  {
41  // Calculate the conservative fluxes
42  phi = phiHbyA - p_rghEqn.flux();
43 
44  // Explicitly relax pressure for momentum corrector
45  p_rgh.relax();
46 
47  // Correct the momentum source with the pressure gradient flux
48  // calculated from the relaxed pressure
49  U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
50  U.correctBoundaryConditions();
51  fvOptions.correct(U);
52  }
53  }
54 
55  p = p_rgh + rho*gh;
56 
57  #include "continuityErrs.H"
58 
59  // For closed-volume cases adjust the pressure level
60  // to obey overall mass continuity
62  {
63  if (!compressible)
64  {
66  (
67  "p",
68  p.dimensions(),
70  );
71  }
72  else
73  {
76  }
77  p_rgh = p - rho*gh;
78  }
79 
80  rho = thermo.rho();
81  rho = max(rho, rhoMin[i]);
82  rho = min(rho, rhoMax[i]);
83  rho.relax();
84 
85  Info<< "Min/max rho:" << min(rho).value() << ' '
86  << max(rho).value() << endl;
87 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
phiHbyA
Definition: pEqn.H:20
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:127
const dimensionedScalar rhoMin
const int nNonOrthCorr
fv::options & fvOptions
dimensionedScalar compressibility
Definition: pEqn.H:1
const surfaceScalarField & ghf
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
psiReactionThermo & thermo
Definition: createFields.H:28
dynamicFvMesh & mesh
IOMRFZoneList & MRF
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
HbyA
Definition: pEqn.H:4
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
p_rgh
Definition: pEqn.H:139
bool compressible
Definition: pEqn.H:2
adjustPhi(phiHbyA, U, p_rgh)
const scalar pRefValue
const label pRefCell
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
U
Definition: pEqn.H:72
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
mesh interpolate(rAU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & gh
messageStream Info
Information stream (stdout output on master, null elsewhere)
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:40
const dimensionedScalar rhoMax
bool closedVolume
Definition: pEqn.H:10