Independent Variables#

Independent variables are variables which do not depend upon other dependent variables but are provided as data by the user. Examples include material properties, forcing datasets, etc. These can be provided in a few forms:

Independent Variable Constant#

A field evaluator with no dependencies, a constant value.

This evaluator is typically used for providing data that is a simple constant value.

This evaluator is used by providing the option:

“evaluator type” = “independent variable constant

independent-variable-constant-evaluator-spec

  • “value[double] The value.

Independent Variable From Function#

This evaluator is typically used for providing data that are functions of space and time. The evaluator consists of a list of region,function pairs, and the functions are evaluated across that region at each timestep. If the problem is time-independent, the “constant in time” option results in a performance improvement (as the functions need only be evaluated once). This leverages the exaustive functional format capability provided in Amanzi’s Functions_ library.

This evaluator is used by providing the option:

“evaluator type” == “independent variable

independent-variable-function-evaluator-spec

  • “constant in time[bool] false If true, only evaluate the functions once as they are time-independent.

  • “function[composite-vector-function-spec-list]

Independent Variable From File#

An evaluator with no dependencies specified by discrete data in a file.

This evaluator is typically used for providing data that are functions of space and time. Data is provided, discretely (e.g. with one data point per cell/face/node), at a series of time slices. The time slices are interpolated linearly in time to provide the value.

Within the file, data is expected to meet the following (HDF5) layout:

/time : a 1D array of length NTIMES, providing the time in seconds.
/variable_name.ENTITY.DOF  (group)

   /0 : a 1D array of length NENTITIES, providing the values for each entity
        at time /time[0]
   /1 : ...
   /NTIMES-1 : 1D array at time /time[NTIMES-1]

This evaluator is used by providing the option:

“evaluator type” == “independent variable

independent-variable-from-file-evaluator-spec

  • “filename[string] Path to the file.

  • “variable name[string] Name of the dataset to read from the file.

  • “domain name[string] domain Name of the domain on which the

    field is defined.

  • “component name[string] cell Name of the component in the field to populate.

  • “mesh entity[string] cell Name of the entity on which the component is defined.

  • “number of dofs[int] 1 Number of degrees of freedom to read.

  • “time function[function-spec] optional If provided, time is first manipulated by this function before interpolation. This is useful for things like cyclic data, which can use a modulo time function to repeat the same data.

<ParameterList name="field_evaluators">  <!-- parent list -->
<ParameterList name="porosity">
  <Parameter name="field evaluator type" type="string" value="independent variable from file"/>
  <Parameter name="filename" type="string" value="_DATA_FILE.h5"/>
  <Parameter name="domain name" type="string" value="domain"/>
  <Parameter name="variable name" type="string" value="porosity"/>
  <Parameter name="component name" type="string" value="cell"/>
  <Parameter name="mesh entity" type="string" value="cell"/>
  <Parameter name="number of dofs" type="int" value="1"/>

  <ParameterList name="time function">
    <Parameter name="times" type="Array(double)" value="{1.0, 2.0, 3.0}"/>
  </ParameterList>
</ParameterList>
</ParameterList>

The field porosity is defined as a cell-based variable and interpolated between three time intervals.