mbakker7 / timml

An analytic element model for steady multi-layer flow
MIT License
38 stars 21 forks source link

HeadLineSinkString & LineSinkDitchString: parameters are not communicated to members of lslist #85

Closed Huite closed 1 year ago

Huite commented 1 year ago

This may be an XY problem, so let me state my end goal first: I'm trying to collect the discharge for every line sink in a line sink string.

The current HeadLineSinkString has a discharge method, which returns a n_layer sized array. This is a reasonable default, since you'd expect the same for a well, so it fits with e.g. a well and is good polymorphism.

However, I'd also like to get the discharge per individual linesink. I kinda expected this should work:

discharges = [linesink.discharge() for linesink in linesinkstring.lslist]

However, it returns exclusively zeros, because every individual linesink returns 0.0 for its parameter values. The parameter values are correctly stored in the linesinkstring. Every linesink does know the nparam correctly, it's just not "filled in".

This can be worked around but it's a bit tedious, since every linesink contains multiple parameters and corresponding dischargeinf() values. These cannot be easily interpreter either, because I can only easily access the start and end vertices (x1, y1; x2, y2).

I could also argue that having a discharge_per_linesink (or something) would be a nice utility.

dbrakenhoff commented 1 year ago

I'd vote for both solutions, add a discharge_per_linesink method, and setting the parameters in the individual linesink objects so your snippet would also work. I can take a look tomorrow.

Huite commented 1 year ago

Closed by #86