compressibleAlphaEqnSubCycle.H
Go to the documentation of this file.
1 tmp<surfaceScalarField> talphaPhi1(alphaPhi1);
2 
4 {
5  dimensionedScalar totalDeltaT = runTime.deltaT();
6 
8  (
9  IOobject
10  (
11  "alphaPhi1",
12  runTime.timeName(),
13  mesh
14  ),
15  mesh,
16  dimensionedScalar(alphaPhi1.dimensions(), 0)
17  );
18 
19  surfaceScalarField rhoPhiSum
20  (
21  IOobject
22  (
23  "rhoPhiSum",
24  runTime.timeName(),
25  mesh
26  ),
27  mesh,
28  dimensionedScalar(rhoPhi.dimensions(), 0)
29  );
30 
31  tmp<volScalarField> trSubDeltaT;
32 
33  if (LTS)
34  {
35  trSubDeltaT =
36  fv::localEulerDdt::localRSubDeltaT(mesh, nAlphaSubCycles);
37  }
38 
39  for
40  (
41  subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
42  !(++alphaSubCycle).end();
43  )
44  {
45  #include "alphaEqn.H"
46  talphaPhi1.ref() += (runTime.deltaT()/totalDeltaT)*alphaPhi1;
47  rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
48  }
49 
50  rhoPhi = rhoPhiSum;
51 }
52 else
53 {
54  #include "alphaEqn.H"
55 }
56 
57 const surfaceScalarField& alphaPhi1 = talphaPhi1();
58 surfaceScalarField alphaPhi2("alphaPhi2", phi - alphaPhi1);
59 
60 volScalarField::Internal contErr
61 (
62  (
64  - (fvModels.source(alpha1, rho1)&rho1)
65  - (fvModels.source(alpha2, rho2)&rho2)
66  )()
67 );
const volScalarField & rho1
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
volScalarField & alpha1(mixture.alpha1())
fvMesh & mesh
alpha2
Definition: alphaEqn.H:115
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
phi
Definition: correctPhi.H:3
bool LTS
Definition: createRDeltaT.H:1
const label nAlphaSubCycles(alphaControls.lookup< label >("nAlphaSubCycles"))
Foam::fvModels & fvModels
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const volScalarField & rho2
tmp< surfaceScalarField > talphaPhi1(alphaPhi1)
rhoPhi
Definition: rhoEqn.H:10
surfaceScalarField alphaPhi2("alphaPhi2", phi - alphaPhi1)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
volScalarField::Internal contErr((fvc::ddt(rho)+fvc::div(rhoPhi) -(fvModels.source(alpha1, rho1)&rho1) -(fvModels.source(alpha2, rho2)&rho2))())