ogstools.propertylib.tensor_math module#

Common tensor transformation operations.

They can be used as they are, but are also part of ogstools.propertylib.matrix.Matrix properties. All input arrays are expected to be in vector notation of symmetric tensors in the form of:

[xx, yy, zz, xy] for 2D and

[xx, yy, zz, xy, yz, xz] for 3D.

This notation style is the default output of OGS:

<https://www.opengeosys.org/docs/userguide/basics/conventions/#a-namesymmetric-tensorsa–symmetric-tensors-and-kelvin-mapping>

A better overview for the theoretical background of the equations can be found here, for example:

<https://en.wikipedia.org/wiki/Cauchy_stress_tensor#Cauchy’s_stress_theorem%E2%80%94stress_tensor>

ogstools.propertylib.tensor_math.identity(vals)[source]#
Returns:

The input values.

Parameters:

vals (T)

Return type:

T

ogstools.propertylib.tensor_math.sym_tensor_to_mat(vals)[source]#

Convert an symmetric tensor to a 3x3 matrix.

Parameters:

vals (ndarray)

Return type:

ndarray

ogstools.propertylib.tensor_math.trace(values)[source]#

Return the trace.

\(tr(\mathbf{\sigma}) = \sum\limits_{i=1}^3 \sigma_{ii}\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.eigenvalues(values)[source]#

Return the eigenvalues.

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.eigenvectors(values)[source]#

Return the eigenvectors.

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.det(values)[source]#

Return the determinants.

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.frobenius_norm(values)[source]#

Return the Frobenius norm.

\(||\mathbf{\sigma}||_F = \sqrt{ \sum\limits_{i=1}^m \sum\limits_{j=1}^n |\sigma_{ij}|^2 }\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.invariant_1(values)[source]#

Return the first invariant.

\(I1 = tr(\mathbf{\sigma})\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.invariant_2(values)[source]#

Return the second invariant.

\(I2 = \frac{1}{2} \left[(tr(\mathbf{\sigma}))^2 - tr(\mathbf{\sigma}^2) \right]\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.invariant_3(values)[source]#

Return the third invariant.

\(I3 = det(\mathbf{\sigma})\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.mean(values)[source]#

Return the mean value. Also called hydrostatic component or octahedral normal component.

\(\pi = \frac{1}{3} I1\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.effective_pressure(values)[source]#

Return the effective pressure.

\(\pi = -\frac{1}{3} I1\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.hydrostatic_component(values)[source]#

Return the hydrostatic component.

\(p_{ij} = \pi \delta_{ij}\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.deviator(values)[source]#

Return the deviator.

\(s_{ij} = \sigma_{ij} - \pi \delta_{ij}\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.deviator_invariant_1(values)[source]#

Return the first invariant of the deviator.

\(J1 = 0\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.deviator_invariant_2(values)[source]#

Return the second invariant of the deviator.

\(J2 = \frac{1}{2} tr(\mathbf{s}^2)\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.deviator_invariant_3(values)[source]#

Return the third invariant of the deviator.

\(J3 = \frac{1}{3} tr(\mathbf{s}^3)\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.octahedral_shear(values)[source]#

Return the octahedral shear value.

\(\tau_{oct} = \sqrt{\frac{2}{3} J2}\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.von_mises(values)[source]#

Return the von Mises stress.

\(\sigma_{Mises} = \sqrt{3 J2}\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray

ogstools.propertylib.tensor_math.qp_ratio(values)[source]#

Return the qp ratio (von Mises stress / effective pressure).

\(qp = \sigma_{Mises} / \pi\)

Parameters:

values (PlainQuantity | ndarray)

Return type:

PlainQuantity | ndarray