Deltares / imod-python

🐍🧰 Make massive MODFLOW models
https://deltares.github.io/imod-python/
MIT License
16 stars 0 forks source link

Add support for discharge scaling in drainage package #1012

Open Huite opened 2 months ago

Huite commented 2 months ago

Fixes #1011

Still a draft, this adds the drainage discharge scaling depth.

This is a rather pragmatic approach. We're currently only using the auxiliary variables for concentration, which are treated separately. The _auxiliary_data = {"concentration": "species"} cannot be meaningfully used, since this specific scaling_depth does not contain any additional dimensions.

Adding it to period_data ensures that it is written to the data files, but since it's optional, the presences must then be checked in get_period_names.

I think the name "scaling_depth" is relatively clear. "discharge_scaling_depth" is maybe more complete, but is a bit of a mouthful. We don't support auxiliary variables, I'm not sure if it's worth adding general support. Most packages support a multiplication factor auxiliary variable, which we really don't care for.

Huite commented 2 months ago

Something to consider when dealing with the auxiliary arrays: MODFLOW 6 has no info in the .dat/.bin files to see which column is which. Instead, (I'm pretty sure) the meaning of the columns depends on the order of the auxiliary entry in the options block.

This means it's crucial to coordinate the order of the variables when converting to a dictionary of arrays with the auxiliary entry written in the options block. Otherwise you end up with MF6 interpreting the concentration as the factor or vice versa.

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud