CpmMat elastic calibration difficulty
I am currently trying to make the elastic calibration of the CpmMat model but the values of the computed poisson, based on the uniax.py code, are not changing even though I change in the CpmMat the values of 'young' and 'poisson'. Below is my simulation code on yade 2019.1a:
#######
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from future import standard_library
standard_
from yade import plot,pack,timing
import time, sys, os, copy, numpy as np
savedir = './elastmat/'
# default parameters or from table
readParamsFromT
young = 24e9,
poisson = 0.8,
#sigmaT=18e6,
#frictionAngle
epsCrackOnset=
relDuctility=0.1,
intRadius=1.5,
dtSafety=.4,
damping=0.4,
strainRateTens
strainRateComp
setSpeeds=True,
# 1=tension, 2=compression (ANDed; 3=both)
doModes=1,
specimenLength
specimenRadius
sphereRadius=
# isotropic confinement (should be negative)
isoPrestress=0,
noTableOk=True,
# Number of elements to fetch in order to compute Poisson
n=500
)
from yade.params.table import *
if 'description' in list(O.
print(young, poisson)
concreteId=
CpmMat(
young=young,
#frictionAng
poisson=poisson,
density=6420,
#sigmaT=sigmaT,
relDuctility
epsCrackOnse
#isoPrestres
)
)
sps=SpherePack()
#sp=pack.
sp=pack.
spheresIn
radius=
memoizeDb
returnSph
sp.toSimulation
def getElementsCurr
return np.array(
ibpos = getElementsCurr
def fetchElements(
pos = np.array(pos)
distances = np.sum(
return ibpos[distances
def computePosition
elements = np.array(
current_position = getElementsCurr
return current_
allpos = computePosition(n)
bb=uniaxialTest
negIds,
O.dt=dtSafety*
print('
mm,mx=[pt[axis] for pt in aabbExtrema()]
imm, imx = mm, mx
coord_25,
area_25,
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegrat
CpmStateUpdate
UniaxialStrain
PyRunner(
PyRunner(
]
# plot stresses in ¼, ½ and ¾ if desired as well; too crowded in the graph that includes confinement, though
plot.plots=
O.saveTmp(
O.timingEnabled
global mode
mode='tension' if doModes & 1 else 'compression'
def initTest():
global mode
print("init")
if O.iter>0:
O.wait();
O.loadTmp(
print("Reversing plot data"); plot.reverseData()
else: plot.plot(
strainer.
try:
from yade import qt
renderer=
renderer.
except ImportError: pass
print("init done, will now run.")
O.step(); # to create initial contacts
# now reset the interaction radius and go ahead
ss2sc.
is2aabb.
O.run()
def stopIfDamaged():
global mode, allpos
if O.iter<2 or 'sigma' not in plot.data: return # do nothing at the very beginning
sigma,
allpos = np.append(allpos, computePosition(n), 1)
print(
extremum=
minMaxRatio=0.8 if mode=='tension' else 0.8
if extremum==0: return
import sys; sys.stdout.flush()
if abs(sigma[
if mode=='tension' and doModes & 2: # only if compression is enabled
numpy.
numpy.
mode=
O.save(
print("Saved /tmp/uniax-
print("Damaged, switching to compression... "); O.pause()
# important! initTest must be launched in a separate thread;
# otherwise O.load would wait for the iteration to finish,
# but it would wait for initTest to return and deadlock would result
import _thread; _thread.
return
else:
numpy.
numpy.
print("Damaged, stopping.")
ft,fc=
if doModes==3:
print(
if doModes==2:
print(
if doModes==1:
print('Tensile strength ft=%g'%(abs(ft)))
title=
print('Bye.')
O.pause()
def addPlotData():
yade.plot.
initTest()
waitIfBatch()
#######
If I run this code, I'll have as result two files, one for computing the Young modulus (which is trivial) and another for computing the Poisson modulus (file contains the 500 most central elements positions in which I compute the eps on the three axis to then compute the poisson modulus, whose algorythm is based in the process described on Šmilauer's thesis, page 53 (https:/
The code for Poisson calculus can be found below, in which cutoff is a parameter I manually change in order to get only the linear part of the curve:
#######
def computePoisson(
from scipy.stats import linregress
import numpy as np
pos = np.loadtxt(PATH)
x = pos[:,::4]
y = pos[:,1::4]
z = pos[:,2::4]
dx = x-x[:,0,None]
dy = y-y[:,0,None]
dz = z-z[:,0,None]
poissons = []
for x_, dx_, y_, dy_, z_, dz_ in zip(x.T, dx.T, y.T, dy.T, z.T, dz.T):
ex = linregress(x_, dx_)[0]
ey = linregress(y_, dy_)[0]
ez = linregress(z_, dz_)[0]
v = (-0.5 * (ex + ey)) / ez
return(
#######
By doing so, I can evaluate the variation of Macro Young based on Micro Young and Micro Poisson, but on this case my Micro Poisson will be 0.187 regardless of the variation of these parameters.
If anyone could help on this aspect, thank you, I have no idea on what is causing this non-variability.
I tried searching other topics like https:/
Is there any key point I'm obviously missing in my analysis?
Thank you beforehand and best regards!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Mumić
- Solved:
- Last query:
- Last reply:
This question was reopened
- by Mumić