rigid boundaries
Hi everyone:
I am new to Yade and python and I am trying to simulate a pile as a rigid boundaries. One friend helps me to create a script to generate a sample of my soil. I'm studying geotechinical problems. But i don't know how to create a new rigid boundary to simulate a pile. Can someone tell me how to do this? This is my script:
# -*- coding: utf-8 -*-
from yade import pack,utils,
import numpy as np
import operator,fractions
# TODAS AS UNIDADES ESTÃO NO S.I.
#######
### 1.PARÂMETROS DE ENTRADA ###
#######
# 1.1 IMPORT PARAMETERS FROM TABLE
nRead=readParam
DensidadeP = 2.7,
PoissonP = 0.2,
AnguloAtritoP = 0,
CoesaoP = 0,
PorosidadeS = 0.20,
MatType = 'frict',
TestType = '2D',
PSD = [[0.0032,
verlet = 0.35,
YoungP = 7.e4,
unknownOk=True
)
from yade.params import table
# 1.2 PARAMETROS DO MEIO (MACROSCÓPICOS)
DensidadeS = table.DensidadeP #tf/m³
YoungP = table.YoungP #kN/m²
PoissonP = table.PoissonP #Adimensional
AnguloAtritoP = radians(
CoesaoP = table.CoesaoP
PorosidadeS = table.PorosidadeS
# 1.3 DIMENSÕES DOS ELEMENTOS
# 1.3.1 CURVA GRANULOMETRICA DO SOLO - PSD=[[diâmetros
PSD = table.PSD
# 1.3.2 DADOS MÉDIOS DOS ELEMENTOS
rMeanElemento = ((PSD[0]
rRelFuzzElemento = PSD[0][
rMaxElemento = PSD[0][-1]/2
rMinElemento = PSD[0][0]/2
# 1.4 TIPO DE MATERIAL
MatType = table.MatType # 'frict', 'cohfrict', 'concrete'
# 1.5 TIPO DE AMOSTRA
TestType = table.TestType
##################
### 2.MATERIAL ###
##################
# 2.1 Material Meio
if MatType == 'frict':
Material=
elif MatType == 'cohfrict':
Material=
elif MatType == 'concrete':
# Material=
Material=
O.materials.
# 2.2 Material Contorno
MatContorno = FrictMat(
O.materials.
###################
### 3.GEOMETRIA ###
###################
# 3.1 Triaxial
# 3.1.1 Dimensões
width = 1
height = 0.5
if TestType == '2D':
dx = 1.01*2*rMaxElemento
dy = width
dz = height
CorteTransversal = dy
elif TestType == '3D':
dx = width
dy = width
dz = height
CorteTransversal = dy*dx
# 3.1.2 Faces
mn,mx=(
walls=aabbWalls
wallIds=
base=O.bodies[4]
topo=O.bodies[5]
##################
### 4.CÁLCULOS ###
##################
# 4.1. InteractionLoop
enlargeFactor=1.5
LoopFrict=
[
Ig2_Wall_
Ig2_Sphere_
Ig2_Box_
Ig2_Facet_
],
[
Ip2_FrictMat_
],
[
Law2_
],
)
LoopCohFrict=
[
Ig2_Wall_
Ig2_Sphere_
Ig2_Box_
Ig2_Facet_
],
[
Ip2_FrictMat_
Ip2_CohFrictM
],
[
Law2_
Law2_
],
)
LoopConcrete=
[
Ig2_Wall_
Ig2_Sphere_
Ig2_Box_
Ig2_Facet_
],
[
Ip2_FrictMat_
Ip2_CpmMat_
Ip2_FrictMat_
],
[
Law2_
Law2_
],
)
if MatType == 'frict':
IntLoop = LoopFrict
elif MatType == 'cohfrict':
IntLoop = LoopCohFrict
elif MatType == 'concrete':
IntLoop = LoopConcrete
# 4.2 Factory Parameters
MassFlowRate = 5000/(CorteTran
VMAX = 5
VMIN = 5
FCenter = (0.,0.,height/2)
FExtents2D = (0,width/
FExtents3D = (width/
factoy2D = BoxFactory(
center = FCenter, extents = FExtents2D,
PSDsizes = PSD[0], PSDcum = PSD[1], PSDcalculateMass = True,
vMax = VMAX, vMin = VMIN, vAngle = 0., normal = (0.,0.,-1.),
maxParticles = -1,
massFlowRate = MassFlowRate,
# exactDiam = False,
label = 'factory',
blockedDOFs = 'xYZ',
materialId = 0
)
factoy3D = BoxFactory(
center = FCenter, extents = FExtents3D,
PSDsizes = PSD[0], PSDcum = PSD[1], PSDcalculateMass = True,
vMax = 5*VMAX, vMin = 5*VMIN, vAngle = 0., normal = (0.,0.,-1.),
maxParticles = -1,
massFlowRate = MassFlowRate,
# exactDiam = False,
label = 'factory',
materialId = 0
)
if TestType == '2D':
factory = factoy2D
elif TestType == '3D':
factory = factoy3D
#4.3 Engines
O.engines=[
ForceResetter(),
InsertionSortC
Bo1_Sphere_
Bo1_Box_Aabb(),
Bo1_Wall_Aabb(),
Bo1_Facet_Aabb()
], verletDist=
IntLoop,
factory,
DomainLimiter(
GlobalStiffnes
active=True,
defaultDt=
timeStepUpdat
),
NewtonIntegrat
PyRunner(
# PyRunner(
]
##################
### 5.PyRunner ###
##################
def Porosity(Region):
if TestType == '3D':
return porosity(Region)
elif TestType == '2D':
soma=0.
for b in O.bodies:
if isinstance(
soma+
return (Region-
if TestType == '2D':
acelerador = 1
elif TestType == '3D':
acelerador = 5
Compressao=False
Descompressao=False
AlturaPreenchida=0
def PreencherTriaxi
global Compressao
global Descompressao
global topo
global AlturaPreenchida
if Compressao:
if Porosity(
topo.state.vel = (0.,0.,
Descompressao = True
Compressao = False
newton.damping = 0.7
else:
topo.state.vel = (0,0,-10*
elif Descompressao:
if abs(O.forces.
if topo.state.
print Porosity(
AlturaPreen
print AlturaPreenchid
if topo.state.
Material.
if AlturaPreenchid
topo.
calm()
Descompres
Material.
newton.
PrepararAm
PrepararAm
else:
topo.state.vel = (0,0,0)
Descompressao = False
factory.
# factory.center[2] = (AlturaPreenchi
# factory.extents[2] = (height-
newton.damping = 0.1
# if AlturaPreenchida > 0.95*height:
# newton.gravity = [0.,0.,-9.81]
else:
# topo.state.
topo.
topo.
elif factory.
Compressao=True
def EstabilizarTria
if topo.state.
topo.
else:
topo.
if utils.unbalance
PrepararAmos
def FinalizarPreparo():
print "Amostra Preparada"
print "Densidade"
print Material.density
print "Porosidade"
print Porosity(
print "Tempo"
print O.realtime
export.
O.pause()
O.run()
utils.waitIfBatch()
Thank you so much and wish have a good day!
Regards,
Jessica.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Jessica Soares da Rocha for more information if necessary.