YEqns.H
Go to the documentation of this file.
1 {
2  for (phaseModel& phase : fluid.phases())
3  {
4  PtrList<volScalarField>& Y = phase.Y();
5 
6  if (!Y.empty())
7  {
8  //- Su phase source terms
9  PtrList<volScalarField::Internal> Sus(Y.size());
10  //- Sp phase source terms
11  PtrList<volScalarField::Internal> Sps(Y.size());
12 
13  forAll(Sus, i)
14  {
15  Sus.set
16  (
17  i,
18  new volScalarField::Internal
19  (
20  IOobject
21  (
22  "Su" + phase.name(),
23  mesh.time().timeName(),
24  mesh
25  ),
26  mesh,
28  )
29  );
30  Sps.set
31  (
32  i,
33  new volScalarField::Internal
34  (
35  IOobject
36  (
37  "Sp" + phase.name(),
38  mesh.time().timeName(),
39  mesh
40  ),
41  mesh,
43  )
44  );
45  }
46 
47  forAll(Y, i)
48  {
49  // Calculate mass exchange for species consistent with
50  // alpha's source terms.
51  fluid.massSpeciesTransfer(phase, Sus[i], Sps[i], Y[i].name());
52  }
53  phase.solveYi(Sus, Sps);
54  }
55  }
56 }
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Y
PtrList< volScalarField > & Y
Definition: createFieldRefs.H:7
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
forAll
forAll(fluid.multiComponentPhases(), multiComponentPhasei)
Definition: YEqns.H:8
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189