pyvstress package
Submodules
pyvstress.exceptions module
pyvstress.soil module
- class pyvstress.soil.AbsPoint(z=0, total_stress=0.0, pore_pressure=0.0, effective_stress=0.0, layer_index=0)[source]
Bases:
object
Abstract point class
- __init__(z=0, total_stress=0.0, pore_pressure=0.0, effective_stress=0.0, layer_index=0)[source]
In most cases initilize with only the depth of the point and the rest are computed based on the location of the point in the soil layer.
- Parameters:
z (float) – distance below the ground surface.
total_stress (float) – vertical total stress at the point
pore_pressure (float) – porewater pressure at the point
effective_stress (float) – vertical effective stress at the point
layer_index (int) – index of the layer in which the point lies.
- property z
Return the depth of the point from the ground surface.
- property total_stress
Return the vertical total stress at the point.
- property pore_pressure
Return the porewater pressure at the point.
- property effective_stress
Return the vertical effective stress at the point.
- property layer_index
Return the index of the layer in which the point lies
- class pyvstress.soil.Point(z=0.0, layer_index=0)[source]
Bases:
AbsPoint
Class for Points
- __init__(z=0.0, layer_index=0)[source]
In most cases initilize with only the depth of the point and the rest are computed based on the location of the point in the soil layer.
- Parameters:
z (float) – distance below the ground surface.
total_stress (float) – vertical total stress at the point
pore_pressure (float) – porewater pressure at the point
effective_stress (float) – vertical effective stress at the point
layer_index (int) – index of the layer in which the point lies.
- class pyvstress.soil.SoilLayer(layer_thickness, gamma_bulk, gamma_sat=None, **kwargs)[source]
Bases:
object
Class for soil layers, with layer properties.
- __init__(layer_thickness, gamma_bulk, gamma_sat=None, **kwargs)[source]
- Parameters:
layer_thickness (float) – thickness of the layer.
gamma_bulk (float) – bulk unit weight of the layer.
gamma_sat (float) – saturated unit weight of the layer.
phi (float) – slope of the Mohr-Coulomb failure envelope, an effective stress strength parameter.
c (float) – intercept of the Mohr-Coulomb, an effecitve stress strength parameter.
su (float) – undrained shear strength, a total stress strength parameter.
fc (float) – fines content, will be used for liquefaction triggering analysis.
soiltype (str) – soil description, to be used in correlations.
Use bulk unit weights for soil layers above the water table and saturated unit weights for layers below the water table
- property thickness
Depth to the top of the layer
- property gamma_bulk
Bulk unit weight of the layer
- property gamma_sat
Saturated unit weight of the layer
- property ztop
Return the depth of the top of the layer from the ground surface.
- property zbot
Return the depth of the bottom of the layer from the ground surface.
- property sat
Return if the saturation status of the layer
- property overburden
Return the total vertical stress at the top of the layer.
- class pyvstress.soil.SoilProfile(layers=[], zw=0, q=0.0, gammaw=62.4)[source]
Bases:
object
- __init__(layers=[], zw=0, q=0.0, gammaw=62.4)[source]
- Parameters:
layers ([]) – a list of :class: SoilLayer objects.
zw (float) – depth to groundwater, positive depth below groundlevel, negative depths above groundlevel
surcharge (float) – surface surchage load
gammaw (float) – float, unit weight of water, use consistent units, the units of the the computations is the units of gammaw
- add_layer(layer)[source]
Add a :class: SoilLayer to the end of the :class: SoilProfile
- Parameters:
layer –
- class:
SoilLayer instance
- insert(index, layer)[source]
Insert a SoilLayer object into a list of SoilLayer objects in SoilProfile object.
- property layers
- property zw
- property saturation_zone
- property ztops
Return a list of depth to the top of the layers
- property zbots
Return a list of depth to bottom of the layers
- property surcharge
Return the surface surchage value
- Returns:
external surcharge on the top of the soil profile
- Return type:
float
- property gammaw
Return the unit weight of water
- Returns:
unit weight of water
- Return type:
float
- split_layer(z)[source]
Split the layer into two layers if the depth z is not a layer boundary. i.e. ztop < z < zbot
- update_profile()[source]
Split the profile at the groundwater level and compute overburden stress at the top of each layer.
- water_stress()[source]
If there is standing water then compute the total stress from the water on the soil profile.
- vertical_stresses(pts)[source]
Compute total vertical stress, pore pressure, and effective stress at the specified points, depth below the ground surface
- Parameters:
pts – list of Point instances, depth below the surface at which stress is computed
- calc_total_stress(pt)[source]
Compute total stress at the specified point, depth below the ground surface
- Parameters:
pt (Point) – Point instance
- calc_pore_pressure(pt)[source]
Compute pore pressure at the specified point, the water pressure with respect to the groundwater table
- Parameters:
pt (Point) – Point instance
- assign_layer_index(pts)[source]
Assign layer index to the points.
- Parameters:
pt (Point) – [] of Point object
- get_params(pts, keylist)[source]
Collect and return attribute values of layer object corresponding to point layer indices
- Parameters:
pts – [] of Point objects
keylist – [] of class attributes as string class attributes for which the values are required
- assign_params(pts)[source]
Assign soil parameters of the layer in which the point falls to the point.
Return a dictionary of soil parameters that are in addition to regular class attributes attrs_list = [“_layer_thickness”, “_gamma_bulk”, “_gamma_sat”, “_sat”, “_ztop”, “_zbot”, “_overburden”]
The layers must be assigned indices using assign_layer_index before assigning soil parameters using this method.
- Parameters:
pts (Point) – [] of Point objects
pyvstress.utility_functions module
- pyvstress.utility_functions.check_required(obj, list_params)[source]
Check if given parameters are supplied to an object, if all the required parameters are found return True else raise an error.
- Parameters:
obj – object of the class for which to check for the list of parameters
list_params – list of strings, a list of required parameters
- pyvstress.utility_functions.calc_rankine_ka(phi)[source]
Compute Rankines active earth pressure coefficient
- Parameters:
phi (float) – Mohr-Coulomb phi parameter
- pyvstress.utility_functions.calc_rankine_kp(phi)[source]
Compute Rankines passive earth pressure coefficient
- Parameters:
c (float) – Mohr-Coulomb c parameter
- pyvstress.utility_functions.calc_active_earth_pressure(sigma, phi, c)[source]
Active earth pressure using both phi and c
- Parameters:
sigma (float) – effective stress
phi (float) – Mohr-Coulomb phi parameter
c (float) – Mohr-Coulomb c parameter
- pyvstress.utility_functions.calc_passive_earth_pressure(sigma, phi, c)[source]
Passive earth pressure using both phi and c
- Parameters:
sigma – float effective stress
phi – Mohr-Coulomb phi parameter
c – Mohr-Coulomb c parameter
- pyvstress.utility_functions.stress_profile_points(soil_profile, analysis_type='vertical')[source]
Returns points for computing vertical stresses / lateral earth pressures for the soil profile.
- Parameters:
:class – SoilProfile soil_profile: SoilProfile object
analysis_type (str) – either “vertical” or “lateral” vertical: assigns a point at the soil profile top, one point each at the layer boundaries, at the groundwater table if it is not the same as one of the layer boundaries, and one at the bottom of the soil profile. lateral: assigns a pont at the soil profile top, two points at each of the layer boundaries, a point at the groundwater table if it is not one of the layer boundaries, and one point at the bottom of the soil profile. Two points at the interior layer boundaries are required because the top layer and the bottom layer have different values of phi and c, which will result in different lateral stresses.
- pyvstress.utility_functions.profile_vertical_stresses(soilprofile)[source]
Return vertical stress with depth.
- Parameters:
soilprofile – SoilProfile instance
- pyvstress.utility_functions.profile_lateral_earth_pressures(soilprofile, use_c=True)[source]
Return lateral stresses with depth
- Parameters:
soilprofile (SoilProfile) – SoilProfile instance
use_c (bool) – To indicate if Mohr-Coulomb c should be used in the calculation of lateral earth pressures. If False only phi parameter will be used.
- pyvstress.utility_functions.generate_regular_points(soil_profile, analysis_type='vertical', dz=0.5)[source]
Generate a list of points within the soil profile layer.
Generate points, when possible, at equal intervals of dz. Points may not be dz apart near layer boundaries. Either one or two points are generated at internal layer boundaries based on whether the type of analysis involves vertical stresses, 1 point per boundary, or lateral stresses 2 points per boundary, one point for the layer above the layer boundary and one point for the layer below the boundary.
- Parameters:
soilprofile (SoilProfile) – SoilProfile object
dz (float) – maximum separation distance between points
analysis_type (str) – type of analysis either ‘vertical’ or ‘lateral’
- Returns:
a list of Point objects, almost equally spaced over the soil profile
- Return type:
[Point]