コード例 #1
0
from woo import utils
from woo import ymport

## Omega
o=Omega() 

## PhysicalParameters 
Density=2400
frictionAngle=radians(35)
sphereRadius=0.05
tc = 0.001
en = 0.3
es = 0.3

## Import wall's geometry
params=utils.getViscoelasticFromSpheresInteraction(tc,en,es)
facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,**params)) # **params sets kn, cn, ks, cs
sphereMat=O.materials.append(ViscElMat(density=Density,frictionAngle=frictionAngle,**params))

walls = O.bodies.append(ymport.stl('ring.stl',material=facetMat))

def fill_cylinder_with_spheres(sphereRadius,cylinderRadius,cylinderHeight,cylinderOrigin,cylinderSlope):
    spheresCount=0
    for h in range(0,cylinderHeight/sphereRadius/2):
            for r in range(1,cylinderRadius/sphereRadius/2):
                dfi = asin(0.5/r)*2
                for a in range(0,6.28/dfi):
                    x = cylinderOrigin[0]+2*r*sphereRadius*cos(dfi*a)
                    y = cylinderOrigin[1]+2*r*sphereRadius*sin(dfi*a)
                    z = cylinderOrigin[2]+h*2*sphereRadius
                    s=utils.sphere([x,y*cos(cylinderSlope)+z*sin(cylinderSlope),z*cos(cylinderSlope)-y*sin(cylinderSlope)],sphereRadius,material=sphereMat)
コード例 #2
0
ファイル: clump-viscoelastic.py プロジェクト: Azeko2xo/woodem
from woo import utils,pack,export,qt
import gts,os,random,itertools
from numpy import *
import woo.log 

#woo.log.setLevel('NewtonIntegrator',woo.log.TRACE)

# Parameters
tc=0.001# collision time 
en=.3  # normal restitution coefficient
es=.3  # tangential restitution coefficient
frictionAngle=radians(35)# 
density=2700
# facets material
params=utils.getViscoelasticFromSpheresInteraction(10e3,tc,en,es)
facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,**params)) # **params sets kn, cn, ks, cs
# default spheres material
dfltSpheresMat=O.materials.append(ViscElMat(density=density,frictionAngle=frictionAngle)) 

O.dt=.01*tc # time step

Rs=0.1 # particle radius

# Create geometry
plnSurf = pack.sweptPolylines2gtsSurface([[Vector3(-.5,0,0),Vector3(.5,0,0),Vector3(.5, 0, -.5),Vector3(-.5, 0, -.5)]],capStart=True,capEnd=True)
plnIds=O.bodies.append(pack.gtsSurface2Facets(plnSurf.faces(),material=facetMat,color=(0,1,0)))

plnSurf1 = pack.sweptPolylines2gtsSurface([[Vector3(-.5,-.5,-.5),Vector3(.5,-.5,-.5),Vector3(.5, 1.5, -.5),Vector3(-.5, 1.5, -.5)]],capStart=True,capEnd=True)
plnIds1=O.bodies.append(pack.gtsSurface2Facets(plnSurf1.faces(),material=facetMat,color=(0,1,0)))
コード例 #3
0
ファイル: checkPerf.py プロジェクト: yankang84/woo
tStartAll = time.time()

for z in range(numberTests):
    for i in range(len(radRAD)):
        rR = radRAD[i]
        nbIter = iterN[i]
        O.reset()

        tc = 0.001
        en = .003
        es = .003
        frictionAngle = radians(35)
        density = 2300

        params = utils.getViscoelasticFromSpheresInteraction(tc, en, es)
        defMat = O.materials.append(
            ViscElMat(density=density, frictionAngle=frictionAngle,
                      **params))  # **params sets kn, cn, ks, cs

        O.dt = .1 * tc  # time step
        rad = 0.5  # particle radius
        tolerance = 0.0001

        SpheresID = []
        SpheresID += O.bodies.append(
            pack.regularHexa(pack.inSphere((Vector3(0.0, 0.0, 0.0)), rad),
                             radius=rad / rR,
                             gap=rad / rR * 0.5,
                             material=defMat))
コード例 #4
0
ファイル: clump-viscoelastic.py プロジェクト: yankang84/woo
from builtins import range
from woo import utils, pack, export, qt
import gts, os, random, itertools
from numpy import *
import woo.log

#woo.log.setLevel('NewtonIntegrator',woo.log.TRACE)

# Parameters
tc = 0.001  # collision time
en = .3  # normal restitution coefficient
es = .3  # tangential restitution coefficient
frictionAngle = radians(35)  #
density = 2700
# facets material
params = utils.getViscoelasticFromSpheresInteraction(10e3, tc, en, es)
facetMat = O.materials.append(ViscElMat(
    frictionAngle=frictionAngle, **params))  # **params sets kn, cn, ks, cs
# default spheres material
dfltSpheresMat = O.materials.append(
    ViscElMat(density=density, frictionAngle=frictionAngle))

O.dt = .01 * tc  # time step

Rs = 0.1  # particle radius

# Create geometry
plnSurf = pack.sweptPolylines2gtsSurface([[
    Vector3(-.5, 0, 0),
    Vector3(.5, 0, 0),
    Vector3(.5, 0, -.5),