ttim.linesink#

Classes#

LineSinkBase

LineSink Base Class.

LineSink

LineSink with non-zero and potentially variable discharge through time.

HeadLineSink

Create a head-specified line-sink with optional width and resistance.

LineSinkStringBase

Helper class that provides a standard way to create an ABC using

HeadLineSinkString

String of head-specified line-sinks with optional width and resistance.

MscreenLineSink

MscreenLineSink that varies through time.

LineSinkDitchString

Create ditch consisting of a string of line-sink.

LineSinkDitchString2

Create ditch consisting of a string of line-sink.

LineSinkHoBase

Higher Order LineSink Base Class.

HeadLineSinkHo

HeadLineSink of which the head varies through time.

Module Contents#

class ttim.linesink.LineSinkBase(model, x1=-1, y1=0, x2=1, y2=0, tsandbc=[(0, 1)], res=0, wh='H', layers=0, type='', name='LineSinkBase', label=None, addtomodel=True)[source]#

Bases: ttim.element.Element

LineSink Base Class.

All LineSink elements are derived from this class

nparam#
x1#
y1#
x2#
y2#
res#
wh = 'H'#
__repr__()[source]#
initialize()[source]#

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

setflowcoef()[source]#

Separate function so that this can be overloaded for other types.

potinf(x, y, aq=None)[source]#

Can be called with only one x,y value.

disvecinf(x, y, aq=None)[source]#

Can be called with only one x,y value.

headinside(t)[source]#

The head inside the line-sink.

Parameters:

t (array or float) – time(s) for whih head is computed

Returns:

Head inside the line-sink for each layer that the line-sink is screened in

Return type:

array (length number of layers)

plot(ax=None)[source]#

Plot the element.

class ttim.linesink.LineSink(model, x1=-1, y1=0, x2=1, y2=0, tsandQ=[(0, 1)], res=0, wh='H', layers=0, label=None, addtomodel=True)[source]#

Bases: LineSinkBase

LineSink with non-zero and potentially variable discharge through time.

Really only used for testing.

class ttim.linesink.HeadLineSink(model, x1=-1, y1=0, x2=1, y2=0, tsandh=[(0, 1)], res=0, wh='H', layers=0, label=None, addtomodel=True)[source]#

Bases: LineSinkBase, ttim.equation.HeadEquation

Create a head-specified line-sink with optional width and resistance.

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

  • x1 (scalar) – x-coordinate of fist point of line-sink

  • y1 (scalar) – y-coordinate of fist point of line-sink

  • x2 (scalar) – x-coordinate of second point of line-sink

  • y2 (scalar) – y-coordinate of second point of line-sink

  • tsandh (list or 2D array of (time, head) values or string) – if list or 2D array: pairs of time and head after that time if ‘fixed’: head is fixed (no change in head) during entire simulation

  • 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

nunknowns#
initialize()[source]#

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

class ttim.linesink.LineSinkStringBase(model, tsandbc=[(0, 1)], layers=0, type='', name='LineSinkStringBase', label=None)[source]#

Bases: ttim.element.Element

Helper class that provides a standard way to create an ABC using inheritance.

lslist = []#
__repr__()[source]#
initialize()[source]#

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)[source]#

Returns array (nunknowns, Nperiods).

disvecinf(x, y, aq=None)[source]#

Returns array (nunknowns,Nperiods).

headinside(t, derivative=0)[source]#

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)[source]#

Plot the element.

run_after_solve()[source]#

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)[source]#

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

class ttim.linesink.HeadLineSinkString(model, xy=[(-1, 0), (1, 0)], tsandh=[(0, 1)], res=0, wh='H', layers=0, label=None)[source]#

Bases: LineSinkStringBase, ttim.equation.HeadEquation

String of head-specified line-sinks with optional width and resistance.

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

  • tsandh (list or 2D array of (time, head) values or string) – if list or 2D array: pairs of time and head after that time if ‘fixed’: head is fixed (no change in head) during entire simulation

  • 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

See also

HeadLineSink

x#
y#
nls#
tsandh = [(0, 1)]#
res#
wh = 'H'#
initialize()[source]#

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

class ttim.linesink.MscreenLineSink(model, x1=-1, y1=0, x2=1, y2=0, tsandQ=[(0.0, 1.0)], res=0.0, wh='H', layers=[0, 1], vres=0.0, wv=1.0, label=None, addtomodel=True)[source]#

Bases: LineSinkBase, ttim.equation.MscreenEquation

MscreenLineSink that varies through time.

Must be screened in multiple layers but heads are same in all screened layers

nunknowns#
vres#
wv = 1.0#
initialize()[source]#

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

class ttim.linesink.LineSinkDitchString(model, xy=[(-1, 0), (1, 0)], tsandQ=[(0, 1)], res=0, wh='H', layers=0, Astorage=None, label=None)[source]#

Bases: LineSinkStringBase, ttim.equation.MscreenDitchEquation

Create 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

nls#
Astorage = None#
initialize()[source]#

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

class ttim.linesink.LineSinkDitchString2(model, xy=[(-1, 0), (1, 0)], tsandQ=[(0, 1)], res=0, wh='H', layers=0, Astorage=None, label=None)[source]#

Bases: LineSinkStringBase, ttim.equation.MscreenDitchEquation

Create 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

nls#
Astorage = None#
initialize()[source]#

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

class ttim.linesink.LineSinkHoBase(model, x1=-1, y1=0, x2=1, y2=0, tsandbc=[(0.0, 1.0)], res=0.0, wh='H', order=0, layers=0, type='', name='LineSinkBase', label=None, addtomodel=True)[source]#

Bases: ttim.element.Element

Higher Order LineSink Base Class.

All Higher Order Line Sink elements are derived from this class

order = 0#
nparam#
x1#
y1#
x2#
y2#
res = 0.0#
wh = 'H'#
__repr__()[source]#
initialize()[source]#

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

setflowcoef()[source]#

Separate function so that this can be overloaded for other types.

potinf(x, y, aq=None)[source]#

Can be called with only one x,y value.

disvecinf(x, y, aq=None)[source]#

Can be called with only one x,y value.

headinside(t)[source]#

The head inside the line-sink.

Returns:

Head inside the well for each screen

Return type:

array (length number of screens)

plot(ax=None)[source]#

Plot the element.

class ttim.linesink.HeadLineSinkHo(model, x1=-1, y1=0, x2=1, y2=0, tsandh=[(0.0, 1.0)], order=0, layers=0, label=None, addtomodel=True)[source]#

Bases: LineSinkHoBase, ttim.equation.HeadEquationNores

HeadLineSink of which the head varies through time.

May be screened in multiple layers but all with the same head

nunknowns#
initialize()[source]#

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