create.waterflow {SoPhy} | R Documentation

## Preparation for swms2d

### Description

The function creates the input list for `swms2d`

### Usage

    create.waterflow(h, Kat = 2, MaxIt = 20, hTab = c(0.001, 200),
                     dtMinMax = h$water$dtMinMax, DMul = c(1.1, 0.33),
                     atmadd=FALSE
                     )

### Arguments

`h` | a list of the same format as the output `xswms2d`
`Kat` | type of flow system: 0 : horizontal 1 : axisymmetric (well or single drain) 2 : vertical (profile)
`MaxIt` | maximum number of iteration during any time step.
`hTab` | `c(hTab1, hTabN)`, interval of pressure heads within which a table of hydraulic properties is generated.
`dtMinMax` | `(dtmin, dtmax)`, minimum and maximum permitted time increment.
`DMul` | `c(dMul, dMul2)`, `dMul >= 1`, `dMul2 <= 1`; if number of required iterations is less than 4 or greater than 6 then the next time step is multiplied by `dMul` and `dMul2`, respectively.
`atmadd` | logical. If a segment contains several roots, the potential water uptake for all the roots is added if `atmadd=TRUE`. Otherwise the maximum potential water uptake is assigned to the segment.

### Details

The function is usually called internally; see Examples for an explicite call. The function performes several tasks

- According to `h$water$red` the grid is thinned.
- Several checks are performed to insure that the users input parameters are sound.
- the boundary points and the numerical conditions are determined.
- the root uptake is determined. This functionality is still in an experimental stage.

  If several root segments belong to a single pixel then the boundary condition is taken that appears most. If equality, then in the order of atmospheric condition, Neumann condition, and Dirichlet condition, the first one is taken as condition for the pixel.

  In case of the atmospheric condition, the root uptake function is the minimal function of the standard form (given by P0, P2H, P2L, and P3), such that the values equal the maximal root uptake function at the considered pixel.

  For the Neumann condition, the sum of the Neumann values is taken over all root segment at the pixel with Neumann condition.

  For the Dirichlet condition, the minimum over all Dirichlet values is taken.

- the finite element mesh is created, where points that belong to the atmosphere or to a non-penetrable stone (`$stone$value=NA`) are excluded.

### Value

The output is a list suitable as input list for `swms2d`. Additionally, the list has the following elements:

`flux` | a `length(water.x)`*`length(water.y)` vector of logical values indicating which grid elements of the simulation grid are part of the finite element mesh.
`water.x` | the x coordinates of the thinned grid
`water.y` | the y coordinates of the thinned grid

### Author(s)

Martin Schlather, schlath@hsu-hh.de http://www.unibw-hamburg.de/WWEB/math/schlath/schlather.html

### See Also

`modify.horizons`, `plotRF`, `plotWater`, `simulateHorizons`, `SoPhy`, `swms2d`, `xswms2d`

### Examples

    h <- xswms2d(xlim=c(1, 50), ylim=c(1, 30), step=1, new=NULL)
    h$water$red <- 1
    h$water$top.value <- -50   ## pressure head at surface
    h$water$TPrint <- 10
    h <- simulateHorizons(h)  ## simulation of the stochastic components
    plotRF(h)
    swms2d.in <- create.waterflow(h) ## rewrite h as a list readable by
    ##        swms2d; the following function can also directly be called
    ##        with the argument h; then  create.waterflow is called
    ##        internally
    str(swms2d.in)
    swms2d.out <- swms2d(swms2d.in, iter.print=1) ## numerical simulation
    if (is.character(swms2d.out)) cat(swms2d.out, "\n") else
    plotWater(swms2d.out, what="H")

[Package SoPhy version 1.0.28 Index]