JoshuaLampert / DispersiveShallowWater.jl

Structure-preserving numerical methods for dispersive shallow water models
https://joshualampert.github.io/DispersiveShallowWater.jl/
MIT License
15 stars 3 forks source link

Relaxation for dissipative semidiscretizations #46

Open JoshuaLampert opened 1 year ago

JoshuaLampert commented 1 year ago

To date, the RelaxationCallback only conserves the given quantity. It is also possible to preserve dissipative semidiscretizations via relaxation.

JoshuaLampert commented 1 year ago

Instead of solving

$$ r(\gamma) = J(u_\gamma^{n + 1}) - J(u^n) = 0 $$

for $\gamma$, for explicit Runge-Kutta methods we need to solve

$$ r(\gamma) = J(u\gamma^{n + 1}) - J(u^n) - \gamma\Delta t\sum{i = 1}^sb_iJ^\prime(y_i)\cdot k_i = 0 $$

for $\gamma$. This requires the values $b_i$ from the Butcher tableau (can be obtained from deduce_Butcher_tableau), the stages $k_i$ (obtained from integrator.k) and the definition of entropy_variables returning $J^\prime$ (alternatively, use AD?). The values

$$yi = u^n + \Delta t\sum{j = 1}^sa_{ij}k_j$$

need to be computed again as OrdinaryDiffEq.jl does not save them. Again, $a_{ij}$ are from deduce_Butcher_tableau.

The user could then add a parameter conservation to RelaxationCallback that specifies if the quantity should be conserved or dissipated.