-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28742 from Kavan-Khaledi/shell_local_coordinates
Calculating local quantities for Q4 shell elements
- Loading branch information
Showing
30 changed files
with
2,247 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
modules/solid_mechanics/doc/content/source/auxkernels/ShellLocalCoordinatesAux.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ShellLocalCoordinatesAux | ||
|
||
!syntax description /AuxKernels/ShellLocalCoordinatesAux | ||
|
||
!alert note | ||
The three Cartesian local vectors for each shell element are indexed as follows: the first vector is indexed by 0, the second vector by 1, and the normal vector by 2. The convention used to define the direction of these vectors is explained in [ShellElements](/ShellElements.md) | ||
|
||
|
||
|
||
## Example Input Syntax | ||
|
||
!listing modules/solid_mechanics/test/tests/shell/static/pinched_cylinder_symm_local_stress.i block=AuxKernels/first_axis_x | ||
|
||
!syntax parameters /AuxKernels/ShellLocalCoordinatesAux | ||
|
||
!syntax inputs /AuxKernels/ShellLocalCoordinatesAux | ||
|
||
!syntax children /AuxKernels/ShellLocalCoordinatesAux |
65 changes: 65 additions & 0 deletions
65
modules/solid_mechanics/doc/content/source/auxkernels/ShellResultantsAux.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# ShellResultantsAux | ||
|
||
!syntax description /AuxKernels/ShellResultantsAux | ||
|
||
!alert note | ||
The three Cartesian local vectors for each shell element are indexed as follows: the first vector is indexed by 0, the second vector by 1, and the normal vector by 2. The convention used to define the direction of these vectors is explained in [ShellElements](/ShellElements.md) | ||
|
||
The following stress resultants are computed using this auxiliary kernel: | ||
|
||
axial_force_0: The in-plane axial force in the direction of the first local coordinate axis: | ||
|
||
$$F_{0} = \int_{-t/2}^{t/2} \sigma_{00} dz$$ | ||
|
||
|
||
axial_force_1: The in-plane axial force in the direction of the second local coordinate axis: | ||
|
||
$$ F_{1} = \int_{-t/2}^{t/2} \sigma_{11} dz$$ | ||
|
||
|
||
normal_force: The normal force applied to the shell element in the thickness direction. This force is expected to be always zero due to the plane stress assumption used in the shell element formulation, which disregards out-of-plane stresses: | ||
|
||
$$F_{N} = \int_{-t/2}^{t/2} \sigma_{22} dz$$ | ||
|
||
|
||
bending_moments_0: The bending moment about the first local coordinate axis: | ||
|
||
$$M_{0} = \int_{-t/2}^{t/2} \sigma_{11} z dz$$ | ||
|
||
|
||
bending_moment_1: The bending moment about the second local coordinate axis: | ||
|
||
$$ M_{1} = \int_{-t/2}^{t/2} \sigma_{00} z dz$$ | ||
|
||
|
||
bending_moment_01: The in-plane bending moment: | ||
|
||
$$ M_{01} =M_{10}= \int_{-t/2}^{t/2} \sigma_{01} z dz$$ | ||
|
||
|
||
shear_force_01: The in-plane shear force: | ||
|
||
$$ Q_{01} =Q_{10}= \int_{-t/2}^{t/2} \sigma_{01} dz$$ | ||
|
||
|
||
shear_force_02: The transverse shear force: | ||
|
||
$$Q_{02} =Q_{20}= \int_{-t/2}^{t/2} \sigma_{02} dz$$ | ||
|
||
|
||
shear_force_12: The transverse shear force: | ||
|
||
$$ Q_{12} =Q_{21}= \int_{-t/2}^{t/2} \sigma_{12} dz$$ | ||
|
||
|
||
|
||
|
||
## Example Input Syntax | ||
|
||
!listing modules/solid_mechanics/test/tests/shell/static/plate_cantilever.i block=AuxKernels/moment_22 | ||
|
||
!syntax parameters /AuxKernels/ShellResultantsAux | ||
|
||
!syntax inputs /AuxKernels/ShellResultantsAux | ||
|
||
!syntax children /AuxKernels/ShellResultantsAux |
39 changes: 39 additions & 0 deletions
39
modules/solid_mechanics/include/auxkernels/ShellLocalCoordinatesAux.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "AuxKernel.h" | ||
#include "RankTwoTensor.h" | ||
#include "MooseEnum.h" | ||
|
||
class ShellLocalCoordinatesAux : public AuxKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
ShellLocalCoordinatesAux(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual Real computeValue() override; | ||
|
||
/// Base name of the material system used to calculate the elastic energy | ||
const std::string _base_name; | ||
|
||
enum class PropertyType | ||
{ | ||
first_local_vector, | ||
second_local_vector, | ||
normal_local_vector | ||
} _property; | ||
unsigned int _component; | ||
|
||
/// The local stress tensor | ||
const MaterialProperty<RankTwoTensor> * _local_coordinates; | ||
}; |
59 changes: 59 additions & 0 deletions
59
modules/solid_mechanics/include/auxkernels/ShellResultantsAux.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "AuxKernel.h" | ||
#include "RankTwoTensor.h" | ||
#include "MooseEnum.h" | ||
|
||
// Forward declarations | ||
namespace libMesh | ||
{ | ||
class QGauss; | ||
} | ||
|
||
class ShellResultantsAux : public AuxKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
ShellResultantsAux(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual Real computeValue(); | ||
|
||
/// Base name of the material system used to calculate the elastic energy | ||
const std::string _base_name; | ||
|
||
/// Coupled variable for the shell thickness | ||
const VariableValue & _thickness; | ||
|
||
enum class ResultantType | ||
{ | ||
axial_force_0, | ||
axial_force_1, | ||
normal_force, | ||
bending_moment_0, | ||
bending_moment_1, | ||
bending_moment_01, | ||
shear_force_01, | ||
shear_force_02, | ||
shear_force_12 | ||
} _resultant; | ||
/// Quadrature rule in the out of plane direction | ||
std::unique_ptr<QGauss> _t_qrule; | ||
|
||
/// Quadrature points and weights in the out of plane direction in isoparametric coordinate system | ||
std::vector<Point> _t_points; | ||
std::vector<Real> _t_weights; | ||
|
||
/// The local stress tensor | ||
std::vector<const MaterialProperty<RankTwoTensor> *> _local_stress_t_points; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
modules/solid_mechanics/src/auxkernels/ShellLocalCoordinatesAux.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "ShellLocalCoordinatesAux.h" | ||
#include "libmesh/utility.h" | ||
#include "libmesh/string_to_enum.h" | ||
|
||
registerMooseObject("SolidMechanicsApp", ShellLocalCoordinatesAux); | ||
|
||
InputParameters | ||
ShellLocalCoordinatesAux::validParams() | ||
{ | ||
InputParameters params = AuxKernel::validParams(); | ||
params.addClassDescription( | ||
"This AuxKernel stores a specific component of a shell element's local coordinate " | ||
"vector in an auxiliary variable."); | ||
params.addParam<std::string>("base_name", "Mechanical property base name"); | ||
|
||
MooseEnum property("first_local_vector second_local_vector normal_local_vector"); | ||
params.addRequiredParam<MooseEnum>( | ||
"property", | ||
property, | ||
"The local axis to output: first_local_vector, second_local_vector or normal_local_vector"); | ||
params.addRequiredParam<unsigned int>( | ||
"component", "The vector component of the local coordinate vector: 0, 1 or 2"); | ||
|
||
return params; | ||
} | ||
|
||
ShellLocalCoordinatesAux::ShellLocalCoordinatesAux(const InputParameters & parameters) | ||
: AuxKernel(parameters), | ||
_base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""), | ||
_property(getParam<MooseEnum>("property").getEnum<PropertyType>()), | ||
_component(getParam<unsigned int>("component")) | ||
|
||
{ | ||
_local_coordinates = | ||
&getMaterialProperty<RankTwoTensor>(_base_name + "local_transformation_t_points_0"); | ||
|
||
if (_component > 2) | ||
mooseError("Invalid component: ", | ||
_component, | ||
". The component index of a shell local vector must be 0, 1, or 2."); | ||
} | ||
|
||
Real | ||
ShellLocalCoordinatesAux::computeValue() | ||
{ | ||
Real output_value = 0.0; | ||
|
||
switch (_property) | ||
{ | ||
case PropertyType::first_local_vector: | ||
output_value = (*_local_coordinates)[_qp](0, _component); | ||
break; | ||
case PropertyType::second_local_vector: | ||
output_value = (*_local_coordinates)[_qp](1, _component); | ||
break; | ||
case PropertyType::normal_local_vector: | ||
output_value = (*_local_coordinates)[_qp](2, _component); | ||
break; | ||
} | ||
|
||
return output_value; | ||
} |
Oops, something went wrong.