Using integrator time derivative for implementing residual viscosity with DiffEq.jl

Hello all,

I have been trying to implement a concept known as residual viscosity to stabilize a fluid simulation inside of DiffEq.jl.

In general, I would need access to the derivative of the integrator in order to do this. I know there is a way to access the value after the fact, such as with the SciMLBase.get_du function, however I need the derivative value inside the hot loop for my du function. I currently have tried a very hacky way of doing this where I save previous timesteps in cache variables and then calculate what the derivative is via the previous timesteps and a BDF4 formula. Just thought I would post here since I am not sure of what I could try as far as just directly accessing the integrator. To elaborate, I am using the problem interface in DiffEq.jl.


This isn’t an ODE, it’s a DDE.

1 Like

Ah I see. Looking at the DDE interface, it looks like exactly what I need. Thanks again.