02-leroymacro

Upload: mohammed-larbi

Post on 03-Jun-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 02-Leroymacro

    1/24

    O. LEROY

    Laboratoire de Physique des Gaz et des Plasmas

    Universit Paris-Sud ORSAY, FRANCE

    Lake Tegernsee, Germany, 13-14 sep.07

    Ways to perform electromagnetic

    simulation of very inhomogeneous

    media with CST Microwave Studio

  • 8/12/2019 02-Leroymacro

    2/24

    Part I: Use of VBA macro langage

    Application: Microwave plasma simulation

    coupling between CST and a plasma fluid model

    Plasma

    Fluid model

    Wave

    EM model (CST)

    p = f (p, )

    EHF

    22

    2

    1

    +

    = p

    r

    )( 22

    2

    +

    = p

    i

    = electron-neutral collision frequency / =2f = wave pulsation

    Drude model

  • 8/12/2019 02-Leroymacro

    3/24

    0

    2

    e

    e

    pm

    en=

    Example: ne = 1012 cm-3

    Defining a plasma in CST

  • 8/12/2019 02-Leroymacro

    4/24

    Interest to use VBA to draw the structure

    Homogeneous plasma:

    easy to draw! Inhomogeneous plasma

    with constant step along z:

    still possible to draw

    (but painful!)

    Inhomogeneous plasma with

    100 steps along z and 20 steps along r

    Impossible to draw one by one

    VBA required!

    Example of a 2.45 GHZ

    Microwave coaxial

    Cylindrical plasma 4th slice (out of 100)14th ring (out of 20)

  • 8/12/2019 02-Leroymacro

    5/24

    0587663

    Example of axial discretisation into 100 slices (along z)

    z

    650 600 550 500 450 400 350 300 250 200 150 100 50 0

    0,0

    5,0x1010

    1,0x1011

    1,5x1011

    2,0x1011

    2,5x1011

    3,0x1011

    3,5x1011

    4,0x1011

    donnes Simon (100 mtorr, 300 W) nex2

    ne

    (cm

    -3)

    z (mm)

    Calculated axial profil

    Discretisation

    (averaged ne on the 6th slice)

    Height of each slice depends on

    the gradient (% of variation)

  • 8/12/2019 02-Leroymacro

    6/24

    10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85

    0

    10

    20

    30

    40

    50

    60

    70

    donnes Luis (60 mtorr, anciennes)

    discrtisation 20 couronnes pas variables

    p

    en109

    r(mm)

    15,0 15,2 15,4 15,6 15,8 16,0

    -5

    0

    5

    10

    15

    20

    25

    30

    35

    40

    45

    50

    55

    60

    65

    70

    79,0 79,2 79,4 79,6 79,8 80,00

    5

    10

    15

    20

    25

    30

    35

    Example of radial discretisation of p (=f(ne)) into 20 rings

    Calculated radial profil

    20 steps discretisation

  • 8/12/2019 02-Leroymacro

    7/24

    Typical discretisation: into 100 slices and 20 rings (2000 media)

    4th slice (out of 100)

    14th ring (out of 20)

  • 8/12/2019 02-Leroymacro

    8/24

    Results: Electric field absolute value (V/m) at 2.52 GHz

    End of column effects

  • 8/12/2019 02-Leroymacro

    9/24

    Other example: Plasma treatment reactor using a microwave plasma torch

    Plasma torch

    Height 30 mm, radius 1.5 mm

    Very inhomogeneous media

    2.45 GHz

    Microwave

    excitation

  • 8/12/2019 02-Leroymacro

    10/24

    Electron density (cm-3)

    8.75x1014

    -- 1.00x1015

    7.50x1014

    -- 8.75x1014

    6.25x1014

    -- 7.50x1014

    5.00x1014

    -- 6.25x1014

    3.75x1014 -- 5.00x1014

    2.50x1014

    -- 3.75x1014

    1.25x1014

    -- 2.50x1014

    0.00x1014

    -- 1.25x1014

    Calculated electron density profile

    Choice of discretisation for CST:- 40 slices along height

    - 5 rings along radius

    0,0 0,5 1,0 1,5

    0

    5

    10

    15

    20

    25

    30

    radius (x or y) in mm

    height(z)inmm

    34th slice (out of 40)

    4th ring (out of 5)

    Height

    30 mm

    Radius

    1.5 mm

  • 8/12/2019 02-Leroymacro

    11/24

    A few tips in VBA to perform this work

    Macros are saved here:

    C:\Program Files\CST Studio Suite 2006\Library\Macros\MWS\macro.xxx (xxx begins at 000)Note: CST macros are saved under macro.2xx, macro.5xx, macro.8xx, macro.9xx

    Advice: generate structure macros from the history list

    And study the generated VBA code

  • 8/12/2019 02-Leroymacro

    12/24

    Reading the plasma data (external ASCII file)

    zminzmax

    rmin

    rmax

    nomprojet = GetProjectBaseName

    nomfich = nomprojet & ".txt"

    Open nomfich For Input As #11

    ntz=41

    ntr=6

    For i=1 To ntrInput #11, r(i)

    Next i

    For j=1 To ntz

    Input #11, z(j)

    For i=1 To ntrInput #11 ,ne(j,i)

    Next i

    Next j

    Close #11

    nu=4.0e10

    cte=1.6e-19*1.6e-19/(9.1e-31*8.85e-12)

    For i = 1 To ntr-1

    If i=1 Then

    rmin(i)=r(i)

    Else

    rmax(i)=r(i)-0.5*(r(i)-r(i-1))

    End If

    If i=5 Then

    rmax(i)=1.5Else

    rmax(i)=r(i)+0.5*(r(i+1)-r(i))

    End If

    For j = 1 To ntz-1

    zmin(j)=z(j)zmax(j)=z(j+1)

    If j=40 Then

    zmax(j)=134

    End If

    wp(j,i)=Sqr(ne(j+1,i)*cte)

    Next j

    Next i

  • 8/12/2019 02-Leroymacro

    13/24

    '@ define cylinder: component1:plasma_name

    With Cylinder

    .Reset

    .Name plasma_name

    .Component "component1"

    .Material plasma_name

    .OuterRadius rmax(j)

    .InnerRadius rmin(j)

    .Axis "z"

    .Zrange zmin(i), zmax(i)

    .Xcenter "0"

    .Ycenter "0"

    .Segments "0"

    .Create

    End With

    comp_plasma_name = "component1:" & plasma_name

    '@ boolean insert shapes: component1:Reactor, component1:plasma_name

    Solid.Insert "component1:Reactor", comp_plasma_name

    Next j

    Next i

    Creating the different plasma materials and components

    i = slice number

    j = ring number

    For i = 1 To ntz-1

    For j = 1 To ntr-1

    plasma_name = "plasma" & CStr(i) & "_" & CStr(j)

    '@ define material: plasma_name

    With Material

    .Reset

    .Name plasma_name

    .FrqType "hf"

    .Type "Normal"

    .Epsilon "1.0"

    .Mue "1.0"

    .Kappa "0.0"

    .TanD "0.0"

    .TanDFreq "0.0"

    .TanDGiven "False".TanDModel "ConstTanD"

    .KappaM "0.0"

    .TanDM "0.0"

    .TanDMFreq "0.0"

    .TanDMGiven "False"

    .DispModelEps "Drude"

    .EpsInfinity "1.0"

    .DispCoeff1Eps wp(i,j)

    .DispCoeff2Eps nu

    .DispModelMue "None"

    .Rho "0.0"

    .Colour "0.988235", "0.662745", "0.980392"

    .Wireframe "False"

    .Transparency "66"

    .Create

    End With

  • 8/12/2019 02-Leroymacro

    14/24

    Automatic

    generation

    of materials

    Automatic

    generation of

    components

    {Slice number 2Ring number

    Results

  • 8/12/2019 02-Leroymacro

    15/24

    Resonance around the

    microwave excitation

    frequency (2.45 GHz)

    Results

    Electric field

    Absolute value

    Note:

    The 2.45 GHz large

    resonance peakis impossible to obtain

    with an homogeneous

    plasma

  • 8/12/2019 02-Leroymacro

    16/24

    Part II: Use of VOXEL import data format

    Application: Microwave heating

    coupling between CST and a thermal code (FLUENT)

    Temperature

    Thermal code

    (FLUENT)

    Wave

    EM model

    (CST)

    T (T)

    Power loss density

    (Watt/m3)

    {{

    FLUENT

    FLUENT

    CST

    CST

    CST

    time

    t=0

  • 8/12/2019 02-Leroymacro

    17/24

    VOXEL = volumetric pixel = 3D pixel

    VOXEL was first used in videogames for

    landscapes representation.

    For example: COMANCHE

    (helicopter simulation flight game)

    but was abandoned when graphics engines

    were able to use triangles and polygones.

    Today, VOXEL is widely used for 3Drepresentation in medical imaging by

    numerical treatment of 2D cut-planes

    issued from investigation machines

    (Magnetic Resonance Imaging)

    Main use of VOXEL in CST MWS: HUGO human body model

  • 8/12/2019 02-Leroymacro

    18/24

    Main use of VOXEL in CST MWS: HUGO human body model

    Example of simulation: radiation of a mobile phone near a human head

    Without HUGOWith HUGO

  • 8/12/2019 02-Leroymacro

    19/24

    Structure of a voxel data file: 3 files

    File 1: Material.txtMaterial description file

    // frequency: 2450 MHz//

    // material_name num eps mue kappa[s/m] rho[kg/m^3]

    Vacuum 0 1.0 1.0 0.0 1

    Tower1 1 2.0 1.0 0.2 1100Tower2 2 3.0 1.0 0.3 1200

    densityconductivity

    =

    Permittivity: = -i = - i / , with =2f

    commentaries

    {

  • 8/12/2019 02-Leroymacro

    20/24

    File 2: Material.vox Data info file

    Material file at appropriate frequency

    Binary

    datafile

    nameNumber of voxelsin each directionSpatial dimensions

    of each voxel

    [Version]

    [Material]

    //f(MHz) filename

    2450 material.txt

    [Background]

    [Voxel]

    // type nx ny nz dx[mm] dy[mm] dz[mm] offset filename

    char 5 5 5 1 1 1 0 material.bin

    [Bitmap]

    front front.bmpside side.bmp

    File 3: Material.bin binary data file

  • 8/12/2019 02-Leroymacro

    21/24

    File 3: Material.bin binary data file

    program voxel

    implicit real*8 (a-h,o-z)

    integer*1 i0,i1,i2

    integer recn

    open(10,file='test.bin',form='unformatted',access='direct',recl=1)

    i0=0

    i1=1

    i2=2

    recn=1

    do k=1,5 !parameter for z

    do j=1,5 !parameter for y

    do i=1,5 !parameter for x

    if (i.eq.3) then

    write(10,rec=recn) i0

    recn=recn+1

    endif

    if ((i.eq.1.or.i.eq.2).and.(j.le.4)) then

    write(10,rec=recn) i1

    recn=recn+1

    endif

    if ((i.eq.1.or.i.eq.2).and.(j.eq.5)) then

    write(10,rec=recn) i0

    recn=recn+1

    endif

    if ((i.eq.4.or.i.eq.5).and.(j.le.3)) then

    write(10,rec=recn) i0

    recn=recn+1endif

    if ((i.eq.4.or.i.eq.5).and.(j.ge.4)) then

    write(10,rec=recn) i2

    recn=recn+1

    endif

    enddo

    enddo

    enddo

    close(10)

    end

    Example of fortran code used

    to generate a binary file

    (also possible to generatein C or with Mathlab, )

    Simple example:

    5x5 voxelisation of 2 towers1st is composed of material 1

    2nd is composed of material 2

    2

    1

    i=1 i=2 i=3 i=4 i=5

    j=1

    j=2

    j=3

    j=4

    j=5

    0

    View from the top

  • 8/12/2019 02-Leroymacro

    22/24

    Voxel is coded on 1 octet with unsigned 8 bits numbers

    possible values between 0 and 255 (in binary: 00 FF)

    Limitation:

    Coding of permittivity = i needs the coding of all the possible

    (, ) couples. For instance, we can choose:

    25 homogeneous ranges of variation with T for

    10 homogeneous ranges of variation with T for

    (25 10 < 256 OK)

    File size of BIN file is nxnynz = 5 5 5 = 125 octets in the previous case

    BIN file only editable with an hexadecimal editor

    VOXEL coding and limitation

    2.45 GHz microwave localized field applicator

  • 8/12/2019 02-Leroymacro

    23/24

    10 10 Voxelisation

    of the circular sectionof the wood

    250 couples

    of (, )

    pp

    Wood drying application

    Discretisation:

    5 voxel along radius r=12.5 mm

    (then 10 voxel along x and 10 voxel along y)

    200 voxel along height z= 500 mm

    Then size of BIN file is:

    10 10 200 = 20000 octets = 20 Ko

    Woodto be voxelised Power loss

    Density

    (Watt/m3)

    CONCLUSION

  • 8/12/2019 02-Leroymacro

    24/24

    CONCLUSION

    2 ways to perform electromagnetic simulation of very inhomogeneous media

    Use of VBA macro langage

    Use of VOXEL import data format

    - Useful if you want to keep a constant

    meshing when interacting with another code

    - Very adapted for 2D inhomogeneities