All Classes Namespaces Files Functions Variables Typedefs Friends Macros Groups
updateFluxes.H
Go to the documentation of this file.
1 //Gradients and divergence
2 //---------Start---------
4 
5 divUf = tr(gradUf);
6 
8 
10 
12 
13 //---------End---------
14 
15 //Continuity equation fluxes
16 //---------Start---------
17 rhoW = tauQGDf*
18  (
19  ((Uf * gradRhof) & Uf)
20  +
21  (rhoUf * divUf)
22  +
24  );
25 
26 rhoW += tauQGDf * gradPf;
27 
28 jm = rhoUf - rhoW;
29 
30 phiJm = mesh.Sf() & jm;
31 phi = mesh.Sf() & rhoUf;
32 //---------End---------
33 
34 // Fluxes for momentum balance equation
35 //---------Start---------
36 
38 phiP = mesh.Sf() * pf;
39 
40 Pif =
41  //QGD diffusive fluxes
42  tauQGDf*
43  (
44  (UrhoUf & gradUf)
45  +
46  Uf*gradPf
47  )
48  +
49  tauQGDf *
50  (
51  I * ( (Uf & gradPf) + (gammaf * pf * divUf) )
52  );
53 
55 {
56  Pif +=
57  muf*
58  (
59  gradUf
60  +
61  Foam::T(gradUf)
62  -
63  (2.0/3.0)*I*divUf
64  );
65 }
66 else
67 {
68  tauMCPtr() = qgdInterpolate(turbulence->muEff() * dev2(Foam::T(fvc::grad(U))));
69  phiTauMC = mesh.Sf() & tauMCPtr();
70 }
71 
72 phiPi = mesh.Sf() & Pif;
73 
74 //---------End---------
75 
76 // Fluxes for energy balance equation
77 //---------Start---------
79 
80 qf =
81  -tauQGDf*
82  (
83  UrhoUf &
84  (
85  gradef
86  - (pf / rhof / rhof) * gradRhof
87  )
88  );
89 
91 {
92  qf -=
94 }
95 
96 phiQ = mesh.Sf() & qf;
97 
98 // QGD-141/142 bug hotfix
99 phiQ.setOriented(true);
100 
101 phiPiU = mesh.Sf() & (Pif & Uf);
102 
103 //clean diffusive flux for inert specie
104 {
105  forAll(diffusiveFlux[inertIndex].internalField(), iFace)
106  {
107  diffusiveFlux[inertIndex].primitiveFieldRef()[iFace] = 0.0;
108  }
110  {
112  {
113  diffusiveFlux[inertIndex].boundaryFieldRef()[iPatch][iFace] = 0.0;
114  }
115  }
116 }
117 forAll(Y, i)
118 {
119 
120  if ( i != inertIndex )
121  {
122  gradYf = fvsc::grad(Y[i]);
123  phiJmY[i] = qgdFlux(phiJm,Y[i],Yf[i]);
124  surfaceScalarField dydtflux = - phi * tauQGDf
125  * (Uf & gradYf);
126  phiJmY[i] += dydtflux;
127  diffusiveFlux[i] = dydtflux;
128  //inert specie flux will be updated in QGDYEqn.H
129  }
130  // QGD-141/142 bug hotfix
131  diffusiveFlux[i].setOriented(true);
132 }
133 
134 //---------End---------
rhoUf
Definition: updateFields.H:14
const label inertIndex(composition.species()[inertSpecie])
gradPf
Definition: updateFluxes.H:33
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)
pf
Definition: updateFields.H:21
const surfaceScalarField & tauQGDf
Definition: createFields.H:55
phiP
Definition: updateFluxes.H:51
PtrList< surfaceScalarField > phiJmY(Y.size())
——–End———
muf
Definition: updateFields.H:38
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh)
Switch implicitDiffusion(thermo.implicitDiffusion())
gradRhof
Definition: updateFluxes.H:11
rhoE boundaryFieldRef()
phiJmH
——–End———
Definition: updateFluxes.H:95
gradUf
Definition: updateFields.H:34
phiPiU
Definition: updateFluxes.H:115
gradef
Definition: updateFluxes.H:9
PtrList< surfaceScalarField > Yf(Y.size())
gammaf
Definition: updateFields.H:27
PtrList< surfaceScalarField > diffusiveFlux(Y.size())
phiPi
Definition: updateFluxes.H:85
phiJm
Definition: updateFluxes.H:39
qf
Definition: updateFluxes.H:97
alphauf
Definition: updateFields.H:42
tmp< GeometricField< T, Foam::fvsPatchField, Foam::surfaceMesh > > qgdInterpolate(const GeometricField< T, Foam::fvPatchField, Foam::volMesh > &psi)
rhof
Definition: updateFields.H:27
forAll(Y, i)
Definition: QGDYEqn.H:36
H
Definition: updateFields.H:34
autoPtr< surfaceTensorField > tauMCPtr
phiJmU
——–End———
Definition: updateFluxes.H:50
rhoW
——–End———
Definition: updateFluxes.H:22
UrhoUf
Definition: updateFields.H:18
volScalarField & e
Definition: createFields.H:50
Hf
Definition: updateFields.H:35
PtrList< volScalarField > & Y
Definition: createFields.H:29
phiTauMC
Definition: updateFluxes.H:82
divUf
Definition: updateFluxes.H:7
jm
Definition: updateFluxes.H:37
Uf
Definition: updateFields.H:30
phiQ
Definition: updateFluxes.H:113
volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho())
Info<< "Thermo corrected"<< endl;autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:59
volScalarField & T
Definition: createFields.H:53
tmp< surfaceVectorField > grad(const volScalarField &vF)
volScalarField & p
Definition: createFields.H:52
surfaceVectorField gradYf("gradYf", gradRhof/rhof)
Pif
Definition: updateFluxes.H:53