problem of the command "O.cell.velGrad"
Hi
Firstly, A RVE (goal stress-strain stress(
-------
#!/usr/bin/python # This is server.py file
import string
from yade import plot,qt
from yade.pack import *
from yade import pack
O.materials.
initSize=0.028
sp=pack.
O.periodic=True
sp.toSimulation()
O.save('model.gz')
O.dt=1e-7
def plotAddData():
with open('stressStr
f.write(
f.write('\n')
EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
NewtonIntegrat
Peri3dController(
# after reaching nSteps do doneHook action
label='p3d'
),
PyRunner(
]
p3d.stressMask=
p3d.goal=
O.step()
bo1s.aabbEnlarg
O.run(); O.wait()
-------
As you can see, the strain and stress at each step are written in the file "stressStrain.txt".
Now I want to use the strain in the "stressStrain.txt" to calculate the stress again using the following commands:
-------
#!/usr/bin/python # This is server.py file
import string
from yade.pack import *
from yade import pack
import numpy as np # initial the math of matrix compute (needed in ns)
# initial the global , variables
arrcc =[0]*3 # last step strain(commit)
arrtt =[0]*3 # last step strain(trail)
scc=[0]*3 # last step stress
orst=1 # initialize the orginal save document(trial)
check=[0]*1 # I need to calculate the first step when ag=0
check[0]=0
pertstrain=[0]*3
count=[0]
# load the identical package
O.load(
#O.periodic=True ### note!!! add
O.dt=1e-8
ns=100
# see the example of peri3dcontroller, 1.5 is used to speed up the computation
EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
NewtonIntegrat
]
O.cell.
#O.step()
O.run(1,True)
bo1s.aabbEnlarg
def response(msg):
# change the form of message
aa = msg.split(',')
global arrcc
global arrtt
global scc
global orst
arr=[0]*3 # change form, the current strain
if orst == 2:
O.loadTmp('temp')
orst == 2
for i in range(0,3):
arr[i] = string.atof(aa[i])
ag = [0]*3 # current - last ie. the changed strain
ag[0] = arr[0] - arrcc[0]
ag[1] = arr[1] - arrcc[1]
ag[2] = (arr[2] - arrcc[2]) # incremental strain
arrcc[0]=arr[0] # update strain
arrcc[1]=arr[1]
arrcc[2]=arr[2]
dstrain = utils.Matrix3(
O.cell.
O.run(ns,True)
stressValue=
stressxx=
stressyy=
stressxy=
print stressxx,
O.saveTmp('temp') # different gauss point has different number(first first ...)
with open('stressStr
lines=
flen=len(lines)
for i in lines:
numbers=i.split()
strain=
msg = str(strain[
response(msg)
-------
I thought the stress calculated are the same ones in the "stressStrain.txt" (or acceptable small errors ), however, they are not, and the results are seriously affected by the time step O.dt.
I think using the command "O.cell.
Can you please tell me how to solve the problem? my goal is: when I give a strain, the RVE returns a correct stress (i.e., the one in the stressStrain.txt )
I would greatly appreciate it if you can help me!
Thank you!
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 dan.wang for more information if necessary.