Add scaling field input
The new parameterization (#86 (closed)) can be inserted. Now support for small scale heterogeneities has to be re-enabled.
We came up with the following proposal:
FlowParameters stores three scaling factors for every (level 0) grid cell.
\xi_h: applies to matric head
\xi_K: applies to conductivity
\xi_\theta: is added to porosity (saturated water content)
These parameters can be set through special setter functions that support multiple scaling schemes:
- Miller scaling:
\xi_h = \xi_K,
\xi_\theta = 0
- Warrick scaling:
\xi_h = \xi_K
The only input for scaling fields will be H5 datasets. Their values will be interpreted as point values and fed into an interpolator. The interpolator then yields the field values based on global coodinates and will be evaluated for storing the scaling values per cell. Choices will be nearest-neighbor interpolator and linear interpolator. Fields will have extensions and offsets the user can choose.
Several interpolators can be merged into a ScaleAdapter, which evaluates them for yielding the actual set of scaling values. Initially, there will be a
MillerScaleAdapter and a
DummyScaleAdapter (which always yields
\xi = 1).
FlowParameters then stores several of these along with the usual grid element mapping.
RangeField of interpolators is
double), whereas the
ScaleAdapter returns a 3 dimensional vector with scaling factors.
FlowParameters inserts these values into the
Input through parameter file
The parameter file must support addition of scaling fields. This initial version will only support one field covering the entire domain.
volumes: sand: index: 0 type: MvG parameters: # .. silt: index: 1 type: MvG parameters: # .. scaling: type: Miller data: scale_miller: file: miller.h5 dataset: global/dataset offset: [0, 0] extensions: [1, 1] interpolation: linear
Build new interpolators in 2D and 3D based on the current implementation and [Wikipedia] (https://en.wikipedia.org/wiki/Bilinear_interpolation).
Maybe compile these into a separate object file.
How to test the implementation?
- Unit test: Interpolator. Load values and verify for certain positions.
- Unit test: Scaling adapter. Load scaling config and verify values for certain positions.
- Unit test: Scaled parameterization. Load parameterization config and very that scaled values coincide with unscaled values plus scaling.