|
FlexELA
|
Provides the core functionality to run ELA. More...
#include <ELA.h>Go to the source code of this file.
Functions | |
| void | ELA_SolverSaveDilation (const double *c) |
| Setup the vector dilation term ([Gaylo2022], Eq. 26) | |
| void | ELA_SolverClearDilation () |
| Cleanup after ELA_SolverClearDilation() | |
| void | ELA_SolverDilateLabels (const double *u_div) |
| Apply the vector dilation term from [Gaylo2022], Eq. 22. | |
| void | ELA_SolverNormalizeLabel (const double *f) |
| Cleanup machine precision related errors, including [Gaylo2022], Eq. 47. | |
| void | ELA_SolverFilterLabels (const double &tol, const double *f) |
| Apply the filter from [Gaylo2022], Eq. 30. | |
| void | ELA_SolverAdvectLabels (const int &d, const double *flux, const double *delta) |
| Apply the convection terms from [Gaylo2022], Eq. 22. | |
Provides the core functionality to run ELA.
The descriptions below describe operations on a single vector source fraction feild. When there are multiple ELA instances (set by nn in ELA_Init()), one call to the following functions performs the operation on all instances
| void ELA_SolverAdvectLabels | ( | const int & | d, |
| const double * | flux, | ||
| const double * | delta | ||
| ) |
Apply the convection terms from [Gaylo2022], Eq. 22.
This term is called each step \( d \) of an operator split advection scheme, and performs
\[ \mathbf{s} \gets \mathbf{s} + \frac{1}{\Delta x_d} \left[ \left(\Delta t \mathbf{F}\right)_{d+1/2} - \left(\Delta t \mathbf{F}\right)_{d-1/2} \right] \]
where the vector flux terms are found by upwinding:
\[ \left(\Delta t \mathbf{F}\right)_{d+1/2} = \left(\Delta t F\right)_{d+1/2} \times \begin{cases} \hat{\mathbf{s}}_{d+1} & \text{if} \quad \left(\Delta t F\right)_{d+1/2} > 0 \\ \hat{\mathbf{s}}_{d} & \text{if} \quad \left(\Delta t F\right)_{d+1/2} < 0 \end{cases} \]
with
\[ \hat{s}_l = \frac{s_l}{\sum_i s_i}. \]
It is assumed that the feild flux is such that the value at (i, j, k) defines the flux on the positive face. This routine requires that the flux on all faces is provided. This requires one layer of padding cells on the negative face of the domain to be defined.
| d | The flux direction, 0, 1, or 2 |
| flux | The scalar flux scaled by the timestep, \( \Delta t F \). NOTE: \( F > 0 \) corresponds to volume moving from the cell \( d+1 \) to the cell \( d \), which is typically a negative velocity. |
| delta | The size of the cell in direction d, \( \Delta x_d \) |
d should be 1, 2, or 3 | void ELA_SolverClearDilation | ( | ) |
Cleanup after ELA_SolverClearDilation()
This routine is called at the end of an operator-split advection when \( \tilde{\mathbf{c}} \) from ELA_SolverClearDilation() is no longer needed.
| void ELA_SolverDilateLabels | ( | const double * | u_div | ) |
Apply the vector dilation term from [Gaylo2022], Eq. 22.
This term is called each step \( d \) of an operator split advection scheme, and performs
\[ \mathbf{s} \gets \mathbf{s} + \tilde{\mathbf{c}} \left(\Delta t \frac{\partial u_d}{\partial x_d} \right) \]
| u_div | The velocity divergence, scaled by the timestep, \( \Delta t \frac{\partial u_d}{\partial x_d}\) |
| void ELA_SolverFilterLabels | ( | const double & | tol, |
| const double * | f | ||
| ) |
Apply the filter from [Gaylo2022], Eq. 30.
This applies a filter to keep ELA consistent with filtered VOF ([Gaylo2022], Eq. 29):
\[ \mathbf{s} \gets \begin{cases} \hat{\mathbf{s}} & \text{if} \quad f<\epsilon \\ \mathbf{0} & \text{if} \quad 1-f<\epsilon \\ \mathbf{s} & \text{otherwise} \end{cases}, \]
where the normalized vector source fraction is computed
\[ \hat{s}_l = \frac{s_l}{\sum_i s_i}. \]
| tol | The tolerance \( \epsilon \). |
| f | The volume fraction \( f \). |
| void ELA_SolverNormalizeLabel | ( | const double * | f | ) |
Cleanup machine precision related errors, including [Gaylo2022], Eq. 47.
This function does two cleanup operations. First, it sets any \(s_l\le\varepsilon (1-f)\) to \(s_l=0\), where \( \varepsilon \) is machine precision. Second, it performs the normalization ([Gaylo2022], Eq. 47):
\[ \mathbf{s} \gets (1-f) \; \hat{\mathbf{s}}, \]
where the normalized vector source fraction is computed
\[ \hat{s}_l = \frac{s_l}{\sum_i s_i}. \]
| f | The volume fraction \( f \). |
| void ELA_SolverSaveDilation | ( | const double * | c | ) |
Setup the vector dilation term ([Gaylo2022], Eq. 26)
This routine is called at the start of an operator-split advection, when the internal vector source fraction is \(\mathbf{s}^{(0)}\). The vector dilation term \(\tilde{\mathbf{c}}\) is calculated
\[ \tilde{\mathbf{c}} \gets (1-\tilde{c}) \; \hat{\mathbf{s}}, \]
and stored internally, where the normalized vector source fraction is computed
\[ \hat{s}_l = \frac{s_l}{\sum_i s_i}. \]
| c | The scalar dilation term \(\tilde{c}\) |