.. _inputFile: Problem input file ================================= The problem input file uses the extension `.ini`. By default, *Astra* uses `astra.ini` in the current directory. It is possible to start astra with an other input file using the `-i` command line option specifying the full path to the input file. The problem input file is read when *Astra* starts. It is split into several sections, each section name corresponding to a C++ class in *Astra* structure. Inside each section, each line defines an entry, which can have as many parameters as one wishes. (note that it requires at least one parameter). The input file allows for comments, which should start with ``#``. .. _gridSection: ``Grid`` section -------------------- The grid section defines the grid total dimension. It consists of 3 entries ``X1-grid``, ``X2-grid`` (when DIMENSIONS>=2) and ``X3-grid`` (when DIMENSIONS=3). Each entry defines the repartition of the grid points in the corresponding direction (the grid is always rectilinear). Each entry defines a series of grid blocks which are concatenated along the direction. Each block in a direction can have a different spacing rule (uniform, log or stretched). The definition of the Grid entries is as follows +----------------------------+-------------------------+------------------------------+ | | Allowed value | Example | +============================+=========================+==============================+ | Entry name | X1/2/3-Grid | X1-Grid | +----------------------------+-------------------------+------------------------------+ | start of domain | floating point | 0.0 | +----------------------------+-------------------------+------------------------------+ | # of points in domain | integer >= 1 | 64 | +----------------------------+-------------------------+------------------------------+ | end of domain | floating point | 1.0 | +----------------------------+-------------------------+------------------------------+ In the example below, we define in ``X1`` direction a grid of 64 points starting at ``X1=0.0`` and ending at ``X1=1.0``: .. code-block:: [Grid] X1-Grid 0.0 64 1.0 ``Physics`` section -------------------- The physics section defines the physics solved by *Astra* and the associated parameters. The physics section should at least contain the entry ``rhs`` which define the right-hand side of the equations solved by *Astra*. Depending on the choice of the right-hand side, other entries may be required. +----------------------------+-------------------------------------------------------+ | ``rhs`` value | Comment | +============================+=======================================================+ | ``advection`` | An homogenous advection rhs, used for testing | +----------------------------+-------------------------------------------------------+ | ``hydro`` | Incompressible Navier Stokes equations | +----------------------------+-------------------------------------------------------+ | ``burgers`` | 1D Burgers equations (used for testing) | +----------------------------+-------------------------------------------------------+ | ``mhd`` | Incompressible magnetohydrodynamics equation | +----------------------------+-------------------------------------------------------+ | ``compressible_hydro`` | compressible Navier Stokes equations | +----------------------------+-------------------------------------------------------+ Depending on the choice of the right-hand side, the following entries may be required in the physics section: ``advection`` right hand side ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | Entry name | Parameter type | Comment | +================+====================+===========================================================================================================+ | direction | integer | direction of the flow (0=x1, 1=x2, 2=x3) | +----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | velocity | float | flow velocity (constant in space and time) | +----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ ``hydro`` right hand side ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | Entry name | Parameter type | Comment | +=================+====================+===========================================================================================================+ | viscosity | float, (int) | | 1st parameter: kinematic viscosity | | | | | 2nd parameter (optional): order of the viscosity term *n* in :math:`=\nu \Delta^n v (default 1)` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | omega | float | (optional) rotation rate along the x3 (=z) axis | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | shear_type | string | (optional) type of large-scale shear. Value allowed: ``linear`` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | shear_rate | float | (optional) shear rate when `shear_type` is `linear` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ ``mhd`` right hand side ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | Entry name | Parameter type | Comment | +=================+====================+===========================================================================================================+ | viscosity | float, (int) | | 1st parameter: kinematic viscosity | | | | | 2nd parameter (optional): order of the viscosity term *n* in :math:`=\nu \Delta^n v (default 1)` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | resistivity | float, (int) | | 1st parameter: kinematic resistivity | | | | | 2nd parameter (optional): order of the resistivity term *n* in :math:`=\nu \Delta^n B (default 1)` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | omega | float | (optional) rotation rate along the x3 (=z) axis | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | shear_type | string | (optional) type of large-scale shear. Value allowed: ``linear`` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | shear_rate | float | (optional) shear rate when `shear_type` is `linear` | +-----------------+--------------------+-----------------------------------------------------------------------------------------------------------+ ``compressible_hydro`` right hand side ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | Entry name | Parameter type | Comment | +=================+====================+============================================================================================================+ | viscosity | float, (int) | | 1st parameter: kinematic viscosity | | | | | 2nd parameter (optional): order of the viscosity term *n* in :math:`=\nu \Delta^n v` (default 1) | +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | eta_rho | float, (int) | | 1st parameter: mass diffusion | | | | | 2nd parameter (optional): order of the diffusion term *n* in :math:`=\eta_\rho \Delta^n \rho` (default 1)| +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | rho_floor | float | (optional) density floor (default 1e-6) | +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | omega | float | (optional) rotation rate along the x3 (=z) axis | +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | cs | float | (optional) isothermal sound speed (default 1) | +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | shear_type | string | (optional) type of large-scale shear. Value allowed: ``linear`` | +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ | shear_rate | float | (optional) shear rate when `shear_type` is `linear` | +-----------------+--------------------+------------------------------------------------------------------------------------------------------------+ ``InitFlow`` section -------------------- The ``InitFlow`` section defines the initial conditions of the flow. Several entries can be used simultaneously to define more complex initial conditions. +------------------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | Entry name | Parameter type | Comment | +========================+====================+===========================================================================================================+ | large_scale_3d_noise | float, float | | (optional) Apply a 3D noise to all the wavemodes above a critical wavelength L. | | | | | The first parameter is the noise amplitude, and the second parameter is the critical wavelength. | | | | | NB: the noise is applied to all fields. | +------------------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | large_scale_2d_noise | float, float | | (optional) Apply a 2D noise to all the wavemodes above a critical wavelength L in the (x,y) plane. | | | | | The first parameter is the noise amplitude, and the second parameter is the critical wavelength. | | | | | NB: the noise is applied to all fields. | +------------------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | large_scale_1d_noise | float, float | | (optional) Apply a 1D noise to all the wavemodes above a critical wavelength L in the (x) direction. | | | | | The first parameter is the noise amplitude, and the second parameter is the critical wavelength. | | | | | NB: the noise is applied to all fields. | +------------------------+--------------------+-----------------------------------------------------------------------------------------------------------+ | shear_layer | float, float | | (optional) Create a shear layer: :math:`v_x=-v_0` if :math:`y