Skip to content

Importing two-dimensional Ansys field maps

Ansys uses the eight-node curved quadrilateral, sometimes known as "serendipity" element, for two-dimensional electrostatic problems. In Ansys terminology, this element is known as PLANE121. Ansys will occasionally generate degenerate quadrilaterals, which are curved quadratic triangles. Field maps based on the PLANE121 element can be imported in Garfield++ using the class ComponentAnsys121.

Creating a field map

The following recipe assumes that the command format is used. Most of the commands cited can of course also be run from the GUI.

  1. Clear earlier calculations and enter the pre-processor.
    FINISH
    /CLEAR,START
    /PREP7
    
  2. If using the GUI, enter the preferences and ensure that the only discipline selected within the "Electromagnetic" group is "Electric". The equivalent commands are

    KEYW,PR_ELMAG,1
    KEYW,MAGELC,1
    

    Disable the p-method solution options. This option leads to elements of higher polynomial order, for which Garfield++ does not have shape functions implemented.

    /PMETH,OFF,1
    
    3. Select the quadrilateral as element.
    ET,1,PLANE121
    

    In case your chamber has rotational symmetry around an axis, a non-default element behaviour needs to be selected.

    ET,1,PLANE121   ! Select plane quadrilaterals
    KEYOPT,1,3,1    ! Declare the element to be axisymmetric
    

    In Ansys, the y-axis acts as axis of rotational symmetry and no part of the model should be located in x < 0.

  3. When defining material properties, be sure that every material has its permittivity set. Choose material numbers starting from 1 and leave no holes in the numbering. Set the permittivity of conductors to a very high value. Set the resistivity of perfect conductors to 0 so as to make them eligible for removal as background. Try to avoid temperature-dependent properties as these can not be used by Garfield to identify materials. For instance, to define a perfect conductor (material 1) and a dielectricum (material 2):

    MP, PERX, 1, 1e10 ! Metal
    MP, RSVX, 1, 0.0
    MP, PERX, 2, 4.5  ! Bulk dielectric constant
    

  4. Create the model. See any of the numerous Ansys tutorials for advice. Pay particular particular attention to gluing adjacent areas where necessary (AGLUE command). For instance, to create a conducting strip on the wall of a block of dielectric material:

    ! Define some dimensions, in microns
    halfpitch = 50
    thickbulk = 200
    halfstrip = 20
    thickstrip = 5
    
    BLC4, 0, 0, halfpitch, thickbulk   ! Area 1: dielectricum
    BLC4, 0, 0, halfstrip, thickstrip  ! Area 2: conductor
    ASBA, 1, 2, , , KEEP               ! Area 1 becomes area 3
    
    AGLUE, ALL                         ! Glue everything
    

  5. Assign material properties with the AATT command.

    ASEL, S, , , 3             ! Select the dielectricum
    AATT, 2                    ! Properties of material 2
    ASEL, S, , , 2             ! Select the conductor
    AATT, 1                    ! Properties of material 1
    

  6. Set boundary conditions.

    ASEL, `, , , 2             ! Select the metal
    LSLA, S                    ! Select all its border lines
    DL, ALL, 2, VOLT, 1000     ! Set the borders to 1000 V
    
    ASEL, S, , , 3             ! Select the dielectricum
    LSLA, S                    ! Select all its border lines
    LSEL, R, LOC, Y, thickbulk ! Sub-select lines at y=thickbulk
    DL, ALL, 3, VOLT, 0        ! Set this line to 0 V
    
    ASEL, S, , , 3
    LSLA, S
    LSEL, R, LOC, X, 0         ! Select the lines at x=0
    DL, ALL, 3, SYMM           ! Impose a symmetry condition
    ASEL, S, , , 3
    LSLA, S
    LSEL, R, LOC, X, halfpitch ! Idem for y=halfpitch
    DL, ALL, 3, SYMM
    

  7. Mesh the problem. This can for instance be done using free meshing.

    LSEL,ALL
    ASEL, ALL
    MSHKEY,0
    SMRT, 3
    AMESH, 2,3
    

    It is not always necessary to mesh the metal parts of the device. Then solve the problem.

    /SOLU
    SOLVE
    FINISH
    

    Optionally visualise the solution:

    /POST1
    /EFACET,1
    PLNSOL, VOLT,, 0
    

  8. Write the solution to files. The potentials at the nodes are written to a file with the PRNSOL command. In the example below, the file name is chosen to be "PRNSOL.lis" but feel free to use another name.

    /OUTPUT, PRNSOL, lis
    PRNSOL
    /OUTPUT
    

    The PRNSOL file contains the potentials at the nodes. When interpolating between nodes, we need to know where each of these nodes is located in space. This information is contained in the output of the NLIST command, which is written to a file called "NLIST.lis". Note the COORD option - without this option, the file would contain additional information which is not used in Garfield++, at the price of reduced precision in the node coordinates.

    /OUTPUT, NLIST, lis
    NLIST,,,,COORD
    /OUTPUT
    

    We also need to know how the nodes are tied into elements. This structure is shown by the ELIST command, the output of which is written to a file called "ELIST.lis".

    /OUTPUT, ELIST, lis
    ELIST
    /OUTPUT
    

    Finally we also write the material properties (dielectric constants and electric resistivities) to a file "MPLIST.lis".

    OUTPUT, MPLIST, lis
    MPLIST
    /OUTPUT
    

Importing a field map

To load the ".lis" files exported from Ansys, we use the function Initialise of the class ComponentAnsys121.

ComponentAnsys121 fm;
fm.Initialise("ELIST.lis", "NLIST.lis", "MPLIST.lis", "PRNSOL.lis", "micron");
fm.EnableMirrorPeriodicityX();
fm.PrintRange();
ViewField fieldView;
fieldView.SetComponent(&fm);
// Set the plot limits in the current viewing plane.
fieldView.SetArea(-0.01, 0., 0.01, 0.02);
fieldView.PlotContour();

Source files

The Ansys script discussed above and a simple C++ program to read the field map can be found in the directory Examples/Ansys121 of the source tree.