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  while (simple.correctNonOrthogonal())
28  {
29  fvScalarMatrix p_rghEqn
30  (
32  );
33 
34  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
35 
36  p_rghEqn.solve();
37 
38  if (simple.finalNonOrthogonalIter())
39  {
40  // Calculate the conservative fluxes
41  phi = phiHbyA - p_rghEqn.flux();
42 
43  // Explicitly relax pressure for momentum corrector
44  p_rgh.relax();
45 
46  // Correct the momentum source with the pressure gradient flux
47  // calculated from the relaxed pressure
48  U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf);
49  U.correctBoundaryConditions();
50  fvOptions.correct(U);
51  }
52  }
53 
54  p = p_rgh + rho*gh;
55 
56  #include "continuityErrs.H"
57 
58  // For closed-volume cases adjust the pressure level
59  // to obey overall mass continuity
61  {
62  if(!compressible)
63  {
65  (
66  "p",
67  p.dimensions(),
69  );
70  }
71  else
72  {
75 
76  }
77  p_rgh = p - rho*gh;
78  }
79 
80  rho = thermo.rho();
81  rho.relax();
82  Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value()
83  << endl;
84 }
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:49
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:40
simple
const dictionary & simple
Definition: readFluidMultiRegionSIMPLEControls.H:1
ghf
const surfaceScalarField & ghf
Definition: setRegionFluidFields.H:18
Foam::fvc::domainIntegrate
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcVolumeIntegrate.C:81
phiHbyA
phiHbyA
Definition: pEqn.H:20
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:17
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Definition: hashSets.C:26
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:38
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::Info
messageStream Info
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:36
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:53
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Definition: hashSets.C:40
compressible
bool compressible
Definition: pEqn.H:2
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
U
U
Definition: pEqn.H:72
phig
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Definition: findRefCell.C:127
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:50
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
compressibility
dimensionedScalar compressibility
Definition: pEqn.H:1
p_rgh
p_rgh
Definition: pEqn.H:139
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Definition: fvcFlux.C:27
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:36
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:37