https://mooseframework.inl.gov
ShaftConnectableUserObjectInterface.h
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 
10 #pragma once
11 
12 #include "libmesh/dense_matrix.h"
13 #include "InputParameters.h"
14 
15 using namespace libMesh;
16 class UserObject;
18 
23 {
24 public:
26 
27  virtual void initialize();
28  virtual void execute();
29  virtual void finalize();
30  virtual void threadJoin(const UserObject & uo);
31 
32  virtual Real getTorque() const;
33  virtual void getTorqueJacobianData(DenseMatrix<Real> & jacobian_block,
34  std::vector<dof_id_type> & dofs_j) const;
35  virtual Real getMomentOfInertia() const;
36  virtual void getMomentOfInertiaJacobianData(DenseMatrix<Real> & jacobian_block,
37  std::vector<dof_id_type> & dofs_j) const;
38 
39 protected:
40  virtual void setupConnections(unsigned int n_connections, unsigned int n_flow_eq);
44  virtual void
45  setConnectionData(const std::vector<std::vector<std::vector<Real>>> & phi_face_values,
46  const std::vector<std::vector<dof_id_type>> & flow_channel_dofs);
47  virtual void setOmegaDofs(const MooseVariableScalar * omega_var);
51  virtual void setupJunctionData(std::vector<dof_id_type> & scalar_dofs);
52 
53  virtual void computeMomentOfInertiaScalarJacobianWRTFlowDofs(const DenseMatrix<Real> & jac,
54  const unsigned int & c);
55  virtual void computeTorqueScalarJacobianWRTFlowDofs(const DenseMatrix<Real> & jac,
56  const unsigned int & c);
57 
59  unsigned int _n_shaft_eq;
61  unsigned int _n_connections;
63  unsigned int _n_flow_eq;
64 
66  std::vector<dof_id_type> _omega_dof;
68  std::vector<dof_id_type> _scalar_dofs;
70  std::vector<std::vector<dof_id_type>> _flow_channel_dofs;
75 
78  std::vector<DenseMatrix<Real>> _torque_jacobian_flow_channel_vars;
83 
84  std::vector<DenseMatrix<Real>> _moi_jacobian_flow_channel_vars;
89 
91  std::vector<std::vector<std::vector<Real>>> _phi_face_values;
92 
93 public:
95 };
std::vector< std::vector< std::vector< Real > > > _phi_face_values
Side shape function value (i.e. side from the flow channels)
DenseMatrix< Real > _moi_jacobian_omega_var
Jacobian entries of moment of inertia wrt to omega variable (from shaft)
DenseMatrix< Real > _torque_jacobian_scalar_vars
Jacobian entries of torque wrt to scalar variables (from junction)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
void initialize(EquationSystems &es, const std::string &system_name)
InputParameters validParams()
unsigned int _n_flow_eq
Number of flow variables in connected flow channels.
Interface class for user objects that are connected to a shaft.
unsigned int _n_shaft_eq
Number of equation in the shaft component.
std::vector< dof_id_type > _omega_dof
Degrees of freedom for omega variable (from shaft)
DenseMatrix< Real > _moi_jacobian_scalar_vars
Jacobian entries of moment of inertia wrt to omega scalar variables (from junction) ...
std::vector< dof_id_type > _scalar_dofs
Degrees of freedom for scalar variables (from junction)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
DenseMatrix< Real > _torque_jacobian_omega_var
Jacobian entries of torque wrt to omega variable (from shaft)
std::vector< std::vector< dof_id_type > > _flow_channel_dofs
Degrees of freedom for flow channel variables, for each connection.
std::vector< DenseMatrix< Real > > _torque_jacobian_flow_channel_vars
Cached scalar residual Jacobian matrices w.r.t.
std::vector< DenseMatrix< Real > > _moi_jacobian_flow_channel_vars
unsigned int _n_connections
Number of flow channels the shaft connected component is attached to.