MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
alphaEqns.H
Go to the documentation of this file.
1 
7 {
9  word alphaScheme("div(phi,alpha)");
10  word alpharScheme("div(phirb,alpha)");
11 
12  surfaceScalarField phir(phic*interface.nHatf());
13 
14  for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
15  {
16  volScalarField::Internal Sp
17  (
18  IOobject
19  (
20  "Sp",
21  runTime.timeName(),
22  mesh
23  ),
24  mesh,
25  dimensionedScalar("Sp", dgdt.dimensions(), 0.0)
26  );
27 
28  volScalarField::Internal Su
29  (
30  IOobject
31  (
32  "Su",
33  runTime.timeName(),
34  mesh
35  ),
36  // Divergence term is handled explicitly to be
37  // consistent with the explicit transport solution
38  divU*min(alpha1, scalar(1))
39  );
40 
41  forAll(dgdt, celli)
42  {
43  if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
44  {
45  Sp[celli] -= dgdt[celli]*alpha1[celli];
46  Su[celli] += dgdt[celli]*alpha1[celli];
47  }
48  else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
49  {
50  Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
51  }
52  }
53 
54 
55  surfaceScalarField phiAlpha1
56  (
57  fvc::flux
58  (
59  phi,
60  alpha1,
61  alphaScheme
62  )
63  + fvc::flux
64  (
65  -fvc::flux(-phir, alpha2, alpharScheme),
66  alpha1,
67  alpharScheme
68  )
69  );
70 
71  MULES::explicitSolve
72  (
73  geometricOneField(),
74  alpha1,
75  phi,
76  phiAlpha1,
77  Sp,
78  Su,
79  1,
80  0
81  );
82 
83  surfaceScalarField rho1f(fvc::interpolate(rho_gas));
84  surfaceScalarField rho2f(fvc::interpolate(rho_foam));
85  rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f;
86  alpha2 = scalar(1) - alpha1;
87  }
88 
89  Info<< "Liquid phase volume fraction = "
90  << alpha1.weightedAverage(mesh.V()).value()
91  << " Min(alpha1) = " << min(alpha1).value()
92  << " Min(alpha2) = " << min(alpha2).value()
93  << endl;
94 }
95 ///@endcond