How-to: Convert a ttim model to timflow#

Conversion of a ttim model to a timflow model only requires a few minor changes.

The import statement#

The timflow.transient model is essentially the same as ttim. So all that is required is to change the import statement. For example, if your model imports ttim as

import ttim

and you don’t want to make any other changes to your model, then replace the import statement by

from timflow import transient as ttim

or, if you like that better

import timflow.transient as ttim

If you used a different name in your original model, then make sure to use the same name in the timflow model. So if your import statement was

import ttim as ttm

then replace it by

import timflow.transient as ttm

Note: The docs of timflow use the three-letter abbreviation tft (for timflow transient) for the transient model.

Combining two or more plot statements on the same graph#

All plotting commands in timflow are gathered in the plots submodule. Each plotting command optionally takes an axis as input. If no axis is provided, then a new plot is created. Each plotting command returns the axis to which is plots. When you issue multiple plotting commands in a row, then make sure that the axis created by the first plotting command is passed on to the second plotting command. For more details, see the howto_convert_timml_model.ipynb in the steady documentation.

Renaming of line-sink elements#

The line elements in timflow.transient have been renamed to coincide with the line element names in timflow.steady. The old ones still work, but you will get a deprecation warning. These are the changes:

  • HeadLineSink -> River

  • HeadLineSinkString -> RiverString

  • LineSinkDitch -> Ditch

  • LineSinkDitchString -> DitchString

  • LeakyLineDoublet -> LeakyWall (these can also be impermeable by specifing res="imp" for the resistance)

  • LeakyLineDoubletString -> LeakyWallString