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 
15  (
16  mesh.Sf() & fvc::interpolate(UdmModel.Udm())
17  );
18 
19  if (nAlphaSubCycles > 1)
20  {
21  dimensionedScalar totalDeltaT = runTime.deltaT();
22  surfaceScalarField alphaPhiSum
23  (
24  IOobject
25  (
26  "alphaPhiSum",
27  runTime.timeName(),
28  mesh
29  ),
30  mesh,
31  dimensionedScalar("0", phi.dimensions(), 0)
32  );
33 
34  for
35  (
36  subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
37  !(++alphaSubCycle).end();
38  )
39  {
40  #include "alphaEqn.H"
41  alphaPhiSum += (runTime.deltaT()/totalDeltaT)*alphaPhi;
42  }
43 
44  alphaPhi = alphaPhiSum;
45  }
46  else
47  {
48  #include "alphaEqn.H"
49  }
50 
51  // Apply the diffusion term separately to allow implicit solution
52  // and boundedness of the explicit advection
53  {
54  fvScalarMatrix alpha1Eqn
55  (
58  );
59 
60  alpha1Eqn.solve(mesh.solver("alpha1Diffusion"));
61 
62  alphaPhi += alpha1Eqn.flux();
63  alpha2 = 1.0 - alpha1;
64 
65  Info<< "Phase-1 volume fraction = "
66  << alpha1.weightedAverage(mesh.Vsc()).value()
67  << " Min(" << alpha1.name() << ") = " << min(alpha1).value()
68  << " Max(" << alpha1.name() << ") = " << max(alpha1).value()
69  << endl;
70  }
71 
72  rhoPhi = alphaPhi*(rho1 - rho2) + phi*rho2;
73  rho = mixture.rho();
74 }
rhoPhi
rhoPhi
Definition: rhoEqn.H:10
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:261
rho
rho
Definition: alphaEqnSubCycle.H:73
alphaEqn.H
mixture
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
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
alphaPhi
surfaceScalarField alphaPhi(IOobject("alphaPhi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), phi *fvc::interpolate(alpha1))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
nAlphaSubCycles
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")))
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::Info
messageStream Info
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
phir
surfaceScalarField phir(mesh.Sf() &fvc::interpolate(UdmModel.Udm()))
rho2
rho2
Definition: pEqn.H:125
alpha2
alpha2
Definition: alphaEqn.H:112
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
rho1
rho1
Definition: pEqn.H:124
alpha1
volScalarField & alpha1
Definition: createFields.H:15
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
Foam::fvc::ddt
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
UdmModel
relativeVelocityModel & UdmModel(UdmModelPtr())