← Back to team overview

yade-users team mailing list archive

Re: [Question #689234]: How to export relative velocity of spheres to Paraview

 

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

    Status: Solved => Open

Chien-Cheng Hung is still having a problem:
Hi Jan,

In my "vtk.exportInteractions" command, I don't want to export the
interactions that are related to O.bodies[0] and O.bodies[1]. How do
exclude specific interactions from my export vtk files?

I tried as follow but it seems not to work. 
I'd appreciate it if you could give some hints. Thank you!

###
def weakeningTemp(i):
    heatCapacity = 900 # [J/kg*K]
    density = 2500 # [kg/m3]
    thermal_diff = 1.e-6
    shear_modulus = 22e9
    tau_c = 0.1*shear_modulus
    initialTemp = 20
    penetrationDepth = i.geom.penetrationDepth                    
    radius1 = i.geom.refR1                                        
    radius2 = i.geom.refR2                                        
    effectiveRadius = (i.geom.refR1 * i.geom.refR2 )/( i.geom.refR1+i.geom.refR2  )         
    contactRadius = math.sqrt( i.geom.penetrationDepth *effectiveRadius)   
    Da = 2 * contactRadius
    contactArea = np.pi*(contactRadius**2)                        
    relativeVelocity = i.geom.shearInc.norm()/O.dt                
    weakeningTemp = (math.sqrt((relativeVelocity*Da)/(np.pi*thermal_diff))*tau_c)/(density*heatCapacity) + initialTemp
    return weakeningTemp

builtins.weakeningTemp = weakeningTemp # such that VTKExporter has
access to it

vtk = export.VTKExporter("weakingTemp_test")
def vtkExport():
    for a in range(2,len(O.bodies)):
        b = O.bodies[a]
    for i in b.intrs():
        O.interactions.erase(i.id1,0)
        O.interactions.erase(i.id1,1)
        O.interactions.erase(0,i.id2)
        O.interactions.erase(1,i.id2)
        vtk.exportInteractions(what=dict(weakeningTemp="weakeningTemp(i)"))
###

Cheers,
Chien-Cheng

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