dfnWorks icon indicating copy to clipboard operation
dfnWorks copied to clipboard

dfnGen fails with user defined fractures

Open DaveHealy-github opened this issue 2 years ago • 8 comments

When I run dfnGen with a custom Python script containing say 700 fractures, the code blows up in the Python module hydraulic_properties.py, with a list index exception. The error reads:


Traceback (most recent call last): File "/home/daveh/dfnWorks/FracPaQpy/FracPaQpyDFN.py", line 787, in DFN.create_network() File "/home/daveh/anaconda3/lib/python3.10/site-packages/pydfnworks/dfnGen/generation/generator.py", line 141, in create_network self.assign_hydraulic_properties() File "/home/daveh/anaconda3/lib/python3.10/site-packages/pydfnworks/dfnGen/generation/generator.py", line 416, in assign_hydraulic_properties self.set_fracture_hydraulic_values(hy_prop_type, [fracture_num], File "/home/daveh/anaconda3/lib/python3.10/site-packages/pydfnworks/dfnGen/generation/hydraulic_properties.py", line 545, in set_fracture_hydraulic_values self.aperture[fracture_list - 1] = b IndexError: index 749 is out of bounds for axis 0 with size 749


An example of one of my scripts is attached below (with .py changed to .txt) I think the problem lies with the tracking of how many fractures to assign apertures (or other values) to; in this case, I had 765 original fractures, but only 749 after isolated ones were removed. The loop in the above code is defined on the range provided by the length of user_rect_params (i.e., 765 in this case), but the aperture list on the DFN object is sized to the reduced fracture set (749 in this case). fracpaqpyDFN.txt

DaveHealy-github avatar Jul 11 '23 13:07 DaveHealy-github

@aidanstansberry Can you take a look?

hymanjd avatar Jul 11 '23 15:07 hymanjd

There is a straightforward workaround on your end while we work on a fix on our end. If the user fracture is rejected during network generation, we have already stored the hydraulic property value in an array hence the error message. You can comment out any rejected fractures in your input and that should alleviate the error.

Look for lines like this in the output and comment out the corresponding user fractures

Rejected user defined rectangular fracture 695 rejectCode = -6: Fracture too close to another fracture's edge.

aidanstansberry avatar Jul 11 '23 21:07 aidanstansberry

Ace, I'll give that a try. Thanks.

DaveHealy-github avatar Jul 12 '23 08:07 DaveHealy-github

Sadly, that didn't work. I commented out the ones being Rejected and that gets me n=749. But then the workflow removes Isolated fractures down to n=666 - and they are not specifically listed on the console. It is this discrepancy (n=749 versus n=666) that is causing the index error, I think.

DaveHealy-github avatar Jul 12 '23 10:07 DaveHealy-github

It looks like the same issue occurs when we remove isolated fractures from the domain. If you just want to visualize the DFN add these flags to the script

DFN.params['keepIsolatedFractures']['value'] = True DFN.params['visualizationMode']['value'] = True

Hopefully this helps.

aidanstansberry avatar Jul 12 '23 15:07 aidanstansberry

Thanks again - and yes, that works! That will enable me to move forwards for a while.

DaveHealy-github avatar Jul 12 '23 15:07 DaveHealy-github

Just thinking, it would be v useful to get the rejected fractures from dfnGen listed in a file. I can then script something to comment these out in the next run... Thanks, Dave

DaveHealy-github avatar Jul 13 '23 12:07 DaveHealy-github

We will talk about how to do this and let you know when we have a fix. Thanks for the patience and suggestions

hymanjd avatar Jul 13 '23 16:07 hymanjd