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(phi.dimensions(), Zero)
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  mesh.newIOobject("alphaPhiSum"),
22  mesh,
23  dimensionedScalar(phi.dimensions(), Zero)
24  );
25 
26  for
27  (
28  subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
29  !(++alphaSubCycle).end();
30  )
31  {
32  #include "alphaEqn.H"
33  alphaPhiSum += (runTime.deltaT()/totalDeltaT)*alphaPhi;
34  }
35 
36  alphaPhi = alphaPhiSum;
37  }
38  else
39  {
40  #include "alphaEqn.H"
41  }
42 
43  // Apply the diffusion term separately to allow implicit solution
44  // and boundedness of the explicit advection
45  {
46  fvScalarMatrix alpha1Eqn
47  (
50  );
51 
52  alpha1Eqn.solve("alpha1Diffusion");
53 
54  alphaPhi += alpha1Eqn.flux();
55  alpha2 = 1.0 - alpha1;
56 
57  Info<< "Phase-1 volume fraction = "
58  << alpha1.weightedAverage(mesh.Vsc()).value()
59  << " Min(" << alpha1.name() << ") = " << min(alpha1).value()
60  << " Max(" << alpha1.name() << ") = " << max(alpha1).value()
61  << endl;
62  }
63 
64  rhoPhi = alphaPhi*(rho1 - rho2) + phi*rho2;
65  rho = mixture.rho();
66 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
volScalarField & rho1
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
const volScalarField & alpha2
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:40
dynamicFvMesh & mesh
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:201
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
volScalarField & rho2
label nAlphaSubCycles(alphaControls.get< label >("nAlphaSubCycles"))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
rhoPhi
Definition: rhoEqn.H:10
messageStream Info
Information stream (stdout output on master, null elsewhere)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField alphaPhi(phi.name()+alpha1.name(), fvc::flux(phi, alpha1, alphaScheme))
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
const volScalarField & alpha1