pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU("rAU", 1.0/UEqn.A());
6  (
7  "phiHbyA",
10  );
11 
13  (
14  (
15  mixture.surfaceTensionForce()
17  )*rAUf*mesh.magSf()
18  );
19 
21 
22  // Update the pressure BCs to ensure flux consistency
24 
25  PtrList<fvScalarMatrix> p_rghEqnComps(mixture.phases().size());
26 
27  label phasei = 0;
29  (
30  PtrDictionary<phaseModel>,
31  mixture.phases(),
32  phase
33  )
34  {
35  const rhoThermo& thermo = phase().thermo();
36  const volScalarField& rho = thermo.rho()();
37 
38  p_rghEqnComps.set
39  (
40  phasei,
41  (
42  fvc::ddt(rho) + thermo.psi()*correction(fvm::ddt(p_rgh))
43  + fvc::div(phi, rho) - fvc::Sp(fvc::div(phi), rho)
44  ).ptr()
45  );
46 
47  phasei++;
48  }
49 
50  // Cache p_rgh prior to solve for density update
52 
53  while (pimple.correctNonOrthogonal())
54  {
55  fvScalarMatrix p_rghEqnIncomp
56  (
59  );
60 
61  tmp<fvScalarMatrix> p_rghEqnComp;
62 
63  phasei = 0;
65  (
66  PtrDictionary<phaseModel>,
67  mixture.phases(),
68  phase
69  )
70  {
71  tmp<fvScalarMatrix> hmm
72  (
73  (max(phase(), scalar(0))/phase().thermo().rho())
74  *p_rghEqnComps[phasei]
75  );
76 
77  if (phasei == 0)
78  {
79  p_rghEqnComp = hmm;
80  }
81  else
82  {
83  p_rghEqnComp.ref() += hmm;
84  }
85 
86  phasei++;
87  }
88 
89  solve(p_rghEqnComp + p_rghEqnIncomp);
90 
91  if (pimple.finalNonOrthogonalIter())
92  {
93  phasei = 0;
95  (
96  PtrDictionary<phaseModel>,
97  mixture.phases(),
98  phase
99  )
100  {
101  phase().dgdt() =
102  pos0(phase())
103  *(p_rghEqnComps[phasei] & p_rgh)/phase().thermo().rho();
104 
105  phasei++;
106  }
107 
108  phi = phiHbyA + p_rghEqnIncomp.flux();
109 
110  U = HbyA
111  + rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf);
112  U.correctBoundaryConditions();
113  }
114  }
115 
116  p = max(p_rgh + mixture.rho()*gh, pMin);
117 
118  // Update densities from change in p_rgh
119  mixture.correctRho(p_rgh - p_rgh_0);
120  rho = mixture.rho();
121 
122  // Correct p_rgh for consistency with p and the updated densities
123  p_rgh = p - rho*gh;
124  p_rgh.correctBoundaryConditions();
125 
126  K = 0.5*magSqr(U);
127 
128  Info<< "max(U) " << max(mag(U)).value() << endl;
129  Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
130 }
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
rAU
Definition: pEqn.H:1
phiHbyA
Definition: pEqn.H:22
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
rho
Definition: pEqn.H:1
pimpleNoLoopControl & pimple
p
Definition: pEqn.H:50
label phasei
Definition: pEqn.H:27
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
volScalarField p_rgh_0(p_rgh)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:170
p_rgh
Definition: pEqn.H:140
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
CGAL::Exact_predicates_exact_constructions_kernel K
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
rhoEqn solve()
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
forAllIter(PtrDictionary< phaseModel >, fluid.phases(), iter)
Definition: pEqn.H:34
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar pos0(const dimensionedScalar &ds)
const surfaceScalarField & ghf
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedScalar pMin("pMin", dimPressure, fluid)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & gh
phi
Definition: pEqn.H:18
messageStream Info
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
dimensioned< scalar > mag(const dimensioned< Type > &)
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
phaseChangeTwoPhaseMixture & mixture
Definition: createFields.H:38
PtrList< fvScalarMatrix > p_rghEqnComps(mixture.phases().size())
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
zeroField Sp
Definition: alphaSuSp.H:2