I am Japanese. Sorry for my rude English ...

and, I am new to yade .... I am also new to programming and DEM.

In the simple shear test in the tutorial, a positive shear force is applied to the stress σxz until a threshold shear strain is reached.

But，I want to apply a positive shear stress to stress σxz and then a negative shear force to stress σxz.

Examples with tutorial　(Periodic simple shear)↓

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
 Revision history for this message Jan Stránský (honzik) said on 2022-11-11: #1

Hello,

> a positive shear force is applied

no, the script applies strain (of course, stress is then a consequence) [1]

> I want to apply a positive shear stress to stress σxz and then a negative shear force to stress σxz.

if you are ok with the same approach (apply strain), then simply:
###
O.cell.velGrad = Matrix3(0, 0, .1, 0, 0, 0, 0, 0, 0)
# some running until "then"
O.cell.velGrad = Matrix3(0, 0, -.1, 0, 0, 0, 0, 0, 0) # note the opposite non-zero value
###

Cheers
Jan

 Revision history for this message 内山康太郎 (kenkoutaro) said on 2022-11-12: #2

Thank you very much, Jan.

I have one more question.
How can I execute O.cell.velGrad = Matrix3(0, 0, .1, 0, 0, 0, 0, 0, 0, 0) followed by O.cell.velGrad = Matrix3(0, 0, -.1, 0, 0, 0, 0, 0, 0, 0)

Can you please give me a program to do this?

 Revision history for this message Jan Stránský (honzik) said on 2022-11-12: #3

Something like
###
O.cell.velGrad = Matrix3(0, 0, .1, 0, 0, 0, 0, 0, 0, 0)
O.step()
O.cell.velGrad = Matrix3(0, 0, -.1, 0, 0, 0, 0, 0, 0, 0)
###
?

Basically you have it in [1], first isotropic compression, then shear. You do the same approach, just with different velGrad values.

Cheers
Jan

 Revision history for this message 内山康太郎 (kenkoutaro) said on 2022-11-13: #4

Absolutely.

1st, isotropic compression

(O.cell.velGrad = Matrix3(0, 0, .1, 0, 0, 0, 0, 0, 0, 0))

3rd. Proceed with analysis for positive the distorsion value (shear strain)
(abs(O.cell.trsf[0, 2]) > .5)

(O.cell.velGrad = Matrix3(0, 0, -.1, 0, 0, 0, 0, 0, 0, 0))

5th, Proceed with analysis for negative the distorsion value (shear strain)
(abs(O.cell.trsf[0, 2]) > .5)

(O.cell.velGrad = Matrix3(0, 0, .1, 0, 0, 0, 0, 0, 0, 0, 0))

We want to loop from the second to the sixth.

An image of the loop is shown in the URL below.
I want to obtain a curve (stress-strain curve of soil) plotting stress σ on the vertical axis and strain γ on the horizontal axis.

 Revision history for this message Jan Stránský (honzik) said on 2022-11-13: #5

Instant replay:
Basically you have it in [1], first isotropic compression, then shear. You do the same approach, just with different velGrad values.

MWE:
###

coords = [1+2*i for i in range(4)]
O.bodies.append([sphere((x,y,z),1) for x in coords for y in coords for z in coords])
O.periodic = True
O.cell.setBox(8,8,8)

stress = getStress()
strainXZ = O.cell.trsf[0,2],
stressXZ = stress[0,2],
)
plot.plots = {"strainXZ":"stressXZ"}

# isotropic compression
while abs(getStress()[0,0]) < 1e6:
O.step()

for cycle in range(3):
# positive shear
while O.cell.trsf[0, 2] < .5:
O.step()
# negative shear
while O.cell.trsf[0, 2] > -.5:
O.step()

plot.plot()
###

Cheers
Jan

 Revision history for this message 内山康太郎 (kenkoutaro) said on 2022-11-14: #6

I can't thank you enough.

 Revision history for this message 内山康太郎 (kenkoutaro) said on 2022-11-14: #7

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