pEqn.H
Go to the documentation of this file.
1 {
2  const volScalarField& psi = thermo.psi();
3 
4  volVectorField HbyA("HbyA", U);
5 
7  {
8  HbyA = trTU() & UEqn().H();
9  }
10  else
11  {
12  HbyA = trAU()*UEqn().H();
13  }
14 
15  UEqn.clear();
16 
17  bool closedVolume = false;
18 
20  (
21  "phiHbyA",
23  );
24 
25  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
26 
28 
29  while (simple.correctNonOrthogonal())
30  {
31  tmp<fvScalarMatrix> tpEqn;
32 
34  {
35  tpEqn =
36  (
38  + fvOptions(psi, p, rho.name())
39  ==
41  );
42  }
43  else
44  {
45  tpEqn =
46  (
48  + fvOptions(psi, p, rho.name())
49  ==
51  );
52  }
53 
54  tpEqn().setReference(pRefCell, pRefValue);
55 
56  tpEqn().solve();
57 
58  if (simple.finalNonOrthogonalIter())
59  {
60  phi = phiHbyA - tpEqn().flux();
61  }
62  }
63 
65 
66  // Explicitly relax pressure for momentum corrector
67  p.relax();
68 
70  {
71  U = HbyA - (trTU() & fvc::grad(p));
72  }
73  else
74  {
75  U = HbyA - trAU()*fvc::grad(p);
76  }
77 
78  U.correctBoundaryConditions();
79  fvOptions.correct(U);
80 
81  // For closed-volume cases adjust the pressure and density levels
82  // to obey overall mass continuity
84  {
87  }
88 
89  rho = thermo.rho();
90  rho = max(rho, rhoMin);
91  rho = min(rho, rhoMax);
92  rho.relax();
93  Info<< "rho max/min : "
94  << max(rho).value() << " "
95  << min(rho).value() << endl;
96 }
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
trAU
tmp< volScalarField > trAU
Definition: UEqn.H:20
p
p
Definition: pEqn.H:62
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
trTU
tmp< volTensorField > trTU
Definition: UEqn.H:21
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::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
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
pressureImplicitPorosity
Switch pressureImplicitPorosity(false)
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