Question #276604 on Yade changed:
https://answers.launchpad.net/yade/+question/276604

Yor1 posted a new comment:
Hello Jan,

I use the formula of plastic dissipation used in sources.
In fact, i integrate the formula in the recorder like this :

tensCks=shearCks=cks=cks0=0
e10=e20=e30=0

def recorder():
    E=0
    Ub=0
    Uc=0
    Wp=0
    Wpla=0

    global tensCks, shearCks, e10,e20,e30
    tensCks=0
    shearCks=0
    for o in O.bodies:
        tensCks+=o.state.tensBreak
        shearCks+=o.state.shearBreak

    for i in O.interactions:
       #Ft=i.phys.shearForce
       #du=i.geom.shearInc
       #kt=i.phys.ks
       #Fn=i.phys.normalForce
       #Ftt=Ft-kt*du
       #maxFs=(Fn.norm()*tan(math.pi*FRICT/180)

      if((i.phys.shearForce-i.phys.ks*i.geom.shearInc).norm() > 
i.phys.normalForce.norm()*tan(math.pi*FRICT/180) ):
                Ftt=i.phys.shearForce-i.phys.ks*i.geom.shearInc
                ratio = i.phys.normalForce.norm()*tan(math.pi*FRICT/180) / 
Ftt.norm()
                trialForce=Ftt
                Ftt *= ratio
                e=((1/i.phys.ks)*(trialForce-Ftt)).dot(Ftt)
                Wpla=Wpla+e
      if not i.isReal : continue
      if isinstance(O.bodies[i.id1].shape,Sphere) and 
isinstance(O.bodies[i.id2].shape,Sphere):
        E+=0.5*(i.phys.normalForce.squaredNorm()/i.phys.kn + 
i.phys.shearForce.squaredNorm()/i.phys.ks)
                
    yade.plot.addData( t=O.time
                        ,i=O.iter
                        ,e1=triax.strain[0]-e10
                        ,e2=triax.strain[1]-e20
                        ,e3=triax.strain[2]-e30
                        ,s1=triax.stress(triax.wall_right_id)[0]
                        ,s2=triax.stress(triax.wall_top_id)[1]
                        ,s3=triax.stress(triax.wall_front_id)[2]
                        
,tc=0.5*tensCks,sc=0.5*shearCks,unbF=utils.unbalancedForce()
                        ,E=E   #Energie elastique
                        ,Wp=triax.externalWork #Travail des contraintes 
appliquees aux limites de echantillon
                        ,Wk=utils.kineticEnergy() #Energie cinetique
                        
,Wd=2*utils.kineticEnergy()*DAMP*0.1*utils.PWaveTimeStep() #Energie dissipee 
par amortissement
                        ,Wpla=Wpla #energie plastique
    )
    plot.saveDataTxt(OUT)

-- 
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