alphaSuSp.H
Go to the documentation of this file.
1 tmp<volScalarField::Internal> Sp
2 (
4  (
5  "Sp",
6  mesh,
7  dimensionedScalar(dgdt.dimensions(), 0)
8  )
9 );
10 
11 tmp<volScalarField::Internal> Su
12 (
14  (
15  "Su",
16  mesh,
17  dimensionedScalar(dgdt.dimensions(), 0)
18  )
19 );
20 
21 // Phase change alpha1 source
22 Pair<tmp<volScalarField::Internal>> phaseChangeS
23 (
24  phaseChange.Salpha(alpha1)
25 );
26 
27 if (phaseChangeS[0].valid())
28 {
29  Su = phaseChangeS[0];
30  Sp = phaseChangeS[1];
31 }
32 
33 volScalarField::Internal& SpRef = Sp.ref();
34 volScalarField::Internal& SuRef = Su.ref();
35 
36 forAll(dgdt, celli)
37 {
38  if (dgdt[celli] > 0.0)
39  {
40  SpRef[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
41  SuRef[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4);
42  }
43  else if (dgdt[celli] < 0.0)
44  {
45  SpRef[celli] += dgdt[celli]/max(alpha1[celli], 1e-4);
46  }
47 }
48 
49 tmp<volScalarField> divU
50 (
51  mesh.moving()
52  ? fvc::div(phiCN() + mesh.phi())
53  : fvc::div(phiCN())
54 );
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Pair< tmp< volScalarField::Internal > > phaseChangeS(phaseChange.Salpha(alpha1))
volScalarField & alpha1(mixture.alpha1())
twoPhaseChangeModel & phaseChange
fvMesh & mesh
tmp< surfaceScalarField > phiCN(phi)
tmp< volScalarField > divU
Definition: alphaSuSp.H:9
const tmp< volScalarField::Internal > & Sp
Definition: alphaSuSp.H:7
volScalarField::Internal dgdt(IOobject("dgdt", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), alpha1 *fvc::div(phi))
forAll(dgdt, celli)
Definition: alphaSuSp.H:36
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const tmp< volScalarField::Internal > & Su
Definition: alphaSuSp.H:6
const dimensionedScalar e
Elementary charge.
Definition: doubleScalar.H:105