astro-turing / Integrating-diagenetic-equations-using-Python

Reactive-transport model simulating formation of limestone-marl alternations
Apache License 2.0
0 stars 1 forks source link

Update Use_solve_ivp_without_py-pde_wrapper branch #33

Closed HannoSpreeuw closed 2 months ago

HannoSpreeuw commented 1 year ago

Discussed in https://github.com/astro-turing/Integrating-diagenetic-equations-using-Python/discussions/26

From this discussion it is clear that this branch should be maintained. One of the most pressing reasons is the need to solve for stiff equations in the perhaps not too distant future. This requires implicit solvers using functional Jacobians, which solve_ivp accommodates for, but only if the py-pde wrapper is not used.

What this means is that the refactoring applied to the main branch should also be applied to the Use_solve_ivp_without_py-pde_wrapper branch. This involves PR #15 and beyond. Abundant use of git's cherry-pick is anticipated.

A constant porosity diffusion coefficient needs to implemented, similar to the main branch, which should be propagated to the functional Jacobian.

An important aspect is that solve_ivp's memory use and performance needs to be investigated and improved if needed.

EmiliaJarochowska commented 2 months ago

I believe we can also close this issue now since the py-pde wrapper can be coaxed into reproducing oscillations?

HannoSpreeuw commented 2 months ago
One of the most pressing reasons is the need to solve for stiff equations in the perhaps not too distant future. 

The py-pde wrapper precludes functional Jacobians, but at this point it seems we can get away with numerically approximated Jacobians for implicit solvers.

A constant porosity diffusion coefficient needs to implemented, similar to the main branch, which should be propagated to the functional Jacobian.

A constant porosity diffusion coefficient has been implemented in the Use_solve_ivp_without_py-pde_wrapper branch, not in its functional Jacobian, but that is not an issue, as long as you don't call the functional Jacobian.

An important aspect is that solve_ivp's memory use and performance needs to be investigated and improved if needed.

This has been tackled.

EmiliaJarochowska commented 2 months ago

I hear a "yes"?

HannoSpreeuw commented 2 months ago

Yes!