DitchString#
- class timflow.transient.linesink.DitchString(model, xy=[(-1, 0), (1, 0)], tsandQ=[(0, 1)], res=0, wh='H', layers=0, Astorage=None, label=None)#
Bases:
LineSinkStringBase,timflow.transient.equation.MscreenDitchEquationCreate ditch consisting of a string of line-sink.
The total discharge for the string is specified and divided over the line-sinks such that the head at the center inside each line-sink is equal. A width and resistance may optionally be specified.
Inflow per unit length of line-sink is computed as:
\[\sigma = w(h_{aq} - h_{ls})/c\]where \(c\) is the resistance of the bottom of the line-sink, \(w\) is the width over which water enters the line-sink, \(h_{aq}\) is the head in the aquifer at the center of the line-sink, \(h_{ls}\) is the specified head inside the line-sink Note that all that matters is the conductance term \(w/c\) but both are specified separately
- Parameters:
model (Model object) – Model to which the element is added
xy (array or list) – list or array of (x,y) pairs of coordinates of end-points of line-sinks in string
tsandQ (list or 2D array of (time, discharge) values) – if list or 2D array: pairs of time and discharge after that time
res (scalar (default is 0)) – resistance of line-sink
wh (scalar or str) – distance over which water enters line-sink if ‘H’: (default) distance is equal to the thickness of the aquifer layer (when flow comes mainly from one side) if ‘2H’: distance is twice the thickness of the aquifer layer (when flow comes from both sides) if scalar: the width of the stream that partially penetrates the aquifer layer
layers (scalar, list or array) – layer(s) in which element is placed if scalar: element is placed in this layer if list or array: element is placed in all these layers
label (str or None) – label of element
- initialize()#
Initialize the element.
Initialization of terms that cannot be initialized before other elements or the aquifer is defined.
As we don’t want to require a certain order of entering elements, these terms are initialized when Model.solve is called The initialization class needs to be overloaded by all derived classes
- potinf(x, y, aq=None)#
Returns array (nunknowns, Nperiods).
- disvecinf(x, y, aq=None)#
Returns array (nunknowns,Nperiods).
- headinside(t, derivative=0)#
The head inside the line-sink string.
- Parameters:
t (array or float) – time(s) for whih head is computed
- Returns:
Head inside the line-sink for each line-sink, each layer that the line-sink is screened in, and each time
- Return type:
array size nline-sinks, nlayers, ntimes
- plot(ax=None, layer=None)#
Plot the element.
- run_after_solve()#
Function to run after a solution is completed.
For most elements nothing needs to be done, but for strings of elements some arrays may need to be filled.
- discharge_list(t, derivative=0)#
The discharge of each line-sink in the string.
- Parameters:
t (array or float) – time(s) for whih discharge is computed
- Returns:
Discharge for each line-sink, each layer that the line-sink is screened in, and each time
- Return type:
array size nline-sinks, nlayers, ntimes
- potential(x, y, aq=None)#
Returns complex array of size (ngvbc, naq, npval).
- unitpotential(x, y, aq=None)#
Returns complex array of size (naq, npval).
Can be more efficient for given elements.
- unitpotentialone(x, y, jtime, aq=None)#
Returns complex array of size (naq, npval).
Can be more efficient for given elements.
- disvec(x, y, aq=None)#
Returns 2 complex arrays of size (ngvbc, naq, npval).
- unitdisvec(x, y, aq=None)#
Returns 2 complex arrays of size (naq, npval).
Can be more efficient for given elements.
- potinflayers(x, y, layers=0, aq=None)#
Layers can be scalar, list, or array.
returns array of size (len(layers),nparam,npval) only used in building equations
- potentiallayers(x, y, layers=0, aq=None)#
Returns complex array of size (ngvbc, len(layers),npval).
Only used in building equations.
- unitpotentiallayers(x, y, layers=0, aq=None)#
Returns complex array of size (len(layers), npval).
Only used in building equations.
- disvecinflayers(x, y, layers=0, aq=None)#
Layers can be scalar, list, or array.
returns 2 arrays of size (len(layers),nparam,npval) only used in building equations
- disveclayers(x, y, layers=0, aq=None)#
Returns 2 complex array of size (ngvbc, len(layers), npval).
Only used in building equations.
- unitdisveclayers(x, y, layers=0, aq=None)#
Returns complex array of size (len(layers), npval).
Only used in building equations.
- discharge(t, derivative=0)#
The discharge in each layer.
- Parameters:
t (scalar, list or array) – times at which discharge is computed. t must be ordered and tmin <= t <= tmax
derivative (when derivative=0, returns discharge (default)) – when derivative=1, returns derivative of the discharge when derivative=-1, returns integrated discharge
- Returns:
Discharge in each screen with zeros for layers that are not screened
- Return type:
array of discharges (nlayers,len(t))
- dischargeold(t, derivative=0)#
The discharge in each layer.
- Parameters:
t (scalar, list or array) – times at which discharge is computed. t must be ordered and tmin <= t <= tmax
- Returns:
Discharge in each screen with zeros for layers that are not screened
- Return type:
array of discharges (nlayers,len(t))
- equation()#
Matrix rows for multi-screen conditions where total discharge is specified.
Returns matrix part nunknowns,neq,npval, complex. Returns rhs part nunknowns,nvbc,npval, complex head_out - c*q_s = h_in Set h_i - h_(i+1) = 0 and Sum Q_i = Q I would say headin_i - headin_(i+1) = 0 headout_i - c*qs_i - headout_(i+1) + c*qs_(i+1) = 0 In case of storage: Sum Q_i - A * p^2 * headin = Q