initial.rst 4.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Initial Conditions
==================

DORiE computes transient solutions, and hence needs a solution from which it
can start. There are multiple ways of specifying an initial condition.
All have in common that the data provided must be interpolated on the
respective solution grid function space. Depending on the actual input data,
this means that information can be lost and specific features can be distorted.
Users are responsible to ensure that the solution grid function space and the
input data for initial conditions match in this sense.

Initial conditions can generally be stated in several physical quantities, as
long as the respective quantity has a unique transformation to the solver
solution quantity.

Initial condition input is controlled entirely via the
:doc:`Configuration File <man-config-file>`.

19 20 21 22 23 24
.. note::
   The initial condition is projected onto the actual solution function space.
   Depending on grid shape and resolution, function space (order), and
   interpolator (if applicable), the resulting solution may vary greatly from
   the actual input data.

25 26 27 28 29
Input Types
-----------
This is an overview of all input types for initial conditions.
They are controlled by the ``initial.type`` key and available for every model.

30
.. object:: Analytic
31

32
    * ``type = analytic``
33

34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    An analytic function :math:`f(\vec{p})` which depends on the physical
    position :math:`\vec{p}`. The function must be defined via the key
    ``initial.equation``. For parsing the input expression, we use muparser_
    which supports a set of common mathematical functions. Additionally, the
    following variables can be used:

    Available variables:
      * ``x``: X-coordinate :math:`p_1 \, [\mathrm{m}]`.
      * ``y``: Y-coordinate :math:`p_2 \, [\mathrm{m}]`.
      * ``z``: Z-coordinate :math:`p_3 \, [\mathrm{m}]` (only in 3D).
      * ``h``: Height above origin. Synonymous to ``y`` in 2D and ``z`` in 3D.
      * ``pi``: Mathematical constant :math:`\pi`.
      * ``dim``: Number of physical dimensions.

    .. tip::
       Assuming the target quantity is the matric head (see
       :ref:`initial-transformation`), typical initial conditions for a
       Richards simulation are
52

53 54
       * Hydrostatic equilibrium: A vertical gradient of :math:`-1` and a
         fixed value ``<v>`` at height :math:`h = 0 \, \mathrm{m}`::
55

56
            initial.equation = -h + <v>
57

58
       * Gravity flow: Constant value.
59

60 61 62
    .. tip::
       The expression for a gaussian pulse of solute concentration centered at
       :math:`\vec{p} = [0.5, 0.5]^T \, \mathrm{m}` is::
63

64 65
          initial.equation = exp(-sqrt((x-0.5)^2+(y-0.5)^2)/(4.*0.002))/(4*pi*0.002)^(2/dim).

66
.. object:: Dataset
67 68 69

    * ``type = data``

70 71 72 73 74 75 76 77 78 79 80 81
    Load the initial condition from a data file ``initial.file`` by opening the
    dataset ``initial.dataset`` inside this file. The data is interpreted as
    function :math:`f(\mathbf{p})` of the physical position :math:`\mathbf{p}`
    using one of the available :ref:`interpolators <man-interpolators>`, which
    can be chosen using the setting ``initial.interpolation``. The input data
    is automatically streched to match the grid extensions.

    Supported file extensions:

    * ``.h5``: H5_ data file. ``initial.dataset`` may be a file-internal path
      to the target dataset.

82
.. _initial-transformation:
83

84 85 86 87 88 89 90 91 92 93 94 95 96 97
Transformation Types
--------------------
This is an overview of the transformation types of all models.
They are controlled via the ``initial.quantity`` key.

Richards
^^^^^^^^
Initial condition tranformations for the Richards solver.

.. object:: No Transformation

    * ``quantity = matricHead``

    The input data is directly interpreted as matric head
98
    :math:`f = h_m [\mathrm{m}]`.
99

100
Transport
101
^^^^^^^^^
102
Initial condition tranformations for the Transport solver.
103

104
.. object:: No Transformation
105

106
    * ``quantity = soluteConcentration``
107

108
    The input data is directly interpreted as solute concentration,
109
    :math:`f = c_w [\mathrm{kg}/\mathrm{m}^3]`.
110

111
.. _H5: https://www.h5py.org/
112
.. _muparser: http://beltoforion.de/article.php?a=muparser&p=features