# -*- coding: utf-8 -*-
# encoding: utf-8
from yade import ymport, utils, pack, export, plot
from pylab import *
import math
import os

#### SIMULATIONS DEFINED HERE
utils.readParamsFromTable(Y2=16e9,Y13=32e9,SXX=-9e6,SYY=-6e6,SZZ=-6e6,FOLDER='test/',NAME='-toto',noTableOk=True)
from yade.params.table import *

os.mkdir(FOLDER)


PACK='111_50k'
DFN='penny_R0.1'
intR=1.245

Sxx=SXX # Sigmaxx
Syy=SYY # Sigmayy
Szz=SZZ # Sigmazz

DENS=4000
YOUNG=Y13
YOUNG2=Y2
FRICT=2
RFRICT=0
ALPHA=0.3
TENS=14e6 
COH=32e6
Ejemplo n.º 2
0
# -*- coding: utf-8
from yade import ymport, utils,pack,export, geom, plot
import gts,os

#### set False when running in batch mode
defaultTable = True
####-------------------------------------
####-------------------------------------

utils.readParamsFromTable(
rm = 0.33,
noTableOk = True
)
from yade.params.table import *
print 'rm=',rm

#################################
#####     FUNCTIONS          ####
#################################
def hMax(n):
	idHMax=0
	hMax=-1000000.0
	for i in O.bodies:
		h=i.state.pos[n]
		if (h>hMax):
			hMax=h
			idHMax=i.id
	hMax=hMax+O.bodies[idHMax].shape.radius
	return (hMax)	
    
    
Ejemplo n.º 3
0
# -*- coding: utf-8 -*-
from yade import ymport, utils, pack, export, plot
from pylab import *
import math

#### SIMULATIONS DEFINED HERE

utils.readParamsFromTable(PACK='010101_5k',
                          R=1.,
                          Y=27e9,
                          A=0.4,
                          T=6e6,
                          C=15e6,
                          RATE=0.02,
                          OUT='default',
                          MAX=1,
                          noTableOk=True)
from yade.params.table import *

### simulation indices
PACKING = PACK
OUTPUT = OUT

### Simulation Control
rate = RATE  # loading rate
### choose how to stop the simulation
iterMax = MAX  # maximum number of iteration -> line 144
#maxStress=2.e6 # simulation stops when sigma>maxStress -> lines 146-150

### Material microproperties
intR = R
porCheckInterval = 5000		#How often the porosity is checked for convergence
checkPointInterval = 10000	#How often the simulation is checkpointed for potential restarts

r=3e-4			#Mean Radius (m)
s=1.2e-4		#Width of uniform distribution from which radii are selected (m)
N=100			#Number of spheres
t=0.065		#Surface tension coefficient (N/m)
p=0.8			#Desired porosity
c=0
rMin=1.0e-6	#Spheres with radii below this limit are excluded

utils.readParamsFromTable(
	Row=0,
	Por=p,
	rMean=r,
	rStd=s,
	sig=t,
	numSpheres=N,
	Save=1
)

from yade.params.table import *
tPorosity=Por
REVL=math.pow(5*numSpheres*(float(4)/3*math.pi*rMean**3),float(1)/3) 
O.dt=dtStart

done=False

#Create the pack of spheres
O.materials.append(BubbleMat(density=1e5))
sp=pack.SpherePack()
Ejemplo n.º 5
0
Archivo: sim.py Proyecto: 8803104/trunk
from yade import *
from yade import utils
utils.readParamsFromTable(unknownOk=True,
	important=6,
	unimportant='foo',
	this=-1,
	notInTable='notInTable'
)
from yade.params import table
#print O.tags['description']
print 'important',table.important
print 'unimportant',table.unimportant
#print O.tags['params']
#print O.tags['defaultParams']
import time
#time.sleep(5)
O.engines=[PyRunner(command='time.sleep(.005)',iterPeriod=1)]
O.run(1000,True)
print 'finished'
import sys
sys.stdout.flush()
sys.exit(0)
Ejemplo n.º 6
0
# -*- coding: utf-8 -*-
from yade import ymport, utils, pack, export, plot
from pylab import *
import math

#### SIMULATIONS DEFINED HERE

utils.readParamsFromTable(sigma3_conf=-10e6,
                          MAX=1e5,
                          RATE=-0.02,
                          YOUNG=4e9,
                          ALPHA=0.3,
                          TENS=3e6,
                          COH=25e6,
                          OUT='toto',
                          noTableOk=True)

from yade.params.table import *

PACK = '111_50k'

PACKING = PACK
OUTPUT = OUT
rate = RATE  # loading rate
iterMax = MAX

### Material microproperties
intR = 1.245
DENS = 4000
finalFricDegree = 2
Ejemplo n.º 7
0
from yade import *
from yade import utils
utils.readParamsFromTable(unknownOk=True,
                          important=6,
                          unimportant='foo',
                          this=-1,
                          notInTable='notInTable')
from yade.params import table
#print O.tags['description']
print 'important', table.important
print 'unimportant', table.unimportant
#print O.tags['params']
#print O.tags['defaultParams']
import time
#time.sleep(5)
O.engines = [PyRunner(command='time.sleep(.005)', iterPeriod=1)]
O.run(1000, True)
print 'finished'
import sys
sys.stdout.flush()
sys.exit(0)
Ejemplo n.º 8
0
# -*- coding: utf-8 -*-
from yade import ymport, utils, pack, export, plot
from pylab import *
import math

#### SIMULATIONS DEFINED HERE

utils.readParamsFromTable(sigma3_conf=-10e6,
                          finalFricDegree=18,
                          MAX=80000,
                          RATE=-0.02,
                          OUT='load_from_pack_10k_422e9default',
                          noTableOk=True)
from yade.params.table import *
PACK = '10k_121_monodisperse'
R = 1.245
Y = 30e9
A = 0.2
T = 4e6
C = 40e6

PACKING = PACK
OUTPUT = OUT
rate = RATE  # loading rate
iterMax = MAX

### Material microproperties
intR = R
DENS = 5650
YOUNG = Y
ALPHA = A
Ejemplo n.º 9
0
The 3d display has displacement scaling applied, so that the fracture looks more spectacular. The scale
is 1000 for tension and 100 for compression.

"""

# default parameters or from table
utils.readParamsFromTable(
    noTableOk=True,  # unknownOk=True,
    young=24e9,
    poisson=.2,
    sigmaT=3.5e6,
    frictionAngle=atan(0.8),
    epsCrackOnset=1e-4,
    crackOpening=1e-6,
    intRadius=1.5,
    dtSafety=.4,
    damping=0.2,
    strainRateTension=10,
    strainRateCompression=50,
    # 1=tension, 2=compression (ANDed; 3=both)
    doModes=3,
    biaxial=True,

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

from yade.params.table import *

if 'description' in O.tags.keys():
    O.tags['id'] = O.tags['id'] + O.tags['description']
Ejemplo n.º 10
0
from yade import pack,timing,utils
utils.readParamsFromTable(noTableOk=True,num=12000)
import yade.params.table
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),.03*((12000./yade.params.table.num)**(1/3.)),.5)
sp.toSimulation()
O.bodies.append(utils.wall((0,0,0),axis=2))
O.bodies.append(utils.wall((0,0,0),axis=1))
#O.bodies.append(utils.wall((0,0,0),axis=0))
#O.bodies.append(utils.wall((0,2,0),axis=1))
#O.bodies.append(utils.wall((2,0,0),axis=0))
O.engines=([SubdomainBalancer(axesOrder='xyz',colorize=True)] if 'SubdomainBalancer' in dir() else [])+[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()],verletDist=.05*.05),
	InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),
	NewtonIntegrator(gravity=(0,0,-10)),
	#PyRunner(iterPeriod=5000,command='O.pause(); timing.stats();')
]
O.dt=utils.PWaveTimeStep()
O.timingEnabled=True
#O.step(); #O.run(10000,True)
timing.stats()
from yade import qt
qt.View()
#O.step()
#O.run(5000,True)
Ejemplo n.º 11
0
#
# https://yade-dem.org/wiki/ScriptParametricStudy
#
## read parameters from table here
from yade import utils, plot
utils.readParamsFromTable(gravity=-9.81,density=2400,initialSpeed=10,noTableOk=True)
from yade.params.table import *
print gravity,density,initialSpeed

O.materials.append(FrictMat(young=30e9,density=density,poisson=.3)) ## use the 'density' parameter here

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys(),],
		[Law2_ScGeom_FrictPhys_CundallStrack(),]
	),
	PyRunner(iterPeriod=100,command='myAddPlotData()',label='plotDataCollector'),
	NewtonIntegrator(damping=0.4,gravity=(0,0,gravity))## here we use the 'gravity' parameter
]
O.bodies.append([
	utils.box([0,50,0],extents=[1,50,1],fixed=True,color=[1,0,0]),
	utils.sphere([0,0,10],1,color=[0,1,0])
])

O.bodies[1].state.vel=(0,initialSpeed,0) ## assign initial velocity

O.dt=.8*utils.PWaveTimeStep()
## o.saveTmp('initial')
Ejemplo n.º 12
0
import warnings

warnings.filterwarnings("ignore")

#### SIMULATIONS DEFINED HERE
utils.readParamsFromTable(fPACK="Packing/",
                          PACK='111_5k',
                          Y1=4.30e+10,
                          A1=0.01,
                          T1=8e6,
                          C1=30e6,
                          SXX=-11e6,
                          SYY=-30e6,
                          SZZ=-11e6,
                          sp=0.1,
                          alpha_patch=90.,
                          posP=[[0.5, 0.5, 0.35], [0.5, 0.5, 0.65],
                                [0.5, 0.214285, 0.35], [0.5, 0.214285, 0.65],
                                [0.5, 0.785714, 0.35], [0.5, 0.785714, 0.65]],
                          sc=0.01,
                          injectionf=1e-7,
                          timeMax=0.000001,
                          FOLDER='Test/',
                          NAME='-test',
                          factor=1,
                          noTableOk=True)
from yade.params.table import *

#### parameters of the simulation (geometry, boundary conditions, output, etc...)
os.mkdir(FOLDER)
Ejemplo n.º 13
0
"""



# default parameters or from table
utils.readParamsFromTable(noTableOk=True, # unknownOk=True,
	young=24e9,
	poisson=.2,
	sigmaT=3.5e6,
	frictionAngle=atan(0.8),
	epsCrackOnset=1e-4,
	crackOpening=1e-6,

	intRadius=1.5,
	dtSafety=.4,
	damping=0.2,
	strainRateTension=10,
	strainRateCompression=50,
	# 1=tension, 2=compression (ANDed; 3=both)
	doModes=3,
	biaxial=True,

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

from yade.params.table import *

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

packingFile='periCube.pickle'
Ejemplo n.º 14
0
#
# https://yade-dem.org/wiki/ScriptParametricStudy
#
## read parameters from table here
from yade import utils, plot
utils.readParamsFromTable(gravity=-9.81,
                          density=2400,
                          initialSpeed=10,
                          noTableOk=True)
from yade.params.table import *
print gravity, density, initialSpeed

O.materials.append(FrictMat(young=30e9, density=density,
                            poisson=.3))  ## use the 'density' parameter here

O.engines = [
    ForceResetter(),
    InsertionSortCollider([
        Bo1_Sphere_Aabb(),
        Bo1_Box_Aabb(),
    ]),
    InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),
                     Ig2_Box_Sphere_ScGeom()], [
                         Ip2_FrictMat_FrictMat_FrictPhys(),
                     ], [
                         Law2_ScGeom_FrictPhys_CundallStrack(),
                     ]),
    PyRunner(iterPeriod=100,
             command='myAddPlotData()',
             label='plotDataCollector'),
    NewtonIntegrator(damping=0.4,
Ejemplo n.º 15
0
# DATA COMPONENTS
from yade import utils
from yade import qt
from yade import *
from yade import pack, plot, geom
from math import *
#from fenics import *
import sys

#from pylab import *
#######################################################3
utils.readParamsFromTable(n=1, dens=2500, frict=35.3, E=4e5, coh=1e4, eta=5)
from yade.params.table import *
##########################################################
#granular material data
particlematerial = CohFrictMat(young=E,
                               poisson=.2,
                               density=dens,
                               frictionAngle=radians(frict),
                               normalCohesion=coh,
                               shearCohesion=coh,
                               momentRotationLaw=True,
                               etaRoll=eta,
                               etaTwist=eta)
O.materials.append(particlematerial)
##################################################################
#sp=pack.SpherePack()
# generate randomly spheres with uniform radius distribution
#sp.makeCloud((0,0,0),(1,1,1),rMean=.3,rRelFuzz=.5)
# add the sphere pack to the simulation
#sp.toSimulation()
Ejemplo n.º 16
0
# default parameters or from table
utils.readParamsFromTable(noTableOk=True, # unknownOk=True,
	young=24e9,
	poisson=.2,
	G_over_E=.20,

	sigmaT=3.5e6,
	frictionAngle=atan(0.8),
	epsCrackOnset=1e-4,
	crackOpening=1e-6,

	intRadius=1.5,
	dtSafety=.8,
	damping=0.4,
	strainRateTension=.05,
	strainRateCompression=.5,
	setSpeeds=True,
	# 1=tension, 2=compression (ANDed; 3=both)
	doModes=3,

	specimenLength=.15,
	sphereRadius=3.5e-3,

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

	# use the ScGeom variant
	scGeom=False
)

from yade.params.table import *
Ejemplo n.º 17
0
from yade import pack,log,timing,utils
log.setLevel("SubdomainBalancer",log.INFO)
#log.setLevel("BodyContainer",log.TRACE)
utils.readParamsFromTable(noTableOk=True,num=12000)
import yade.params.table
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),.03*((12000./yade.params.table.num)**(1/3.)),.5)
sp.toSimulation()
O.bodies.append(utils.wall((0,0,0),axis=2))
O.bodies.append(utils.wall((0,0,0),axis=1))
#O.bodies.append(utils.wall((0,0,0),axis=0))
#O.bodies.append(utils.wall((0,2,0),axis=1))
#O.bodies.append(utils.wall((2,0,0),axis=0))
O.engines=([SubdomainBalancer(axesOrder='xyz',colorize=True)] if 'SubdomainBalancer' in dir() else [])+[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()],verletDist=.05*.05),
	InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),
	NewtonIntegrator(gravity=(0,0,-10)),
	#PyRunner(iterPeriod=5000,command='O.pause(); timing.stats();')
]
O.dt=utils.PWaveTimeStep()
O.timingEnabled=True
#O.step(); #O.run(10000,True)
timing.stats()
from yade import qt
qt.View()
#O.step()
#O.run(5000,True)
Ejemplo n.º 18
0
# -*- coding: utf-8 -*-
# encoding: utf-8
from yade import ymport, utils, pack, export, plot
from pylab import *
import math

#### SIMULATIONS DEFINED HERE
utils.readParamsFromTable(Y135=16e9,
                          Y24=32e9,
                          SXX=-9.e6,
                          SYY=-6.e6,
                          SZZ=-6e6,
                          FOLDER='test/',
                          NAME='toto',
                          noTableOk=True)
from yade.params.table import *

os.mkdir(FOLDER)

PACK = '111_50k'
DFN = 'penny_R0.1'
intR = 1.245

Sxx = SXX  # Sigmaxx
Syy = SYY  # Sigmayy
Szz = SZZ  # Sigmazz

DENS = 4000
YOUNG = Y135
YOUNG2 = Y24
FRICT = 2
Ejemplo n.º 19
0
# default parameters or from table
utils.readParamsFromTable(noTableOk=True, # unknownOk=True,
	young=24e9,
	poisson=.2,
	poisson=.20,

	sigmaT=3.5e6,
	frictionAngle=atan(0.8),
	epsCrackOnset=1e-4,
	crackOpening=1e-6,

	intRadius=1.5,
	dtSafety=.8,
	damping=0.4,
	strainRateTension=.05,
	strainRateCompression=.5,
	setSpeeds=True,
	# 1=tension, 2=compression (ANDed; 3=both)
	doModes=3,

	specimenLength=.15,
	sphereRadius=3.5e-3,

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

	# use the ScGeom variant
	scGeom=False
)

from yade.params.table import *