Télécharger biot_helmholtz.dgibi

Retour à la liste

Numérotation des lignes :

  1. ************************************************************************
  2. * Test de l'operateur BIOT pour le calcul *
  3. * du champ d'induction magnetique *
  4. * *
  5. * Calcul du champ d'induction magnetique B cree par des bobines de *
  6. * Helmholtz *
  7. * *
  8. * Reference : https://fr.wikipedia.org/wiki/Bobines_de_Helmholtz *
  9. * *
  10. ************************************************************************
  11.  
  12. ** Indicateur de trace
  13. itrac = FAUX ;
  14.  
  15.  
  16.  
  17. *------------------------- P A R A M E T R E S ------------------------*
  18.  
  19. ** Bobines (rayon, nombre de tours, courant)
  20. r = 1. ;
  21. nt = 100 ;
  22. i = 42. ;
  23.  
  24. ** Dimensions du domaine de calcul et parametre de discretisation
  25. l = 4. ;
  26. dens1 = 0.05 ;
  27.  
  28. ** Permeabilite magnetique du milieu
  29. mu = 12.566E-7 ;
  30.  
  31.  
  32.  
  33.  
  34. ** Options de calcul
  35. OPTI 'DIME' 2 'MODE' 'AXIS' 'ELEM' 'QUA4' 'DENS' dens1 ;
  36.  
  37. ** On maille le domaine de calcul (points cibles)
  38. ligz = DROI (0. 0.) (0. l) ;
  39. cib = ligz TRAN ((l / 2.) 0.) ;
  40. ccib = CONT cib ;
  41.  
  42. ** Calcul du champ d'induction magnetique (cas particuler d'inducteurs filaires puisque
  43. * rayon int=ext et section nulle, on donne donc le courant et non la desnite de courant)
  44. b1 = BIOT 'INDU' cib 'CERC' ((l - r) / 2.) r r 0. (-1. * nt * i) mu ;
  45. b2 = BIOT 'INDU' cib 'CERC' ((l + r) / 2.) r r 0. (-1. * nt * i) mu ;
  46. b = b1 + b2 ;
  47.  
  48. SI itrac ;
  49. vb = @VECOUL b (MOTS 'BR' 'BZ') 1.E1 ;
  50. TRAC vb ccib 'TITR' 'Champ B dans le domaine' ;
  51. FINSI ;
  52.  
  53. ** Lignes de champ
  54. v = EXCO (MOTS 'BR' 'BZ') b (MOTS 'UR' 'UZ') ;
  55. fc = FCOURANT cib v ;
  56. maxf = MAXI fc ;
  57. minf = MINI fc ;
  58. nlig = 15 ;
  59. lf = PROG minf 'PAS' ((maxf - minf) / (nlig + 1)) maxf ;
  60. lig o = @ISOSURF cib lf fc ;
  61. chbm = CHAN 'CHAM' b cib ;
  62. bm = (((EXCO 'BR' chbm 'SCAL') ** 2) + ((EXCO 'BZ' chbm 'SCAL') ** 2)) ** 0.5 ;
  63. blig = PROI bm lig ;
  64. SI itrac ;
  65. TRAC blig lig ccib 'TITR' 'Lignes de champ B' ;
  66. FINSI ;
  67.  
  68. ** Verification du champ le long de l'axe des bobines
  69. bz1 = EVOL 'BLEU' 'CHPO' b1 'BZ' ligz ;
  70. bz2 = EVOL 'JAUN' 'CHPO' b2 'BZ' ligz ;
  71. bz = EVOL 'VERT' 'CHPO' b 'BZ' ligz ;
  72. lz = PROG 0. 'PAS' dens1 l ;
  73. lbth1 = mu * nt * i * r * r / (2. * (((r ** 2) + ((lz - ((l - r) / 2.)) ** 2)) ** 1.5)) ;
  74. lbth2 = mu * nt * i * r * r / (2. * (((r ** 2) + ((lz - ((l + r) / 2.)) ** 2)) ** 1.5)) ;
  75. lbth = lbth1 + lbth2 ;
  76. bth = EVOL 'ROUG' 'MANU' lz lbth ;
  77. lb = EXTR bz 'ORDO' ;
  78. lerr = (lb - lbth) / lbth ;
  79. err = MAXI 'ABS' lerr ;
  80. SI itrac ;
  81. tl = TABL ;
  82. tl . 'TITRE' = TABL ;
  83. tl . 'TITRE' . 1 = 'Theorie' ;
  84. tl . 'TITRE' . 2 = 'Calcul BIOT bobine 1' ;
  85. tl . 'TITRE' . 3 = 'Calcul BIOT bobine 2' ;
  86. tl . 'TITRE' . 4 = 'Calcul BIOT total' ;
  87. DESS (bth ET bz1 ET bz2 ET bz) 'TITR' 'Champ B le long de l''axe' 'LEGE' tl
  88. 'TITX' 'Position Z (m)' 'TITY' 'Champ mag. B (T)' ;
  89. FINSI ;
  90.  
  91. MESS 'Erreur relative max. :' err ;
  92. SI (err > 1.E-6) ;
  93. ERRE 'Erreur dans le calcul du champ d''induction magnetique' ;
  94. FINSI ;
  95.  
  96.  
  97.  
  98. FIN ;
  99.  
  100.  
  101.  
  102.  
  103.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales