https://mooseframework.inl.gov
ShaftComponentTorqueScalarKernel.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "MooseVariableScalar.h"
12 #include "Assembly.h"
13 #include "UserObject.h"
15 
17 
20 {
22  params.addRequiredParam<UserObjectName>("shaft_connected_component_uo",
23  "Shaft connected component user object name");
24  params.addClassDescription("Torque contributed by a component connected to a shaft");
25  return params;
26 }
27 
29  const InputParameters & parameters)
30  : ScalarKernel(parameters),
31  _shaft_connected_component_uo(
32  getUserObject<ShaftConnectableUserObjectInterface>("shaft_connected_component_uo"))
33 {
34 }
35 
36 void
38 {
39 }
40 
41 void
43 {
45 
47 
49 }
50 
51 void
53 {
54  DenseMatrix<Real> jacobian_block;
55  std::vector<dof_id_type> dofs_j;
57  jacobian_block.scale(-1);
58  addJacobian(_assembly, jacobian_block, _var.dofIndices(), dofs_j, _var.scalingFactor());
59 }
void accumulateTaggedLocalResidual()
ShaftComponentTorqueScalarKernel(const InputParameters &parameters)
unsigned int number() const
registerMooseObject("ThermalHydraulicsApp", ShaftComponentTorqueScalarKernel)
MooseVariableScalar & _var
void addRequiredParam(const std::string &name, const std::string &doc_string)
const ShaftConnectableUserObjectInterface & _shaft_connected_component_uo
Shaft connected component user object.
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
virtual const std::vector< dof_id_type > & dofIndices() const
Interface class for user objects that are connected to a shaft.
Assembly & _assembly
void scale(const Real factor)
Torque contributed by a component connected to a shaft.
DenseVector< Number > _local_re
void addClassDescription(const std::string &doc_string)
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
static InputParameters validParams()
virtual void getTorqueJacobianData(DenseMatrix< Real > &jacobian_block, std::vector< dof_id_type > &dofs_j) const
void scalingFactor(const std::vector< Real > &factor)