void_ratio_permeability

Class summary

CkPermeabilityModel(Ck, ka, ea) Semi-log void ratio permeability relationship
ConstantPermeabilityModel(ka) Permeability constant with void ratio
FunctionPermeabilityModel(fn_e_from_k, ...) Functional definition of permeability void-ratio realationship
PermeabilityVoidRatioRelationship Base class for defining permeability void ratio relationships
PwiseLinearPermeabilityModel(ka, ea[, xlog, ...]) Piecewise linear ratio permeability relationship

Module listing

Relationships between permeability and void-ratio

class geotecha.constitutive_models.void_ratio_permeability.CkPermeabilityModel(Ck, ka, ea)[source]

Bases: geotecha.constitutive_models.void_ratio_permeability.PermeabilityVoidRatioRelationship

Semi-log void ratio permeability relationship

Parameters:

Ck : float

Slope of void-ratio vs permeability.

ka, ea : float

Permeability and void ratio specifying a point on e-k line.

Methods

e_and_k_for_plotting(**kwargs) Void ratio and permeability that plot the model
e_from_k(k, **kwargs) Void ratio from permeability
k_from_e(e, **kwargs) Permeability from void ratio
plot_model(**kwargs) Plot the void ratio-permeability
e_and_k_for_plotting(**kwargs)[source]

Void ratio and permeability that plot the model

Parameters:

npts : int, optional

Number of points to return. Default npts=100.

xmin, xmax : float, optional

Range of x (i.e. effective stress) values from which to return points. Default xmin=1, xmax=100.

Returns:

x, y : 1d ndarray

npts permeability, and void ratio values between xmin and xmax.

e_from_k(k, **kwargs)[source]

Void ratio from permeability

Parameters:

k : float

Current permeability.

Returns:

e : float

Void ratio corresponding to current permeability.

Examples

>>> a = CkPermeabilityModel(Ck=1.5, ka=10, ea=4)
>>> a.e_from_k(8.0)
3.854...

Array Inputs:

>>> a.e_from_k(np.array([8.0, 4.0]))
array([ 3.854...,  3.403...])
k_from_e(e, **kwargs)[source]

Permeability from void ratio

Parameters:

e : float

Void ratio.

Returns:

k : float

Permeability corresponding to current void ratio.

Examples

>>> a = CkPermeabilityModel(Ck=1.5, ka=10, ea=4)
>>> a.k_from_e(3.855)
8.0...

Array Inputs

>>> a.k_from_e(np.array([3.855, 3.404]))
array([ 8.0...,  4.0...])
class geotecha.constitutive_models.void_ratio_permeability.ConstantPermeabilityModel(ka)[source]

Bases: geotecha.constitutive_models.void_ratio_permeability.PermeabilityVoidRatioRelationship

Permeability constant with void ratio

Note that the method e_from_k is meaningless because there are multiple e values for single k value.

Parameters:

ka : float

Permeability.

Methods

e_and_k_for_plotting(**kwargs) Void ratio and permeability that plot the model
e_from_k(k, **kwarks) Void ratio from permeability, parameters are irrelevant.
k_from_e(e, **kwargs) Permeability from void ratio
plot_model(**kwargs) Plot the void ratio-permeability
e_and_k_for_plotting(**kwargs)[source]

Void ratio and permeability that plot the model

Parameters:

npts : int, optional

Number of points to return. Default npts=100

xmin, xmax : float, optional

Range of x (i.e. effective stress) values from which to return points. Default xmin=1, xmax=100.

Returns:

x, y : 1d ndarray

npts permeability, and void ratio values between xmin and xmax.

e_from_k(k, **kwarks)[source]

Void ratio from permeability, parameters are irrelevant.

k_from_e(e, **kwargs)[source]

Permeability from void ratio

Parameters:

e : float

Void ratio.

Returns:

ka : float

The constant permeability.

Examples

>>> a = ConstantPermeabilityModel(ka=2.5)
>>> a.k_from_e(3.855)
2.5

Array Inputs:

>>> a.k_from_e(np.array([3.855, 3.404]))
array([ 2.5,  2.5])
class geotecha.constitutive_models.void_ratio_permeability.FunctionPermeabilityModel(fn_e_from_k, fn_k_from_e, *args, **kwargs)[source]

Bases: geotecha.constitutive_models.void_ratio_permeability.PermeabilityVoidRatioRelationship

Functional definition of permeability void-ratio realationship

User provides python functions.

Parameters:

fn_e_from_k: callable object

Function to obtain void ratio from permeability. fn_e_from_k should be the inverse function of fn_k_from_e.

fn_k_from_e : callable object

Function to obtain peremability from void ratio. fn_k_from_e should be the inverse function of fn_e_from_k.

*args, **kwargs : anything

Positional and keyword arguments to be passed to the fn_e_from_k, fn_k_from_efunctions. Note that any additional args and kwargs passed to the functions will be appended to the args, and kwargs. You may get into a mess for example with e_from_k because normally the first postional argument passed to such fucntions is k. If you add your own positional arguments, then k will be after you own arguments. Just be aware that the usual way to call methods of the base object PermeabilityVoidRatioRelationship a single positonal arguement, e.g. k, e, followed by any required keyword arguments.

Notes

Any function should be able to accept additonal keywords.

Examples

>>> def efk(k, b=2):
...     return k * b
>>> def kfe(e, b=2):
...     return e / b
>>> a = FunctionPermeabilityModel(efk, kfe, b=5)
>>> a.e_from_k(3)
15
>>> a.k_from_e(15)
3.0

Methods

e_and_k_for_plotting(**kwargs) Void ratio and permeability that plot the method
e_from_k(estress, **kwargs) Void ratio from permeability
k_from_e(e, **kwargs) Permeability from void ratio
plot_model(**kwargs) Plot the void ratio-permeability
class geotecha.constitutive_models.void_ratio_permeability.PermeabilityVoidRatioRelationship[source]

Bases: object

Base class for defining permeability void ratio relationships

Methods

e_and_k_for_plotting(**kwargs) Void ratio and permeability that plot the method
e_from_k(estress, **kwargs) Void ratio from permeability
k_from_e(e, **kwargs) Permeability from void ratio
plot_model(**kwargs) Plot the void ratio-permeability
e_and_k_for_plotting(**kwargs)[source]

Void ratio and permeability that plot the method

e_from_k(estress, **kwargs)[source]

Void ratio from permeability

k_from_e(e, **kwargs)[source]

Permeability from void ratio

plot_model(**kwargs)[source]

Plot the void ratio-permeability

class geotecha.constitutive_models.void_ratio_permeability.PwiseLinearPermeabilityModel(ka, ea, xlog=False, ylog=False, xbase=10, ybase=10)[source]

Bases: geotecha.constitutive_models.void_ratio_permeability.PermeabilityVoidRatioRelationship

Piecewise linear ratio permeability relationship

x and y data can be interpolated natural-natural, natural-log10, log10-natural, or log10, log10.

Parameters:

ka, ea : 1d array

Permeability values and void ratio values defining a one-to-one relationship.

xlog, ylog : True/False, Optional

If True then interpolation on each axis is assumed to be logarithmic with base 10. x refers to the peremability axis, y to the void ratio axis. Default xlog=ylog=False.

Methods

e_and_k_for_plotting(**kwargs) Void ratio and permeability that plot the model
e_from_k(k, **kwargs) Void ratio from permeability
k_from_e(e, **kwargs) Permeability from void ratio
plot_model(**kwargs) Plot the void ratio-permeability
e_and_k_for_plotting(**kwargs)[source]

Void ratio and permeability that plot the model

Parameters:

npts : int, optional

Number of points to return. Default npts=100.

xmin, xmax : float, optional

Range of x (i.e. effective stress) values from which to return points. Default min and max of model ka.

Returns:

x, y : 1d ndarray

npts permeability, and void ratio values between xmin and xmax.

e_from_k(k, **kwargs)[source]

Void ratio from permeability

Parameters:

k : float

Current permeability.

Returns:

e : float

Void ratio corresponding to current permeability.

Examples

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]), ea=np.array([5, 7.0]))
>>> a.e_from_k(1.25)
5.5

Array Inputs:

>>> a.e_from_k(np.array([1.25, 1.75]))
array([ 5.5,  6.5])

Logarithmic permeability scale:

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]),
... ea=np.array([5, 7.0]), xlog=True)
>>> a.e_from_k(1.25)
5.643...
>>> a.e_from_k(np.array([1.25, 1.75]))
array([ 5.643...,  6.614...])

Logarithmic void ratio scale:

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]),
... ea=np.array([5, 7.0]), ylog=True)
>>> a.e_from_k(1.25)
5.4387...
>>> a.e_from_k(np.array([1.25, 1.75]))
array([ 5.4387...,  6.435...])

Logarithmic permeability and void ratio scale:

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]),
... ea=np.array([5, 7.0]), xlog=True, ylog=True)
>>> a.e_from_k(1.25)
5.572...
>>> a.e_from_k(np.array([1.25, 1.75]))
array([ 5.572...,  6.560...])

Increasing vs decreasing inputs:

>>> ea = np.arange(1,10)
>>> ka = 3 * ea
>>> np.isclose(PwiseLinearPermeabilityModel(ka, ea).e_from_k(7.2),
... PwiseLinearPermeabilityModel(ka[::-1], ea[::-1]).e_from_k(7.2))
True
k_from_e(e, **kwargs)[source]

Permeability from void ratio

Parameters:

e : float

Void ratio.

Returns:

k : float

Permeability corresponding to current void ratio.

Examples

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]), ea=np.array([5, 7.0]))
>>> a.k_from_e(5.5)
1.25

Array Inputs:

>>> a.k_from_e(np.array([5.5, 6.5]))
array([ 1.25,  1.75])

Logarithmic permeability scale:

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]),
... ea=np.array([5, 7.0]), xlog=True)
>>> a.k_from_e(5.644)
1.25...
>>> a.k_from_e(np.array([5.644, 6.615]))
array([ 1.25...,  1.75...])

Logarithmic void ratio scale:

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]),
... ea=np.array([5, 7.0]), ylog=True)
>>> a.k_from_e(5.4388)
1.25...
>>> a.k_from_e(np.array([5.4388, 6.436]))
array([ 1.25...,  1.75...])

Logarithmic permeability and void ratio scale:

>>> a = PwiseLinearPermeabilityModel(ka=np.array([1.0, 2.0]),
... ea=np.array([5, 7.0]), xlog=True, ylog=True)
>>> a.k_from_e(5.573)
1.25...
>>> a.k_from_e(np.array([5.573, 6.561]))
array([ 1.25...,  1.75...])

Increasing vs decreasing inputs:

>>> ea = np.arange(1,10)
>>> ka = 3 * ea
>>> np.isclose(PwiseLinearPermeabilityModel(ka, ea).k_from_e(3.0),
... PwiseLinearPermeabilityModel(ka[::-1], ea[::-1]).k_from_e(3.0))
True