yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #25830
Re: [Question #697744]: Increase particle radiues
Question #697744 on Yade changed:
https://answers.launchpad.net/yade/+question/697744
Description changed to:
Hi,
I am increasing my particle radius at each 100 iteration. But particle
radius is not updating when using body.state.radius to update it. The
change is not visible in the GUI.
Best,
Mithu
Here is my code:
#!/usr/bin/env python
#encoding: ascii
# Testing of the Deformation Enginge with Luding Contact Law
# Modified Oedometric Test
# The reference paper [Haustein2017]
from __future__ import print_function
from yade import utils, plot, timing
from yade import pack
import pandas as pd
import numpy as np
from scipy.integrate import odeint
o = Omega()
# Physical parameters
fr = 0.54
rho = 1050
Diameter = 0.0012
D=Diameter
r1 = Diameter/2
#r2 = Diameter/2
k1 = 100000
kp = 12.0*k1
kc = k1 * 0.1
ks = k1 * 0.1
DeltaPMax = Diameter/3.0
Chi1 = 0.34
o.dt = 1.0e-7
particleMass = 4.0/3.0*math.pi*r1*r1*r1*rho
Vi1 = math.sqrt(k1/particleMass)*DeltaPMax*Chi1
PhiF1=0.999
#PhiF1 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)
Tab_rad=0.008
Cyl_height=0.045
cross_area=math.pi*(Tab_rad**2)
Comp_press= 0.5e8
Comp_force=Comp_press*cross_area
i=0
# swelling_mode function
def model(r,t,Q_max,rho_t,rho_w,r_0,D):
Q=((rho_w*(r**3))/(rho_t*(r_0**3)))-(rho_w/rho_t)+1;
drdt =((D*rho_t)/(r*rho_w))*((Q_max-Q)/Q);
return drdt
P=[1.45,rho,1000,r1,396.36e-12]
time_save=[]
radius_save=[]
#*************************************
# Add material
mat1 = O.materials.append(LudingMat(frictionAngle=fr, density=rho, k1=k1, kp=kp, ks=ks, kc=kc, PhiF=PhiF1, G0 = 0.0))
# Spheres for compression and walls
sp=pack.SpherePack()
sp.makeCloud((-3.0*Diameter,-3.0*Diameter,-18*Diameter),(3.0*Diameter,3.0*Diameter,18.0*Diameter), rMean=Diameter/2.0,rRelFuzz=0.18,num=527)
sp.toSimulation(material=mat1)
walls=O.bodies.append(yade.geom.facetCylinder((0,0,0),radius=Tab_rad,height=Cyl_height,segmentsNumber=20,wallMask=6,material=mat1))
# Add engines
o.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.05),
Bo1_Wall_Aabb(),
Bo1_Facet_Aabb()
]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.05),
Ig2_Facet_Sphere_ScGeom(),
Ig2_Wall_Sphere_ScGeom()],
[Ip2_LudingMat_LudingMat_LudingPhys()],
[Law2_ScGeom_LudingPhys_Basic()]
),
NewtonIntegrator(damping=0.1, gravity=[0, 0, 0]),
PyRunner(command='ParticleSwelling()', iterPeriod=100, label="fCheck"),
#DeformControl(label="DefControl")
]
def ParticleSwelling():
time_current=O.iter*o.dt
time_save.append(time_current)
radius_save_t=[]
for b in O.bodies:
if isinstance(b.shape, Sphere):
t=[0,time_current-time_save[0]]
r= odeint(model,P[3],t,args=(P[0],P[1],P[2],P[3],P[4],))
b.state.radius = r[1]
radius_save_t.append(b.state.radius)
radius_save.append(radius_save_t)
if time_current>8:
O.pause()
radius_data=pd.DataFrame(radius_save)
radius_data.to_csv(r'compression_data_PH101.csv')
--
You received this question notification because your team yade-users is
an answer contact for Yade.