Difference between revisions of "Kharon theory manual"

From Kraken Wiki
Jump to: navigation, search
(Conservation of Total Enthalpy)
Line 136: Line 136:
 
::::::::<math> -\left[\text{max}\left(F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}}\right]u_{\text{W},q} </math>
 
::::::::<math> -\left[\text{max}\left(F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}}\right]u_{\text{W},q} </math>
 
</equation>
 
</equation>
 
  
 
Denoting <math>\left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{e}} = D_{\text{e},q}</math> and <math>\left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}} = D_{\text{w},q}</math> and modifying the central coefficient slightly, since <math>\text{max}\left(F_{\text{e},q},0\right) = F_{\text{e},q} + \text{max}\left(-F_{\text{e},q},0\right)</math> and <math>\text{max}\left(-F_{\text{w},q},0\right) = -F_{\text{w},q} + \text{max}\left(F_{\text{w},q},0\right)</math>, <xr id="eqn:MomentumConservation5"/> reduces to
 
Denoting <math>\left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{e}} = D_{\text{e},q}</math> and <math>\left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}} = D_{\text{w},q}</math> and modifying the central coefficient slightly, since <math>\text{max}\left(F_{\text{e},q},0\right) = F_{\text{e},q} + \text{max}\left(-F_{\text{e},q},0\right)</math> and <math>\text{max}\left(-F_{\text{w},q},0\right) = -F_{\text{w},q} + \text{max}\left(F_{\text{w},q},0\right)</math>, <xr id="eqn:MomentumConservation5"/> reduces to
 
  
 
<equation id="eqn:MomentumConservation6">
 
<equation id="eqn:MomentumConservation6">
Line 146: Line 144:
 
::::::::<math>-\left[\text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q}\right]u_{\text{E},q} - \left[\text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q}\right]u_{\text{W},q}</math>
 
::::::::<math>-\left[\text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q}\right]u_{\text{E},q} - \left[\text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q}\right]u_{\text{W},q}</math>
 
</equation>
 
</equation>
 
  
 
Identifying the coefficients of neighboring velocities
 
Identifying the coefficients of neighboring velocities
Line 424: Line 421:
 
<equation id="eqn:TotalEnthalpyConservation3">
 
<equation id="eqn:TotalEnthalpyConservation3">
 
{{NumBlk|:|<math>\Rightarrow\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \nabla h_q \right)</math>|<xr id="eqn:TotalEnthalpyConservation3" nolink />}}
 
{{NumBlk|:|<math>\Rightarrow\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \nabla h_q \right)</math>|<xr id="eqn:TotalEnthalpyConservation3" nolink />}}
::::<math>= \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}
+
::::<math>= \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]</math>
\right)\right]</math>
 
 
::::<math> -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
 
::::<math> -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
 
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
 
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
Line 434: Line 430:
  
 
<equation id="eqn:TotalEnthalpyConservation4">
 
<equation id="eqn:TotalEnthalpyConservation4">
{{NumBlk|:|<math>\Leftrightarrow\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \nabla h_q \right)</math>|<xr id="eqn:TotalEnthalpyConservation4" nolink />}}
+
{{NumBlk|:|<math>\Leftrightarrow \iiint\limits_V \left[\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \nabla h_q \right)\right]\, dV </math>|<xr id="eqn:TotalEnthalpyConservation4" nolink />}}
::::<math>= \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}
+
::::<math>= \iiint\limits_V \Big\{  \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]</math>
\right)\right]</math>
+
::::<math> -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
 +
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
 +
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q} \Big\}\, dV </math>
 +
</equation>
 +
 
 +
As with the conservation of mass and momentum above, the divergence terms on the left-hand side of the equation are transformed into surface integrals over the cell faces using the divergence theorem.
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation5">
 +
{{NumBlk|:|<math>\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA</math>|<xr id="eqn:TotalEnthalpyConservation5" nolink />}}
 +
::::<math>= \iiint\limits_V \Big\{  \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]</math>
 +
::::<math> -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
 +
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
 +
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q} \Big\}\, dV </math>
 +
</equation>
 +
 
 +
Developing the left-hand side first.
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation6">
 +
{{NumBlk|:|<math>\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA</math>|<xr id="eqn:TotalEnthalpyConservation6" nolink />}}
 +
::::<math> = \left(\varepsilon \alpha_q \rho_q h_q u_q A\right)_{\text{e}} - \left(\varepsilon \alpha_q \rho_q h_q u_q A\right)_{\text{w}} - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x} A\right)_{\text{e}} + \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x} A\right)_{\text{w}} </math>
 +
::::<math> = F_{\text{e},q} h_{\text{e},q} + F_{\text{w},q} h_{\text{w},q} - \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} \left(h_{\text{E},q} - h_{\text{P},q}\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} \left(h_{\text{P},q} - h_{\text{W},q}\right) </math>
 +
</equation>
 +
 
 +
Adopting upwind discretization for the enthalpy fluxes on the cell faces
 +
 
 +
<equation id="eqn:UpwindEnthalpyFluxes">
 +
{{NumBlk|:|<math>
 +
\begin{align}
 +
& F_{\text{e},q} h_{\text{e},q} = \text{max}\left(F_{\text{e},q},0\right) h_{\text{P},q} - \text{max}\left(-F_{\text{e},q},0\right) h_{\text{E},q}\\
 +
& F_{\text{w},q} h_{\text{w},q} = \text{max}\left(F_{\text{w},q},0\right) h_{\text{W},q} - \text{max}\left(-F_{\text{w},q},0\right) h_{\text{P},q}
 +
\end{align}
 +
</math>|<xr id="eqn:UpwindEnthalpyFluxes" nolink />}}
 +
</equation>
 +
 
 +
and rearranging terms
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation7">
 +
{{NumBlk|:|<math>\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA</math>|<xr id="eqn:TotalEnthalpyConservation7" nolink />}}
 +
::::<math> = \left[ \text{max}\left(F_{\text{e},q},0\right) + \text{max}\left(-F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} \right] h_{\text{P},q}</math>
 +
::::<math> - \left[ \text{max}\left(-F_{\text{e},q},0\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} \right] h_{\text{E},q} - \left[ \text{max}\left(F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} \right] h_{\text{W},q}</math>
 +
</equation>
 +
 
 +
 
 +
Denoting <math>\left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} = D_{\text{e},q}</math> and <math>\left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} = D_{\text{w},q}</math> and modifying the central coefficient slightly, since <math>\text{max}\left(F_{\text{e},q},0\right) = F_{\text{e},q} + \text{max}\left(-F_{\text{e},q},0\right)</math> and <math>\text{max}\left(-F_{\text{w},q},0\right) = -F_{\text{w},q} + \text{max}\left(F_{\text{w},q},0\right)</math>, <xr id="eqn:TotalEnthalpyConservation7"/> reduces to
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation8">
 +
{{NumBlk|:|<math>\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA</math>|<xr id="eqn:TotalEnthalpyConservation8" nolink />}}
 +
::::<math> = \left[ \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q} + \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q} + \left( F_{\text{e},q} - F_{\text{w},q} \right) \right] h_{\text{P},q} </math>
 +
::::<math> - \left[ \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q} \right] h_{\text{E},q}
 +
- \left[ \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q} \right] h_{\text{W},q} </math>
 +
</equation>
 +
 
 +
 
 +
Identifying the coefficients of neighboring velocities as
 +
 
 +
<equation id="eqn:EnthalpyNeighborCoefficients">
 +
{{NumBlk|:|<math>
 +
\begin{align}
 +
& a_{\text{e},q} = \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q}\\
 +
& a_{\text{w},q} = \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q}
 +
\end{align}
 +
</math>|<xr id="eqn:EnthalpyNeighborCoefficients" nolink />}}
 +
</equation>
 +
 
 +
leads to a general form
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation9">
 +
{{NumBlk|:|<math>\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA</math>|<xr id="eqn:TotalEnthalpyConservation9" nolink />}}
 +
::::<math> = \left[ a_{\text{e},q} + a_{\text{w},q} + \left( F_{\text{e},q} - F_{\text{w},q} \right) \right] h_{\text{P},q} - a_{\text{e},q} h_{\text{E},q} - a_{\text{w},q} h_{\text{W},q}</math>
 +
</equation>
 +
 
 +
Substituting the results of <xr id="eqn:TotalEnthalpyConservation9"/> into <xr id="eqn:TotalEnthalpyConservation5"/> and continuing with the development
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation10">
 +
{{NumBlk|:|<math>\Rightarrow \left[ a_{\text{e},q} + a_{\text{w},q} + \left( F_{\text{e},q} - F_{\text{w},q} \right) \right] h_{\text{P},q} - a_{\text{e},q} h_{\text{E},q} - a_{\text{w},q} h_{\text{W},q}\, dA</math>|<xr id="eqn:TotalEnthalpyConservation10" nolink />}}
 +
::::<math>= \iiint\limits_V \Big\{  \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]</math>
 
::::<math> -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
 
::::<math> -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
 
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
 
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q}</math>
+
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q} \Big\}\, dV </math>
 +
</equation>
 +
 
 +
Integrating the right-hand side term by term. The phase change term reduces to
 +
 
 +
<equation id="eqn:TotalEnthalpyConservation10">
 +
{{NumBlk|:|<math>\iiint\limits_V \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right] dV</math>|<xr id="eqn:TotalEnthalpyConservation10" nolink />}}
 +
::::<math>= \left[\text{max}\left(\Gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\Gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right] </math>
 
</equation>
 
</equation>

Revision as of 16:14, 19 April 2018

Conservation of Mass

Figure 1: Conservation of mass for an interior cell

Steady one-dimensional conservation of mass (of phase q) is given through the following relation

\nabla\cdot\left(\varepsilon \alpha_q \rho_q u_q\right) = \gamma_{pq} + s_{\text{mass},q}

 

 

 

 

(1)

Equation 1 is discretized for an interior cell, shown in Figure 1, by volume integration over cell P.

\Leftrightarrow \iiint\limits_V \left[\nabla\cdot\left(\varepsilon \alpha_q \rho_q u_q\right)\right]\, dV = \iiint\limits_V \left(\gamma_{pq} + s_{\text{mass},q}\right)\, dV

 

 

 

 

(2)

The divergence term on the left-hand side of the equation is transformed into a surface integral over the cell faces using the divergence theorem.

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q u_q\right)\cdot n\right]\, dA = \iiint\limits_V \left(\gamma_{pq} + s_{\text{mass},q}\right)\, dV

 

 

 

 

(3)

Throughout this document upwind discretization is used to evaluate the face mass flow rates, even though any discretization scheme could be chosen. The final discretized form reduces to

\Leftrightarrow \left(\varepsilon \alpha_q \rho_q u_q A\right)_\text{e} - \left(\varepsilon \alpha_q \rho_q u_q A\right)_\text{w} = F_{\text{e},q} - F_{\text{w},q} = \Gamma_{pq} + S_{\text{mass},q}

 

 

 

 

(4)

where:

 \alpha_q volume fraction of phase q [-],
 \gamma_{pq} volumetric mass transfer rate from phase p to q [kg/m3s],
 \Gamma_{pq} mass transfer rate from phase p to q [kg/s],
 \varepsilon porosity, fluid fraction of cell volume [-],
 \rho_q density of phase q [kg/m3],
 A face area [m2],
 F face mass flow rate [kg/s],
 n face normal pointing out of the cell (1 for east face, -1 for west face),
 s_{\text{mass},q} volumetric mass source to phase q [kg/m3s],
 S_{\text{mass},q} mass source to phase q [kg/s],
 u_q velocity of phase q [m/s],
subscript e east face (the face in the negative x-direction),
subscript w west face (the face in the positive x-direction),
subscript q current phase for which the equation is written (1 = primary, 2 = secondary),
subscript p the other phase (p = 2 for q = 1 and p = 1 for q = 2),
subscript pq indicates exchange between phases (e.g.  \Gamma_{pq} mass transfer from phase p to q).

Conservation of Momentum

Figure 2: Conservation of momentum for an interior cell

Steady one-dimensional conservation of momentum (of phase q) is solved from the following relation

\nabla\cdot\left(\varepsilon \alpha_q \rho_q u_q u_q\right) = \nabla\cdot\left(\varepsilon \alpha_q \mu_{\text{eff},q} \nabla u_q\right)

 

 

 

 

(5)

+ \left[\text{max}\left(\gamma_{pq},0\right)u_p - \text{max}\left(-\gamma_{pq},0\right)u_q\right] - \varepsilon \alpha_q \nabla p + \varepsilon \alpha_q \rho_q g
- \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C \left| u_q \right| u_q - k\left(u_q - u_p\right) + s_{\text{mom},q}


Equation 5 is discretized for an interior cell, shown in Figure 2, by volume integration over cell P. The diffusion term has been moved to the left-hand side, since it will be developed together with the divergence of momentum.

\Leftrightarrow \iiint\limits_V \left[\nabla\cdot\left(\varepsilon \alpha_q \rho_q u_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \mu_{\text{eff},q} \nabla u_q\right)\right]\, dV = \iiint\limits_V \left[\text{max}\left(\gamma_{pq},0\right)u_p - \text{max}\left(-\gamma_{pq},0\right)u_q\right]\, dV

 

 

 

 

(6)

 + \iiint\limits_V \left(-\varepsilon \alpha_q \nabla p + \varepsilon \alpha_q \rho_q g - \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C \left| u_q \right| u_q - k\left(u_q - u_p\right) + s_{\text{mom},q}\right)\, dV

As with the conservation of mass equation above, the divergence terms on the left-hand side of the equation are transformed into surface integrals over the cell faces using the divergence theorem.

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q u_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x}\right)\cdot n\right]\, dA = \left[\text{max}\left(\Gamma_{pq},0\right)u_p - \text{max}\left(-\Gamma_{pq},0\right)u_q\right]

 

 

 

 

(7)

 -\varepsilon \alpha_q V \nabla p + \varepsilon \alpha_q \rho_q V g - \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C V \left| u_q \right| u_q - K\left(u_q - u_p\right) + S_{\text{mom},q}

Developing the left-hand side terms first

\iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q u_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(8)

 = \left(\varepsilon \alpha_q \rho_q u_q u_q A\right)_{\text{e}} - \left(\varepsilon \alpha_q \rho_q u_q u_q A\right)_{\text{w}} - \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x} A\right)_{\text{e}} + \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x} A\right)_{\text{w}}
 = F_{\text{e},q} u_{\text{e},q} + F_{\text{w},q} u_{\text{w},q} - \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{e}} \left(u_{\text{e},q} - u_{\text{P},q}\right) + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}} \left(u_{\text{P},q} - u_{\text{w},q}\right)


Adopting upwind discretization for the momentum fluxes on the cell faces

F_{\text{e},q} u_{\text{e},q} = \text{max}\left(F_{\text{e},q},0\right)u_{\text{P},q} - \text{max}\left(-F_{\text{e},q},0\right)u_{\text{E},q}

 

 

 

 

(9)

F_{\text{w},q} u_{\text{w},q} = \text{max}\left(F_{\text{w},q},0\right)u_{\text{W},q} - \text{max}\left(-F_{\text{w},q},0\right)u_{\text{P},q}

 

 

 

 

(10)

and rearranging terms

\Leftrightarrow\iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q u_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(11)

 =\left[\text{max}\left(F_{\text{e},q},0\right) + \text{max}\left(-F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{e}} + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}}\right]u_{\text{P},q}
 -\left[\text{max}\left(-F_{\text{e},q},0\right) + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{e}}\right]u_{\text{E},q}
 -\left[\text{max}\left(F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}}\right]u_{\text{W},q}

Denoting \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{e}} = D_{\text{e},q} and \left(\varepsilon \alpha_q A \frac{\mu_{\text{eff},q}}{\delta x}\right)_{\text{w}} = D_{\text{w},q} and modifying the central coefficient slightly, since \text{max}\left(F_{\text{e},q},0\right) = F_{\text{e},q} + \text{max}\left(-F_{\text{e},q},0\right) and \text{max}\left(-F_{\text{w},q},0\right) = -F_{\text{w},q} + \text{max}\left(F_{\text{w},q},0\right), Equation 11 reduces to

\Leftrightarrow\iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q u_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(12)

 = \left[\text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q} + \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q} + \left(F_{\text{e},q} - F_{\text{w},q}\right)\right]u_{\text{P},q}
-\left[\text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q}\right]u_{\text{E},q} - \left[\text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q}\right]u_{\text{W},q}

Identifying the coefficients of neighboring velocities

a_{\text{e},q} = \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q}

 

 

 

 

(13)

a_{\text{w},q} = \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q}

 

 

 

 

(14)

leads to a general form

\Leftrightarrow\iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q u_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \mu_{\text{eff},q} \frac{\Delta u_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(15)

 = \left[a_{\text{e},q} + a_{\text{w},q} + \left(F_{\text{e},q} - F_{\text{w},q}\right)\right]u_{\text{P},q} - a_{\text{e},q}u_{\text{E},q} - a_{\text{w},q}u_{\text{W},q}

Substituting the results of Equation 15 into Equation 7 and continuing with the development

\Rightarrow\left[a_{\text{e},q} + a_{\text{w},q} + \left(F_{\text{e},q} - F_{\text{w},q}\right)\right]u_{\text{P},q} - a_{\text{e},q}u_{\text{E},q} - a_{\text{w},q}u_{\text{W},q}

 

 

 

 

(16)

 = \left[\text{max}\left(\Gamma_{pq},0\right)u_p - \text{max}\left(-\Gamma_{pq},0\right)u_q\right] - \varepsilon \alpha_q V \nabla p + \varepsilon \alpha_q \rho_q V g
- \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C V \left| u_q \right| u_q - K\left(u_q - u_p\right) + S_{\text{mom},q}

At this point, the conservation of mass equation times cell velocity, u_{\text{P},q}, is subtracted from Equation 16

\Rightarrow\left[a_{\text{e},q} + a_{\text{w},q} + \left(F_{\text{e},q} - F_{\text{w},q}\right) - \left(F_{\text{e},q} - F_{\text{w},q}\right)\right]u_{\text{P},q} - a_{\text{e},q}u_{\text{E},q} - a_{\text{w},q}u_{\text{W},q}

 

 

 

 

(17)

 = \left[\text{max}\left(\Gamma_{pq},0\right)u_p - \text{max}\left(-\Gamma_{pq},0\right)u_q\right] - \left(\Gamma_{pq} + S_{\text{mass},q}\right)u_{\text{P},q}
 -\varepsilon \alpha_q V \nabla p + \varepsilon \alpha_q \rho_q V g - \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C V \left| u_q \right| u_q - K\left(u_q - u_p\right) + S_{\text{mom},q}

Splitting the mass source term

\Leftrightarrow\left[a_{\text{e},q} + a_{\text{w},q}\right]u_{\text{P},q} - a_{\text{e},q}u_{\text{E},q} - a_{\text{w},q}u_{\text{W},q}

 

 

 

 

(18)

 = \left[\text{max}\left(\Gamma_{pq},0\right)u_{\text{P},p} - \text{max}\left(-\Gamma_{pq},0\right)u_{\text{P},q}\right]
-\left[\text{max}\left(\Gamma_{pq},0\right) - \text{max}\left(-\Gamma_{pq},0\right) + \text{max}\left(S_{\text{mass},q},0\right) - \text{max}\left(-S_{\text{mass},q},0\right)\right]u_{\text{P},q}
 -\varepsilon \alpha_q V \nabla p + \varepsilon \alpha_q \rho_q V g - \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C V \left| u_q \right| u_q - K\left(u_q - u_p\right) + S_{\text{mom},q}


\Leftrightarrow\left[a_{\text{e},q} + a_{\text{w},q} + \text{max}\left(\Gamma_{pq},0\right) + \text{max}\left(S_{\text{mass},q},0\right) + \text{max}\left(-\Gamma_{pq},0\right)\right]u_{\text{P},q} - a_{\text{e},q}u_{\text{E},q} - a_{\text{w},q}u_{\text{W},q}

 

 

 

 

(19)

 = \left[\text{max}\left(-\Gamma_{pq},0\right) + \text{max}\left(-S_{\text{mass},q},0\right)\right]u_q + \text{max}\left(\Gamma_{pq},0\right)u_p
 -\varepsilon \alpha_q V \nabla p + \varepsilon \alpha_q \rho_q V g - \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C V \left| u_q \right| u_q - K\left(u_q - u_p\right) + S_{\text{mom},q}

Since the right-hand side contains only references to the central cell, subscripts P have been dropped from right-hand side to simplify the notation. Note that the diagonal element of the coefficient matrix contains the split terms, \text{max}\left(\Gamma_{pq},0\right) + \text{max}\left(S_{\text{mass},q},0\right), resulting from the subtraction of the mass equation times cell velocity, while the counterparts, \left[\text{max}\left(-\Gamma_{pq},0\right) + \text{max}\left(-S_{\text{mass},q},0\right)\right]u_q, remain on the right-hand side. These are not considered as momentum source terms, as such, since they are only artifacts of the derivation procedure.

Finally, denoting the central coefficient by  a_P = a_{\text{e},q} + a_{\text{w},q} + \text{max}\left(\Gamma_{pq},0\right) + \text{max}\left(S_{\text{mass},q},0\right) + \text{max}\left(-\Gamma_{pq},0\right) and casting Equation 19 into a vector form (over the phases) the final form, in which the equations are actually solved, is obtained. For simplicity’s sake, the equation is written only for the first 3 cells (c1, c2 and c3).



\begin{bmatrix}
a_{\text{P,c1},1} + K_{\text{c1}} &            -K_{\text{c1}}         &          -a_{\text{e,c1},1}       &                   0               &                \cdots             &                   0               \\
          -K_{\text{c1}}          & a_{\text{P,c1},2} + K_{\text{c1}} &                   0               &          -a_{\text{e,c1},2}       &                \ddots             &                \vdots             \\
         -a_{\text{w,c2},1}       &                   0               & a_{\text{P,c2},1} + K_{\text{c2}} &            -K_{\text{c2}}         &          -a_{\text{e,c2},1}       &                   0               \\
                  0               &            -a_{\text{w,c2},2}     &            -K_{\text{c2}}         & a_{\text{P,c2},2} + K_{\text{c2}} &                   0               &          -a_{\text{e,c2},2}       \\
               \vdots             &                \ddots             &          -a_{\text{w,c3},1}       &                   0               & a_{\text{P,c3},1} + K_{\text{c3}} &            -K_{\text{c3}}         \\
                  0               &                \cdots             &                   0               &          -a_{\text{w,c3},2}       &             -K_{\text{c3}}        & a_{\text{P,c3},2} + K_{\text{c3}}      
\end{bmatrix}
\begin{pmatrix}
u_{\text{c1,1}}\\
u_{\text{c1,2}}\\
u_{\text{c2,1}}\\
u_{\text{c2,2}}\\
u_{\text{c3,1}}\\
u_{\text{c3,2}}
\end{pmatrix}
=
\begin{pmatrix}
S_{\text{mom,c1,1}}\\
S_{\text{mom,c1,2}}\\
S_{\text{mom,c2,1}}\\
S_{\text{mom,c2,2}}\\
S_{\text{mom,c3,1}}\\
S_{\text{mom,c3,2}}
\end{pmatrix}

 

 

 

 

(20)


where:

S_{\text{mom},\text{c1},q} = \Big\{\big[\text{max}\left(-\Gamma_{pq},0\right) + \text{max}\left(-S_{\text{mass},q},0\right)\big]u_q + \text{max}\left(\Gamma_{pq},0\right)u_p
- \varepsilon \alpha_q V \nabla p + \varepsilon \alpha_q \rho_q V g - \tfrac{1}{2} \varepsilon^3 \alpha_q \rho_q C V \left| u_q \right| u_q - K\left(u_q - u_p\right) + S_{\text{mom},q}\Big\}_{\text{c1}}

and

 \alpha_q volume fraction of phase q [-],
 \gamma_{pq} volumetric mass transfer rate from phase p to q [kg/m3s],
 \Gamma_{pq} mass transfer rate from phase p to q [kg/s],
 \delta x distance between two adjacent cell centers [m],
 \varepsilon porosity, fluid fraction of cell volume [-],
 \mu_{\text{eff},q} effective viscosity of phase q [Ns/m2],
 \rho_q density of phase q [kg/m3],
 A face area [m2],
 C inertial loss coefficient [1/m],
 F face mass flow rate [kg/s],
 g acceleration of gravity [m/s2],
 k volumetric interphase drag coefficient [kg/m3s],
 K interphase drag coefficient [kg/s],
 n face normal pointing out of the cell (1 for east face, -1 for west face),
 p pressure [Pa],
 s_{\text{mass},q} volumetric mass source to phase q [kg/m3s],
 S_{\text{mass},q} mass source to phase q [kg/s],
 s_{\text{mom},q} volumetric momentum source to phase q [N/m3],
 S_{\text{mom},q} momentum source to phase q [N],
 u_q velocity of phase q [m/s],
 V cell volume [m3],
subscript c1 refers to first cell,
subscript c2 refers to second cell,
subscript c3 refers to third cell,
subscript e east face (the face in the negative x-direction),
subscript E east neighbor (the cell in the negative x-direction),
subscript w west face (the face in the positive x-direction),
subscript W west neighbor (the cell in the positive x-direction),
subscript P central cell (the cell for which the equation is written),
subscript q current phase for which the equation is written (1 = primary, 2 = secondary),
subscript p the other phase (p = 2 for q = 1 and p = 1 for q = 2),
subscript pq indicates exchange between phases (e.g.  \Gamma_{pq} mass transfer from phase p to q).

Conservation of Total Enthalpy

Figure 3: Conservation of total enthalpy for an interior cell

Conservation of total enthalpy (of phase q) can be written as

\frac{\partial \left(\varepsilon \alpha_q \rho_q h_{0,q}\right)}{\partial t} + \nabla\cdot\left(\varepsilon \alpha_q \rho_q h_{0,q} u_q\right)

 

 

 

 

(21)

= \nabla\cdot\left(\varepsilon \alpha_q \lambda_{\text{eff},q} \nabla T_q \right) + \left[\text{max}\left(\gamma_{pq},0\right) h_{0,\text{cre}} - \text{max}\left(-\gamma_{pq},0\right) h_{0,\text{des}}\right]
- \nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \varepsilon \alpha_q \frac{\partial p}{\partial t} + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q}

Disregarding the transient terms and moving the diffusion term to the left-hand side leads to

\Rightarrow\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_{0,q} u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \lambda_{\text{eff},q} \nabla T_q \right)

 

 

 

 

(22)

= \left[\text{max}\left(\gamma_{pq},0\right) h_{0,\text{cre}} - \text{max}\left(-\gamma_{pq},0\right) h_{0,\text{des}}\right] - \nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q}

Total enthalpy is defined as the sum of specific enthalpy, kinetic energy and potential energy

h_0 = h + \tfrac{1}{2} \left| u_q \right|^2 - \mathbf{g} \cdot \mathbf{r}

 

 

 

 

(23)

where \mathbf{g} \cdot \mathbf{r} is the dot product of gravity vector, \mathbf{g}, and location vector, \mathbf{r}, a vector pointing from the reference level to the evaluated location. The total enthalpies related to phase change can be defined as


\begin{align}
& h_{0,\text{cre}} = h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\\
& h_{0,\text{des}} = h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}
\end{align}

 

 

 

 

(24)

In other words, when mass is transferred to phase q (“created”), it brings with it the saturation enthalpy of phase q, h_{\text{P,sat,}q}, and the kinetic energy of phase p, \tfrac{1}{2} \left| u_p \right|^2_{\text{P}}. When mass is transferred from phase q (“destroyed”), it leaves with the enthalpy and kinetic energy of phase q, h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}}. It is chosen that the potential energy associated with phase change is evaluated at the center of the cell, \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}.

Substituting Equation 23 and Equation 24 to Equation 22 and rearranging terms

\Rightarrow\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \lambda_{\text{eff},q} \nabla T_q \right)

 

 

 

 

(25)

= \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}
\right)\right]
 -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q}

At this point, an approximation is introduced: the diffusion term is expressed relative to the gradient of enthalpy, instead of temperature, as follows. This approximation is considered to be sufficiently accurate for small enthalpy differences.

\Rightarrow\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \nabla h_q \right)

 

 

 

 

(26)

= \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]
 -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q}

Equation 26 is discretized for an interior cell, shown in Figure 3, by volume integration over cell P.

\Leftrightarrow \iiint\limits_V \left[\nabla\cdot\left(\varepsilon \alpha_q \rho_q h_q u_q\right) - \nabla\cdot\left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \nabla h_q \right)\right]\, dV

 

 

 

 

(27)

= \iiint\limits_V \Big\{  \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]
 -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q} \Big\}\, dV

As with the conservation of mass and momentum above, the divergence terms on the left-hand side of the equation are transformed into surface integrals over the cell faces using the divergence theorem.

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(28)

= \iiint\limits_V \Big\{  \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]
 -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q} \Big\}\, dV

Developing the left-hand side first.

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(29)

 = \left(\varepsilon \alpha_q \rho_q h_q u_q A\right)_{\text{e}} - \left(\varepsilon \alpha_q \rho_q h_q u_q A\right)_{\text{w}} - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x} A\right)_{\text{e}} + \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x} A\right)_{\text{w}}
 = F_{\text{e},q} h_{\text{e},q} + F_{\text{w},q} h_{\text{w},q} - \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} \left(h_{\text{E},q} - h_{\text{P},q}\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} \left(h_{\text{P},q} - h_{\text{W},q}\right)

Adopting upwind discretization for the enthalpy fluxes on the cell faces


\begin{align}
& F_{\text{e},q} h_{\text{e},q} = \text{max}\left(F_{\text{e},q},0\right) h_{\text{P},q} - \text{max}\left(-F_{\text{e},q},0\right) h_{\text{E},q}\\
& F_{\text{w},q} h_{\text{w},q} = \text{max}\left(F_{\text{w},q},0\right) h_{\text{W},q} - \text{max}\left(-F_{\text{w},q},0\right) h_{\text{P},q}
\end{align}

 

 

 

 

(30)

and rearranging terms

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(31)

 = \left[ \text{max}\left(F_{\text{e},q},0\right) + \text{max}\left(-F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} \right] h_{\text{P},q}
 - \left[ \text{max}\left(-F_{\text{e},q},0\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} \right] h_{\text{E},q} - \left[ \text{max}\left(F_{\text{w},q},0\right) + \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} \right] h_{\text{W},q}


Denoting \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{e}} = D_{\text{e},q} and \left(\varepsilon \alpha_q A \frac{\lambda_{\text{eff},q}}{c_{p,q}\delta x}\right)_{\text{w}} = D_{\text{w},q} and modifying the central coefficient slightly, since \text{max}\left(F_{\text{e},q},0\right) = F_{\text{e},q} + \text{max}\left(-F_{\text{e},q},0\right) and \text{max}\left(-F_{\text{w},q},0\right) = -F_{\text{w},q} + \text{max}\left(F_{\text{w},q},0\right), Equation 31 reduces to

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(32)

 = \left[ \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q} + \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q} + \left( F_{\text{e},q} - F_{\text{w},q} \right) \right] h_{\text{P},q}
 - \left[ \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q} \right] h_{\text{E},q}
- \left[ \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q} \right] h_{\text{W},q}


Identifying the coefficients of neighboring velocities as


\begin{align}
& a_{\text{e},q} = \text{max}\left(-F_{\text{e},q},0\right) + D_{\text{e},q}\\
& a_{\text{w},q} = \text{max}\left(F_{\text{w},q},0\right) + D_{\text{w},q}
\end{align}

 

 

 

 

(33)

leads to a general form

\Leftrightarrow \iint\limits_{A}\!\!\!\!\!\!\!\!\!\!\!\subset\!\supset \left[\left(\varepsilon \alpha_q \rho_q h_q u_q\right)\cdot n - \left(\varepsilon \alpha_q \frac{\lambda_{\text{eff},q}}{c_{p,q}} \frac{\Delta h_q}{\delta x}\right)\cdot n\right]\, dA

 

 

 

 

(34)

 = \left[ a_{\text{e},q} + a_{\text{w},q} + \left( F_{\text{e},q} - F_{\text{w},q} \right) \right] h_{\text{P},q} - a_{\text{e},q} h_{\text{E},q} - a_{\text{w},q} h_{\text{W},q}

Substituting the results of Equation 34 into Equation 28 and continuing with the development

\Rightarrow \left[ a_{\text{e},q} + a_{\text{w},q} + \left( F_{\text{e},q} - F_{\text{w},q} \right) \right] h_{\text{P},q} - a_{\text{e},q} h_{\text{E},q} - a_{\text{w},q} h_{\text{W},q}\, dA

 

 

 

 

(36)

= \iiint\limits_V \Big\{  \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]
 -\nabla\cdot\left(\tfrac{1}{2}\varepsilon \alpha_q \rho_q \left| u_q \right|^2 u_q\right)
+\nabla\cdot\left(\varepsilon \alpha_q \rho_q \left( \mathbf{g} \cdot \mathbf{r} \right)u_q\right)
-\nabla\cdot\left(\varepsilon \alpha_q \mathbf{q} \right) + \nabla\cdot\left(\varepsilon \alpha_q \boldsymbol{\tau} \cdot \mathbf{u}_q  \right) + s_{h,q} \Big\}\, dV

Integrating the right-hand side term by term. The phase change term reduces to

\iiint\limits_V \left[\text{max}\left(\gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right] dV

 

 

 

 

(36)

= \left[\text{max}\left(\Gamma_{pq},0\right) \left(h_{\text{P,sat,}q} + \tfrac{1}{2} \left| u_p \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right) - \text{max}\left(-\Gamma_{pq},0\right) \left(h_{\text{P,}q} + \tfrac{1}{2} \left| u_q \right|^2_{\text{P}} - \left(\mathbf{g} \cdot \mathbf{r}\right)_{\text{P}}\right)\right]