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 35 of file TorqueReaction.h.

Constructor & Destructor Documentation

TorqueReaction::TorqueReaction ( const InputParameters &  parameters)

Definition at line 30 of file TorqueReaction.C.

31  : NodalPostprocessor(parameters),
32  _aux(_fe_problem.getAuxiliarySystem()),
33  _axis_origin(getParam<RealVectorValue>("axis_origin")),
34  _direction_vector(getParam<RealVectorValue>("direction_vector"))
35 {
36  std::vector<AuxVariableName> reacts = getParam<std::vector<AuxVariableName>>("react");
37  _nrt = reacts.size();
38 
39  for (unsigned int i = 0; i < _nrt; ++i)
40  _react.push_back(&_aux.getVariable(_tid, reacts[i]).nodalSln());
41 }
const Point _axis_origin
unsigned int _nrt
AuxiliarySystem & _aux
std::vector< const VariableValue * > _react
const Point _direction_vector

Member Function Documentation

void TorqueReaction::execute ( )
virtual

Definition at line 50 of file TorqueReaction.C.

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

Definition at line 81 of file TorqueReaction.C.

82 {
83  gatherSum(_sum);
84 
85  return _sum;
86 }
void TorqueReaction::initialize ( )
virtual

Definition at line 44 of file TorqueReaction.C.

45 {
46  _sum = 0.0;
47 }
void TorqueReaction::threadJoin ( const UserObject &  y)

Definition at line 89 of file TorqueReaction.C.

90 {
91  const TorqueReaction & pps = static_cast<const TorqueReaction &>(y);
92  _sum += pps._sum;
93 }

Member Data Documentation

AuxiliarySystem& TorqueReaction::_aux
protected

Definition at line 46 of file TorqueReaction.h.

Referenced by TorqueReaction().

const Point TorqueReaction::_axis_origin
protected

Definition at line 50 of file TorqueReaction.h.

Referenced by execute().

const Point TorqueReaction::_direction_vector
protected

Definition at line 51 of file TorqueReaction.h.

Referenced by execute().

unsigned int TorqueReaction::_nrt
protected

Definition at line 53 of file TorqueReaction.h.

Referenced by execute(), and TorqueReaction().

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

Definition at line 48 of file TorqueReaction.h.

Referenced by execute(), and TorqueReaction().

Real TorqueReaction::_sum
protected

Definition at line 55 of file TorqueReaction.h.

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


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