Cross-section image
Hi,
How can I take a 2D cross -section image of my compacts. Similar to a X-ray computed microtomography (XμCT).
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
o = Omega()
# Physical parameters
fr = 0.54
rho = 1050
Diameter = 0.000079
D=Diameter
r1 = Diameter
r2 = Diameter
k1 = 126000
kp = 12.0*k1
kc = k1 * 0.1
ks = k1 * 0.1
DeltaPMax = Diameter/3.0
Chi1 = 0.34
o.dt = 1.0e-10
particleMass = 4.0/3.0*
Vi1 = math.sqrt(
PhiF1=0.999
#PhiF1 = DeltaPMax*
Tab_rad=0.0017
Tab_height=0.0075
Comp_press=3e8
cross_area=
Comp_force=
#******
# Add material
mat1 = O.materials.
# Spheres for compression
sp=pack.
sp.makeCloud(
#cyl = pack.inCylinder
#sp = pack.filterSphe
sp.toSimulation
##No of particles
count = 0
for b in O.bodies:
if isinstance(b.shape, Sphere):
count +=1
##Mass of particles
m_p=count
#######
#O.bodies.
walls=O.
df = pd.DataFrame(
df.to_csv(
from csv import writer
def append_
# Open file in append mode
with open(file_name, 'a+', newline='') as write_obj:
# Create a writer object from csv module
csv_writer = writer(write_obj)
# Add contents of list as last row in the csv file
df = pd.DataFrame(
df.to_csv(
from csv import writer
def append_
# Open file in append mode
with open(file_name, 'a+', newline='') as write_obj:
# Create a writer object from csv module
csv_writer = writer(write_obj)
# Add contents of list as last row in the csv file
# Add engines
o.engines = [
ForceResetter(),
InsertionSort
InteractionLoop(
[Ig2_
Ig2_
Ig2_
[Ip2_
[Law2_
),
NewtonIntegra
#VTKRecorder(
PyRunner(
DeformControl
]
def checkForce():
# at the very start, unbalanced force can be low as there is only few
# contacts, but it does not mean the packing is stable
if O.iter < 1000:
return
# the rest will be run only if unbalanced is < .1 (stabilized packing)
timing.reset()
#if unbalancedForce() > 0.2:
# return
# add plate at upper box side
highSphere = 0.0
for b in O.bodies:
if highSphere < b.state.pos[2] and isinstance(b.shape, Sphere):
else:
pass
O.bodies.
# without this line, the plate variable would only exist inside this
# function
global plate
plate = O.bodies[-1] # the last particles is the plate
# Wall objects are "fixed" by default, i.e. not subject to forces
# prescribing a velocity will therefore make it move at constant velocity
# (downwards)
plate.state.vel = (0, 0, -30)
# start plotting the data now, it was not interesting before
O.engines = O.engines + [PyRunner(
# next time, do not call this function anymore, but the next one
# (unloadPlate) instead
fCheck.command = 'unloadPlate()'
def unloadPlate():
# if the force on plate exceeds maximum load, start unloading
# if abs(O.forces.
if abs(O.forces.
# next time, do not call this function anymore, but the next one
# (stopUnloading) instead
def stopUnloading():
if abs(O.forces.
# O.tags can be used to retrieve unique identifiers of the simulation
# if running in batch, subsequent simulation would overwrite each other's output files otherwise
# d (or description) is simulation description (composed of parameter values)
# while the id is composed of time and process number
# plot.saveDataTx
O.pause()
def addPlotData():
if not isinstance(
return
Fz = O.forces.
plot.addData(
Fz=Fz,
i=O.iter
)
def defVisualizer():
with open("data.
for b in O.bodies:
if isinstance(b.shape, Sphere):
O.timingEnabled
O.run(1, True)
plot.plots=
plot.plot()
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 Mithushan Soundaranathan for more information if necessary.