soil structure interaction

Asked by William

Hi, I’m now doing the research about ‘soil structure interaction’, but I met some difficulties that I can’t overcome.
My model is 2D.
1. I generate four boundaries:

id_Mat=O.materials.append(FrictMat(young=100e9,poisson=0.3,density=1000,frictionAngle = radians(10)))
Mat=O.materials[id_Mat]
id_box1 = O.bodies.append(box((0.5,12.5,0.5),(0.5,12.5,0.5),fixed=True,material=Mat))
id_box2 = O.bodies.append(box((101.5,12.5,0.5),(0.5,12.5,0.5),fixed=True,material=Mat))
id_box3 = O.bodies.append(box((51,20.5,0.5),(50,0.5,0.5),fixed=True,material=Mat))
id_box4 = O.bodies.append(box((51,-0.5,0.5),(70,0.5,0.5),fixed=True,material=Mat))

2. Generate particles

sp = pack.SpherePack()
sp.makeCloud(Vector3(1,0,0.5),Vector3(101,20,0.5),num=N_particles,rMean=AvgRadius,rRelFuzz=.33,distributeMass=False)
sp.toSimulation(material = SphereMat)

3. Radius expansion method. ConfPress1=50kPa. I don’t know if it’s proper to use TriaxialStressController here.

triax1=TriaxialStressController(
    maxMultiplier=1.+1.5e5/Young, # spheres growing factor (fast growth)
    finalMaxMultiplier=1.+4e3/Young,
    internalCompaction = True, # If true the confining pressure is generated by growing particles
    stressMask = 7,
    computeStressStrainInterval = 10,
    goal1 = ConfPress1,
goal2 = ConfPress1,

The first phase of work is described above. It’s the ‘generation.py’.

Next, I will write the second file called ‘conpression.py’. The outcome (generation.yade.bz2) of first file ‘generation.py’ will be loaded and I want to apply 100kPa normal stress on the upper boundary and cancel it’s ‘fixed’, but I don’t know how to do it (1. How to apply 100kPa on the upper boundary? 2. How to modify the code of previous file to cancel the ‘fixed’ ?)

When the above two stages are finished, the third file (shear.py) will work. I want the bottom boundary to move to the left and I don’t know how to realize it.

The code of ‘generation.py’:
from __future__ import print_function
from builtins import range
from yade import pack,export,qt,plot,os,timing
import matplotlib; matplotlib.rc('axes',grid=True)
import pylab

#Material constants
Density = 3000
FrictionAngle = 1.5
PoissonRatio = 0.5
Young = 300e6
Damp = 0.5
AvgRadius = 0.1
N_particles = 2000

#Confining variables
ConfPress1 = -50000

#define material for all bodies:
id_Mat=O.materials.append(FrictMat(young=100e9,poisson=0.3,density=1000,frictionAngle = radians(10)))
Mat=O.materials[id_Mat]

id_box1 = O.bodies.append(box((0.5,12.5,0.5),(0.5,12.5,0.5),fixed=True,material=Mat))
id_box2 = O.bodies.append(box((101.5,12.5,0.5),(0.5,12.5,0.5),fixed=True,material=Mat))
id_box3 = O.bodies.append(box((51,20.5,0.5),(50,0.5,0.5),fixed=True,material=Mat))
id_box4 = O.bodies.append(box((51,-0.5,0.5),(70,0.5,0.5),fixed=True,material=Mat))

SphereMat = O.materials.append(FrictMat(young = Young, poisson = PoissonRatio, frictionAngle = radians(FrictionAngle), density = Density))
sp = pack.SpherePack()
sp.makeCloud(Vector3(1,0,0.5),Vector3(101,20,0.5),num=N_particles,rMean=AvgRadius,rRelFuzz=.33,distributeMass=False)
sp.toSimulation(material = SphereMat)

triax1=TriaxialStressController(
    maxMultiplier=1.+1.5e5/Young, # spheres growing factor (fast growth)
    finalMaxMultiplier=1.+4e3/Young,
    internalCompaction = True, # If true the confining pressure is generated by growing particles
    stressMask = 7,
    computeStressStrainInterval = 10,

    goal1 = ConfPress1,
    goal2 = ConfPress1,
)

newton=NewtonIntegrator(damping=Damp)

###engine
O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
    InteractionLoop(
     [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
     [Ip2_FrictMat_FrictMat_FrictPhys()],
     [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8, defaultDt=4*utils.PWaveTimeStep()),
    triax1,
    newton,
    PyRunner(realPeriod=10,command='checkUnbalanced()',label='check'),
    PyRunner(command='addPlotData()',iterPeriod=2000,label='record'),
    TriaxialStateRecorder(iterPeriod=2000,file='WallStresses')
]

# Simulation stop conditions defination
def checkUnbalanced():
    unb=unbalancedForce()
    mStress = (triax1.stress(triax1.wall_right_id)[0]+triax1.stress(triax1.wall_top_id)[1])/2.0
    s1 = triax1.stress(triax1.wall_right_id)[0]
    s2 = triax1.stress(triax1.wall_top_id)[1]
    if unb<0.01 and abs(ConfPress1-mStress)/abs(ConfPress1)<0.01:
       O.pause()
       O.save('generation.yade.bz2')

# collect history of data
def addPlotData():
    unb = unbalancedForce()
    mStress = -(triax1.stress(triax1.wall_right_id)[0]+triax1.stress(triax1.wall_top_id)[1])/2.
    area = (O.bodies[1].state.pos[0]-O.bodies[0].state.pos[0])*(O.bodies[3].state.pos[1]-O.bodies[2].state.pos[1])
    Porosity = 1-sum(pi*b.shape.radius**2 for b in O.bodies if isinstance(b.shape,Sphere))/2000

    plot.addData(e11=-triax1.strain[0], e22=-triax1.strain[1], e33=-triax1.strain[2],
     ev=-triax1.strain[0]-triax1.strain[1]-triax1.strain[2],
   s11=-triax1.stress(triax1.wall_right_id)[0],
   s22=-triax1.stress(triax1.wall_top_id)[1],
   s33=-triax1.stress(triax1.wall_front_id)[2],
   ub=unbalancedForce(),
   dstress=(-triax1.stress(triax1.wall_top_id)[1])-(-triax1.stress(triax1.wall_right_id)[0]),
   disx=triax1.width,
   disy=triax1.height,
   disz=triax1.depth,
   i=O.iter,
   porosity=Porosity,
   ke=utils.kineticEnergy(),
   totalEnergy=O.energy.total()
   )

    plot.saveDataTxt('generation.txt.bz2')

Is there any problem in the code?

Above all, my questions are:
1. How to apply 100kPa on the upper boundary?
2. How to modify the code of previous file to cancel the ‘fixed’ ?
3. How to move the bottom boundary to the left?
4. Is anyone willing to share the similar examples’ code?
5. Is there some examples of direct shear (not simple shear)?

Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
William (qfxx-123) said :
#1

The second question: How to modify the code of previous file to cancel the upper boundary's ‘fixed’ in the second file 'compression.py'?

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

Hi,
TriaxialStressController can be used for 2D cases but it still requires that you place 6 walls (in fact boxes), not 4.
Also, if the the walls have custom numbering (i.e. not what you get by inserting "O.bodies.append(aabbWalls(...))" first) you need to set correct values for the wall_ids.

For further solution I would suggest to not split the thing in two files, example how to avoid that is in [1].
You can actually start from [1] and make it 2D.

Note: pasting code fragments in a question is not appropriate [2].

[1] https://gitlab.com/yade-dev/trunk/-/blob/3e9a209234b7f23241d5f4bdef1b586056e97582/examples/simple-scene/save-then-reload.py
[2] https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hello,

> 1. How to apply 100kPa on the upper boundary?

adding force to it [3], taking into account area
O.forces.setPermF(upperBoundaryId,stress*area*direction)

> 2. How to modify the code of previous file to cancel the ‘fixed’ ?

b.state.blockedDOFs = ... # [4], actual value of ... depends on definition of "cancel the ‘fixed’"

> 3. How to move the bottom boundary to the left?

e.g. by force [3] or prescribed velocity [5]
b.state.vel = Vector3(...)

> 5. Is there some examples of direct shear (not simple shear)?

just search "yade direct shear", first 5 results: [6,7,8,9,10]

Cheers
Jan

[3] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.setPermF
[4] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.blockedDOFs
[5] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.vel
[6] https://answers.launchpad.net/yade/+question/693282
[7] https://answers.launchpad.net/yade/+question/672563
[8] https://answers.launchpad.net/yade/+question/668213
[9] https://www.researchgate.net/publication/289544761
[10] https://www.researchgate.net/publication/282837540

Revision history for this message
William (qfxx-123) said :
#4
Revision history for this message
Jan Stránský (honzik) said :
#5

> I met some new questions.

then please open a new question for each separate problem ([2], point 5).
Thanks
Jan

[2] https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
William (qfxx-123) said :
#6

Hi, Jan. The new questions are still based on this problem. I'm so sorry that I didn't make it clear.

Revision history for this message
Jan Stránský (honzik) said :
#7

I am not sure if I got correctly your last message. If you are going to open new questions, please ignore this message.

Please open a new question for a new problem - [2], point 5:
- "Do not merge different questions in one single post, even if - in your mind - they are connected to one single project"
- "Do not use the same thread to jump to another question"

If it is "still based on this problem" is irrelevant. They are new questions, new problems ([2], point 5).
Not to mention that the OP itself should have been split into several separate questions ([2], point 5).

Then, if the thread is related to the same separate problem, it is meaningful to continue discussion, specifying more the problem etc.
But it really is not this case.

The questions are not only to answer your question, but also to build a knowledge base for others.
If the questions are well organized, it is much easier to search it.

E.g. your question about force / stress is an excellent example of a question, that should be separate just because it is in principle independent problem, which surely will be interesting / useful for somebody else.
Similarly for the "sloped wall".

> ubuntu2021

what is this line?

Cheers
Jan

Revision history for this message
William (qfxx-123) said (last edit ):
#8

Ok, I will follow your advice and open a new question.
(The version of ubuntu is 21.10)
Thank you, Jan.

Cheers
Xujin

Revision history for this message
William (qfxx-123) said :
#9

Thanks Jan Stránský, that solved my question.

Revision history for this message
Jan Stránský (honzik) said :
#10

> I will follow your advice and open a new question.

Thanks :-)

> The version of ubuntu is 21.10

then please specify the version.
There is tradition to have two Ubuntu releases per year (04 in April and 10 in October).
So "ubuntu2021" is ambiguous (could be 21.04 or 21.10).

Cheers
Jan