Пример #1
0
 def mag_work(field,data):
     """v dot j cross B"""
     Bvector = [data['magnetic_field_%s'%s] for s in 'xyz']
     current = xo.Curl(Bvector, data.dds)
     output  = data['velocity_x']*(current[1]*Bvector[2]-current[2]*Bvector[1])
     output += data['velocity_y']*(current[2]*Bvector[0]-current[0]*Bvector[2])
     output += data['velocity_z']*(current[0]*Bvector[1]-current[1]*Bvector[2])
     output *= 1./(np.pi*4)
     return output
Пример #2
0
 def mag_force_norm(field,data):
     """||j cross B||"""
     Bvector = [data['magnetic_field_%s'%s] for s in 'xyz']
     current = xo.Curl(Bvector, data.dds)
     output  = (current[1]*Bvector[2]-current[2]*Bvector[1])**2
     output += (current[2]*Bvector[0]-current[0]*Bvector[2])**2
     output += (current[0]*Bvector[1]-current[1]*Bvector[2])**2
     output = np.sqrt(output)
     output *= 1./(np.pi*4)
     return output
Пример #3
0
 def current_z(field,data):
     Bvector = [data['magnetic_field_%s'%s] for s in 'xyz']
     return xo.Curl(Bvector   , data.dds,component=2)