Modifying the adaptive timestep

37 views
Skip to first unread message

Bastien Bodin

unread,
Mar 29, 2022, 12:41:00 PM3/29/22
to pysph-users
Hi everyone,

I'm implementing a SPH application with a thermal dependance.
Therefore would like to know if it is possible to implement another criterion for the adaptive timestep. It would depend on a user-defined fluid property. This property (Temp) is added with the method fluid.add_property(Temp).

I saw that there is the method "compute_timestep(self, dt, cfl)" from the Integrator class, but is it possible to adapt it ?

Thank you for your time.

Bastien BODIN

Navaneet Villodi

unread,
Apr 1, 2022, 10:24:49 AM4/1/22
to pysph-users
If it is very specific to your application, instead of modifying `pysph.sph.integrator.compute_time_step` you could just add another particle property  `dt_adapt`. Then, you could subclass `pysph.sph.equation.Equation` to implement your criterion and set the property `dt_adapt`. 

ICYMI, it is detailed in docs
You may also have a look at this as an example.

Cheers
Navaneet
Reply all
Reply to author
Forward
0 new messages