Grid

Grid

Determines the simulation size and relationship of physical coordinates to cell indices.

Every object in Vorpal interacts with a grid defined by the Grid block. If there is more than one Grid block in the input file, Vorpal uses the grid named globalGrid and ignores any others. If there are no Grid blocks named globalGrid, the last Grid block will be used and all preceding Grid blocks will be ignored.

Grid defaults to a uniform Cartesian grid if you omit the kind parameter or when you set kind to uniCartGrid, regardless of the presence or value of coordinateSystem parameter.

Note

There are no restrictions on the ratio of grid sizes among the dimensions. However, Tech-X recommends novice users unfamiliar with effects of large aspect ratio cells, keep the grid sizes, DX, DY, and DZ, within a factor of 5 from each other.

By convention, Vorpal lays out its axes as follows:

x: left to right y: front to back z: bottom to top

Grid Parameters

maxIntDepHalfWidth (integer, optional, default = 1)

Maximum half-width of either the interpolator or depositor stencil.

Please see VSim - Additional Attributes for Particles for more information.

maxCellXings (integer, optional, default = 1)

The maximum number of cells a particle is allowed to cross in one time step. This does not override the maxcellxing parameter specified in the species block, but must be equal to or larger than any species block maxcellxing value. This is used in calculating the number of guard cells found in the simulation.

Please see VSim - Additional Attributes for Particles for more information.

kind (string)

Specifies type of grid to use, and is one of the following options.

  • uniCartGrid (default) Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.

    numCells (integer vector, required)

    Sets number of cells in the x, y, and z directions. Should contain at least as many values as there are dimensions in the grid. Example usage:

      numCells = [5 10 15]
    or
      numCells = [NX NY NZ]
    
    lengths (float vector, required)

    Sets lengths of the simulation space in meter units. Should contain at least as many values as there are dimensions in the grid. Example usage:

      lengths = [0.1 0.1 0.1]
    or
      lengths = [LX LY LZ]
    
    startPositions (float vector, required, default = [0 0 0])

    Specifies where the starting coordinates in the simulation space are in meter units. Should contain at least as many values as there are dimensions in the grid. Example usage:

      startPositions = [-0.05 0.0 0.0]
    or
      startPositions = [XBGN YBGN ZBGN]
    
  • coordProdGrid Works with VSimPD and VSimVE licenses.

    coordinateSystem (optional, default=Cartesian)

    Sets the coordinate system of the grid. One of:

    • Cartesian (default), e.g. x,y,z

    • Cylindrical, e.g. z, r, phi

    • Polar, e.g. r, phi,z

    • Tubular, e.g. phi, z, r

    includeCylAxis (integer, optional, default = 0)

    Whether or not to include the lower bound in the radial direction that corresponds to r = 0 in the simulation. If includeCylAxis is true, one needs to make sure that the starting position in the r direction (dir1) is set to 0.0. If includeCylAxis is false, one needs to make sure that the starting position in the r direction (dir1) is set to greater than 0.0. Setting includeCylAxis to true in the Grid block sets a flag that allows for proper evaluation of the nodal volume element and Ez area element for the first cell. One should also take care to set includeCylAxis in any necessary FieldUpdater blocks. See: FieldUpdater for the different kinds of CoordProd updaters that are available.

    coordinateGrid (block, required)

    Specifies the lower and upper bounds and cell size of each dimension of the coordinate product grid independently in its own CoordinateGrid block. See CoordinateGrid.

  • uniCartCrossDev Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.

    This grid kind is parsed in an equivalent manner as uniCartGrid, requiring: numCells, lengths, startPositions.

  • varCartCrossDev Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.

    coordinateGrid (block, required)

    Specifies the lower and upper bounds and cell size of each dimension of the coordinate product grid independently in its own CoordinateGrid block. See CoordinateGrid.

    Note the variable grid does adhere to the defined number of cells, via scaling.

  • uniCylCrossDev Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.

    This grid kind is parsed in an equivalent manner as the other Cross Dev Grid kinds.

  • varCylCrossDev Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.

    This grid kind is parsed in an equivalent manner as uniCylCrossDev. Note the variable grid does adhere to the defined number of cells, via scaling.

Example Uniform Cartesian Grid Block

<Grid globalGrid>
  kind = uniCartGrid
  numCells = [40 20 20]
  lengths = [5e-06 5e-05 5e-05]
  startPositions = [0.0 -2.5e-05 -2.5e-05]
</Grid>

Example Cylindrical Grid Block

<Grid globalGrid>
  kind = coordProdGrid
  coordinateSystem = Cylindrical
  includeCylAxis = 1
  <CoordinateGrid dir0>
    sectionBreaks = [ZBGN ZEND]
    deltaAtBreaks = [DZ DZ]
  </CoordinateGrid>
  <CoordinateGrid dir1>
    sectionBreaks = [RBGN REND]
    deltaAtBreaks = [DR DR]
  </CoordinateGrid>
</Grid>

Example Uniform Cartesian Cross Device Grid Block

<Grid globalGrid>
  kind = uniCartCrossDev
  numCells = [40 20 20]
  lengths = [5e-06 5e-05 5e-05]
  startPositions = [0.0 -2.5e-05 -2.5e-05]
</Grid>

Example of Variable Cartesian Grid Block

<Grid globalGrid>
  kind = varCartCrossDev
  numCells = [NX NY NZ]
  <CoordinateGrid dir0>
    sectionBreaks = [XBGN XBGNRAMP XBGN_HIGH XEND_HIGH XENDRAMP XEND]
    deltaAtBreaks = [DX_LOW DX_LOW DX_HIGH DX_HIGH DX_LOW DX_LOW]
  </CoordinateGrid>
  <CoordinateGrid dir1>
    sectionBreaks = [YBGN YBGNRAMP YBGN_HIGH YEND_HIGH YENDRAMP YEND]
    deltaAtBreaks = [DY_LOW DY_LOW DY_HIGH DY_HIGH DY_LOW DY_LOW]
  </CoordinateGrid>
  <CoordinateGrid dir2>
    sectionBreaks = [ZBGN ZBGNRAMP ZBGN_HIGH ZEND_HIGH ZENDRAMP ZEND]
    deltaAtBreaks = [DZ_LOW DZ_LOW DZ_HIGH DZ_HIGH DZ_LOW DZ_LOW]
    </CoordinateGrid>
</Grid>

Example of Uniform Cylindrical Cross Device Grid Block

<Grid globalGrid>
  kind = uniCylCrossDev
  verbosity = VPMW_TOP_LEVEL_VERBOSITY
  startPositions = [0. 0.]
  numCells = [NZ NR]
  lengths = [LZ LR]
  maxCellXings = VPMW_MAX_CELL_XING
  includeCylAxis = true
</Grid>

Example of Variable Cylindrical Cross Device Grid Block

<Grid globalGrid>
  kind = varCylCrossDev
  numCells = [NZ NR NPHI]
  maxCellXings = VPMW_MAX_CELL_XING
  includeCylAxis = true
  <CoordinateGrid dir0>
    sectionBreaks = [BGNZ ENDZ]
    deltaAtBreaks = [DZ DZ]
  </CoordinateGrid>
  <CoordinateGrid dir1>
    sectionBreaks = [BGNR ENDR]
    deltaAtBreaks = [DR0 DR]
  </CoordinateGrid>
</Grid>