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  IOobject
22  (
23  "alphaPhiSum",
24  runTime.timeName(),
25  mesh
26  ),
27  mesh,
28  dimensionedScalar(phi.dimensions(), Zero)
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 }
runTime
engineTime & runTime
Definition: createEngineTime.H:13
rhoPhi
rhoPhi
Definition: rhoEqn.H:10
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
turbulence
Info<< "Reading field U\n"<< 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\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
alpha2
const volScalarField & alpha2
Definition: setRegionFluidFields.H:9
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
alpha1
const volScalarField & alpha1
Definition: setRegionFluidFields.H:8
nAlphaSubCycles
label nAlphaSubCycles(alphaControls.get< label >("nAlphaSubCycles"))
rho
rho
Definition: alphaEqnSubCycle.H:70
alphaEqn.H
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
phir
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
alphaPhi
surfaceScalarField alphaPhi(phi.name()+alpha1.name(), fvc::flux(phi, alpha1, alphaScheme))
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
rho2
volScalarField & rho2
Definition: setRegionFluidFields.H:30
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
rho1
volScalarField & rho1
Definition: setRegionFluidFields.H:27
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
stdFoam::end
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:121
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
mixture
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39