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 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
surfaceScalarField & phi
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
dynamicFvMesh & mesh
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
const volScalarField & alpha1
alpha2
Definition: alphaEqn.H:115
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Info<< "Reading field p_rgh\"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating phaseChangeTwoPhaseMixture\"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:33
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
rhoPhi
Definition: rhoEqn.H:10
messageStream Info
const dimensionedScalar & rho2
Definition: createFields.H:40
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
const dimensionedScalar & rho1
Definition: createFields.H:39
surfaceScalarField alphaPhi(phi.name()+alpha1.name(), fvc::flux(phi, alpha1, alphaScheme))
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")))