-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathYEqn.H
57 lines (44 loc) · 1.34 KB
/
YEqn.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
tmp<fv::convectionScheme<scalar>> mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
)
);
{
reaction->correct();
Qdot = reaction->Qdot();
volScalarField Yt(0.0*Y[0]);
const PtrList<volScalarField>& diffCoeffs = cTranModel.diffCoeffs();
const PtrList<volScalarField>& diffTCoeffs = cTranModel.diffTCoeffs();
forAll(Y, i)
{
if (i != inertIndex && composition.active(i))
{
volScalarField& Yi = Y[i];
fvScalarMatrix YiEqn
(
fvm::ddt(rho, Yi)
+ mvConvection->fvmDiv(phi, Yi)
// - fvm::laplacian(turbulence->muEff(), Yi)
- fvm::laplacian(rho*diffCoeffs[i], Yi) // mass diffusion due to mass fraction gradients
==
reaction->R(Yi)
+ fvOptions(rho, Yi)
);
YiEqn += fvc::laplacian(diffTCoeffs[i]/T, T); // mass diffusion due to temp gradients
YiEqn.relax();
fvOptions.constrain(YiEqn);
YiEqn.solve(mesh.solver("Yi"));
fvOptions.correct(Yi);
Yi.max(0.0);
Yt += Yi;
//inert check
}
}
Y[inertIndex] = scalar(1) - Yt;
Y[inertIndex].max(0.0);
}