www.mooseframework.org
RankTwoScalarTools.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #ifndef RANKTWOSCALARTOOLS_H
8 #define RANKTWOSCALARTOOLS_H
9 
10 // MOOSE includes
11 #include "MooseTypes.h"
12 
13 // Forward declarations
14 class MooseEnum;
15 class RankTwoTensor;
16 
17 namespace libMesh
18 {
19 class Point;
20 }
21 
23 {
24 /*
25  * Return the scalar_type MooseEnum
26  */
27 MooseEnum scalarOptions();
28 
29 /*
30  * Return scalar quantity of a rank two tensor based on the user specified scalar_type
31  * @param point1 The starting point of the rotation axis for a cylinderical system
32  * @param point2 The end point of the rotation axis
33  * @param curr_point The point corresponding to the stress (pass in & _q_point[_qp])
34  * @param direction The direction vector in which the scalar stress value is calculated
35  * point1 and point2 are required only for the cases of axialStress, hoopStress and radialStress
36  * curr_point is required only for the cases of hoopStress and radialStress
37  * direction is required only for directionValueTensor
38  * for all other cases, these parameters will take the default values
39  */
40 Real getQuantity(const RankTwoTensor & tensor,
41  const MooseEnum scalar_type,
42  const Point & point1,
43  const Point & point2,
44  const Point & curr_point,
45  Point & direction);
46 
47 /*
48  * Extracts the value of the tensor component at the specified indices
49  */
50 Real component(const RankTwoTensor & r2tensor, unsigned int i, unsigned int j);
51 
52 /*
53  * Extracts the value of the tensor component at the specified indices and
54  * updates the unit direction vector.
55  */
56 Real component(const RankTwoTensor & r2tensor, unsigned int i, unsigned int j, Point & direction);
57 
58 /*
59  * The von Mises Stress is calculated in the deviatoric stress space:
60  * \sigma_{vm} = \sqrt{\frac{3}{2}S_{ij}S_{ij}}
61  * This scalar quanitity is often used to determine the onset of plasticity by
62  * comparing the von Mises stress to the yield stress in J2 plasticity models.
63  */
64 Real vonMisesStress(const RankTwoTensor & tensor);
65 
66 /*
67  * The equivalent plastic strain is calculated as
68  * \epsilon_{eqv}^{pl} = \sqrt{\frac{2}{3}\epsilon_{ij}^{pl} \epsilon_{ij}^{pl}}
69  * Users must take care to pass in the plastic inelastic_strain only.
70  */
71 Real equivalentPlasticStrain(const RankTwoTensor & strain);
72 
73 /*
74  * The effective strain is calculated as
75  * \epsilon_{eff} = \sqrt{\frac{2}{3}\epsilon_{ij} \epsilon_{ij}}
76  */
77 Real effectiveStrain(const RankTwoTensor & strain);
78 
79 /*
80  * The hydrostatic scalar of a tensor is computed as the sum of the diagonal
81  * terms divided by 3.
82  */
83 Real hydrostatic(const RankTwoTensor & r2tensor);
84 
85 /*
86  * Computes the L2 normal of a rank two tensor
87  */
88 Real L2norm(const RankTwoTensor & r2tensor);
89 
90 /*
91  * The volumentric strain is the change in volume over the original volume. In
92  * this method the squared and cubic terms are included so that the calculation
93  * is valid for both small and finite strains.
94  */
95 Real volumetricStrain(const RankTwoTensor & strain);
96 
97 /*
98 * The first invariant of a tensor is the sum of the diagonal component; defined
99 * in L. Malvern, Introduction to the Mechanics of a Continuous Mediam (1969) pg 89.
100 */
101 Real firstInvariant(const RankTwoTensor & r2tensor);
102 
103 /*
104  * The second invariant is calculated using the formula from K. Hjelmstad,
105  * Fundamentals of Structural Mechanics (1997) pg. 24.
106  * Note that the Hjelmstad version of the second invariant is the negative of
107  * the second invariant given in L. Malvern, Introduction to the Mechanics of a
108  * Continuous Medium (1969) pg 89.
109 */
110 Real secondInvariant(const RankTwoTensor & r2tensor);
111 
112 /*
113  * The third invariant of a rank 2 tensor is the determinate of the tensor; defined
114  * in L. Malvern, Introduction to the Mechanics of a Continuous Mediam (1969) pg 89.
115  */
116 Real thirdInvariant(const RankTwoTensor & r2tensor);
117 
118 /*
119  * The max Principal method returns the largest principal value for a symmetric
120  * tensor, using the calcEigenValues method.
121  * param r2tensor RankTwoTensor from which to extract the principal value
122  * param direction Direction corresponding to the principal value
123  */
124 Real maxPrincipal(const RankTwoTensor & r2tensor, Point & direction);
125 
126 /*
127  * The mid Principal method calculates the second largest principal value for a
128  * tensor. This method is valid only for 3D problems and will return an error
129  * if called in 2D problems.
130  * param r2tensor RankTwoTensor from which to extract the principal value
131  * param direction Direction corresponding to the principal value
132  */
133 Real midPrincipal(const RankTwoTensor & r2tensor, Point & direction);
134 
135 /*
136  * The min Principal stress returns the smallest principal value from a symmetric
137  * tensor.
138  * param r2tensor RankTwoTensor from which to extract the principal value
139  * param direction Direction corresponding to the principal value
140  */
141 Real minPrincipal(const RankTwoTensor & r2tensor, Point & direction);
142 
143 /*
144  * This method is called by the *Principal methods to calculate the eigenvalues
145  * and eigenvectors of a symmetric tensor and return the desired value based on
146  * vector position.
147  * param r2tensor The RankTwoTensor from which to extract eigenvalues/vectors
148  * param index The index of the principal value
149  * param direction The eigenvector corresponding to the computed eigenvalue
150  */
151 Real
152 calcEigenValuesEigenVectors(const RankTwoTensor & r2tensor, unsigned int index, Point & eigenvec);
153 
154 /*
155  * The axial stress is the scalar component of the stress tensor in an user-defined
156  * direction; the axis direction is specified by inputing two points.
157  * axial-stress = axis^T_i * \sigma_{ij} * axis_j
158  * @param point1 The starting point of the rotation axis for a cylinderical system
159  * @param point2 The end point of the rotation axis
160  * @param direction The direction vector in which the scalar stress value is calculated.
161  */
162 Real axialStress(const RankTwoTensor & stress,
163  const Point & point1,
164  const Point & point2,
165  Point & direction);
166 
167 /*
168  * The hoop stress is calculated as
169  * hoop-stress = z^T_i * \sigma_{ij} * z_j
170  * where z is defined as the cross of the user-defined (via input points) axis
171  * of rotation and the normal from the current position to the axis of rotation.
172  * @param point1 The starting point of the rotation axis for a cylinderical system
173  * @param point2 The end point of the rotation axis
174  * @param curr_point The point corresponding to the stress (pass in & _q_point[_qp])
175  * @param direction The direction vector in which the scalar stress value is calculated.
176  */
177 Real hoopStress(const RankTwoTensor & stress,
178  const Point & point1,
179  const Point & point2,
180  const Point & curr_point,
181  Point & direction);
182 
183 /* The radial stress is calculated as
184  * radial_stress = normal^T_i * \sigma_{ij} * normal_j
185  * where normal is the position vector of the current point that is normal to
186  * the user-defined axis of rotation; the axis direction is specified with two points.
187  * @param point1 The starting point of the rotation axis for a cylinderical system
188  * @param point2 The end point of the rotation axis
189  * @param curr_point The point corresponding to the stress (pass in & _q_point[_qp])
190  * @param direction The direction vector in which the scalar stress value is calculated.
191 */
192 Real radialStress(const RankTwoTensor & stress,
193  const Point & point1,
194  const Point & point2,
195  const Point & curr_point,
196  Point & direction);
197 
198 /*
199  * This method is a helper method for the hoopStress and radialStress methods to
200  * calculate the unit position vector which is normal to the user supplied axis
201  * of rotation; the rotation axis direction is specified by inputing two points.
202  * @param point1 The starting point of the rotation axis for a cylinderical system
203  * @param point2 The end point of the rotation axis
204  * @param curr_point The point corresponding to the stress (pass in & _q_point[_qp])
205  * @param normalPosition The vector from the current point that is normal to the rotation axis
206  */
207 void normalPositionVector(const Point & point1,
208  const Point & point2,
209  const Point & curr_point,
210  Point & normalPosition);
211 
212 /*
213  * This method calculates the scalar value of the supplied rank-2 tensor in the
214  * direction specified by the user.
215  */
216 Real directionValueTensor(const RankTwoTensor & r2tensor, Point & direction);
217 
218 /*
219  * Triaxiality is the ratio of the hydrostatic stress to the von Mises stress.
220  */
221 Real triaxialityStress(const RankTwoTensor & stress);
222 }
223 
224 #endif // RANKTWOSCALARTOOLS_H
Real firstInvariant(const RankTwoTensor &r2tensor)
Real radialStress(const RankTwoTensor &stress, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
Real triaxialityStress(const RankTwoTensor &stress)
Real component(const RankTwoTensor &r2tensor, unsigned int i, unsigned int j, Point &direction)
Real equivalentPlasticStrain(const RankTwoTensor &strain)
Real effectiveStrain(const RankTwoTensor &strain)
Real maxPrincipal(const RankTwoTensor &r2tensor, Point &direction)
Real directionValueTensor(const RankTwoTensor &r2tensor, Point &direction)
Real volumetricStrain(const RankTwoTensor &strain)
Real thirdInvariant(const RankTwoTensor &r2tensor)
Real hoopStress(const RankTwoTensor &stress, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
Real vonMisesStress(const RankTwoTensor &tensor)
Real minPrincipal(const RankTwoTensor &r2tensor, Point &direction)
Real axialStress(const RankTwoTensor &stress, const Point &point1, const Point &point2, Point &direction)
Real calcEigenValuesEigenVectors(const RankTwoTensor &r2tensor, unsigned int index, Point &eigenvec)
Real midPrincipal(const RankTwoTensor &r2tensor, Point &direction)
Real getQuantity(const RankTwoTensor &tensor, const MooseEnum scalar_type, const Point &point1, const Point &point2, const Point &curr_point, Point &direction)
Real L2norm(const RankTwoTensor &r2tensor)
void normalPositionVector(const Point &point1, const Point &point2, const Point &curr_point, Point &normalPosition)
Real secondInvariant(const RankTwoTensor &r2tensor)
Real hydrostatic(const RankTwoTensor &r2tensor)