alphaEqn.H
Go to the documentation of this file.
1{
2 word alphaScheme("div(phi,alpha)");
3 word alpharScheme("div(phirb,alpha)");
4
5 surfaceScalarField phir("phir", phic*interface.nHatf());
6
7 Pair<tmp<volScalarField>> vDotAlphal =
8 mixture->vDotAlphal();
9 const volScalarField& vDotcAlphal = vDotAlphal[0]();
10 const volScalarField& vDotvAlphal = vDotAlphal[1]();
11 const volScalarField vDotvmcAlphal(vDotvAlphal - vDotcAlphal);
12
13 tmp<surfaceScalarField> talphaPhi;
14
16 {
17 fvScalarMatrix alpha1Eqn
18 (
19 fv::EulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)
20 + fv::gaussConvectionScheme<scalar>
21 (
22 mesh,
23 phi,
24 upwind<scalar>(mesh, phi)
25 ).fvmDiv(phi, alpha1)
26 - fvm::Sp(divU, alpha1)
27 ==
28 fvm::Sp(vDotvmcAlphal, alpha1)
30 );
31
32 alpha1Eqn.solve();
33
34 Info<< "Phase-1 volume fraction = "
35 << alpha1.weightedAverage(mesh.Vsc()).value()
36 << " Min(" << alpha1.name() << ") = " << min(alpha1).value()
37 << " Max(" << alpha1.name() << ") = " << max(alpha1).value()
38 << endl;
39
40 talphaPhi = alpha1Eqn.flux();
41 }
42
43 volScalarField alpha10("alpha10", alpha1);
44
45 for (int aCorr=0; aCorr<nAlphaCorr; aCorr++)
46 {
47 tmp<surfaceScalarField> talphaPhiCorr
48 (
49 fvc::flux
50 (
51 phi,
52 alpha1,
53 alphaScheme
54 )
55 + fvc::flux
56 (
57 -fvc::flux(-phir, alpha2, alpharScheme),
58 alpha1,
60 )
61 );
62
63 if (MULESCorr)
64 {
65 talphaPhiCorr.ref() -= talphaPhi();
66
67 volScalarField alpha100("alpha100", alpha10);
69
70 MULES::correct
71 (
72 geometricOneField(),
73 alpha1,
74 talphaPhi(),
75 talphaPhiCorr.ref(),
77 (
78 divU*(alpha10 - alpha100)
80 )(),
81 oneField(),
82 zeroField()
83 );
84
85 // Under-relax the correction for all but the 1st corrector
86 if (aCorr == 0)
87 {
88 talphaPhi.ref() += talphaPhiCorr();
89 }
90 else
91 {
92 alpha1 = 0.5*alpha1 + 0.5*alpha10;
93 talphaPhi.ref() += 0.5*talphaPhiCorr();
94 }
95 }
96 else
97 {
98 MULES::explicitSolve
99 (
100 geometricOneField(),
101 alpha1,
102 phi,
103 talphaPhiCorr.ref(),
105 (divU*alpha1 + vDotcAlphal)(),
106 oneField(),
107 zeroField()
108 );
109
110 talphaPhi = talphaPhiCorr;
111 }
112
113 alpha2 = 1.0 - alpha1;
114 }
115
117
118 // Cache alphaPhi
120
121 Info<< "Liquid phase volume fraction = "
122 << alpha1.weightedAverage(mesh.V()).value()
123 << " Min(" << alpha1.name() << ") = " << min(alpha1).value()
124 << " Max(" << alpha1.name() << ") = " << max(alpha1).value()
125 << endl;
126}
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
Y[inertIndex] max(0.0)
surfaceScalarField & phi
const volScalarField & alpha1
volScalarField & rho2
volScalarField & rho1
alphaPhi10
Definition: alphaEqn.H:7
rhoPhi
Definition: alphaEqn.H:6
alpha2
Definition: alphaEqn.H:9
dynamicFvMesh & mesh
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
word alpharScheme("div(phirb,alpha)")
zeroField divU
Definition: alphaSuSp.H:3
volScalarField alpha10("alpha10", alpha1)
Pair< tmp< volScalarField > > vDotAlphal
Definition: alphaEqn.H:7
const volScalarField & vDotcAlphal
Definition: alphaEqn.H:9
const volScalarField vDotvmcAlphal(vDotvAlphal - vDotcAlphal)
tmp< surfaceScalarField > talphaPhi
Definition: alphaEqn.H:13
const volScalarField & vDotvAlphal
Definition: alphaEqn.H:10
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
bool MULESCorr(alphaControls.getOrDefault("MULESCorr", false))
label nAlphaCorr(alphaControls.get< label >("nAlphaCorr"))