2D simulation with sphere using PeriTriaxController
Hello, everyone. Now I do a 2D sphere biaxial compression simulation in Yade using PeriTriaxContro
from yade import pack, qt, plot
import time
#######
### DEFINING VARIABLES AND MATERIALS ###
#######
ts = time.time()
pressure = -1e5
size=0.24
## create materials for spheres for initial consolidation
O.materials.
# setup periodic boundary, insert the packing
sp = pack.SpherePack()
sp.makeCloud(
sp.toSimulation()
O.cell.hSize = Matrix3(size,0,0, 0,size,0, 0,0,.1)
O.dt=.5*
for p in O.bodies:
inertia = 0.5 * p.state.mass * p.shape.radius**2 # in 2D simulation, the inertia is important, should be calculate carefully.
print(len(
#######
### DEFINING ENGINES ###
#######
triax=PeriTriax
# specify target values and whether they are strains or stresses
goal=
# type of servo-control
dynCell=
# wait until the unbalanced force goes below this value
maxUnbalanced
# call this function when goal is reached and the packing is stable
doneHook=
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
triax,
newton
]
def addPlotData():
pp = utils.porosity() #this is the porosity of the cell.
ee = pp / (1-pp) #this is the void ratio of the 3D cell.
evv=
ezv=
szv=
sigmadv=
sigmam=
sigma0v=
sigma1v=
ssdv=
srdv=
plot.
ev=evv,
)
# define what to plot//since they have the same x (i), the latter i should have a space in it 'i '
plot.plots=
#each 'i' should have different number or location of space. Or the latter will overwrite the former one.
}
# show the plot
plot.plot()
yade.qt.
# output the necessary data which are useful to postprocess
def outputData():
fout = open(filename, 'a')
pp = utils.porosity() #this is the porosity of the cell.
ee = pp / (1-pp) #this is the void ratio of the 3D cell.
evv=
sigmadv=
sigmam=
ssdv=
srdv=
fout.
fout.close()
def consolidationFi
O.engines += [PyRunner(
# set the current cell configuration to be the reference one
setContactFric
for p in O.bodies:
print 'consolidationF
def triaxFinished():
print 'Finished'
O.pause()
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: