ttim#
Copyright (C), 2017, Mark Bakker.
TTim is a computer program for the simulation of transient multi-layer flow with analytic elements and consists of a library of Python scripts and FORTRAN extensions.
Mark Bakker, Delft University of Technology mark dot bakker at tudelft dot nl.
Submodules#
- ttim.aquifer
- ttim.aquifer_parameters
- ttim.besselnumba
- ttim.besselnumba_old
- ttim.besselnumba_total
- ttim.besselnumbanew
- ttim.circareasink
- ttim.circinhom
- ttim.element
- ttim.equation
- ttim.fit
- ttim.inhom1d
- ttim.invlapnumba
- ttim.kuhlman_invlap
- ttim.linedoublet
- ttim.linedoublet1d
- ttim.linesink
- ttim.linesink1d
- ttim.model
- ttim.plots
- ttim.stripareasink
- ttim.trace
- ttim.version
- ttim.well
Attributes#
Classes#
Create a circular area-sink with uniform infiltration rate in aquifer layer 0. |
|
Cross-section inhomogeneity consisting of stacked aquifer layers. |
|
Cross-section inhomogeneity consisting of stacked aquifer layers. |
|
Create a segment of a leaky wall, which is simulated with a line-doublet. |
|
Create a string of leaky wall segements consisting of line-doublets. |
|
Leaky line doublet with specified resistance. |
|
LineDoublet1D Base Class. |
|
Create a head-specified line-sink with optional width and resistance. |
|
HeadLineSink of which the head varies through time. |
|
String of head-specified line-sinks with optional width and resistance. |
|
LineSink with non-zero and potentially variable discharge through time. |
|
Create ditch consisting of a string of line-sink. |
|
Linesink1D with a specified discharge for each layer the linesink is in. |
|
1D flux-difference linesink element. |
|
1D head-difference linesink element. |
|
1D head-specified linesink element. |
|
Linesink1D with a specified discharge. |
|
LineSink1D Base Class. |
|
Create a multi-layer model object consisting of many aquifer layers. |
|
Create model specifying a multi-aquifer sequence of aquifer-leakylayer-etc. |
|
Model class for cross-section models. |
|
Well with a specified discharge for each layer that the well is screened in. |
|
Create a well with a specified head inside the well. |
|
Create a well with a specified discharge. |
|
Well Base Class. |
Functions#
|
Compute a pathline by numerical integration of the velocity vector. |
|
|
|
Print the version of dependencies. |
Package Contents#
- ttim.__name__ = 'ttim'#
- ttim.__author__ = 'Mark Bakker'#
- class ttim.CircAreaSink(model, xc=0, yc=0, R=0.1, tsandN=[(0, 1)], name='CircAreaSink', label=None)[source]#
Bases:
ttim.element.ElementCreate a circular area-sink with uniform infiltration rate in aquifer layer 0.
Infiltration rate in length / time, positive for water entering the aquifer.
- Parameters:
model (Model object) – model to which the element is added
xc (float) – x-coordinate of center of area-sink
yc (float) – y-coordinate of center of area-sink
R (radius of area-sink)
tsandN (list of tuples) – tuples of starting time and infiltration rate after starting time
label (string or None (default: None)) – label of the area-sink
- xc#
- yc#
- R#
- 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.Calibrate(model)[source]#
- model#
- parameters#
- seriesdict#
- seriesinwelldict#
- set_parameter(name=None, layers=None, initial=0, pmin=-np.inf, pmax=np.inf, inhoms=None)[source]#
Set parameter to be optimized.
- Parameters:
name (str) – name can be ‘kaq’, ‘Saq’, ‘c’, ‘Sll’ or ‘kzoverkh’.
layers (int or list of ints) – layer number(s) for which the parameter is set. If an integer is passed, parameter is associated with a single layer. If a list of layers is passed, layers must be consecutive and parameter is set for each layer from min(layers) up to and including max(layers).
initial (float, optional) – initial value for the parameter (the default is 0)
pmin (float, optional) – lower bound for parameter value (the default is -np.inf)
pmax (float, optional) – upper bound for paramater value (the default is np.inf)
inhoms (str, list) – string with name of inhomogeneity, list with string names of inhomogeneities or list of inhomogeneities inhomogeneity(ies) for which the parameter is set. If a string is passed, parameter is associated with a single inhomogeneity. If a list of strings of inhomogeneities (or list of inhomogeneities) is passed, parameter is set for each inhomogeneity in the list. This allows linking of parameters across inhomogeneities.
- set_parameter_by_reference(name=None, parameter=None, initial=0, pmin=-np.inf, pmax=np.inf)[source]#
Set parameter to be optimized.
- Parameters:
name (str) – parameter name
parameter (np.array) – array reference containing the parameter to be optimized. must be specified as reference, i.e. w.rc[0:]
initial (float, optional) – initial value for the parameter (the default is 0)
pmin (float, optional) – lower bound for parameter value (the default is -np.inf)
pmax (float, optional) – upper bound for paramater value (the default is np.inf)
- series(name, x, y, layer, t, h, weights=None)[source]#
Method to add observations to Calibration object.
- Parameters:
name (str) – name of series
x (float) – x-coordinate
y (float) – y-coordinate
layer (int) – layer number, 0-indexed
t (np.array) – array containing timestamps of timeseries
h (np.array) – array containing timeseries values, i.e. head observations
- seriesinwell(name, element, t, h)[source]#
Method to add observations to Calibration object.
- Parameters:
name (str) – name of series
element (element object with headinside function)
t (np.array) – array containing timestamps of timeseries
h (np.array) – array containing timeseries values, i.e. head observations
- residuals(p, printdot=False, weighted=True, layers=None, series=None)[source]#
Method to calculate residuals given certain parameters.
- Parameters:
p (np.array) – array containing parameter values
printdot (bool, optional) – print dot for each function call
- Returns:
array containing all residuals
- Return type:
np.array
- rmse(weighted=True, layers=None)[source]#
Calculate root-mean-squared-error.
- Returns:
return rmse value
- Return type:
float
- class ttim.Xsection3D(model, x1, x2, kaq=1, z=(4, 3, 2, 1), Saq=0.001, kzoverkh=0.1, poraq=0.3, topboundary='conf', phreatictop=False, topres=0, topthick=0, topSll=0, toppor=0.3, tsandhstar=None, tsandN=None, name=None)[source]#
Bases:
XsectionCross-section inhomogeneity consisting of stacked aquifer layers.
Vertical resistance is computed from vertical hydraulic conductivity and the anisotropy factor.
- Parameters:
model (Model) – Model to add the cross-section to, usually an instance of ModelXsection.
x1 (scalar) – x-coordinate of the left boundary of the cross-section.
x2 (scalar) – x-coordinate of the right boundary of the cross-section.
kaq (array) – Hydraulic conductivities of the aquifers.
z (array) – Elevations of the tops and bottoms of the layers.
Saq (array) – Specific storage of the aquifers.
kzoverkh (scalar) – Ratio of vertical hydraulic conductivity to horizontal hydraulic conductivity.
poraq (array) – Porosities of the aquifers.
topboundary (str) – Type of top boundary. Can be ‘conf’ for confined, ‘semi’ for semi-confined or “leaky” for a leaky top boundary.
phreatictop (bool) – If true, interpret the first specific storage coefficient as specific yield., i.e. it is not multiplied by aquifer thickness.
topres (scalar) – Resistance of the top boundary. Only used if topboundary is ‘leaky’.
topthick (scalar) – Thickness of the top boundary. Only used if topboundary is ‘leaky’.
topSll (scalar) – Specific storage of the top boundary. Only used if topboundary is ‘leaky’.
toppor (scalar) – Porosity of the top boundary. Only used if topboundary is ‘leaky’.
tsandhstar (list of tuples) – list containing time and water level pairs for the hstar boundary condition.
tsandN (list of tuples) – list containing time and infiltration pairs for the infiltration boundary condition.
name (str) – Name of the cross-section.
- class ttim.XsectionMaq(model, x1, x2, kaq=1, z=(1, 0), c=(), Saq=0.001, Sll=0, poraq=0.3, porll=0.3, topboundary='conf', phreatictop=False, tsandhstar=None, tsandN=None, name=None)[source]#
Bases:
XsectionCross-section inhomogeneity consisting of stacked aquifer layers.
- Parameters:
model (Model) – Model to add the cross-section to, usually an instance of ModelXsection.
x1 (float) – x-coordinate of the left boundary of the cross-section.
x2 (float) – x-coordinate of the right boundary of the cross-section.
kaq (array) – Hydraulic conductivities of the aquifers.
z (array) – Elevations of the tops and bottoms of the layers.
c (array) – Resistance of the leaky layers.
Saq (array) – Specific storage of the aquifers.
Sll (array) – Specific storage of the leaky layers.
poraq (array) – Porosities of the aquifers.
porll (array) – Porosities of the leaky layers.
topboundary (str) – Type of top boundary. Can be ‘conf’ for confined, ‘semi’ for semi-confined or “leaky” for a leaky top boundary.
phreatictop (bool) – If true, interpret the first specific storage coefficient as specific yield., i.e. it is not multiplied by aquifer thickness.
tsandhstar (list of tuples) – list containing time and water level pairs for the hstar boundary condition.
tsandN (list of tuples) – list containing time and infiltration pairs for the infiltration boundary condition.
name (str) – Name of the cross-section.
- class ttim.LeakyLineDoublet(model, x1=-1, y1=0, x2=1, y2=0, res='imp', order=0, layers=0, label=None, addtomodel=True)[source]#
Bases:
LineDoubletHoBase,ttim.equation.LeakyWallEquationCreate a segment of a leaky wall, which is simulated with a line-doublet.
The specific discharge through the wall is equal to the head difference across the wall divided by the resistance of the wall.
- Parameters:
model (Model object) – Model to which the element is added
x1 (scalar) – x-coordinate of fist point of line-doublet
y1 (scalar) – y-coordinate of fist point of line-doublet
x2 (scalar) – x-coordinate of second point of line-doublet
y2 (scalar) – y-coordinate of second point of line-doublet
res (scalar or string) – if string: ‘imp’ for an impermeable wall (same as res = np.inf) if scalar: resistance of leaky wall
order (int (default is 0)) – polynomial order of potential jump along line-doublet (head jump if transmissivity is equal on each side of wall)
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
- 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.LeakyLineDoubletString(model, xy=[(-1, 0), (1, 0)], res='imp', order=0, layers=0, label=None)[source]#
Bases:
ttim.element.Element,ttim.equation.LeakyWallEquationCreate a string of leaky wall segements consisting of line-doublets.
- 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 the segements in the string
res (scalar or string) – if string: ‘imp’ for an impermeable wall (same as res = np.inf) if scalar: resistance of leaky wall
order (int (default is 0)) – polynomial order of potential jump along line-doublet (head jump if transmissivity is equal on each side of wall)
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
- res = 'imp'#
- order = 0#
- ldlist = []#
- nld#
- 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.LeakyLineDoublet1D(model, xld=0, res='imp', layers=0, label=None)[source]#
Bases:
LineDoublet1DBase,ttim.equation.LeakyWallEquationLeaky line doublet with specified resistance.
- Parameters:
model (Model object) – model to which the element is added
xld (float) – x-coordinate of the line doublet
res (float) – resistance of the line doublet
layers (int, array or list) – layer (int) or layers (list or array) in which line doublet is located
label (string or None (default: None)) – label of the 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.LineDoublet1DBase(model, xld=0, tsandbc=[(0, 0)], res='imp', layers=0, type='', name='LineDoublet1DBase', label=None)[source]#
Bases:
ttim.element.ElementLineDoublet1D Base Class.
All LineDoublet1D elements are derived from this class
- Parameters:
model (Model object) – Model to which the element is added
xld (float) – x-coordinate of the line doublet
tsandbc (list of tuples) – list of tuples of the form (time, bc) for boundary conditions
res (float) – resistance of the line doublet
layers (int, array or list) – layer (int) or layers (list or array) in which line doublet is located
type (string) – type of element, “g” for given, “v” for variable and “z” for zero.
name (string) – name of the element
label (string, optional) – label of the element
- tiny = 1e-08#
- nparam#
- xld#
- 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.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.HeadEquationCreate 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
See also
- 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.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.HeadEquationNoresHeadLineSink 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
- class ttim.HeadLineSinkString(model, xy=[(-1, 0), (1, 0)], tsandh=[(0, 1)], res=0, wh='H', layers=0, label=None)[source]#
Bases:
LineSinkStringBase,ttim.equation.HeadEquationString 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
- 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(model, x1=-1, y1=0, x2=1, y2=0, tsandQ=[(0, 1)], res=0, wh='H', layers=0, label=None, addtomodel=True)[source]#
Bases:
LineSinkBaseLineSink with non-zero and potentially variable discharge through time.
Really only used for testing.
- class ttim.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.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
- 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.DischargeLineSink1D(model, xls=0, tsandq=[(0, 1)], res=0, wh='H', layers=0, label=None)[source]#
Bases:
LineSink1DBaseLinesink1D with a specified discharge for each layer the linesink is in.
- Parameters:
model (Model object) – model to which the element is added
x (float) – x-coordinate of the linesink
tsandq (list of tuples) – tuples of starting time and specific discharge after starting time
res (float) – resistance of the linesink
layers (int, array or list) – layer (int) or layers (list or array) in which linesink is located
label (string or None (default: None)) – label of the linesink
Examples
Example of an infinitely long linesink that pumps with a specific discharge of 100 between times 10 and 50, with a specific discharge of 20 between times 50 and 200, and zero speficic discharge after time 200.
>>> DischargeLineSink1D(ml, tsandq=[(10, 100), (50, 20), (200, 0)])
- class ttim.FluxDiffLineSink1D(model, xls=0, layers=0, label=None, aq=None)[source]#
Bases:
LineSink1DBase,ttim.equation.FluxDiffEquation1D flux-difference linesink element.
Used to ensure continuity of flux in a cross-section model, e.g. at the boundary of an inhomogeneity.
- Parameters:
model (Model object) – Model to which the element is added
xls (float) – x-coordinate of the linesink
layers (int, array or list) – layer (int) or layers (list or array) in which linesink is located
label (string, optional) – label of the 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.HeadDiffLineSink1D(model, xls=0, layers=0, label=None, aq=None)[source]#
Bases:
LineSink1DBase,ttim.equation.HeadDiffEquation1D head-difference linesink element.
Used to ensure continuity of head in a cross-section model, e.g. at the boundary of an inhomogeneity.
- Parameters:
model (Model object) – Model to which the element is added
xls (float) – x-coordinate of the linesink
layers (int, array or list) – layer (int) or layers (list or array) in which linesink is located
label (string, optional) – label of the element
aq (Aquifer object) – aquifer in which the element is located
- 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.HeadLineSink1D(model, xls=0, tsandh=[(0, 1)], res=0, wh='H', layers=0, label=None)[source]#
Bases:
LineSink1DBase,ttim.equation.HeadEquation1D head-specified linesink element.
- Parameters:
model (Model object) – Model to which the element is added
xls (float) – x-coordinate of the linesink
tsandh (list of tuples) – list of tuples of the form (time, head) for head conditions
res (float) – resistance of the linesink
wh (string or float) – wetted perimeter of the linesink, “H” for aquifer height, “2H” for 2x aquifer height (two-sided flow) or specify any float value
layers (int, array or list) – layer (int) or layers (list or array) in which linesink is located
label (string, optional) – label of the 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.LineSink1D(model, xls=0, tsandq=[(0, 1)], res=0, wh='H', vres=0.0, wv=1.0, layers=0, label=None)[source]#
Bases:
LineSink1DBase,ttim.equation.MscreenEquationLinesink1D with a specified discharge.
- Parameters:
model (Model object) – model to which the element is added
x (float) – x-coordinate of the linesink
tsandq (list of tuples) – tuples of starting time and specific discharge after starting time
res (float) – resistance of the linesink
layers (int, array or list) – layer (int) or layers (list or array) in which linesink is located
label (string or None (default: None)) – label of the linesink
Examples
Example of an infinitely long linesink that pumps with a specific discharge of 100 between times 10 and 50, with a specific discharge of 20 between times 50 and 200, and zero specific discharge after time 200.
>>> LineSink1D(ml, tsandq=[(10, 100), (50, 20), (200, 0)])
- 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.LineSink1DBase(model, xls=0, tsandbc=[(0, 1)], res=0, wh='H', layers=0, type='', name='LineSink1DBase', label=None, aq=None, inhomelement=False)[source]#
Bases:
ttim.element.ElementLineSink1D Base Class.
All LineSink1D elements are derived from this class
- Parameters:
model (Model object) – Model to which the element is added
xls (float) – x-coordinate of the line sink
tsandbc (list of tuples) – list of tuples of the form (time, bc) for boundary conditions
res (float) – resistance of the line sink
wh (string or float) – wetted perimeter of the linesink, “H” for aquifer height, “2H” for 2x aquifer height (two-sided flow) or specify any float value
layers (int, array or list) – layer (int) or layers (list or array) in which line sink is located
type (string) – type of element, “g” for given, “v” for variable and “z” for zero.
name (string) – name of the element
label (string, optional) – label of the element
aq (Aquifer object) – aquifer in which the element is located
inhomelement (boolean) – set to True if element is part of an inhomogeneity
- tiny = 1e-08#
- nparam#
- xls#
- res#
- wh = 'H'#
- aq = 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.Model3D(kaq=1, z=[4, 3, 2, 1], Saq=0.001, kzoverkh=0.1, poraq=0.3, topboundary='conf', phreatictop=False, topres=0, topthick=0, topSll=0, toppor=0.3, tmin=1, tmax=10, tstart=0, M=10, timmlmodel=None)[source]#
Bases:
TimModelCreate a multi-layer model object consisting of many aquifer layers.
The resistance between the layers is computed from the vertical hydraulic conductivity of the layers.
- Parameters:
kaq (float, array or list) – hydraulic conductivity of each layer from the top down if float, hydraulic conductivity is the same in all aquifers
z (array or list) – elevation of top of system followed by bottoms of all layers from the top down bottom of layer is automatically equal to top of layer below it if topboundary=’conf’: length is number of layers + 1 if topboundary=’semi’: length is number of layers + 2 as top of leaky layer on top of systems needs to be specified
Saq (float, array or list) – specific storage of all aquifers layers if float, sepcific storage is same in all aquifers layers if phreatictop is True and topboundary is ‘conf’, Saq of top aquifer is phreatic storage coefficient (and not multiplied with the layer thickness)
kzoverkh (float) – vertical anisotropy ratio vertical k divided by horizontal k if float, value is the same for all layers length is number of layers
topboundary (string, 'conf' or 'semi' (default is 'conf')) – indicating whether the top is confined (‘conf’) or semi-confined (‘semi’). currently only implemented for ‘conf’
topres (float) – resistance of top semi-confining layer, only read if topboundary=’semi’
topthick (float) – thickness of top semi-confining layer, only read if topboundary=’semi’
phreatictop (boolean) – the storage coefficient of the top aquifer layer is treated as phreatic storage (and not multiplied with the aquifer thickness)
tmin (scalar) – the minimum time for which heads can be computed after any change in boundary condition.
tmax (scalar) – the maximum time for which heads can be computed.
tstart (scalar) – time at start of simulation (default 0)
M (integer (default 10)) – the number of terms to be used in the numerical inversion algorithm. 10 is usually sufficient. If drawdown curves appear to oscillate, more terms may be needed, but this seldom happens.
timmlmodel (optional instance of a solved TimML model) – a timml model may be included to add steady-state flow
- name = 'Model3D'#
- class ttim.ModelMaq(kaq=[1], z=[1, 0], c=[], Saq=[0.001], Sll=[0], poraq=[0.3], porll=[0.3], topboundary='conf', phreatictop=False, tmin=1, tmax=10, tstart=0, M=10, timmlmodel=None)[source]#
Bases:
TimModelCreate model specifying a multi-aquifer sequence of aquifer-leakylayer-etc.
- Parameters:
kaq (float, array or list) – hydraulic conductivity of each aquifer from the top down if float, hydraulic conductivity is the same in all aquifers
z (array or list) – elevation tops and bottoms of the aquifers from the top down leaky layers may have zero thickness if top=’conf’: length is 2 * number of aquifers if top=’semi’: length is 2 * number of aquifers + 1 as top of leaky layer on top of systems needs to be specified
c (float, array or list) – resistance of leaky layers from the top down if float, resistance is the same for all leaky layers if top=’conf’: length is number of aquifers - 1 if top=’semi’: length is number of aquifers
Saq (float, array or list) – specific storage of all aquifers if float, sepcific storage is same in all aquifers if phreatictop is True and topboundary is ‘conf’, Saq of top aquifer is phreatic storage coefficient (and not multiplied with the layer thickness)
Sll (float, array or list) – specific storage of all leaky layers if float, sepcific storage is same in all leaky layers if phreatictop is True and topboundary is ‘semi’, Sll of top leaky layer is phreatic storage coefficient (and not multiplied with the layer thickness)
topboundary (string, 'conf' or 'semi' (default is 'conf')) – indicating whether the top is confined (‘conf’) or semi-confined (‘semi’)
phreatictop (boolean) – the storage coefficient of the top model layer is treated as phreatic storage (and not multiplied with the aquifer thickness)
tmin (scalar) – the minimum time for which heads can be computed after any change in boundary condition.
tmax (scalar) – the maximum time for which heads can be computed
tstart (scalar) – time at start of simulation (default 0)
M (integer) – the number of terms to be used in the numerical inversion algorithm. 10 is usually sufficient. If drawdown curves appear to oscillate, more terms may be needed, but this seldom happens.
timmlmodel (optional instance of a solved TimML model) – a timml model may be included to add steady-state flow
- name = 'ModelMaq'#
- class ttim.ModelXsection(naq=1, tmin=1, tmax=10, tstart=0, M=10, timmlmodel=None)[source]#
Bases:
TimModelModel class for cross-section models.
- Parameters:
naq (integer) – number of aquifers
tmin (float) – the minimum time for which heads can be computed after any change in boundary condition.
tmax (float) – the maximum time for which heads can be computed.
tstart (float, optional) – time at start of simulation (default 0)
M (integer, optional) – the number of terms to be used in the numerical inversion algorithm. 10 is usually sufficient.
timmlmodel (timml.Model) – a timml model may be included to add a steady-state flow result to the computed solution.
- elementlist = []#
- elementdict#
- vbclist = []#
- zbclist = []#
- gbclist = []#
- tmin = 1#
- tmax = 10#
- tstart = 0#
- M = 10#
- aq#
- name = 'TimModel'#
- modelname = 'ml'#
- timmlmodel = None#
- plots#
- plot#
- ttim.timtrace(ml, xstart, ystart, zstart, tstartend, tstartoffset, tstep, nstepmax=100, hstepmax=10, silent=False, correctionstep=True)[source]#
Compute a pathline by numerical integration of the velocity vector.
Pathline is broken up in sections for which starting times are provided. Pathline is computed from first starting time + offset until second starting time, then continued from second starting time + offset until third starting time, etc.
- Parameters:
model (Model object) – model
xstart (float) – x-coordinate of starting location of pathline
ystart (float) – y-coordinate of starting location of pathline
zstart (float) – z-coordinate of starting location of pathline
tstartend (list) – list of starting times of pathline. last entry is the ending time.
tstartoffset (float or list) – time after starting time when pathline is started. value or list. if this value is smaller than tmin it may cause problems after change in boundary conditions
tstep (scalar or list) – maximum time step for each step along pathline. Either one value for all sections, or list with values for each section.
nstepmax (integer) – maximum number of steps per section
hstepmax (float or integer) – maximum length of horizontal step
silent (boolean) – parameter to indicate if message should be printed to the screen for each section of the pathline
correctionstep (boolean) – parameter to indicate if a correction step (Euler’s method) should be taken. Taking a correction step is more accurate, especially for curved pathlines.
- Returns:
result –
xyzt : 2D array with four columns: x, y, z, t along pathline
message : list with text messages of each section of the pathline
status : numerical indication of the result. Negative is likely undesirable.
-2 : reached maximum number of steps before reaching maximum time
-1 : starting z value not inside aquifer
+1 : reached maximum time
+2 : reached element
+3 : flows out of top of aquifer
- Return type:
dictionary with three items
- ttim.timtraceline(ml, xstart, ystart, zstart, tstart, delt, tmax, nstepmax=100, hstepmax=10, correctionstep=True, silent=False)[source]#
- ttim.__version__ = '0.8.0'#
- ttim.show_versions(optional=True)[source]#
Print the version of dependencies.
- Parameters:
optional (bool, optional) – Print the version of optional dependencies, by default False
- Return type:
None
- class ttim.DischargeWell(model, xw=0, yw=0, tsandQ=[(0, 1)], rw=0.1, res=0, layers=0, label=None)[source]#
Bases:
WellBaseWell with a specified discharge for each layer that the well is screened in.
This is not very common and is likely only used for testing and comparison with other codes. The discharge must be specified for each screened layer. The resistance of the screen may be specified. The head is computed such that the discharge \(Q_i\) in layer \(i\) is computed as
\[Q_i = 2\pi r_wH_i(h_i - h_w)/c\]where \(c\) is the resistance of the well screen and \(h_w\) is the head inside the well.
- Parameters:
model (Model object) – model to which the element is added
xw (float) – x-coordinate of the well
yw (float) – y-coordinate of the well
tsandQ (list of tuples) – tuples of starting time and discharge after starting time
rw (float) – radius of the well
res (float) – resistance of the well screen
layers (int, array or list) – layer (int) or layers (list or array) where well is screened
label (string or None (default: None)) – label of the well
Examples
Example of a well that pumps with a discharge of 100 between times 10 and 50, with a discharge of 20 between times 50 and 200, and zero discharge after time 200.
>>> Well(ml, tsandQ=[(10, 100), (50, 20), (200, 0)])
- class ttim.HeadWell(model, xw=0, yw=0, rw=0.1, tsandh=[(0, 1)], res=0, layers=0, label=None)[source]#
Bases:
WellBase,ttim.equation.HeadEquationCreate a well with a specified head inside the well.
The well may be screened in multiple layers. The resistance of the screen may be specified. The head is computed such that the discharge \(Q_i\) in layer \(i\) is computed as
\[Q_i = 2\pi r_wH_i(h_i - h_w)/c\]where \(c\) is the resistance of the well screen and \(h_w\) is the head inside the well.
- Parameters:
model (Model object) – model to which the element is added
xw (float) – x-coordinate of the well
yw (float) – y-coordinate of the well
rw (float) – radius of the well
tsandh (list of tuples) – tuples of starting time and discharge after starting time
res (float) – resistance of the well screen
layers (int, array or list) – layer (int) or layers (list or array) where well is screened
label (string (default: None)) – label of the well
- 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.Well(model, xw=0, yw=0, rw=0.1, tsandQ=[(0, 1)], res=0, rc=None, layers=0, wbstype='pumping', label=None)[source]#
Bases:
WellBase,ttim.equation.WellBoreStorageEquationCreate a well with a specified discharge.
The well may be screened in multiple layers. The discharge is distributed across the layers such that the head inside the well is the same in all screened layers. Wellbore storage and skin effect may be taken into account. The head is computed such that the discharge \(Q_i\) in layer \(i\) is computed as
\[Q_i = 2\pi r_wH_i(h_i - h_w)/c\]where \(c\) is the resistance of the well screen and \(h_w\) is the head inside the well.
- Parameters:
model (Model object) – model to which the element is added
xw (float) – x-coordinate of the well
yw (float) – y-coordinate of the well
rw (float) – radius of the well
tsandQ (list of tuples) – tuples of starting time and discharge after starting time
res (float) – resistance of the well screen
rc (float) – radius of the caisson, the pipe where the water table inside the well flucuates, which accounts for the wellbore storage
layers (int, array or list) – layer (int) or layers (list or array) where well is screened
wbstype (string) – ‘pumping’: Q is the discharge of the well ‘slug’: volume of water instantaneously taken out of the well
label (string (default: None)) – label of the well
- hdiff = None#
- nunknowns#
- wbstype = 'pumping'#
- 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