Hi all,(adsbygoogle = window.adsbygoogle || []).push({});

I've written a simulation of water flow in two dimensions in F90 but I'm having some trouble with it. Water flows from one cell to another using an equation for rate of change of depth and an algorithm for assigning flow direction.

The flow direction bit is fine but the dD/dt equation is giving me some trouble. I've tried an Euler forward method of integrating this equation through time but more water wants to move than is in the cell and I have to use a very fine time-step to allow the water to get where it wants to go, which is computationally expensive. A colleague suggested I adopt an implicit integrator as this will allow the hydraulic head (which depth is linked with) to reduce gradually, and presumably slow down the flow.

I've tried using two subroutines I found online; bsstep.f and ode.f but I can't manage to get either to work successfully. One of the problems is that the r.h.s includes values that need to be passed through from the main program. Also they talk about a system of ODEs but as far as I'm aware I only have 1. I'm not the best at maths sadly...

Does anybody have any ideas about simple ODE integrators, for one equation only, that aren't to difficult/complicated to use?

Thanks in advance...

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Integrate single ODE in F90

Loading...

Similar Threads - Integrate single | Date |
---|---|

Programming succesive trapezoidal integrator | Mar 16, 2018 |

Python Numerical integration 'quad' error | Jan 29, 2018 |

Numerical Integration with variable limits MATLAB | Jan 15, 2018 |

Python Integrating to Infinity Numerically | Sep 14, 2017 |

Fortran77 woes- single parameter least squares minimisation stuck! | Jan 26, 2014 |

**Physics Forums - The Fusion of Science and Community**