.. sec:InputsMeshAndGridding: Grids and tiles =============== Grids ----- The following inputs are defined using the prefix ``amr``: +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | | Description | Type | Default | +======================+=======================================================================+=============+===========+ | max_grid_size_x | Maximum number of cells in each grid in *X*. Can be specified | Ints | 32 | | | per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | max_grid_size_y | Maximum number of cells in each grid in *Y*. Can be specified | Ints | 32 | | | per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | max_grid_size_z | Maximum number of cells in each grid in *Z*. Can be specified | Ints | 32 | | | per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | blocking_factor_x | Each grid in *X* must be divisible by ``blocking_factor_x``. Can be | Ints | 8 | | | specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | blocking_factor_y | Each grid in *Y* must be divisible by ``blocking_factor_y``. Can be | Ints | 8 | | | specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | blocking_factor_z | Each grid in *Z* must be divisible by ``blocking_factor_z``.Can be | Ints | 8 | | | specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | refine_grid_layout_x | If set, AMReX will attempt to chop new grids into smaller chunks along| Bool | true | | | the x axis, ensuring at least one grid per MPI process, provided this | | | | | does not violate the blocking factor constraint. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | refine_grid_layout_y | If set, AMReX will attempt to chop new grids into smaller chunks along| Bool | true | | | the y axis, ensuring at least one grid per MPI process, provided this | | | | | does not violate the blocking factor constraint. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | refine_grid_layout_z | If set AMReX will attempt to chop new grids into smaller chunks along | Bool | true | | | the z axis, ensuring at least one grid per MPI process, provided this | | | | | does not violate the blocking factor constraint. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ Note, the default for ``max_grid_size`` is 64 for GPU runs. The domain is decomposed into grids by dividing the number of cells by the max grid size for each direction (e.g., ``n_cells[0]/max_grid_size_x``). The blocking factor ensures that the grids will be sufficiently coarsenable for good multigrid performance; therefore, the ``max_grid_size`` must be divisible by the corresponding ``blocking_factor``. .. note:: The `AMReX documentation `_ contains a significant amount of information on grid creation and load balancing. Users are strongly encouraged to read the relevant sections. ----- Tiles ----- The following inputs are defined using the prefix ``fabarray``: +----------------------+-----------------------------------------------------------------------+----------+-------------+ | | Description | Type | Default | +======================+=======================================================================+==========+=============+ | mfiter_tile_size | Maximum number of cells in each direction for (logical) tiles. | Ints<3> | 1024000 8 8 | +----------------------+-----------------------------------------------------------------------+----------+-------------+ The following inputs are defined using the prefix ``particles``: +----------------------+-----------------------------------------------------------------------+-------------+--------------+ | | Description | Type | Default | +======================+=======================================================================+=============+==============+ | tile_size | Maximum number of cells in each direction for (logical) tiles | Ints<3> | 1024000 8 8 | | | in the ParticleBoxArray if ``load_balance`` is ``DualGrid`` | | | +----------------------+-----------------------------------------------------------------------+-------------+--------------+ When running on shared memory machines using an OpenMP enabled executable, *grids* are subdivided into *tiles* and iterated over to improve data locality by cache blocking. .. note:: MFIX-Exa disables tiling when using GPU accelerators. .. sec:InputsMeshRefinement: Mesh refinement =============== The following inputs are defined using the prefix ``amr``. These inputs control the automatic mesh refinement algorithm and are only applicable when ``amr.max_level > 0``. +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | | Description | Type | Default | +======================+=======================================================================+=============+===========+ | max_level | Maximum level of refinement. The default value, 0, means that there | Int | 0 | | | is one cell size covering the entire domain (i.e., single-level). | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | grid_eff | Threshold value to ensure grids do not contain too large a fraction | Real | 0.7 | | | of untagged cells. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | n_error_buf | Controls how many extra cells will be tagged around every tagged cell.| Ints | 1 | | | For example, if set to ``2`` then tagging cell ``(i,j,k)`` will tag | | | | | cells from ``(i-2,j-2,k-2(`` to ``(i+2,j+2,k+2)``. | | | | | Used to ensure coarse-fine boundaries are not too close to tagged | | | | | cells. Can be specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | n_error_buf_x | Controls how many extra cells will be tagged around every tagged cell | Ints | 1 | | | along the x axis. For example, if set to ``2`` then tagging cell | | | | | ``(i,j,k)`` will tag cells from ``i-2`` to ``i+2``. Used to ensure | | | | | coarse-fine boundaries are not too close to tagged cells. Can be | | | | | specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | n_error_buf_y | Controls how many extra cells will be tagged around every tagged cell | Ints | 1 | | | along the y axis. For example, if set to ``2`` then tagging cell | | | | | ``(i,j,k)`` will tag cells from ``j-2`` to ``j+2``. Used to ensure | | | | | coarse-fine boundaries are not too close to tagged cells. Can be | | | | | specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | n_error_buf_z | Controls how many extra cells will be tagged around every tagged cell | Ints | 1 | | | along the z axis. For example, if set to ``2`` then tagging cell | | | | | ``(i,j,k)`` will tag cells from ``k-2`` to ``k+2``. Used to ensure | | | | | coarse-fine boundaries are not too close to tagged cells. Can be | | | | | specified per-level. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | ref_ratio_vect | If specified, sets thee refinement ratios between AMR levels. It's an | Ints | | | | error if the size of the integer array, if present, is less than | | | | | ``max_level*3``. The first three numbers specify the refinement ratios| | | | | in three dimensions between levels 0 and 1, the next three numbers | | | | | specify the ratios for levels 1 and 2, etc. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | ref_ratio | If ``ref_ratio_vect`` is not specified, this parameter will be used to| Ints | 2 | | | set the refinement ratios between AMR levels. If there are more AMR | | | | | levels than the size of the integer parameter array, the last integer | | | | | will be used as the refinement ratio for the unspecified levels. For | | | | | example, if ``max_level`` is 4 and the provided ``amr.ref_ratio`` | | | | | is ``2 4``, the refinement ratios are 2, 4, 4 and 4, for levels 0/1, | | | | | 1/2, 2/3, and 3/4, respectively. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ .. caution:: **Mesh refinement limitations:** * MFIX-Exa simulations with particles currently do not support mesh refinement. See the `AMReX documentation `_ for details on the adaptive mesh refinement algorithms. The following inputs are defined using the prefix ``mfix``. These inputs control the automatic mesh refinement algorithm and are only applicable when ``amr.max_level > 0``. +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | | Description | Type | Default | +======================+=======================================================================+=============+===========+ | regrid_int | How often to regrid (in number of steps at level 0). | Int | 0 | | | If regrid_int <= 0 then no regridding will occur. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ Tagging for refinement ---------------------- The following inputs are defined using the prefix ``mfix.tag``. They control how cells are tagged for the mesh refinement algorithm and are only applicable when ``amr.max_level > 0``. Cells intersected by the embedded boundary are always tagged for refinement, regardless of these settings. +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | | Description | Type | Default | +======================+=======================================================================+=============+===========+ | rho | Tag cells for refinement when the fluid density is **greater than** | Reals | None | | | the specified value. | | | | | | | | | | * To tag cells when density is **less than** the specified value, | | | | | set ``mfix.tag.rho.less_than = true``. | | | | | * Values may be specified per level. If fewer than ``amr.max_level`` | | | | | values are provided, the last value is used for all higher levels. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | rho.less_than | Tag cells for refinement when the fluid density is **less than** the | Bool | false | | | specified value. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | grad_rho | Tag cells for refinement when the difference in fluid density between | Reals | None | | | two adjacent cells is greater than the specified value. | | | | | | | | | | * To tag cells when the difference is less than the specified value, | | | | | set ``mfix.tag.grad_rho.less_than = true``. | | | | | * Values may be specified per level. If fewer than ``amr.max_level`` | | | | | values are provided, the last value is used for all higher levels. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | grad_rho.less_than | Tag cells for refinement when the difference in fluid density between | Bool | false | | | two adjacent cells is **less than** the specified value. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | vel | Tag cells for refinement when the magnitude of fluid velocity | Reals | None | | | is **greater than** the specified value. | | | | | | | | | | * To tag cells when the difference is less than the specified value, | | | | | set ``mfix.tag.vel.less_than = true``. | | | | | * Values may be specified per level. If fewer than ``amr.max_level`` | | | | | values are provided, the last value is used for all higher levels. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | vel.less_than | Tag cells for refinement when fluid velocity magnitude is | Bool | false | | | **less than** the specified value. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | grad_vel | Tag cells for refinement when the difference in any fluid velocity | Reals | None | | | component between two adjacent cells is **greater than** the | | | | | specified value. | | | | | | | | | | * To tag cells when the difference is less than the specified value, | | | | | set ``mfix.tag.grad_vel.less_than = true``. | | | | | * Values may be specified per level. If fewer than ``amr.max_level`` | | | | | values are provided, the last value is used for all higher levels. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | grad_vel.less_than | Tag cells for refinement when the difference in any fluid velocity | Bool | false | | | component between two adjacent cells is **less than** the specified | | | | | value. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+ | regions | A list of predefined regions used to identify sections of the domain | Strings | None | | | for mesh refinement. | | | +----------------------+-----------------------------------------------------------------------+-------------+-----------+