www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
TorqueReaction Class Reference

#include <TorqueReaction.h>

Inheritance diagram for TorqueReaction:
[legend]

Public Member Functions

 TorqueReaction (const InputParameters &parameters)
 
virtual void initialize ()
 
virtual void execute ()
 
virtual Real getValue ()
 
void threadJoin (const UserObject &y)
 

Protected Attributes

AuxiliarySystem & _aux
 
std::vector< const VariableValue * > _react
 
const Point _axis_origin
 
const Point _direction_vector
 
unsigned int _nrt
 
Real _sum
 

Detailed Description

Definition at line 37 of file TorqueReaction.h.

Constructor & Destructor Documentation

◆ TorqueReaction()

TorqueReaction::TorqueReaction ( const InputParameters &  parameters)

Definition at line 38 of file TorqueReaction.C.

39  : NodalPostprocessor(parameters),
40  _aux(_fe_problem.getAuxiliarySystem()),
41  _axis_origin(getParam<RealVectorValue>("axis_origin")),
42  _direction_vector(getParam<RealVectorValue>("direction_vector"))
43 {
44  std::vector<AuxVariableName> reacts =
45  getParam<std::vector<AuxVariableName>>("reaction_force_variables");
46  _nrt = reacts.size();
47 
48  for (unsigned int i = 0; i < _nrt; ++i)
49  _react.push_back(&_aux.getVariable(_tid, reacts[i]).dofValues());
50 }
const Point _axis_origin
unsigned int _nrt
AuxiliarySystem & _aux
std::vector< const VariableValue * > _react
const Point _direction_vector

Member Function Documentation

◆ execute()

void TorqueReaction::execute ( )
virtual

Definition at line 59 of file TorqueReaction.C.

60 {
61  // Tranform the node coordinates into the coordinate system specified by the user
62  Point position = (*_current_node) - _axis_origin;
63 
64  // Determine the component of the vector in the direction of the rotation direction vector
65  Point normal_position_component =
66  position - (position * _direction_vector) / _direction_vector.norm_sq() * _direction_vector;
67 
68  // Define the force vector from the reaction force/ residuals from the stress divergence kernel
69  Real _rz;
70  if (_nrt == 3)
71  _rz = (*_react[2])[_qp];
72  else
73  _rz = 0.0;
74 
75  Point force((*_react[0])[_qp], (*_react[1])[_qp], _rz);
76 
77  // Cross the normal component of the position vector with the force
78  RealVectorValue torque = normal_position_component.cross(force);
79 
80  // Find the component of the torque vector acting along the given axis of rotation direction
81  // vector
82  RealVectorValue parallel_torque_component =
83  (torque * _direction_vector) / _direction_vector.norm_sq() * _direction_vector;
84 
85  // Add the magnitude of the parallel torque component to the sum of the acting torques
86  _sum += parallel_torque_component.norm();
87 }
const Point _axis_origin
unsigned int _nrt
std::vector< const VariableValue * > _react
const Point _direction_vector

◆ getValue()

Real TorqueReaction::getValue ( )
virtual

Definition at line 90 of file TorqueReaction.C.

91 {
92  gatherSum(_sum);
93 
94  return _sum;
95 }

◆ initialize()

void TorqueReaction::initialize ( )
virtual

Definition at line 53 of file TorqueReaction.C.

54 {
55  _sum = 0.0;
56 }

◆ threadJoin()

void TorqueReaction::threadJoin ( const UserObject &  y)

Definition at line 98 of file TorqueReaction.C.

99 {
100  const TorqueReaction & pps = static_cast<const TorqueReaction &>(y);
101  _sum += pps._sum;
102 }

Member Data Documentation

◆ _aux

AuxiliarySystem& TorqueReaction::_aux
protected

Definition at line 48 of file TorqueReaction.h.

Referenced by TorqueReaction().

◆ _axis_origin

const Point TorqueReaction::_axis_origin
protected

Definition at line 52 of file TorqueReaction.h.

Referenced by execute().

◆ _direction_vector

const Point TorqueReaction::_direction_vector
protected

Definition at line 53 of file TorqueReaction.h.

Referenced by execute().

◆ _nrt

unsigned int TorqueReaction::_nrt
protected

Definition at line 55 of file TorqueReaction.h.

Referenced by execute(), and TorqueReaction().

◆ _react

std::vector<const VariableValue *> TorqueReaction::_react
protected

Definition at line 50 of file TorqueReaction.h.

Referenced by execute(), and TorqueReaction().

◆ _sum

Real TorqueReaction::_sum
protected

Definition at line 57 of file TorqueReaction.h.

Referenced by execute(), getValue(), initialize(), and threadJoin().


The documentation for this class was generated from the following files: