https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15class UserObject;
17
22{
23public:
25
26 virtual void initialize();
27 virtual void execute();
28 virtual void finalize();
29 virtual void threadJoin(const UserObject & uo);
30
31 virtual Real getTorque() const;
32 virtual void getTorqueJacobianData(DenseMatrix<Real> & jacobian_block,
33 std::vector<dof_id_type> & dofs_j) const;
34 virtual Real getMomentOfInertia() const;
35 virtual void getMomentOfInertiaJacobianData(DenseMatrix<Real> & jacobian_block,
36 std::vector<dof_id_type> & dofs_j) const;
37
38protected:
39 virtual void setupConnections(unsigned int n_connections, unsigned int n_flow_eq);
43 virtual void
44 setConnectionData(const std::vector<std::vector<std::vector<Real>>> & phi_face_values,
45 const std::vector<std::vector<dof_id_type>> & flow_channel_dofs);
46 virtual void setOmegaDofs(const MooseVariableScalar * omega_var);
50 virtual void setupJunctionData(std::vector<dof_id_type> & scalar_dofs);
51
52 virtual void computeMomentOfInertiaScalarJacobianWRTFlowDofs(const DenseMatrix<Real> & jac,
53 const unsigned int & c);
54 virtual void computeTorqueScalarJacobianWRTFlowDofs(const DenseMatrix<Real> & jac,
55 const unsigned int & c);
56
58 unsigned int _n_shaft_eq;
60 unsigned int _n_connections;
62 unsigned int _n_flow_eq;
63
65 std::vector<dof_id_type> _omega_dof;
67 std::vector<dof_id_type> _scalar_dofs;
69 std::vector<std::vector<dof_id_type>> _flow_channel_dofs;
71 Real _torque;
74
77 std::vector<DenseMatrix<Real>> _torque_jacobian_flow_channel_vars;
81 DenseMatrix<Real> _torque_jacobian_omega_var;
82
83 std::vector<DenseMatrix<Real>> _moi_jacobian_flow_channel_vars;
85 DenseMatrix<Real> _moi_jacobian_scalar_vars;
87 DenseMatrix<Real> _moi_jacobian_omega_var;
88
90 std::vector<std::vector<std::vector<Real>>> _phi_face_values;
91
92public:
94};
Interface class for user objects that are connected to a 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)
virtual void setupConnections(unsigned int n_connections, unsigned int n_flow_eq)
virtual void computeTorqueScalarJacobianWRTFlowDofs(const DenseMatrix< Real > &jac, const unsigned int &c)
virtual void setOmegaDofs(const MooseVariableScalar *omega_var)
DenseMatrix< Real > _torque_jacobian_scalar_vars
Jacobian entries of torque wrt to scalar variables (from junction)
std::vector< std::vector< dof_id_type > > _flow_channel_dofs
Degrees of freedom for flow channel variables, for each connection.
virtual void computeMomentOfInertiaScalarJacobianWRTFlowDofs(const DenseMatrix< Real > &jac, const unsigned int &c)
std::vector< DenseMatrix< Real > > _torque_jacobian_flow_channel_vars
Cached scalar residual Jacobian matrices w.r.t.
DenseMatrix< Real > _moi_jacobian_omega_var
Jacobian entries of moment of inertia wrt to omega variable (from shaft)
std::vector< dof_id_type > _omega_dof
Degrees of freedom for omega variable (from shaft)
virtual void setConnectionData(const std::vector< std::vector< std::vector< Real > > > &phi_face_values, const std::vector< std::vector< dof_id_type > > &flow_channel_dofs)
Stores data computed by a volume-junction-like object associated with the conection.
unsigned int _n_shaft_eq
Number of equation in the shaft component.
virtual void setupJunctionData(std::vector< dof_id_type > &scalar_dofs)
Stores data associated with a junction component.
std::vector< std::vector< std::vector< Real > > > _phi_face_values
Side shape function value (i.e. side from the flow channels)
std::vector< DenseMatrix< Real > > _moi_jacobian_flow_channel_vars
unsigned int _n_connections
Number of flow channels the shaft connected component is attached to.
virtual void getMomentOfInertiaJacobianData(DenseMatrix< Real > &jacobian_block, std::vector< dof_id_type > &dofs_j) const
unsigned int _n_flow_eq
Number of flow variables in connected flow channels.
virtual void getTorqueJacobianData(DenseMatrix< Real > &jacobian_block, std::vector< dof_id_type > &dofs_j) const
DenseMatrix< Real > _torque_jacobian_omega_var
Jacobian entries of torque wrt to omega variable (from shaft)