New question #303013 on Yade:
https://answers.launchpad.net/yade/+question/303013

Hi, everyone 
  I want to use the engine Peri3dController to reach the goal state, but I 
suffered some question. I used the identical initial condition, and used two 
ways to reach the same goal of strain, but I got different results. The first 
way is that I used the stressMask=0b011100 and goal=(0,-8e-4,0,0,0,0) and 
nSteps = 8000 to compute once. The second way is that I used the 
stressMask=0b011100 and goal=(0,-4e-4,0,0,0,0) and nSteps = 4000 to compute 
twice by using strain=p3d.strain(imitating the example 
peri3dController_triaxialCompression.py ). I thought that the final goal is 
same, and the rate of applied strain is also same (goal/nSteps), so the final 
stress should be same, too, should not it? But the final stress is different! 
The following is my code, can you give me some suggestions? Thank you.

##################################### The initial condition
#!/usr/bin/python           # This is server.py file
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot

O.materials.append(CpmMat(young=150e9,frictionAngle=atan(0.8),poisson=.2,sigmaT=500e8,epsCrackOnset=1e-6,relDuctility=80000))

initSize=1.2

sp=pack.randomPeriPack(radius=.05,initSize=Vector3(initSize,initSize,initSize))

sp.toSimulation()

O.save('/tmp/tt.gz')

################################# The first way, using goal=-8e-4 and 
nSteps=8000 to compute once
#!/usr/bin/python           # This is server.py file
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot

loadFile='/tmp/tt.gz'
O.load(loadFile)

O.dt=PWaveTimeStep()/2

plot.plots={'ex':('sx',)}
def plotAddData():
        plot.addData(
                sx=p3d.stress[1],
                ex=p3d.strain[1],
        )

EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
        ForceResetter(),
        
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
        InteractionLoop(
                
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
                [Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
        NewtonIntegrator(),
        Peri3dController(
                                        
                                                        nSteps=8000,            
        # how many time steps the simulation will last
                                                        # after reaching nSteps 
do doneHook action
                                                        doneHook='print 
"Simulation with Peri3dController finished."; O.pause()',

                                                        # the prescribed path 
(step,value of stress/strain) can be defined in absolute values
                                                        
                                                        # or in relative values
                                                        
                                                        # if the goal value is 
0, the absolute stress/strain values are always considered (step values remain 
relative)plot.plots={'ex':('sx',)}
                                                        
                                                        # if ##Path is not 
explicitly defined, it is considered as linear function between (0,0) and 
(nSteps,goal)
                                                        # as in yzPath and 
xyPath
                                                        # the relative values 
are really relative (zxPath gives the same - except of the sign from goal value 
- result as yyPath)
                                                        
                                                        
                                                        # variables used in the 
first step
                                                        label='p3d'
                                                        ),
        PyRunner(command='plotAddData()',iterPeriod=1),
]



p3d.stressMask=0b011100       # prescribed ex,ey,sz,syz,ezx,sxy;   e..strain;  
s..stress
p3d.goal=(0,-0.008,0,0,0,0)  #xx, yy, zz, yz, zx, xy
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.
O.run(); O.wait()


print "p3d.stress[0]"
print p3d.stress[0]
print "p3d.stress[1]"
print p3d.stress[1]
print "p3d.stress[5]"
print p3d.stress[5]


plot.saveDataTxt('8000.txt')    
plot.plot(subPlots=False)


####################################### The second way, using goal=-4e-4 and 
nSteps=4000 and strain=p3d.strain to compute twice
#!/usr/bin/python           # This is server.py file
import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot


loadFile='/tmp/tt.gz'
O.load(loadFile)

 
O.dt=PWaveTimeStep()/2

plot.plots={'ex':('sx',)}
def plotAddData():
        plot.addData(
                sx=p3d.stress[1],
                ex=p3d.strain[1],
        )

EnlargeFactor=1.5
EnlargeFactor=1.0
O.engines=[
        ForceResetter(),
        
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
        InteractionLoop(
                
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
                [Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
        NewtonIntegrator(),
        Peri3dController(
                                        
                                                        nSteps=4000,            
        # how many time steps the simulation will last
                                                        # after reaching nSteps 
do doneHook action
                                                        doneHook='print 
"Simulation with Peri3dController finished."; O.pause()',

                                                        # the prescribed path 
(step,value of stress/strain) can be defined in absolute values
                                                        
                                                        # or in relative values
                                                        
                                                        # if the goal value is 
0, the absolute stress/strain values are always considered (step values remain 
relative)plot.plots={'ex':('sx',)}
                                                        
                                                        # if ##Path is not 
explicitly defined, it is considered as linear function between (0,0) and 
(nSteps,goal)
                                                        # as in yzPath and 
xyPath
                                                        # the relative values 
are really relative (zxPath gives the same - except of the sign from goal value 
- result as yyPath)
                                                        
                                                        
                                                        # variables used in the 
first step
                                                        label='p3d'
                                                        ),
        PyRunner(command='plotAddData()',iterPeriod=1),
]



p3d.stressMask=0b011100       # prescribed ex,ey,sz,syz,ezx,sxy;   e..strain;  
s..stress
p3d.goal=(0,-0.004,0,0,0,0)  #xx, yy, zz, yz, zx, xy
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.
O.run(); O.wait()



O.engines=[
                                ForceResetter(),
                                
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.0)]),
                                InteractionLoop(
                                        
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.0)],
                                        
[Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
                                NewtonIntegrator(),
                                Peri3dController(
                                                                                
# Vector6 of prescribed final values (xx,yy,zz, yz,zx,xy)
                                                                                
stressMask=0b011100,    # prescribed ex,ey,sz,syz,ezx,sxy; 
                                                                                
nSteps=4000,                    # how many time steps the simulation will last
                                                                                
# after reaching nSteps do doneHook action
                                                                                
doneHook='print "Simulation with Peri3dController finished."; O.pause()',

                                                                                
# the prescribed path (step,value of stress/strain) can be defined in absolute 
values
                                                        
                                                                                
# or in relative values
                                                        
                                                                                
# if the goal value is 0, the absolute stress/strain values are always 
considered (step values remain relative)
                                                        
                                                                                
# if ##Path is not explicitly defined, it is considered as linear function 
between (0,0) and (nSteps,goal)
                                                                                
# as in yzPath and xyPath
                                                                                
# the relative values are really relative (zxPath gives the same - except of 
the sign from goal value - result as yyPath)
                                                        
                                                        
                                                                                
# variables used in the first step
                                                                                
label='p3d',
                                                                                
strain=p3d.strain
                                                                                
),
                                PyRunner(command='plotAddData()',iterPeriod=1),
                        
                        ]

p3d.goal=(0,-0.004,0,0,0,0)   
print p3d.goal
O.run();O.wait()




print "p3d.stress[0]"
print p3d.stress[0]
print "p3d.stress[1]"
print p3d.stress[1]
print "p3d.stress[5]"
print p3d.stress[5]


plot.saveDataTxt('4000.txt')    
plot.plot(subPlots=False)




-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to