# Numerical Calculation of Slosh Dissipation
## 4 Volume-of-Fluid Finite Volume Method: The Elemental Solver
### Mechanical Energy Calculation: Elemental  
The momentum conservation of the fluid system can be written in the inertial reference frame as:  
\[\frac{D}{Dt}(\rho\mathbf{u}_{a})=\mathbf{\
abla}\cdot\mathbf{\tau}+\rho\mathbf{g}+\sigma\kappa \mathbf{\
abla}\alpha \tag{25}\]  
where \(D/Dt\) is the material (Lagrangian) derivative with respect to time, and other variables are as defined previously. Without phase change or chemical mass transport \(D\rho/Dt=0\). This results in:  
\[\frac{D}{Dt}(\rho\mathbf{u}_{a})=\rho\frac{D\mathbf{u}_{a}}{Dt}\,. \tag{26}\]  
The temporal change in kinetic energy results from pre-multiplying (26) with \(\mathbf{u}_{a}\):  
\[\rho\mathbf{u}_{a}\cdot\frac{D\mathbf{u}_{a}}{Dt}=\rho\frac{1}{2}\frac{D|\mathbf{u}_{a}|^{ 2}}{Dt}\,, \tag{27}\]  
where \(|\mathbf{u}_{a}|=\sqrt{\mathbf{u}_{a}^{T}\mathbf{u}_{a}}\). Returning to (26), the right-hand side is expanded  
\[ \begin{array}{rl}\rho\frac{D\mathbf{u}_{a}}{Dt}&=\rho\frac{D(\mathbf{u}+\mathbf{u}_{d}) }{Dt}=\rho\frac{D\mathbf{u}}{Dt}+\rho\mathbf{a}_{d}\\ &=\frac{\partial\rho\mathbf{u}}{\partial t}+\mathbf{\
abla}\cdot(\rho\mathbf{u} \otimes\mathbf{u})+\rho\mathbf{a}_{d}\,.\end{array}  \tag{28}\]  
Equation (25) is now cast in the non-inertial reference frame by assuming that the contribution of \(\lambda\mathbf{\
abla}\cdot\mathbf{u}\) to the gas is negligible as per [38]:  
\[\left[\frac{\partial\rho\mathbf{u}}{\partial t}+\mathbf{\
abla}\cdot(\rho\mathbf{u} \otimes\mathbf{u})+\rho\mathbf{a}_{d}\right]=-\mathbf{\
abla}p+\mathbf{\
abla}\cdot(\mu+\mu_ {t})\Big{(}\mathbf{\
abla}\mathbf{u}+\mathbf{\
abla}\mathbf{u}^{T}\Big{)}+\rho\mathbf{g}+\sigma \kappa\mathbf{\
abla}\alpha\,. \tag{29}\]  
In this work, we compute the mechanical energy in a manner that is consistent with the discretization of the governing equations. This is achieved by pre-multiplying the discretized governing equations at each computational cell \(i\) with \(\mathbf{u}_{a_{i}}\) followed by integration over time:  
\[ \begin{array}{rl}\sum_{i}\int_{0}^{t}\mathbf{u}_{a_{i}}\cdot\int_{V_{i}}\left( \frac{D\rho\mathbf{u}}{Dt}+\rho\mathbf{a}_{d}\right)\mathrm{d}V\,\mathrm{d}t=\\ \sum_{i}\int_{0}^{t}\mathbf{u}_{a_{i}}\cdot\oint_{\partial\Omega_{i}}\left(\mathbf{ \tau}\cdot\mathbf{n}_{\Omega_{i}}\right)\mathrm{d}\Omega\,\mathrm{d}t+\sum_{i} \int_{0}^{t}\mathbf{u}_{a_{i}}\cdot\int_{V_{i}}\rho\mathbf{g}\,\mathrm{d}V\,\mathrm{d} t+\sum_{i}\int_{0}^{t}\mathbf{u}_{a_{i}}\cdot\int_{V_{i}}\sigma\kappa\mathbf{ \
abla}\alpha\,\mathrm{d}V\,\mathrm{d}t\,,\end{array}  \tag{30}\]  
Here, \(\mathbf{u}_{a_{i}}=\frac{1}{V_{i}}\int_{V_{i}}\mathbf{u}_{a}dV\) is the volume averaged absolute velocity and \(\sum_{i}V_{i}=V\). Further, \(\Omega_{i}\) and \(\mathbf{n}_{\Omega_{i}}\) are, respectively, the surface of \(V_{i}\) and outward pointing unit normal. We can proceed to group the terms in (30) into various energy containers. The potential \(E_{P}\) and surface \(E_{\sigma}\) energies are, respectively, given by  
\[E_{P}(t)=\sum_{i}E_{P,i}=-\sum_{i}\int_{0}^{t}\mathbf{u}_{a_{i}}\cdot\int_{V_{i}} \rho\mathsf{g}\,\mathrm{d}V\,\mathrm{d}t\text{ and } \tag{31}\]  
\[E_{\sigma}(t)=\sum_{i}E_{\sigma,i}=-\sum_{i}\int_{0}^{t}\mathbf{u}_{a_{i}}\cdot\int _{V_{i}}\sigma\kappa\mathbf{\
abla}\kappa\,\mathrm{d}V\,\mathrm{d}t\,. \tag{32}\]  
The stress tensor is divided up into internal and external contributions. Internal contributions are inside the tank boundary and include compressive energy \(E_{C}\) (work performed on the fluid through pressure), as well as viscous dissipation \(E_{V}\).