Map 3D Soil Variabilities into STKO soil model

sebi_magi
Posts: 21
Joined: Mon May 30, 2022 5:50 pm

Map 3D Soil Variabilities into STKO soil model

Post by sebi_magi » Thu Jun 02, 2022 1:32 pm

Hello there,

I want to do a 3D Site response analysis in which elastic soil properties vary three dimensionally according to geotechnical and geophysical data retrieved on surveys. I have two questions:

1) Is it possible to generate my 3D Model (i.e G(x,y,z)) and map in onto STKO?, In a webinar (https://www.youtube.com/watch?v=TrHhvJ8L9ao&t, min 15:00 approx) you create a random gaussian soil model and map it into STKO using the Python API, but I have searched in the webinars and you don't elaborate further about this. I want to do something similar, but my data is not random but rather deterministic.

2) If I have varying soil properties for each hexahedron in my model, should I match the lateral absorbing boundaries properties to each hexahedron or this would be an overkill?

If generating the 3D variable model is not possible within STKO, I was thinking in creating the mesh in STKO, and then customize the .tcl script with a Python script and assign different material properties, but this might be cumbersome. Do you have any suggestions?

KInd regards,

Sebastián

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Map 3D Soil Variabilities into STKO soil model

Post by STKO Team » Mon Jun 13, 2022 10:18 am

You can do it quite easily. We just developed a tool for this. But it's not yet documented so I will try to explain it here.

The tool is the RandomizedMaterialWrapper. It is an STKO's wrapper that allows you to select a source nD material, and a text file that represents a Random Material Table. STKO will create modified versions of the source nD material just before running the analysis.

Try to follow these instructions and let us know if something is not clear.
RandomizedMaterial.zip
(70.6 KiB) Downloaded 203 times

In the attached file you will have 2 regions (one for absorbing boundaries, and one for soil elements) and 2 custom scripts required to make the update work correctly. The RandomizedMaterialWrapper only affects the material properties of soil. But the absorbing element should match the corresponding soil elements. This is exactly what those scripts do.
After them, I just put a "record" command to validate the procedure. You can go on with your analysis steps.

Assume you have 9 sample points from geotechnical surveys...
RMAT_1.png
RMAT_1.png (112.27 KiB) Viewed 3816 times

Define a RandomizedMaterialWrapper for soil elements...
RMAT_2.png
RMAT_2.png (29.1 KiB) Viewed 3816 times

Define the Random Material Table file...
RMAT_3.png
RMAT_3.png (33.37 KiB) Viewed 3816 times

This is what the results should look like
RMAT_4.png
RMAT_4.png (79.81 KiB) Viewed 3816 times

sebi_magi
Posts: 21
Joined: Mon May 30, 2022 5:50 pm

Re: Map 3D Soil Variabilities into STKO soil model

Post by sebi_magi » Fri Jun 24, 2022 4:59 am

Hello STKO Team,

Thank you very much for your thorough answer. I took a while in answering because I wanted to wrap-up all my arising questions.

I) Here is a 3D Model (base_3dmodel.scd) I built with the RandomMaterialWrapper, it looks quite nice. As you can see however, the corner absorbing boundaries weren't updated. This is because I couldn't find a way to include them in the Absorbing Boundary selection set with the STKO GUI (If you see the elements.tcl and analysis_steps.tcl, you will notice that the tags of the corner nodes aren't included). I don't know if there is a way to include them with the GUI, but if it's not possible I can do it by scripting or even neglect them.
random_model.png
random_model.png (388.92 KiB) Viewed 3783 times
II) I wanted to know how the randomization is performed. From the geotechnical survey data I have, the 3D Model parameters were interpolated with krigging, so in a way, there is no need to randomize further. Is there a way to set the variance from the RandomMaterialWrapper to zero? Again, if it is not possible, the effect it's perhaps negligible.

III) The soil model I randomized its a parallepiped so the meshing was straightforward. The top of the model however, is a hill with a lot of irregularities, so I'm having trouble in drawing and meshing layered_topography.scd:
topography.png
topography.png (209.18 KiB) Viewed 3783 times
I did the drawing by layers using the Python API and STKO, but it was kind of grueling and prone to errors, and I don't have experience with CAD programs at all. Also, when I try to mesh, even if I have only planar faces, it doesn't create brick elements, what I'm doing is correct or should I find another approach?

Thank you!
Attachments
3DRandomModel.rar
(896.33 KiB) Downloaded 205 times

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Map 3D Soil Variabilities into STKO soil model

Post by STKO Team » Fri Jun 24, 2022 8:59 am

You are right, the script I sent you works for the 2D case.
Here's a more generic script. It's even easier because you don't need to create sets: absorbing and soil elements will be recognized automatically from their class tag from OpenSees.
base_3dmodel.zip
(91.35 KiB) Downloaded 218 times
Regarding your second problem:
It will not mesh it with Hexa elements because you need to build a geometry made of 6-face solids so that it will be suitable for structured meshing.
Then, you also need to make a single geometry otherwise each layer will be detached from the other.
Unfortunately for this kind of model you need to gain a bit of experience with CAD modeling.
You should start by looking at the webinars about geometry modeling from the "get started in opensees with stko" webinars.
Hint:
You should draw smooth countour lines for each level (with splines) and join them with the Loft command. It will create a smooth surface. Then you extrude it to make a solid

sebi_magi
Posts: 21
Joined: Mon May 30, 2022 5:50 pm

Re: Map 3D Soil Variabilities into STKO soil model

Post by sebi_magi » Fri Jun 24, 2022 6:59 pm

This is awesome! Thank you very much.

Now I have to work on the mesh, I will update when I have a result!

sebi_magi
Posts: 21
Joined: Mon May 30, 2022 5:50 pm

Re: Map 3D Soil Variabilities into STKO soil model

Post by sebi_magi » Mon Jun 27, 2022 5:38 am

Hello, I found a problem earlier than I thought!

I created smooth splines for each level as you said.
smooth_splines.png
smooth_splines.png (43.2 KiB) Viewed 3732 times
When I join them with the loft command the result gets messy and the volume can not be meshed (I always use the ruled loft algorithm):
problem_lofts.png
problem_lofts.png (96.34 KiB) Viewed 3732 times
I guess this is because layers are too different from each other, so I worked on some solutions. Here I created two different lofts at the top and the bottom. The hexameshing worked fine for each loft separately, but I could not find a way to join them. Moreover, some layers at the center were too problematic to loft, so I would have to ignore them and change the real topography.
potential_solution_1.png
potential_solution_1.png (50.5 KiB) Viewed 3732 times

I'm pretty sure the problem could be solved if I cut the lower layers and form triangles (see the green lines in the picture behind) instead of irregular pentagons. Again the problem here would be that I'm ignoring an important part of the topography.
potential_solution_2.png
potential_solution_2.png (42.16 KiB) Viewed 3732 times
Do you have any suggestions? Should I just simplify the topography? I attach the model with the spline wires.
Attachments
layered_model_splines.rar
(15.2 KiB) Downloaded 180 times

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Map 3D Soil Variabilities into STKO soil model

Post by STKO Team » Mon Jun 27, 2022 9:09 am

The curve levels should not be done in this way. Some of them cross each other. Others are overlapping at the same Z Coordinate.
This makes the Loft process non-unique.

However, we are adding a new feature that will be released soon. It allows you to create a B-Spline Surface (free-form) from points or curves used as constraints.

In the meanwhile, I used our tool (work in progress) on your model. I had to clean some of your iso-curves to make them consistent (no crossing and no overlap).
Here I obtained a surface that passes through your curves.
Then I extruded it to make a volume.

Let us know
Attachments
layered_model_splines.zip
(63.39 KiB) Downloaded 176 times

sebi_magi
Posts: 21
Joined: Mon May 30, 2022 5:50 pm

Re: Map 3D Soil Variabilities into STKO soil model

Post by sebi_magi » Fri Jul 01, 2022 5:17 am

Hello,

Again, thank you very much for the explanation and the building of the geometry. Looking forward for the implementation of all those fantastic tools you are developing.

The analyses went super smooth and the effects of 3D elastic soil properties in the seismic performance are clear. I have just a few questions.

1) Is there a problem if I run the analyses on MP? I did some runs on a sequential and parallel already and the results were the same, so I just want to confirm.

2) When I open the script editor and load a .py file, I get a ScriptDocument error, then the file cannot be read or edited in the editor. I can edit it with a text editor outside, and it has no issues with running. Not sure why this is happening.

3) I'm most interested in the surface nodal accelerations and velocities. Since selecting the nodes in the surface plot is kind of difficult from the render view when there is topography, I created a selection set with the surface and recorded the output and retrieved the chart data. Is there a better approach for achieving this?. I think it may be possible to do it with the pympc getNodalResult function (you did something similar in the introduction to python API webinar, but I got lost on how to filter and select from nodal coordinates).

Kind regards,


Sebastián.

STKO Team
Posts: 3066
Joined: Tue Oct 29, 2019 8:45 am

Re: Map 3D Soil Variabilities into STKO soil model

Post by STKO Team » Fri Jul 01, 2022 9:39 am

1) Is there a problem if I run the analyses on MP? I did some runs on a sequential and parallel already and the results were the same, so I just want to confirm.
There should be no problem, it should work just fine

2) When I open the script editor and load a .py file, I get a ScriptDocument error, then the file cannot be read or edited in the editor. I can edit it with a text editor outside, and it has no issues with running. Not sure why this is happening.
Can you show a screenshot of the error?

3) I'm most interested in the surface nodal accelerations and velocities. Since selecting the nodes in the surface plot is kind of difficult from the render view when there is topography, I created a selection set with the surface and recorded the output and retrieved the chart data. Is there a better approach for achieving this?. I think it may be possible to do it with the pympc getNodalResult function (you did something similar in the introduction to python API webinar, but I got lost on how to filter and select from nodal coordinates).
You can for example create a script that searches for the node nearest to a user-defined X-Y-Z coordinate.
Try to do it and post here any doubt

sebi_magi
Posts: 21
Joined: Mon May 30, 2022 5:50 pm

Re: Map 3D Soil Variabilities into STKO soil model

Post by sebi_magi » Tue Jul 05, 2022 6:04 am

Dear STKO Team,

I found the surface nodes with a little bit of cheating. If I define a region in OpenSees I can use the NodeRange info at the analysis_steps.tcl to get the surface nodes.

Then I import a .txt with the nodetags and I do the same you did with the drift recorders in the Introduction to Python API webinar. However, I have an issue with this approach:

I) The way I call db.getNodalResult.evaluate(timestep) for each time step will store a database with more than ten thousand nodes for my model, for each time step (4000 time steps). This is extremely slow. Is there a way to trim the database in a way it considers only a subset of the total database? I'm thinking in something like this:

DB= db.getNodalResult("Displacement", match = MpcOdb.Contains)
DB_subset=DB.getnodes(if id.node == match)
and then iterate for all time steps...

I think in the database methods there are some boolean options (you did something like this in the critical damage virtual result from the same webinar), but I could not figure how to do it myself for my case.


As for the problem with the scripts not showing, I think it is something with OneDrive. If I store the scripts in a not-cloud folder this problem doesn't appear. Also when I record an animation I have to store it out of the cloud. I'm not sure why this happens, but it's ok.

Post Reply