Advertisement
Guest User

sss

a guest
Oct 22nd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. { SPACE_CHARGE.PDE
  2.  
  3.  
  4.  
  5. This problem describes the electric field in an insulated cardioid-like
  6.  
  7. chamber due to an electrode at the tip of the cardioid and a localized
  8.  
  9. space charge near the center of the body.
  10.  
  11.  
  12.  
  13. Adaptive grid refinement detects the space charge and refines
  14.  
  15. the computation mesh to resolve its shape.
  16.  
  17.  
  18.  
  19. }
  20.  
  21.  
  22. title "Electrostatic Potential with probe and space charge"
  23.  
  24.  
  25. select errlim = 1e-4
  26.  
  27.  
  28. definitions
  29.  
  30. bigr = 1
  31.  
  32. smallr = 0.4
  33.  
  34. x0 = sqrt(bigr^2/2)
  35.  
  36. y0 = x0
  37.  
  38. r = sqrt(x^2+y^2)
  39.  
  40. { define the electrode center }
  41.  
  42. xc = sqrt((bigr-smallr)^2/2)
  43.  
  44. yc = xc
  45.  
  46. { A space charge source at -xc }
  47.  
  48. source = x/((x+xc)^2 + y^2 + 0.001)
  49.  
  50. k=0.1
  51.  
  52.  
  53. variables
  54.  
  55. V
  56.  
  57.  
  58. equations
  59.  
  60. V : div(k*grad(V)) + source = 0
  61.  
  62.  
  63. boundaries
  64.  
  65. region 1
  66.  
  67. start(xc,yc-smallr)
  68.  
  69.  
  70.  
  71. natural(V) = 0 { -- insulated outer boundary }
  72.  
  73. arc(center=xc,yc) to (x0,y0)
  74.  
  75. arc(center=0,0) angle 270
  76.  
  77. arc(center=xc,-yc) to (xc,smallr-yc)
  78.  
  79. value(V)=1 { -- applied voltage = 1 on tip }
  80.  
  81. arc(center=xc,0) angle -180 to close
  82.  
  83.  
  84. plots
  85.  
  86. grid(x,y)
  87.  
  88. contour(V) as "Potential"
  89.  
  90. contour(V) zoom(0.2,-0.2,0.4,0.4)
  91.  
  92. surface(V) viewpoint (0,10,30)
  93.  
  94. surface(V) zoom(-0.6,-0.2,0.4,0.4)
  95.  
  96. surface(source) zoom(-0.6,-0.2,0.4,0.4)
  97.  
  98.  
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement