 # Initializing stress field

Hi folks,

How do you normally go about initializing the stresses in the domain? I know it’s possible to input initial particle stresses using a text file, but how do you go about doing this if you’re specifying the particles to be created at the Gauss points?

Seems like you’d calculate the initial stresses by calculating the vertical stress and assuming some K_0, finding the stresses acting at each particle level. If I don’t specify particle locations and just let the software generate them at the Gauss points, is there a way to provide these initial stresses in a way that they can be added at the correct locations?

I was considering using time-varying forces to first get the particles in equilibrium based on gravity and then impose some additional loading. However, doing it this way, there are massive settlements initially such that the material points aren’t anywhere close to the Gauss points so the stresses calculated are not reliable. Right now, it seems like I’d have to manually determine where the Gauss points would be for the mesh and create an input file that contains this information. Then, calculate the stresses that match the ordering of these point and put that in the input file for the initial stresses.

When the initial stresses and strains are important to capture correctly, I’m guessing this is the way that folks have been dealing with it. Just want to make sure I’m not making things harder than they need to be or that I’m not reinventing the wheel here…

I mainly rely on some python and matlab “generators” I’ve inhereted (and made) that output text files for mesh coordinates, particle coordinates, stresses, and external loading as well as the entity_ sets.json (for boundary conditions). So I don’t use the Gauss point generator too much.

Seems like you’d calculate the initial stresses by calculating the vertical stress and assuming some K_0, finding the stresses acting at each particle level.

Yes, this is how I do it. Since I already know the coordinates for all my particles from writing the `particles.txt` file, its only 1 or 2 more lines in the python/matlab “generator” to calculate the vertical and horizontal stresses and write a `particle_stresses.txt`.

@yliang-sn has worked with some really large MPM models where in-situ stresses were key. There is a chance one of these models was using the Gauss point generator and `particle_stresses.txt`, but I’m not positive.

I don’t think this necessarily answered your question, but I don’t have too much experience with the built-in Gauss point generator!

Thinking about this a bit more, a quick work-around could be running MPM with the Guass point generator for 1 step to get the `particles00000.h5` output.

This hdf5 file will have all of the initial particle coordinates.

So you could quickly loop through each coordinate in python to calculate in-situ stresses and write these stresses to a `particle_stresses.txt` file in the same order as the particles. If your mesh file doesn’t change, I expect that the Gauss point generator will always make particles in the same order, but if you’re already writing the `particles_stresses.txt`, maybe just saving the coordinates to `particles.txt` is the safe bet. Then you can run the simulation for real, but load the particles and stresses instead of using the Gauss point generator.

I am also doing it by python and matlab. calculate the initial stresses by the coordinates and run the MPM model with a damping force to get more accurate initial stresses.

1 Like

I think it works if you don’t have the coordinates a prior.

Thanks @jgiven100 and @yliang-sn. I wrote a Python script to do the manual stress calculation based on the mesh geometry and Gauss point locations, so that should be sorted. However, once the mesh is anything other than perfectly rectilinear it’ll be tricky so I like your suggestion of using the hdf5 output when generating the points using the Gauss generator and then calculating stresses based on that.

Thanks again!