Initial conditions
==================

The following inputs are defined using the prefix ``ic``:

+-----------------------+------------------------------------------------------------------------+-------------+-----------+
|                       | Description                                                            |   Type      | Default   |
+=======================+========================================================================+=============+===========+
| regions               | Regions used to define initial conditions.                             | Strings     | None      |
+-----------------------+------------------------------------------------------------------------+-------------+-----------+
| allow_regions_overlap | If enabled, particles will be generated/initialized more than once     | Int         | 1         |
|                       | on areas where the IC regions intersect.                               |             |           |
+-----------------------+------------------------------------------------------------------------+-------------+-----------+
| ranking_type          | Specifies the order in which IC regions are sorted during              | String      | Inputs    |
|                       | initialization.                                                        |             |           |
|                       |                                                                        |             |           |
|                       | Options:                                                               |             |           |
|                       |                                                                        |             |           |
|                       | * ``Inputs`` - preserve order in inputs file                           |             |           |
|                       | * ``Volume`` - sort by volume of each IC region                        |             |           |
|                       | * ``Priority`` - sort by specified priority value                      |             |           |
+-----------------------+------------------------------------------------------------------------+-------------+-----------+
| [region_name].priority| Priority value for IC regions if ``ranking_type` == ``Priority``       | Int         | Max       |
+-----------------------+------------------------------------------------------------------------+-------------+-----------+



Fluid settings
~~~~~~~~~~~~~~

For each initial condition region, the fluid inputs are defined
using the compound prefix ``ic.[region_name].[fluid_name]``:

+------------------------+------------------------------------------------------------------------+-------------+-----------+
|                        | Description                                                            |   Type      | Default   |
+========================+========================================================================+=============+===========+
| volfrac                | Volume fraction [required]                                             | Real        | 0         |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| density                | Fluid density                                                          | Real        | 0         |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| velocity               | Velocity components                                                    | Reals       | 0 0 0     |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| pressure               | Fluid pressure                                                         | Real        | 0         |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| temperature            | Fluid temperature                                                      | Real        | 0         |
+------------------------+------------------------------------------------------------------------+-------------+-----------+
| species.[species_name] | Mass fraction of ``species_name``                                      | Real        | 0         |
+------------------------+------------------------------------------------------------------------+-------------+-----------+


.. _InputsICSolids:

Solids settings
~~~~~~~~~~~~~~~

For each initial condition region, general solids inputs are defined
using the compound prefix ``ic.[region_name]``:

+----------------------+------------------------------------------------------------------+-------------+-----------+
|                      | Description                                                      |   Type      | Default   |
+======================+==================================================================+=============+===========+
| solids               | Name of solid type in IC region.  Only one solid is allowed in   | String      | None      |
|                      | an IC region.                                                    |             |           |
+----------------------+------------------------------------------------------------------+-------------+-----------+
| packing              | Specifies how auto-generated particles are placed in the IC      | String      | None      |
|                      | region:                                                          |             |           |
|                      |                                                                  |             |           |
|                      | Options:                                                         |             |           |
|                      |                                                                  |             |           |
|                      | * ``hcp`` - hex-centered packing                                 |             |           |
|                      | * ``pseudo_random`` -- random packing using a fixed random seed  |             |           |
|                      | * ``random`` -- random packing (not repeatable)                  |             |           |
|                      | * ``oneper`` -- one particle per cell                            |             |           |
|                      | * ``eightper`` -- eight particles per cell                       |             |           |
|                      | * ``n-cube`` -- n^3 particles per cell where n is an integer     |             |           |
|                      |                                                                  |             |           |
|                      | (NOTE: ``oneper`` is equivalent to ``1-cube`` and ``eightper``   |             |           |
|                      |     to ``2-cube``)                                               |             |           |
+----------------------+------------------------------------------------------------------+-------------+-----------+

For each initial condition region, the solid inputs are defined
using the compound prefix ``ic.[region_name].[solid_name]``:
Note that diameter distributions must define a weighting type,
please refer to :ref:`ReferenceParticleDistributions <ReferenceParticleDistributions>`.

+------------------------+-----------------------------------------------------------------------+-------------+-----------+
|                        | Description                                                           |   Type      | Default   |
+========================+=======================================================================+=============+===========+
| volfrac                | Volume fraction                                                       | Real        | 0         |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| temperature            | temperature                                                           | Real        | 0         |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| species.[species_name] | Mass fraction of `species_name`                                       | Real        | 0         |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| velocity               | Velocity components                                                   | Reals       | 0 0 0     |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter               | Method to specify particle diameter in the IC region. This is         | String      | None      |
|                        | only used for auto-generated particles.                               |             |           |
|                        |                                                                       |             |           |
|                        | Options:                                                              |             |           |
|                        |                                                                       |             |           |
|                        | * ``constant``  -  specified constant                                 |             |           |
|                        | * ``uniform``   -  uniform distribution                               |             |           |
|                        | * ``normal``    -  normal distribution                                |             |           |
|                        | * ``custom``    -  user-defined distribution                          |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| type                   | Distribution weighting.                                               | String      | N/A       |
|                        |                                                                       |             |           |
|                        | Options:                                                              |             |           |
|                        |                                                                       |             |           |
|                        | * ``number-weighted``                                                 |             |           |
|                        | * ``volume-weighted``                                                 |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| bins                   | Number of bins used when discretizing the distribution to approximate | Int         | 64        |
|                        | the number of particles within an initial condition region.           |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter.constant      | Monodisperse (single valued) particle diameter.                       | Real        | 0         |
|                        | Required for ``constant`` distributions.                              |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter.mean          | Distribution mean.                                                    | Real        | 0         |
|                        | Required for ``normal`` distributions.                                |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter.std           | Distribution standard deviation.                                      | Real        | 0         |
|                        | Required for ``normal`` distributions.                                |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter.min           | Minimum diameter to clip distribution.                                | Real        | 0         |
|                        | Required for ``normal`` distributions and ``uniform`` distributions.  |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter.max           | Maximum diameter to clip distribution.                                | Real        | 0         |
|                        | Required for ``normal`` distributions and ``uniform`` distributions.  |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| diameter.custom        | File name that specifies either the cumulative or probability         | String      | None      |
|                        | distribution. Required for ``custom`` distributions.                  |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density                | Method to specify particle density in the IC region. This is          | String      | None      |
|                        | only used for auto-generated particles.                               |             |           |
|                        |                                                                       |             |           |
|                        | Options:                                                              |             |           |
|                        |                                                                       |             |           |
|                        | * ``constant``  -  specified constant                                 |             |           |
|                        | * ``uniform``   -  uniform distribution                               |             |           |
|                        | * ``normal``    -  normal distribution                                |             |           |
|                        | * ``custom``    -  user-defined distribution                          |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density.constant       | Monodisperse (single valued) particle density.                        | Real        | 0         |
|                        | Required for ``constant`` distributions.                              |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density.mean           | Distribution mean.                                                    | Real        | 0         |
|                        | Required for ``normal`` distributions.                                |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density.std            | Distribution standard deviation.                                      | Real        | 0         |
|                        | Required for ``normal`` distributions.                                |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density.min            | Minimum diameter to clip distribution.                                | Real        | 0         |
|                        | Required for ``normal`` distributions and ``uniform`` distributions.  |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density.max            | Maximum diameter to clip distribution.                                | Real        | 0         |
|                        | Required for ``normal`` distributions and ``uniform`` distributions.  |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+
| density.custom         | File name that specifies either the cumulative or probability         | String      | None      |
|                        | distribution. Required for ``custom`` distributions.                  |             |           |
+------------------------+-----------------------------------------------------------------------+-------------+-----------+

The following inputs must be preceded by the prefix ``mfix``:

+----------------------+-----------------------------------------------------------------------+-------------+--------------+
|                      | Description                                                           |   Type      | Default      |
+======================+=======================================================================+=============+==============+
| particle_init_type   | Particle initialization method.                                       |   String    | AsciiFile    |
|                      |                                                                       |             |              |
|                      | Options:                                                              |             |              |
|                      |                                                                       |             |              |
|                      | * ``Auto`` - automatic particle generation                            |             |              |
|                      | * ``AsciiFile`` - read particle data from file ``particle_input.dat`` |             |              |
|                      |                                                                       |             |              |
+----------------------+-----------------------------------------------------------------------+-------------+--------------+


The following input must be preceded by the prefix ``particles``:

+--------------------+---------------------------------------------------------------------------+-------------+-----------+
|                    | Description                                                               |   Type      | Default   |
+====================+===========================================================================+=============+===========+
| removeOutOfRange   | Remove particles at initialization that are touching a wall.              |    Int      |   1       |
+--------------------+---------------------------------------------------------------------------+-------------+-----------+


Below is an example for specifying an initial condition for a fluid (``fluid``) and one solid (``solid0``).

.. code-block:: none

   mfix.particle_init_type = Auto

   particles.removeOutOfRange = 1

   ic.regions  = bed0  bed1

   ic.bed0.fluid.volfrac   =  0.725
   ic.bed0.fluid.density   =  1.0
   ic.bed0.fluid.velocity  =  0.015  0.00  0.00
   ic.bed0.fluid.temperature =  383.0
   ic.bed0.fluid.species.CO  =  0.3
   ic.bed0.fluid.species.CO2 =  0.2
   ic.bed0.fluid.species.O2  =  0.5

   ic.bed0.solids  = my_solid0

   ic.bed0.packing = pseudo_random

   ic.bed0.my_solid0.volfrac  =  0.275
   ic.bed0.my_solid0.temperature  =  400.0
   ic.bed0.my_solid0.species.Fe2O3 =  0.4
   ic.bed0.my_solid0.species.FeO   =  0.6

   ic.bed0.my_solid0.velocity =  0.00  0.00  0.00

   ic.bed0.my_solid0.diameter = constant
   ic.bed0.my_solid0.diameter.constant =  100.0e-6

   ic.bed0.my_solid0.density  = constant
   ic.bed0.my_solid0.density.constant  = 1000.0

   ic.bed1.fluid.volfrac   =  0.925
   ic.bed1.fluid.density   =  1.0
   ic.bed1.fluid.velocity  =  0.015  0.00  0.00
   ic.bed1.fluid.temperature =  383.0
   ic.bed1.fluid.species.CO  =  0.5
   ic.bed1.fluid.species.CO2 =  0.5
   ic.bed1.fluid.species.O2  =  0.0

   ic.bed1.solids  = solid0
   ic.bed1.packing = pseudo_random

   ic.bed1.solid0.volfrac  =  0.075
   ic.bed1.solid0.temperature  =  450.0
   ic.bed1.solid0.species.Fe2O3 =  0.0
   ic.bed1.solid0.species.FeO   =  1.0

   ic.bed1.solid0.velocity =  0.10  0.00  0.00


   ic.bed1.solid0.diameter = uniform
   ic.bed1.solid0.diameter.type = number-weighted
   ic.bed1.solid0.diameter.bins = 20
   ic.bed1.solid0.diameter.min =   90.0e-6
   ic.bed1.solid0.diameter.max =  110.0e-6

   ic.bed1.solid0.density  = normal
   ic.bed1.solid0.density.mean  = 900.0
   ic.bed1.solid0.density.std  =   30.0
   ic.bed1.solid0.density.min  =  800.0
   ic.bed1.solid0.density.max  = 1000.0
