← Back to team overview

yade-users team mailing list archive

Re: [Question #694706]: Cpm model

 

Question #694706 on Yade changed:
https://answers.launchpad.net/yade/+question/694706

    Status: Needs information => Open

Chen Lifan gave more information on the question:
Jan, thank you for your advice.
I'm using the yade of version 2018.02b. And below is my scripts for unconfined compression test :
from minieigen import *
from yade import plot
import numpy as np
import math, random


O.load('rve_2nd.yade.gz')
width = triax.width
O.engines = O.engines[:3]+O.engines[4:]
O.bodies.erase(400)
O.bodies.erase(401)
O.bodies.erase(404)
O.bodies.erase(405)
top_wall = O.bodies[403]
bottom_wall = O.bodies[402]
top_wall.state.blockDOFs = 'xyzXYZ'
bottom_wall.state.blockDOFs = 'xyzXYZ'
top_pos = top_wall.state.pos
bottom_pos = bottom_wall.state.pos
height0 = top_pos[1]-bottom_pos[1]
zdim = 5.e-2
wall_area = width*zdim

r = numpy.zeros(400)
for i in range(400):
   r[i] = O.bodies[i].shape.radius
print 'Height: ',height0,'Initial stress: ', getStress()/(zdim/2/max(r))

top_wall.state.vel=(0,-0.0004,0)
O.run()
O.engines += [PyRunner(command='output()',iterPeriod=1000,label='outdata',dead=False)]
globals().update(locals())

fout = file('uniax_without4walls.dat','w')
fout.close()

def output():
   print O.forces.f(403)/wall_area/1.e6
   fout = open('uniax_without4walls.dat','a')
   ystrain = (height0-(top_wall.state.pos[1]-bottom_wall.state.pos[1]))/height0*100
   stress = O.forces.f(403)/wall_area/1.e6
   print>>fout,ystrain,stress[0],stress[1],stress[2]
   fout.close()
   if ystrain >= 2.0:
      O.save('rve_damage_without4walls.yade.gz')
      O.pause()

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.