All Functions with Hard-coded Discretizations
Heat and Mass Transfer Equations
solve_T- Using 2nd order central differences, with linear extrapolation for ghost fluid cells across the level set interface.
- Manually constructs sparse matrix, then solves it.
- Uses a 2nd-order discretization with linear extrapolation as defined in (Gibou and Fedkiw, 2005), section 2
- All the possible stencils for this discretization were generated in a Jupyter notebook, visible in this code's GitHub repo at
/docs/gfm_extrap.ipynb. If links don't break, that can be viewed online here.
solve_p- Since the mass conductivity in the equation for $p$ may itself depend on $p$, this function guesses values of $b$, solves for $p$, then iterates a few more times.
solve_p_given_b- This does the actual linear solve for
solve_p. Likesolve_T, it uses a 2nd-order discretization as in (Gibou and Fedkiw, 2005), section 2. This becomes slightly more complicated though because the mass conductivity $b$ is not spatially constant. - All the possible stencils for this discretization were generated in a Jupyter notebook, visible in this code's GitHub repo at
/docs/gfm_extrap_vark.ipynb. If links don't break, that can be viewed online here.
- This does the actual linear solve for
Velocity Calculations
compute_frontvel_heat- Computes heat flux on Stefan interface
- Uses 2nd-order finite difference with quadratic ghost cell extrapolation across Stefan interface to compute heat flux
- Adapted from techniques explained in (Gibou and Fedkiw, 2005)
- Generates a velocity field for level set advection, defined only on dry-layer side of interface; follow with
extrap_v_fastmarchto extrapolate throughout domain
compute_frontvel_mass- Computes heat flux on Stefan interface
- Uses 2nd-order finite difference with quadratic ghost cell extrapolation across Stefan interface to compute heat flux
- Adapted from techniques explained in (Gibou and Fedkiw, 2005)
- Generates a velocity field for level set advection, defined only on dry-layer side of interface; follow with
extrap_v_fastmarchto extrapolate throughout domain
compute_frontvel_fixedspeed- Used for generating arbitrary velocity fields–meant only for debugging
- Intended for use with velocity extrapolation; not currently implemented anywhere.
- 1st order finite difference from interface cell into dried domain
Velocity Extrapolation
extrap_v_fastmarch!- Uses 2nd-order upwind differences (towards the interface) in a fast-marching technique (which makes a single pass over all grid cells in sorted order) to extrapolate velocity away from the interface.
- Follows (Sethian, 1999), section 5.1
Reinitialization
reinitialize_ϕ_HCR!- Reinitializes using a by-hand Explicit Euler in time and WENO in space, as described in (Hartmann et al., 2010)
WENO Derivatives
wenodiffs_local- Evaluates a single WENO derivative
- Implemented as described in (Hartmann et al., 2009),
dϕdx_all_WENO- Used in
𝒢_wenoand thereforereinitialize_ϕ_HCR! - Also used in all velocity computation functions
- Used in
𝒢_weno, wrapped by𝒢_weno_all- Used in
reinitialize_ϕ_HCR! - Godunov's scheme for the norm of gradient, using WENO derivatives
- Used in