alphaEqnSubCycle.H
Go to the documentation of this file.
1 {
3  (
4  IOobject
5  (
6  "alphaPhi",
7  runTime.timeName(),
8  mesh
9  ),
10  mesh,
11  dimensionedScalar("0", phi.dimensions(), 0)
12  );
13 
14  surfaceScalarField phir(fvc::flux(UdmModel.Udm()));
15 
16  if (nAlphaSubCycles > 1)
17  {
18  dimensionedScalar totalDeltaT = runTime.deltaT();
19  surfaceScalarField alphaPhiSum
20  (
21  IOobject
22  (
23  "alphaPhiSum",
24  runTime.timeName(),
25  mesh
26  ),
27  mesh,
28  dimensionedScalar("0", phi.dimensions(), 0)
29  );
30 
31  for
32  (
33  subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
34  !(++alphaSubCycle).end();
35  )
36  {
37  #include "alphaEqn.H"
38  alphaPhiSum += (runTime.deltaT()/totalDeltaT)*alphaPhi;
39  }
40 
41  alphaPhi = alphaPhiSum;
42  }
43  else
44  {
45  #include "alphaEqn.H"
46  }
47 
48  // Apply the diffusion term separately to allow implicit solution
49  // and boundedness of the explicit advection
50  {
51  fvScalarMatrix alpha1Eqn
52  (
55  );
56 
57  alpha1Eqn.solve(mesh.solver("alpha1Diffusion"));
58 
59  alphaPhi += alpha1Eqn.flux();
60  alpha2 = 1.0 - alpha1;
61 
62  Info<< "Phase-1 volume fraction = "
63  << alpha1.weightedAverage(mesh.Vsc()).value()
64  << " Min(" << alpha1.name() << ") = " << min(alpha1).value()
65  << " Max(" << alpha1.name() << ") = " << max(alpha1).value()
66  << endl;
67  }
68 
69  rhoPhi = alphaPhi*(rho1 - rho2) + phi*rho2;
70  rho = mixture.rho();
71 }
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
surfaceScalarField & phi
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
rho1
Definition: pEqn.H:114
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
surfaceScalarField alphaPhi(IOobject("alphaPhi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), phi *fvc::interpolate(alpha1))
dynamicFvMesh & mesh
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
rho2
Definition: pEqn.H:115
alpha2
Definition: alphaEqn.H:112
Info<< "Reading field p_rgh\n"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating phaseChangeTwoPhaseMixture\n"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:33
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
volScalarField & alpha1
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
rhoPhi
Definition: rhoEqn.H:10
messageStream Info
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
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")))