Particles in the middle of the cylinder disappeared after adding the thermal engine
Hi,everyone!
I have completed a relatively good fluid-solid coupling simulation before. Recently, I wanted to add temperature effect, so I added thermalengine to the original script. However, there was a problem as described in the title: I opened the 3D view and found that the particles in the middle of the cylinder had disappeared, so I could not get the desired results.
I do not know what happened,thank you for any possible help or suggestion..
-------
from yade import pack, ymport, plot, utils, export, timing
import numpy as np
import sys
#readParamsFrom
#from yade.params import table
#global Sy
Sy=4e6
damp=0.4
key='_triax_base_'
young=66.2e9
name='JCFPM_triax'
poisson=0.522
name='cylinder'
preStress=-60e6
strainRate = -10
OUT=str(
r1=0.005
r2=0.008
nw=24
nh=15
rParticle=
bcCoeff = 5
width = 0.025
height = 0.05
A=0.25*
allx,ally,
mnx=min(allx)*1.01 #same as aabbExtrema, get the xyz of the lowest corner, multiply by factor to reduce it to let the wall surround all the spheres.
mny=min(ally)*1.01
mnz=min(allz)*0.99
mxx=max(allx)*1.01 #same as aabbExtrema, get the xyz of the top corner, multiply by factor to increase it to let the wall surround all the spheres.
mxy=max(ally)*1.01
mxz=max(allz)*1.01
O.materials.
O.materials.
O.materials.
mn,mx=Vector3(
walls=aabbWalls
wallIds=
bottom,
sp=pack.
pred=pack.
sp=pack.
spheres=
bot = [O.bodies[s] for s in spheres if O.bodies[
top = [O.bodies[s] for s in spheres if O.bodies[
vel = strainRate*
for s in bot:
s.shape.color = (1,0,0)
s.state.
#s.state.vel = (0,0,-vel)
for s in top:
s.shape.color = Vector3(0,1,0)
s.state.
s.state.vel = (0,0,vel)
facets = []
rCyl2 = .5*width / cos(pi/float(nw))
for r in range(nw):
for h in range(nh):
v1 = Vector3( rCyl2*cos(
v2 = Vector3( rCyl2*cos(
v3 = Vector3( rCyl2*cos(
v4 = Vector3( rCyl2*cos(
f1 = facet((
f2 = facet((
facets.
O.bodies.
mass = O.bodies[
for f in facets:
f.state.mass = mass
f.state.
def lateral():
elatTot=0.0
nTot=0
for b in O.bodies:
x=b.state.
y=b.state.
d=sqrt(
if d > r1 and d < r2:
b.shape.
xnew=
ynew=
dnew=
elat=(dnew-d)/d
elatTot+=elat
nTot+=1
elat_avg=
return elat_avg
def bodyByPos(x,y,z):
cBody = O.bodies[1]
cDist = Vector3(
for b in O.bodies:
if isinstance(b.shape, Sphere):
dist = b.state.pos - Vector3(x,y,z)
if np.linalg.
cDist = dist
cBody = b
return cBody
bodyOfInterest = bodyByPos(
def addForces():
for f in facets:
n = f.shape.normal
a = f.shape.area
O.forces.
def stopIfDamaged(
extremum = max(abs(s) for s in plot.data['s'])
s = abs(plot.
e = abs(plot.
if O.iter < 1000 or e < maxEps:
return
if abs(s)/
print('Simulation finished')
presentcohesi
for i in O.interactions:
if hasattr(i.phys, 'isCohesive'):
if i.phys.isCohesive == True:
print('the number of cohesive bond now is:',presentcoh
print('Max stress and strain:
O.wait()
O.dt=.01*
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
PyRunner(
FlowEngine(
ThermalEngine(
newton,
PyRunner(
PyRunner(
]
def plotAddData():
elat_avg=lateral()
Qin = flow.getBoundar
perm = abs(Qin) * flow.viscosity * height / (A * Sy)
f1 = sum(O.forces.
f2 = sum(O.forces.
f = .5*(f2-f1)
s = f/(pi*.
e = (top[0]
plot.addData(
elateral = elat_avg,
i = O.iter,
s = -s,
e = -e,
tc = interactionLaw.
sc = interactionLaw.
permeability = perm
)
plot.saveDataT
O.step()
ss2sc.interacti
is2aabb.
cohesiveCount = 0
for i in O.interactions:
if hasattr(i.phys, 'isCohesive'):
if i.phys.isCohesive == True:
cohesiveCount+=1
print('the origin total number of cohesive bond is:',cohesiveCount)
flow.debug=False
flow.permeabili
flow.defToleran
flow.meshUpdate
flow.fluidBulkM
flow.useSolver=4
flow.permeabili
flow.viscosity= 0.001
flow.decoupleForces = False
flow.bndCondIsP
flow.bndCondVal
flow.dead=0
flow.emulateAct
flow.bndCondIsT
flow.thermalEng
flow.thermalBnd
flow.tZero=25
flow.tZero=25
thermal.dead=1
thermal.
thermal.
thermal.debug=0
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.fluidK = 0.650
thermal.fluidBeta = 2e-5 # 0.0002
thermal.particleT0 = 25
thermal.particleK = 2.0
thermal.particleCp = 710
thermal.
thermal.
thermal.
thermal.
thermal.
thermal.dead=0
plot.plots = { 'e':('s',), 'elateral':('s'),}
plot.plot()
O.run()
#######
Best wishes!
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: