Skip to content

Dealing with WEL IPFs from a project file in open_projectfile_data #1116

Closed
@Huite

Description

@Huite

There are a number of issues with the current implementation of open_projectfile_data:

It loads identical dataframes over and over, because it treats every row of every WEL block separately. This is very inefficient.
Secondly, it doesn't reproduce the behavior of iMOD5 unless very specific conditions are met. For simplicity, I'll categorize the IPFs into two categories: "simple" when it's just a single file with rows of (x, y, rate), and "associated" when it contains references to the external time series (txt) files.

The key part to understand here is that iMOD5 clears all wells whenever it reads a new block. Due to the way that we work, by essentially creating discharge time series of each well first, we can only reproduce it by introducing a zero rate value at the the next stress period. Essentially, whenever we define some input, we could duplicate the stress period data, set its rate value to 0.0, and append it -- I'm not sure this works though, it depends on how the dataframes are combined afterwards.

Anyway, to give some example, a single definition:

0001,(WEL),1
1900-01-01
001,002
 1,2, 001, 1.0, 0.0, -999.9900 ,"simple.ipf"
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"

Here, the values of simple are simply true for the all subsequent stress periods.
For associated, however, iMOD will read the associated text files every stress period and determine the rate value.

0001,(WEL),1
1900-01-01
001,002
 1,2, 001, 1.0, 0.0, -999.9900 ,"simple.ipf"
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"
1900-01-02
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"simple.ipf"

Note: This will turn off the associated wells at the second stress period!
Essentially, there's a duplication of time series data: once in project file, and then again in the associated text files.

Alternatively:

0001,(WEL),1
1900-01-01
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"simple.ipf"
1900-01-02
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"

In this case, associated is only turned on in the second stress period. Unfortunately, for us, this would mean that we would have to cut off any data in the associated files that exists prior to 1900-01-02. I think this is quite undesirable: it forces time selection data into the data loading routines, rather complicating it.

The best solution to deal with this is to disallow the redundant time specification. Ideally, for the WEL, there's only one stress period block, where the associated ipf is given once. Then, all time dependent data is available from the TXT file only. However, due to the setup and history of many project files, they currently tend to repeat the associated ipf every time. So my suggestion is to allow repeated associated ipf files, but they must be present in all stress periods. This creates an unambiguous time series specification.

To illustrate, these would be equivalent and both valid:

0001,(WEL),1
1900-01-01
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"

identical to:

0001,(WEL),1
1900-01-01
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"
1900-01-02
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"
1900-01-03
001,001
 1,2, 001, 1.0, 0.0, -999.9900 ,"associated.ipf"

However, it must be checked that factor and addition values are also equal for all stress periods!

Tasks

@JoerivanEngelen added these tasks

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions