ArtesiaWater / UGW

Python scripts voor oppervlaktewater-component Utrechts GrondWater model (UGW)
4 stars 0 forks source link

Crash op watertypen die niet binnen modelextent vallen #4

Open valdemetriades opened 2 years ago

valdemetriades commented 2 years ago

Opbouw van een deelmodel gaat niet altijd goed: alle watertypen moeten binnen de model extent vallen, anders krijg je een foutmelding.

dbrakenhoff commented 2 years ago

Kan je de foutmelding hier posten? Zou helpen om te weten waar het script vastloopt.

dbrakenhoff commented 2 years ago

Fixed something for a small extent when no bathymetry is present in extent. Was that the issue?

See f3b4f81fc37e87c75b7648751b4991f910787ecf

JJansen-rhdhv commented 2 years ago

There is also an error when using a small extent when there is bathymetry info available. For instance for the extent: extent = [134200, 137600, 469800, 473000.] # Kortenhoef (also tested for larger area with batymetry)

In surface_water.waterinfo_to_ghb(....) --> No large surface water in extent?

Error(s):

Building DRN spd: 100%|███████████████████████████████████████████████████████████████| 49/49 [00:00<00:00, 320.25it/s] Traceback (most recent call last): File "01_create_model_local_kortenhoef.py", line 638, in intersect_method="vertex") File "..\nhflopy\surface_water.py", line 732, in waterinfo_to_ghb ghb = flopy.mf6.ModflowGwfghb(gwf, stress_period_data=spd, save_flows=True) File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\modflow\mfgwfghb.py", line 376, in init "stress_period_data", stress_period_data File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\mfpackage.py", line 1904, in build_mfdata dataset_struct, data, var_path File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\mfpackage.py", line 555, in add_dataset self._container_package, File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\mfpackage.py", line 464, in data_factory trans_list.set_data(data, key=0, autofill=True) File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\data\mfdatalist.py", line 1500, in set_data list_item, autofill=autofill File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\data\mfdatalist.py", line 506, in set_data self._set_data(data, autofill) File "C:\Users\902829\Miniconda3\envs\UGWtest\lib\site-packages\flopy\mf6\data\mfdatalist.py", line 370, in _set_data if isinstance(data_check[0], np.record) or ( IndexError: list index out of range

dbrakenhoff commented 2 years ago

Can you check if this change solves the isssue? 11259539a4cbed5d2c1c155398421612225874c5

I added a check whether there is any large surface water present, if so, then it creates the GHB file, otherwise it continues the script.

JJansen-rhdhv commented 2 years ago

Seems to work now. But crashes on the plotting part. Commenting out the line were the GHB boundary condition is plotted solves this for now.

dbrakenhoff commented 2 years ago

Hopefully also fixed with latest commit c9c5193798b85780e03d8502f9969cd2d14c3d23