Loop3D / LoopStructural

LoopStructural is an open-source 3D structural geological modelling library.
MIT License
178 stars 35 forks source link

Fault surface doesnt produce any displacement[BUG] #83

Closed mustaeenqazi closed 2 years ago

mustaeenqazi commented 2 years ago

Hi,

i Generated a model which has some surfaces of geological layers/formations and some faults. The faults in the model do not show any displacement.

The fault surfaces are generated using : model.create_and_add_fault()

An image of the model: RBF+PLI_Loopstructural

lachlangrose commented 2 years ago

Hi, without seeing the input data or model parameters its difficult to say why it is not working. I think my first guess is that the displacement magnitude is too small for the model size. LoopStructural does not estimate the displacement magnitude within the interpolation like geomodeller or gempy. The caveats of that approach are shown in the LoopStructural paper. LoopStructural needs the displacement magnitude and direction (fault kinematics) to integrate these into the model.

If you can share the model python script or the dataset I'll try and take a look.

mustaeenqazi commented 2 years ago

Hi , Thank you very much, here is my complete code of the model and parameters, i used fault displacement value of 500:

model_code model_code2 model_code3 model_code4

lachlangrose commented 2 years ago

Hi, Can you include the model extent please and could you make a minimal working example that I can run to see the bug. It is difficult to find a bug without knowing the input parameters.

mustaeenqazi commented 2 years ago

Hi, Here is a the link to a working example of my jupyter notebook: https://github.com/mustaeenqazi/Structural-geological-models-for-machine-learning/blob/main/perthbasin_model_from_gempy_data-PLI-creating_fault_surface_with_PLI-Copy1.ipynb

and here is the data which i used for the model : https://github.com/mustaeenqazi/Structural-geological-models-for-machine-learning/blob/main/perthbasin.xlsx

Thanks you.

lachlangrose commented 2 years ago

Hi @mustaeenqazi,

I had a look at your notebook. It looks like you haven't included any data to constrain the fault slip direction. LoopStructural uses the kinematics of the fault (slip direction * displacement) to add the fault into the implicit representation. A fault is represented using a structural frame where there are three coordinates representing the fault surface, fault slip direction and the fault extent. If you add an additional column in your data frame coord you can use 0,1,2 to specify the structural frame coordinate. Alternatively, you can specify the fault volume dimensions major_axis, minor_axis and intermediate_axis and the fault_slip_vector to define the geometry of the fault.

I also noticed you are adding a lot of foliations to the model, unless they are unconformable it is better to use a single geological feature and use different values to differentiate between them. You can calculate the value by using the cumulative thickness, where the thickness is your estimate of the stratigraphic thicknesses.

I hope this helps, sorry about the delay in responding.

mustaeenqazi commented 2 years ago

Hi thank you very much for your reply and help in understanding of loostructural 3D.

I added the column "coord" to my data, in which I used NaN for the formations and gave 0,1,2 values for the faults. I used the same notebook as mentioned in my last comment and i got a "value error" while creating the model. this error is stated as:

ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 2 dimension(s)

the error doesn't occur when i remove the column "coord".

the error states that the problem is in the "model.update()" but if i remove model.update() then the same error occurs when i visualize the created model in the next cell.

the updated data is uploaded here: https://github.com/mustaeenqazi/Errors/blob/main/perthbasin.xlsx

and the updated notebook is here https://github.com/mustaeenqazi/Errors/blob/main/perthbasin_model_from_gempy_data-PLI-creating_fault_surface_with_PLI.ipynb

I want to add that i used the same data (after adding the column "coord") and computed the model using "FDI" instead of PLI. The model is computed in this case, but somehow i cannot visualize the faults in the model. The code for visuaslization gives a warning stated as: "LoopStructural.visualisation.model_visualisation ~ WARNING ~ Isovalue doesn't exist inside bounding box" I used different isovalues but couldn't view the faults in the model. the notebook for this issue is here in the link below:

https://github.com/mustaeenqazi/Errors/blob/main/perthbasin_model_from_gempy_data-PLI-creating_fault_surface_with_FDI.ipynb

mustaeenqazi commented 2 years ago

Hi thanks for your help. I increased the values of the parameters and the faults are visualized now. but unfortunately the fault still doesnt produce any displacement although I used all the parameters used in the "create _and_add_fault()" function.

Example code: code_for_adding_fault

output: no_displacement_in_fault2

Data used: https://github.com/mustaeenqazi/Errors/blob/main/perthbasin_cmu-thickness_as_value-data.xlsx

Working example: https://github.com/mustaeenqazi/Errors/blob/main/perthbasin_model_from_gempy_data-FDI-uncertainity-cumu_thickness_as_value_data.ipynb

lachlangrose commented 2 years ago

Hi,

Looking at your model I think I have found the issues:

  1. The fault_strike_vector needs to represent the slip direction of the fault... so this needs to be a vector representing the fault kinematics... I think the vector 2,3,4 isn't actually the fault slip. In most cases, you don't actually know this so I've added code for LoopStructural to estimate this as the cross product of the normal to the fault surface and the strike component of the fault (e.g. the tangent of the fault normal but with the z component = 0). This is basically assuming pure dip slip. The newest version of LoopStructural doesn't need fault_slip_vector to be specified.

  2. You were providing the observations using the azimuth and dip convention, and renaming the azimuth to strike. Strike is dip_dir+/-90. So if you add 90 degrees to your strike column it should work. Alternatively, just provide the vector components so there is no confusion! This was what was causing the issues because the fault frame was being interpolated incorrectly which meant the displacement direction was parallel to the fault strike.

In the next version of LoopStructural, I will/have added helper functions to calculate the major/minor/intermediate axis for the fault frame as well as estimating the fault slip vector. I have also changed the default behaviour for faults so that the "finite fault" where the fault displacement is represented by a cubic function decaying from the centre of the fault. Previously the displacement was constant on the hanging wall of the fault by default. I'll update it shortly.

Hopefully this works for you.

mustaeenqazi commented 2 years ago

Hi thank you very much for your input and support. I corrected the azimuth data, converted it to strike by adding 90 degrees. What i found is that if i compute faults before computing the stratigraphy, the model does include faults and fault displacement. I also tried the newest verison 1.3.7 but that didnt help much. So this issue has been solved. Another issue is that although the displacement can be seen now but this displacement is not in line with the fault surface, so the fault lies abit away from the fault displacement. for your understanding i attach here an image of my generated model. and also compare it with the same model from another library, Gempy. But i guess this is a topic for another issue/ bugg report as this issue/ bugg is solved. thanks again for your help and support. I appreciate it.

Here are the models which i computed in loop structural: loop loop2

Comparison with the same model in Gempy:

gempy2 gempy3

I will describe the issue in detail in another bug report.

Cheers,

lachlangrose commented 2 years ago

Hi,

Thanks for the follow-up. Here are some ideas:

Happy to keep helping to try and get this model working.

Cheers

lachlangrose commented 2 years ago

Closing because of inactivity