-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEEqn.H
48 lines (41 loc) · 1.42 KB
/
EEqn.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
{
volScalarField& he = thermo.he();
const PtrList<volScalarField>& Hspecs = cTranModel.partialEnthalpies();
const PtrList<volScalarField>& diffTCoeffs = cTranModel.diffTCoeffs();
const PtrList<volScalarField>& diffCoeffs = cTranModel.diffCoeffs();
const volScalarField& kappa = cTranModel.kappa();
fvScalarMatrix EEqn
(
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ (
he.name() == "e"
? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt
)
- fvm::laplacian(kappa/thermo.Cp(), he)
==
Qdot
+ fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
forAll(Hspecs, i)
{
EEqn -= fvc::laplacian(kappa/thermo.Cp()*Hspecs[i], Y[i]); // extra term from writing Fourier's law as a function of sensible enthalpy
EEqn += fvc::laplacian(Hspecs[i]*rho*diffCoeffs[i], Y[i]); // energy flux due to mass diffusion (Fick's law)
EEqn += fvc::laplacian(Hspecs[i]*diffTCoeffs[i]/T, T); // energy flux due to mass diffusion (Soret effect)
}
EEqn.relax();
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
cTranModel.updateState();
Info<< "min/max(T) = "
<< min(T).value() << ", " << max(T).value() << endl;
}