예제 #1
0
from woo import pack, plot

# create some material
O.materials.append(
    CpmMat(young=25e9,
           frictionAngle=.7,
           G_over_E=.2,
           sigmaT=3e6,
           epsCrackOnset=1e-4,
           relDuctility=30))

# create periodic assembly of particles
initSize = 1.2
sp = pack.randomPeriPack(radius=.05,
                         initSize=Vector3(initSize, initSize, initSize),
                         memoizeDb='/tmp/packDb.sqlite')
sp.toSimulation()

# plotting
#plot.live=False
plot.plots = {
    'progress': (
        'sx',
        'sy',
        'sz',
        'syz',
        'szx',
        'sxy',
    ),
    'progress_': (
예제 #2
0
    doModes=3,
    biaxial=True,

    # isotropic confinement (should be negative)
    isoPrestress=0,
)

if 'description' in O.tags.keys():
    O.tags['id'] = O.tags['id'] + O.tags['description']

packingFile = 'periCube.pickle'
# got periodic packing? Memoization not (yet) supported, so just generate it if there is not the right file
# Save and reuse next time.
if not os.path.exists(packingFile):
    sp = pack.randomPeriPack(radius=.05e-3,
                             rRelFuzz=0.,
                             initSize=Vector3().ONE * 1.5e-3)
    dd = dict(cell=(sp.cellSize[0], sp.cellSize[1], sp.cellSize[2]),
              spheres=sp.toList_pointsAsTuples())
    import cPickle as pickle
    pickle.dump(dd, open(packingFile, 'w'))

#
# load the packing (again);
#
import cPickle as pickle
concreteId = O.materials.append(
    CpmMat(young=young,
           frictionAngle=frictionAngle,
           poisson=poisson,
           density=4800,
# triaxial compression.
#   Firstly, a hydrostatic preassure is applied, then a strain along z axis is increasing
# while x- and y- stress is constant
#   The simulation is run on rotated cell to enable localization and strain softening
# (you can also try simulation with command sp.toSimulation() with no rotation,
# in this case there is almost no difference, but in script peri3dController_shear,
# the cell rotation has significant effect)

from woo import pack,plot,qt

# define material
O.materials.append(FrictMat())

# create periodic assembly of particles
initSize=1.2
sp=pack.randomPeriPack(radius=.05,initSize=Vector3(initSize,initSize,initSize),memoizeDb='/tmp/packDb.sqlite')
angle=0
rot=Matrix3(cos(angle),0,-sin(angle), 0,1,0, sin(angle),0,cos(angle))
sp.toSimulation(rot=rot)

# plotting 
plot.live=False
plot.plots={'iter':('sx','sy','sz','syz','szx','sxy',),'iter_':('ex','ey','ez','eyz','ezx','exy',),'ez':('sz',)}
def plotAddData():
	plot.addData(
		iter=O.iter,iter_=O.iter,
		sx=p3d.stress[0],sy=p3d.stress[1],sz=p3d.stress[2],
		syz=p3d.stress[3],szx=p3d.stress[4],sxy=p3d.stress[5],
		ex=p3d.strain[0],ey=p3d.strain[1],ez=p3d.strain[2],
		eyz=p3d.strain[3],ezx=p3d.strain[4],exy=p3d.strain[5],
	)
예제 #4
0
파일: periodic.py 프로젝트: CrazyHeex/woo
    strainRateCompression=50,
    # 1=tension, 2=compression (ANDed; 3=both)
    doModes=3,
    biaxial=True,

    # isotropic confinement (should be negative)
    isoPrestress=0,
)

if 'description' in O.tags.keys(): O.tags['id']=O.tags['id']+O.tags['description']

packingFile='periCube.pickle'
# got periodic packing? Memoization not (yet) supported, so just generate it if there is not the right file
# Save and reuse next time.
if not os.path.exists(packingFile):
    sp=pack.randomPeriPack(radius=.05e-3,rRelFuzz=0.,initSize=Vector3().ONE*1.5e-3)
    dd=dict(cell=(sp.cellSize[0],sp.cellSize[1],sp.cellSize[2]),spheres=sp.toList_pointsAsTuples())
    import pickle as pickle
    pickle.dump(dd,open(packingFile,'w'))

#
# load the packing (again);
#
import pickle as pickle
concreteId=O.materials.append(CpmMat(young=young,frictionAngle=frictionAngle,poisson=poisson,density=4800,sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,G_over_E=G_over_E,isoPrestress=isoPrestress))
sphDict=pickle.load(open(packingFile))
from woo import pack
sp=pack.SpherePack()
sp.fromList(sphDict['spheres'])
sp.cellSize=sphDict['cell']