All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
addEnergyFluxes.H
Go to the documentation of this file.
1 {
2  volScalarField Hi
3  (
4  IOobject
5  (
6  "Hi",
7  runTime.timeName(),
8  mesh,
9  IOobject::NO_READ,
10  IOobject::NO_WRITE
11  ),
12  mesh,
13  dimEnergy/dimMass
14  );
15 
16  surfaceScalarField Hif
17  (
18  "Hif",
19  Hf*0.0
20  );
21 
22  volScalarField Ei
23  (
24  IOobject
25  (
26  "Ei",
27  runTime.timeName(),
28  mesh,
29  IOobject::NO_READ,
30  IOobject::NO_WRITE
31  ),
32  mesh,
33  dimEnergy/dimMass
34  );
35 
36  surfaceScalarField Eif
37  (
38  "Eif",
39  Hf*0.0
40  );
41 
42  forAll(Y, iCmpt)
43  {
44  scalarField& hiIF = Hi.ref();
45  scalarField& eiIF = Ei.ref();
46  const scalarField& pIF = p.internalField();
47  const scalarField& TIF = T.internalField();
48 
49  forAll(hiIF, iCell)
50  {
51  hiIF[iCell] = thermo.composition().Hs(iCmpt, pIF[iCell], TIF[iCell]);
52  eiIF[iCell] = thermo.composition().Es(iCmpt, pIF[iCell], TIF[iCell]);
53  }
54 
55  forAll(Hi.boundaryField(), iPatch)
56  {
57  fvPatchScalarField& hip = Hi.boundaryFieldRef()[iPatch];
58  fvPatchScalarField& eip = Ei.boundaryFieldRef()[iPatch];
59  const fvPatchScalarField& pp = p.boundaryField()[iPatch];
60  const fvPatchScalarField& Tp = T.boundaryField()[iPatch];
61  forAll(hip, iFace)
62  {
63  hip[iFace] = thermo.composition().Hs(iCmpt, pp[iFace], Tp[iFace]);
64  eip[iFace] = thermo.composition().Es(iCmpt, pp[iFace], Tp[iFace]);
65  }
66  }
67 
68  Hif = qgdInterpolate(Hi);
70 
71  phiQ +=
72  //contribution from relative motion of components (diffusion in Yi transport)
73  //which acts actually as convection of energy
74  qgdFlux
75  (
76  diffusiveFlux[iCmpt],
77  Hi,
78  Hif
79  );
80  phiQ +=
81  // contribution due to casting diffusion term from temperature to system enthalpy
82  qgdFlux
83  (
84  fvc::snGrad(Y[iCmpt]) * mesh.magSf(),
85  Ei * turbulence->alphaEff(),
86  Eif * alphauf
87  );
88  }
89 }
90 
91 //
92 //END-OF-FILE
93 //
94 
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdFlux(const GeometricField< scalar, Foam::fvsPatchField, Foam::surfaceMesh > &flux, const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi, const GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > &psif, const word fluxName)
volScalarField Ei(IOobject("Ei", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimEnergy/dimMass)
PtrList< surfaceScalarField > diffusiveFlux(Y.size())
alphauf
Definition: updateFields.H:42
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdInterpolate(const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi)
surfaceScalarField Eif("Eif", Hf *0.0)
forAll(Y, i)
Definition: QGDYEqn.H:36
Hf
Definition: updateFields.H:35
PtrList< volScalarField > & Y
Definition: createFields.H:29
rhoQGDThermo & thermo
Definition: createFields.H:47
Hif
Definition: updateFields.H:39
phiQ
Definition: updateFluxes.H:113
Info<< "Thermo corrected"<< endl;autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:59
volScalarField & T
Definition: createFields.H:53
volScalarField & p
Definition: createFields.H:52