https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ShaftConnectedCompressor1Phase Class Reference

1-phase compressor that must be connected to a Shaft component More...

#include <ShaftConnectedCompressor1Phase.h>

Inheritance diagram for ShaftConnectedCompressor1Phase:
[legend]

Public Types

enum  VolumeJunction1PhaseIndices {
  RHOV_INDEX = 0, RHOUV_INDEX = 1, RHOVV_INDEX = 2, RHOWV_INDEX = 3,
  RHOEV_INDEX = 4
}
 Enumeration for junction variable/equation indices. More...
 
enum  EEndType { IN, OUT }
 End type. More...
 
enum  EComponentSetupStatus {
  CREATED, MESH_PREPARED, INITIALIZED_PRIMARY, INITIALIZED_SECONDARY,
  CHECKED
}
 Component setup status type. More...
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 ShaftConnectedCompressor1Phase (const InputParameters &params)
 
virtual void addVariables () override
 
virtual void addMooseObjects () override
 
virtual UserObjectName getShaftConnectedUserObjectName () const override
 
const UserObjectName & getFluidPropertiesName () const
 Gets the name of fluid properties used in all flow connections. More...
 
const std::vector< Connection > & getConnections () const
 Returns the vector of connections of this component. More...
 
const std::vector< std::string > & getConnectedComponentNames () const
 Returns a list of names of components that are connected to this component. More...
 
const std::vector< SubdomainName > & getConnectedSubdomainNames () const
 Gets the vector of connected subdomain names. More...
 
virtual const std::vector< dof_id_type > & getNodeIDs () const
 Gets the list of boundary nodes connected to this component. More...
 
const std::vector< BoundaryName > & getBoundaryNames () const
 Gets the boundary names for this component. More...
 
std::string stringify (EComponentSetupStatus status) const
 Return a string for the setup status. More...
 
const std::string & cname () const
 Get the component name. More...
 
Componentparent ()
 
const THMMeshconstMesh () const
 Const reference to mesh, which can be called at any point. More...
 
THMMeshmesh ()
 Non-const reference to THM mesh, which can only be called before the end of mesh setup. More...
 
THMProblemgetTHMProblem () const
 Gets the THM problem. More...
 
template<typename T >
bool hasParam (const std::string &name) const
 Test if a parameter exists in the object's input parameters. More...
 
const std::vector< std::string > & getDependencies () const
 Returns a list of names of components that this component depends upon. More...
 
void executeInit ()
 Wrapper function for init() that marks the function as being called. More...
 
void executeInitSecondary ()
 Wrapper function for initSecondary() that marks the function as being called. More...
 
void executeCheck () const
 Wrapper function for check() that marks the function as being called. More...
 
void executeSetupMesh ()
 Wrapper function for setupMesh() that marks the function as being called. More...
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType)
 Adds relationship managers for the component. More...
 
template<typename T >
const T & getComponent (const std::string &name) const
 Return a reference to a component via a parameter name. More...
 
template<typename T >
const T & getComponentByName (const std::string &cname) const
 Return a reference to a component given its name. More...
 
template<typename T >
bool hasComponent (const std::string &name) const
 Check the existence and type of a component via a parameter name. More...
 
template<typename T >
bool hasComponentByName (const std::string &cname) const
 Check the existence and type of a component given its name. More...
 
void connectObject (const InputParameters &params, const std::string &mooseName, const std::string &name) const
 Connect with control logic. More...
 
void connectObject (const InputParameters &params, const std::string &mooseName, const std::string &name, const std::string &par_name) const
 Connect with control logic. More...
 
void makeFunctionControllableIfConstant (const FunctionName &fn_name, const std::string &control_name, const std::string &param="value") const
 Makes a function controllable if it is constant. More...
 
void checkSetupStatus (const EComponentSetupStatus &status) const
 Throws an error if the supplied setup status of this component has not been reached. More...
 
void checkComponentExistsByName (const std::string &comp_name) const
 Checks that a component exists. More...
 
template<typename T >
void checkComponentOfTypeExists (const std::string &param) const
 Checks that the component of a certain type exists, where the name is given by a parameter. More...
 
template<typename T >
void checkComponentOfTypeExistsByName (const std::string &comp_name) const
 Checks that the component of a certain type exists. More...
 
template<typename... Args>
void logError (Args &&... args) const
 Logs an error. More...
 
template<typename... Args>
void logWarning (Args &&... args) const
 Logs a warning. More...
 
void addDependency (const std::string &dependency)
 Adds a component name to the list of dependencies. More...
 
template<typename T >
getEnumParam (const std::string &param) const
 Gets an enum parameter. More...
 
bool problemIsTransient () const
 Whether the problem is transient. More...
 
const std::vector< dof_id_type > & getElementIDs () const
 Gets the element IDs corresponding to this component. More...
 
virtual const std::vector< SubdomainName > & getSubdomainNames () const
 Gets the subdomain names for this component. More...
 
virtual const std::vector< Moose::CoordinateSystemType > & getCoordSysTypes () const
 Gets the coordinate system types for this component. More...
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
template<typename... Args>
void logComponentError (const std::string &component_name, Args &&... args) const
 Logs an error for a component. More...
 
template<typename... Args>
void logComponentWarning (const std::string &component_name, Args &&... args) const
 Logs a warning for a component. More...
 
std::string genName (const std::string &prefix, unsigned int id, const std::string &suffix="") const
 Build a name from a prefix, number and possible suffix. More...
 
std::string genName (const std::string &prefix, unsigned int i, unsigned int j, const std::string &suffix="") const
 Build a name from a prefix, 2 numbers and possible suffix. More...
 
std::string genName (const std::string &prefix, const std::string &name, unsigned int i) const
 Build a name from 2 strings and a number. More...
 
std::string genName (const std::string &prefix, const std::string &middle, const std::string &suffix="") const
 Build a name from strings. More...
 
std::string genSafeName (const std::string &prefix, const std::string &middle, const std::string &suffix="") const
 Build a name from strings that is safe to use in input files (i.e. More...
 
virtual void checkShaftConnection (const Component *const component) const
 
virtual VariableName getMomentofInertiaVariableName () const
 
virtual VariableName getTorqueVariableName () const
 
virtual void setShaftName (const std::string &name) const
 

Static Public Member Functions

static InputParameters validParams ()
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static const unsigned int N_EQ = 5
 Number of equations for the junction. More...
 
static const std::map< std::string, EEndType_end_type_to_enum {{"IN", IN}, {"OUT", OUT}}
 Map of end type string to enum. More...
 

Protected Member Functions

virtual void check () const override
 Check the component integrity. More...
 
virtual void buildVolumeJunctionUserObject () override
 Builds user object for computing and storing the fluxes. More...
 
virtual void setupMesh () override
 Performs mesh setup such as creating mesh or naming mesh sets. More...
 
std::string junctionVariableName (const std::string &var_base) const
 Returns the name of junction variable, depending on whether scalar. More...
 
void addJunctionVariable (bool is_nonlinear, const VariableName &var, Real scaling_factor=1.0)
 Adds a junction variable to the problem, as a scalar or field variable. More...
 
void addJunctionIC (const VariableName &var, Real value)
 Adds a junction IC to the problem, as a scalar or field variable. More...
 
void addVolumeJunctionIC (const VariableName &var, const std::string &quantity)
 Adds a VolumeJunctionIC to the problem. More...
 
virtual void init () override
 Initializes the component. More...
 
virtual void initSecondary () override
 Perform secondary initialization, which relies on init() being called for all components. More...
 
const std::vector< dof_id_type > & getConnectedElementIDs ()
 Gets the element IDs of the connected 1D components. More...
 
const std::vector< processor_id_type > & getConnectedProcessorIDs ()
 Gets the processor IDs of the connected 1D components. More...
 
void addConnection (const BoundaryName &boundary_name)
 Adds a connection for this component. More...
 
void checkNumberOfConnections (const unsigned int &n_connections) const
 Checks that the number of connections is equal to the supplied value. More...
 
template<typename T >
void checkSizeEqualsNumberOfConnections (const std::string &param) const
 Checks that the size of a vector parameter equals the number of connections. More...
 
template<typename T >
void checkAllConnectionsHaveSame (const std::vector< T > &objects, const std::string &description) const
 Checks that all connections have the same of a certain type of object. More...
 
void addRelationshipManagersFromParameters (const InputParameters &moose_object_pars)
 Method to add a relationship manager for the objects being added to the system. More...
 
Node * addNode (const Point &pt)
 
Elem * addNodeElement (dof_id_type node)
 
virtual void setSubdomainInfo (SubdomainID subdomain_id, const std::string &subdomain_name, const Moose::CoordinateSystemType &coord_system=Moose::COORD_XYZ)
 Sets the next subdomain ID, name, and coordinate system. More...
 
template<typename T >
void insistParameterExists (const std::string &function_name, const std::string &param_name) const
 Runtime check to make sure that a parameter of specified type exists in the component's input parameters. More...
 
template<typename T >
void checkParameterValueLessThan (const std::string &param, const T &value_max) const
 Checks that a parameter value is less than a value. More...
 
template<typename T >
void checkSizeLessThan (const std::string &param, const unsigned int &n_entries) const
 Checks that the size of a vector parameter is less than a value. More...
 
template<typename T >
void checkSizeGreaterThan (const std::string &param, const unsigned int &n_entries) const
 Checks that the size of a vector parameter is greater than a value. More...
 
template<typename T1 , typename T2 >
void checkEqualSize (const std::string &param1, const std::string &param2) const
 Checks that the size of two vector parameters are equal. More...
 
template<typename T >
void checkSizeEqualsValue (const std::string &param, const unsigned int &n_entries) const
 Checks that the size of a vector parameter equals a value. More...
 
template<typename T >
void checkSizeEqualsValue (const std::string &param, const unsigned int &n_entries, const std::string &description) const
 Checks that the size of a vector parameter equals a value. More...
 
template<typename T1 , typename T2 >
void checkSizeEqualsParameterValue (const std::string &param1, const std::string &param2) const
 Checks that the size of a vector parameter equals the value of another parameter. More...
 
void checkMutuallyExclusiveParameters (const std::vector< std::string > &params, bool need_one_specified=true) const
 Checks that exactly one parameter out of a list is provided. More...
 
template<typename T >
void passParameter (const std::string &name, const std::string &new_name, InputParameters &params) const
 Passes a parameter from this object's input parameters to another set of input parameters. More...
 
template<typename T >
void passParameter (const std::string &name, InputParameters &params) const
 Passes a parameter from this object's input parameters to another set of input parameters. More...
 
std::string deduceFunctorName (const std::string &name) const
 
const Moose::Functor< T > & getFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
bool isFunctor (const std::string &name) const
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 

Protected Attributes

const BoundaryName & _inlet
 Compressor inlet. More...
 
const BoundaryName & _outlet
 Compressor outlet. More...
 
const Real_omega_rated
 Rated compressor speed. More...
 
const Real_mdot_rated
 Rated compressor mass flow rate. More...
 
const Real_rho0_rated
 Rated compressor inlet stagnation fluid density. More...
 
const Real_c0_rated
 Rated compressor inlet stagnation sound speed. More...
 
const Real_speed_cr_fr
 Compressor speed threshold for friction. More...
 
const Real_tau_fr_const
 Compressor friction constant. More...
 
const std::vector< Real > & _tau_fr_coeff
 Compressor friction coefficients. More...
 
const Real_speed_cr_I
 Compressor speed threshold for inertia. More...
 
const Real_inertia_const
 Compressor inertia constant. More...
 
const std::vector< Real > & _inertia_coeff
 Compressor inertia coefficients. More...
 
const std::vector< Real > & _speeds
 Compressor speeds which correspond to Rp and eff function order. More...
 
const std::vector< FunctionName > & _Rp_functions
 Names of the pressure ratio functions. More...
 
const std::vector< FunctionName > & _eff_functions
 Names of the adiabatic efficiency functions. More...
 
const VariableName _delta_p_var_name
 Name of compressor delta_p variable. More...
 
const VariableName _isentropic_torque_var_name
 Name of compressor isentropic torque variable. More...
 
const VariableName _dissipation_torque_var_name
 Name of compressor dissipation torque variable. More...
 
const VariableName _friction_torque_var_name
 Name of compressor friction torque variable. More...
 
const VariableName _moi_var_name
 Name of compressor inertia variable. More...
 
const Real _volume
 Volume of the junction. More...
 
const Point & _position
 Spatial position of center of the junction. More...
 
const Real_scaling_factor_rhoV
 Scaling factor for rho*V. More...
 
const Real_scaling_factor_rhouV
 Scaling factor for rho*u*V. More...
 
const Real_scaling_factor_rhovV
 Scaling factor for rho*v*V. More...
 
const Real_scaling_factor_rhowV
 Scaling factor for rho*w*V. More...
 
const Real_scaling_factor_rhoEV
 Scaling factor for rho*E*V. More...
 
const VariableName _rhoV_var_name
 rho*V variable name for junction More...
 
const VariableName _rhouV_var_name
 rho*u*V variable name for junction More...
 
const VariableName _rhovV_var_name
 rho*v*V variable name for junction More...
 
const VariableName _rhowV_var_name
 rho*w*V variable name for junction More...
 
const VariableName _rhoEV_var_name
 rho*E*V variable name for junction More...
 
const VariableName _pressure_var_name
 pressure variable name for junction More...
 
const VariableName _temperature_var_name
 temperature variable name for junction More...
 
const VariableName _velocity_var_name
 velocity variable name for junction More...
 
const Real_K
 Form loss coefficient. More...
 
const Real_A_ref
 Reference area. More...
 
std::vector< UserObjectName > _numerical_flux_names
 
THM::FlowModelID _flow_model_id
 Flow model ID. More...
 
std::shared_ptr< const FlowModel_flow_model
 Flow model. More...
 
UserObjectName _fp_name
 Fluid property user object name. More...
 
const std::string _junction_uo_name
 Name of junction user object name, if any. More...
 
std::vector< dof_id_type_connected_elems
 Element IDs of connected 1D components. More...
 
std::vector< processor_id_type_proc_ids
 Processor IDs of connected 1D components. More...
 
subdomain_id_type _junction_subdomain_id
 Junction subdomain ID. More...
 
std::vector< Point > _positions
 Physical positions of connected components. More...
 
std::vector< const Elem * > _elems
 Boundary elements of connected components. More...
 
std::vector< unsigned short int_sides
 Boundary sides of connected components. More...
 
std::vector< dof_id_type_nodes
 Boundary node IDs from connected components. More...
 
std::vector< unsigned int_boundary_ids
 Boundary IDs of connected components. More...
 
std::vector< BoundaryName > _boundary_names
 Boundary names of connected components. More...
 
std::vector< Real_normals
 Outward normals associated with connected components. More...
 
std::vector< RealVectorValue_directions
 Directions of connected components. More...
 
std::vector< Connection_connections
 Vector of connections of this component. More...
 
std::vector< std::string > _connected_component_names
 Vector of connected component names. More...
 
std::vector< SubdomainName > _connected_subdomain_names
 Vector of subdomain names of the connected components. More...
 
Component_parent
 Pointer to a parent component (used in composed components) More...
 
THMProblem_sim
 THM problem this component is part of TODO: make _sim private (applications need to switch to getters to avoid breaking). More...
 
Factory_factory
 The Factory associated with the MooseApp. More...
 
const Real_zero
 
THMMesh_mesh
 The THM mesh TODO: make _mesh private (applications need to switch to getters to avoid breaking) More...
 
std::vector< dof_id_type_node_ids
 Node IDs of this component. More...
 
std::vector< dof_id_type_elem_ids
 Element IDs of this component. More...
 
std::vector< SubdomainID_subdomain_ids
 List of subdomain IDs this components owns. More...
 
std::vector< SubdomainName > _subdomain_names
 List of subdomain names this components owns. More...
 
std::vector< Moose::CoordinateSystemType_coord_sys
 List of coordinate system for each subdomain. More...
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
ActionFactory_action_factory
 
const Parallel::Communicator & _communicator
 
Logger_log
 
VariableName _moment_of_inertia_var_name
 Moment of inertia variable name. More...
 
VariableName _torque_var_name
 Torque of variable name. More...
 
UserObjectName _user_object_name
 Shaft-connectable user object name. More...
 
std::string _shaft_name
 Name of the shaft component. More...
 
bool _connected_to_shaft
 Flag indicating that a shaft has this component connected. More...
 

Detailed Description

1-phase compressor that must be connected to a Shaft component

Definition at line 18 of file ShaftConnectedCompressor1Phase.h.

Member Enumeration Documentation

◆ EComponentSetupStatus

Component setup status type.

Enumerator
CREATED 

only created

MESH_PREPARED 

mesh set up

INITIALIZED_PRIMARY 

mesh set up, called primary init

INITIALIZED_SECONDARY 

mesh set up, called both inits

CHECKED 

mesh set up, called both inits, checked

Definition at line 36 of file Component.h.

37  {
38  CREATED,
42  CHECKED
43  };
only created
Definition: Component.h:38
mesh set up, called primary init
Definition: Component.h:40
mesh set up, called both inits
Definition: Component.h:41
mesh set up, called both inits, checked
Definition: Component.h:42

◆ EEndType

End type.

Enumerator
IN 

inlet

OUT 

outlet

Definition at line 23 of file Component1DConnection.h.

◆ VolumeJunction1PhaseIndices

Enumeration for junction variable/equation indices.

Enumerator
RHOV_INDEX 
RHOUV_INDEX 
RHOVV_INDEX 
RHOWV_INDEX 
RHOEV_INDEX 

Definition at line 26 of file VolumeJunction1Phase.h.

Constructor & Destructor Documentation

◆ ShaftConnectedCompressor1Phase()

ShaftConnectedCompressor1Phase::ShaftConnectedCompressor1Phase ( const InputParameters params)

Definition at line 70 of file ShaftConnectedCompressor1Phase.C.

72  ShaftConnectable(this),
73  _inlet(getParam<BoundaryName>("inlet")),
74  _outlet(getParam<BoundaryName>("outlet")),
75  _omega_rated(getParam<Real>("omega_rated")),
76  _mdot_rated(getParam<Real>("mdot_rated")),
77  _rho0_rated(getParam<Real>("rho0_rated")),
78  _c0_rated(getParam<Real>("c0_rated")),
79  _speed_cr_fr(getParam<Real>("speed_cr_fr")),
80  _tau_fr_const(getParam<Real>("tau_fr_const")),
81  _tau_fr_coeff(getParam<std::vector<Real>>("tau_fr_coeff")),
82  _speed_cr_I(getParam<Real>("speed_cr_I")),
83  _inertia_const(getParam<Real>("inertia_const")),
84  _inertia_coeff(getParam<std::vector<Real>>("inertia_coeff")),
85  _speeds(getParam<std::vector<Real>>("speeds")),
86  _Rp_functions(getParam<std::vector<FunctionName>>("Rp_functions")),
87  _eff_functions(getParam<std::vector<FunctionName>>("eff_functions")),
92  _moi_var_name(junctionVariableName("moment_of_inertia"))
93 {
94  // this determines connection ordering
97 
98  checkSizeEqualsValue<Real>("tau_fr_coeff", 4);
99  checkSizeEqualsValue<Real>("inertia_coeff", 4);
100 }
const Real & _rho0_rated
Rated compressor inlet stagnation fluid density.
ShaftConnectable(const Component *const component)
const Real & _speed_cr_fr
Compressor speed threshold for friction.
const std::vector< Real > & _speeds
Compressor speeds which correspond to Rp and eff function order.
const VariableName _dissipation_torque_var_name
Name of compressor dissipation torque variable.
const Real & _tau_fr_const
Compressor friction constant.
const Real & _mdot_rated
Rated compressor mass flow rate.
const Real & _c0_rated
Rated compressor inlet stagnation sound speed.
const BoundaryName & _outlet
Compressor outlet.
const Real & _speed_cr_I
Compressor speed threshold for inertia.
const VariableName _isentropic_torque_var_name
Name of compressor isentropic torque variable.
void addConnection(const BoundaryName &boundary_name)
Adds a connection for this component.
const VariableName _delta_p_var_name
Name of compressor delta_p variable.
std::string junctionVariableName(const std::string &var_base) const
Returns the name of junction variable, depending on whether scalar.
const BoundaryName & _inlet
Compressor inlet.
const T & getParam(const std::string &name) const
const std::vector< FunctionName > & _Rp_functions
Names of the pressure ratio functions.
const std::vector< Real > & _inertia_coeff
Compressor inertia coefficients.
const std::vector< FunctionName > & _eff_functions
Names of the adiabatic efficiency functions.
const InputParameters & parameters() const
const std::vector< Real > & _tau_fr_coeff
Compressor friction coefficients.
const VariableName _moi_var_name
Name of compressor inertia variable.
const Real & _inertia_const
Compressor inertia constant.
VolumeJunction1Phase(const InputParameters &params)
const Real & _omega_rated
Rated compressor speed.
const VariableName _friction_torque_var_name
Name of compressor friction torque variable.

Member Function Documentation

◆ addConnection()

void Component1DConnection::addConnection ( const BoundaryName &  boundary_name)
protectedinherited

Adds a connection for this component.

Components using this interface must call this function on all of their connection strings.

Parameters
[in]boundary_nameThe name of the boundary

Definition at line 100 of file Component1DConnection.C.

Referenced by Component1DBoundary::Component1DBoundary(), Component1DJunction::Component1DJunction(), ShaftConnectedCompressor1Phase(), ShaftConnectedPump1Phase::ShaftConnectedPump1Phase(), and ShaftConnectedTurbine1Phase::ShaftConnectedTurbine1Phase().

101 {
102  const size_t oparenthesis_pos = boundary_name.find('(');
103  if (oparenthesis_pos != std::string::npos)
104  {
105  logError("You are using the old connection format 'comp_name(end)'. Please update your input "
106  "file to the new one 'comp_name:end'.");
107  }
108  else
109  {
110  const size_t colon_pos = boundary_name.rfind(':');
111  // if it has a colon, assume 'component_name:end_type' format
112  if (colon_pos != std::string::npos)
113  {
114  const std::string connected_component_name = boundary_name.substr(0, colon_pos);
115  const std::string str_end =
116  boundary_name.substr(colon_pos + 1, boundary_name.length() - colon_pos - 1);
117  const EEndType end_type = THM::stringToEnum<EEndType>(str_end);
118 
119  _connections.push_back(Connection(boundary_name, connected_component_name, end_type));
120  _connected_component_names.push_back(connected_component_name);
121 
122  // Add dependency because the connected component's setupMesh() must be called
123  // before this component's setupMesh().
124  addDependency(connected_component_name);
125  }
126  else
127  {
128  logError("Incorrect connection specified '",
129  boundary_name,
130  "'. Valid connection format is 'component_name:end_type'.");
131  }
132  }
133 }
void addDependency(const std::string &dependency)
Adds a component name to the list of dependencies.
Definition: Component.C:129
std::vector< Connection > _connections
Vector of connections of this component.
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
std::vector< std::string > _connected_component_names
Vector of connected component names.

◆ addDependency()

void Component::addDependency ( const std::string &  dependency)
inherited

Adds a component name to the list of dependencies.

Parameters
[in]dependencyname of component to add to list of dependencies

Definition at line 129 of file Component.C.

Referenced by Component1DConnection::addConnection(), HeatTransferBase::HeatTransferBase(), HeatTransferFromHeatStructure3D1Phase::HeatTransferFromHeatStructure3D1Phase(), HSCoupler2D2DRadiation::HSCoupler2D2DRadiation(), HSCoupler2D3D::HSCoupler2D3D(), and Shaft::Shaft().

130 {
131  _dependencies.push_back(dependency);
132 }
std::vector< std::string > _dependencies
List of names of components that this component depends upon.
Definition: Component.h:491

◆ addJunctionIC()

void VolumeJunction1Phase::addJunctionIC ( const VariableName &  var,
Real  value 
)
protectedinherited

Adds a junction IC to the problem, as a scalar or field variable.

Parameters
[in]varVariable name
[in]valueIC value

Definition at line 319 of file VolumeJunction1Phase.C.

Referenced by addVariables(), ShaftConnectedTurbine1Phase::addVariables(), and ShaftConnectedPump1Phase::addVariables().

320 {
322 }
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307
void addConstantIC(const VariableName &var_name, Real value, const std::vector< SubdomainName > &block_names)
Definition: Simulation.C:512

◆ addJunctionVariable()

void VolumeJunction1Phase::addJunctionVariable ( bool  is_nonlinear,
const VariableName &  var,
Real  scaling_factor = 1.0 
)
protectedinherited

Adds a junction variable to the problem, as a scalar or field variable.

Parameters
[in]is_nonlinearIs the variable nonlinear?
[in]varVariable name
[in]scaling_factorScaling factor for variable if nonlinear

Definition at line 303 of file VolumeJunction1Phase.C.

Referenced by VolumeJunction1Phase::addVariables(), ShaftConnectedPump1Phase::addVariables(), addVariables(), ShaftConnectedTurbine1Phase::addVariables(), and SimpleTurbine1Phase::addVariables().

306 {
307  auto & problem = getTHMProblem();
308 
309  const libMesh::FEType fe_type(CONSTANT, MONOMIAL);
310  const auto & subdomains = getSubdomainNames();
311 
312  if (is_nonlinear)
313  problem.addSimVariable(is_nonlinear, var, fe_type, subdomains, scaling_factor);
314  else
315  problem.addSimVariable(is_nonlinear, var, fe_type, subdomains);
316 }
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307

◆ addMooseObjects()

void ShaftConnectedCompressor1Phase::addMooseObjects ( )
overridevirtual

Reimplemented from VolumeJunction1Phase.

Definition at line 190 of file ShaftConnectedCompressor1Phase.C.

191 {
193 
194  const std::vector<std::pair<std::string, VariableName>> quantities_aux = {
195  {"delta_p", _delta_p_var_name},
196  {"isentropic_torque", _isentropic_torque_var_name},
197  {"dissipation_torque", _dissipation_torque_var_name},
198  {"friction_torque", _friction_torque_var_name},
199  {"moment_of_inertia", _moment_of_inertia_var_name}};
200  for (const auto & quantity_and_name : quantities_aux)
201  {
202  const std::string class_name = "ShaftConnectedCompressor1PhaseAux";
203  InputParameters params = _factory.getValidParams(class_name);
204  params.set<AuxVariableName>("variable") = quantity_and_name.second;
205  params.set<MooseEnum>("quantity") = quantity_and_name.first;
206  params.set<UserObjectName>("compressor_uo") = getShaftConnectedUserObjectName();
207  const std::string obj_name = genName(name(), quantity_and_name.first + "_aux");
208  params.set<std::vector<SubdomainName>>("block") = getSubdomainNames();
209  getTHMProblem().addAuxKernel(class_name, obj_name, params);
210  }
211 
212  const std::vector<std::string> quantities_pp = {
213  "pressure_ratio", "efficiency", "rel_corrected_flow", "rel_corrected_speed"};
214  for (const auto & quantity : quantities_pp)
215  {
216  const std::string class_name = "ShaftConnectedCompressor1PhasePostprocessor";
217  InputParameters params = _factory.getValidParams(class_name);
218  params.set<MooseEnum>("quantity") = quantity;
219  params.set<UserObjectName>("compressor_uo") = getShaftConnectedUserObjectName();
220  params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_TIMESTEP_END};
221  getTHMProblem().addPostprocessor(class_name, Component::genName(name(), quantity), params);
222  }
223 }
virtual UserObjectName getShaftConnectedUserObjectName() const override
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
const VariableName _dissipation_torque_var_name
Name of compressor dissipation torque variable.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const ExecFlagType EXEC_TIMESTEP_END
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const VariableName _isentropic_torque_var_name
Name of compressor isentropic torque variable.
virtual const std::string & name() const
const VariableName _delta_p_var_name
Name of compressor delta_p variable.
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
virtual void addMooseObjects() override
VariableName _moment_of_inertia_var_name
Moment of inertia variable name.
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307
const VariableName _friction_torque_var_name
Name of compressor friction torque variable.
const ExecFlagType EXEC_INITIAL

◆ addNode()

Node * Component::addNode ( const Point &  pt)
protectedinherited

Definition at line 213 of file Component.C.

Referenced by Component2D::build2DMesh(), Component2D::build2DMesh2ndOrder(), FileMeshComponent::buildMesh(), ElbowPipe1Phase::buildMeshNodes(), Component1D::buildMeshNodes(), and VolumeJunction1Phase::setupMesh().

214 {
215  auto node = mesh().addNode(pt);
216  _node_ids.push_back(node->id());
217  return node;
218 }
std::vector< dof_id_type > _node_ids
Node IDs of this component.
Definition: Component.h:455
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
Node * addNode(const Point &pt)
Add a new node into the mesh.
Definition: THMMesh.C:95

◆ addNodeElement()

Elem * Component::addNodeElement ( dof_id_type  node)
protectedinherited

Definition at line 221 of file Component.C.

Referenced by VolumeJunction1Phase::setupMesh().

222 {
223  auto elem = mesh().addNodeElement(node);
224  _elem_ids.push_back(elem->id());
225  return elem;
226 }
Elem * addNodeElement(dof_id_type node)
Definition: THMMesh.C:116
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
Definition: Component.h:457
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60

◆ addRelationshipManagers()

virtual void Component::addRelationshipManagers ( Moose::RelationshipManagerType  )
inlinevirtualinherited

Adds relationship managers for the component.

Reimplemented in FileMeshPhysicsComponent.

Definition at line 110 of file Component.h.

110 {}

◆ addRelationshipManagersFromParameters()

void Component::addRelationshipManagersFromParameters ( const InputParameters moose_object_pars)
protectedinherited

Method to add a relationship manager for the objects being added to the system.

Relationship managers have to be added relatively early. In many cases before the Action::act() method is called.

This method was copied from Action.

Parameters
moose_object_parsThe MooseObject to inspect for RelationshipManagers to add

Definition at line 158 of file Component.C.

Referenced by FileMeshPhysicsComponent::addRelationshipManagers().

159 {
160  const auto & buildable_types = moose_object_pars.getBuildableRelationshipManagerTypes();
161 
162  for (const auto & buildable_type : buildable_types)
163  {
164  auto & rm_name = std::get<0>(buildable_type);
165  auto & rm_type = std::get<1>(buildable_type);
166  auto rm_input_parameter_func = std::get<2>(buildable_type);
167 
168  addRelationshipManager(moose_object_pars, rm_name, rm_type, rm_input_parameter_func);
169  }
170 }
const std::vector< std::tuple< std::string, Moose::RelationshipManagerType, Moose::RelationshipManagerInputParameterCallback > > & getBuildableRelationshipManagerTypes() const
void addRelationshipManager(const InputParameters &moose_object_pars, std::string rm_name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback rm_input_parameter_func, Moose::RMSystemType sys_type=Moose::RMSystemType::NONE)
Method for adding a single relationship manager.
Definition: Component.C:173

◆ addVariables()

void ShaftConnectedCompressor1Phase::addVariables ( )
overridevirtual

Reimplemented from VolumeJunction1Phase.

Definition at line 169 of file ShaftConnectedCompressor1Phase.C.

170 {
172 
178 
179  if (!_app.isRestarting())
180  {
186  }
187 }
virtual void addVariables() override
const VariableName _dissipation_torque_var_name
Name of compressor dissipation torque variable.
bool isRestarting() const
const VariableName _isentropic_torque_var_name
Name of compressor isentropic torque variable.
const VariableName _delta_p_var_name
Name of compressor delta_p variable.
void addJunctionIC(const VariableName &var, Real value)
Adds a junction IC to the problem, as a scalar or field variable.
VariableName _moment_of_inertia_var_name
Moment of inertia variable name.
void addJunctionVariable(bool is_nonlinear, const VariableName &var, Real scaling_factor=1.0)
Adds a junction variable to the problem, as a scalar or field variable.
MooseApp & _app
const Real & _inertia_const
Compressor inertia constant.
const VariableName _friction_torque_var_name
Name of compressor friction torque variable.

◆ addVolumeJunctionIC()

void VolumeJunction1Phase::addVolumeJunctionIC ( const VariableName &  var,
const std::string &  quantity 
)
protectedinherited

Adds a VolumeJunctionIC to the problem.

Parameters
[in]varVariable name
[in]quantityQuantity to compute

Definition at line 325 of file VolumeJunction1Phase.C.

Referenced by VolumeJunction1Phase::addVariables().

326 {
327  const std::string class_name = "VolumeJunction1PhaseIC";
328  InputParameters params = _factory.getValidParams(class_name);
329  params.set<std::vector<SubdomainName>>("block") = getSubdomainNames();
330  params.set<VariableName>("variable") = var;
331  params.set<MooseEnum>("quantity") = quantity;
333  {"initial_p",
334  "initial_T",
335  "initial_vel_x",
336  "initial_vel_y",
337  "initial_vel_z",
338  "volume",
339  "position"});
340  params.set<UserObjectName>("fluid_properties") = _fp_name;
341  getTHMProblem().addSimInitialCondition(class_name, genName(name(), var, "ic"), params);
342 }
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual const std::string & name() const
void addSimInitialCondition(const std::string &type, const std::string &name, InputParameters params)
Definition: Simulation.C:495
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
UserObjectName _fp_name
Fluid property user object name.
Definition: FlowJunction.h:38
const InputParameters & parameters() const
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307

◆ buildVolumeJunctionUserObject()

void ShaftConnectedCompressor1Phase::buildVolumeJunctionUserObject ( )
overrideprotectedvirtual

Builds user object for computing and storing the fluxes.

Reimplemented from VolumeJunction1Phase.

Definition at line 110 of file ShaftConnectedCompressor1Phase.C.

111 {
112  const Component & c = getComponentByName<Component>(_shaft_name);
113  const Shaft & scc = dynamic_cast<const Shaft &>(c);
114  const VariableName omega_var_name = scc.getOmegaVariableName();
115 
117  execute_on = {EXEC_INITIAL, EXEC_LINEAR, EXEC_NONLINEAR};
118 
119  {
120  const std::string class_name = "ADShaftConnectedCompressor1PhaseUserObject";
121  InputParameters params = _factory.getValidParams(class_name);
122  params.set<bool>("use_scalar_variables") = false;
123  params.set<subdomain_id_type>("junction_subdomain_id") = _junction_subdomain_id;
124  params.set<std::vector<BoundaryName>>("boundary") = _boundary_names;
125  params.set<std::vector<Real>>("normals") = _normals;
126  params.set<std::vector<processor_id_type>>("processor_ids") = getConnectedProcessorIDs();
127  params.set<std::vector<UserObjectName>>("numerical_flux_names") = _numerical_flux_names;
128  params.set<Real>("volume") = _volume;
129  params.set<std::vector<VariableName>>("A") = {FlowModel::AREA};
130  params.set<std::vector<VariableName>>("rhoA") = {FlowModelSinglePhase::RHOA};
131  params.set<std::vector<VariableName>>("rhouA") = {FlowModelSinglePhase::RHOUA};
132  params.set<std::vector<VariableName>>("rhoEA") = {FlowModelSinglePhase::RHOEA};
133  params.set<std::vector<VariableName>>("rhoV") = {_rhoV_var_name};
134  params.set<std::vector<VariableName>>("rhouV") = {_rhouV_var_name};
135  params.set<std::vector<VariableName>>("rhovV") = {_rhovV_var_name};
136  params.set<std::vector<VariableName>>("rhowV") = {_rhowV_var_name};
137  params.set<std::vector<VariableName>>("rhoEV") = {_rhoEV_var_name};
138  // the direction of the outlet channel
139  params.set<Point>("di_out") = _directions[1].unit();
140  params.set<Real>("omega_rated") = _omega_rated;
141  params.set<bool>("treat_as_turbine") = getParam<bool>("treat_as_turbine");
142  params.set<Real>("mdot_rated") = _mdot_rated;
143  params.set<Real>("rho0_rated") = _rho0_rated;
144  params.set<Real>("c0_rated") = _c0_rated;
145  params.set<Real>("speed_cr_fr") = _speed_cr_fr;
146  params.set<Real>("tau_fr_const") = _tau_fr_const;
147  params.set<std::vector<Real>>("tau_fr_coeff") = _tau_fr_coeff;
148  params.set<Real>("speed_cr_I") = _speed_cr_I;
149  params.set<Real>("inertia_const") = _inertia_const;
150  params.set<std::vector<Real>>("inertia_coeff") = _inertia_coeff;
151  params.set<std::vector<Real>>("speeds") = _speeds;
152  params.set<std::vector<FunctionName>>("Rp_functions") = _Rp_functions;
153  params.set<std::vector<FunctionName>>("eff_functions") = _eff_functions;
154  params.set<Real>("min_pressure_ratio") = getParam<Real>("min_pressure_ratio");
155  params.set<Real>("max_pressure_ratio") = getParam<Real>("max_pressure_ratio");
156  params.set<std::vector<VariableName>>("omega") = {omega_var_name};
157  params.set<Real>("A_ref") = getParam<Real>("A_ref");
158  params.set<Real>("K") = getParam<Real>("K");
159  params.set<UserObjectName>("fp") = _fp_name;
160  params.set<std::string>("compressor_name") = cname();
161  params.set<bool>("apply_velocity_scaling") = getParam<bool>("apply_velocity_scaling");
162  params.set<ExecFlagEnum>("execute_on") = execute_on;
164  connectObject(params, _junction_uo_name, "K");
165  }
166 }
virtual UserObjectName getShaftConnectedUserObjectName() const override
const Real & _rho0_rated
Rated compressor inlet stagnation fluid density.
std::string _shaft_name
Name of the shaft component.
const VariableName _rhoV_var_name
rho*V variable name for junction
const std::vector< processor_id_type > & getConnectedProcessorIDs()
Gets the processor IDs of the connected 1D components.
static const std::string AREA
Definition: FlowModel.h:102
const Real & _speed_cr_fr
Compressor speed threshold for friction.
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
const std::vector< Real > & _speeds
Compressor speeds which correspond to Rp and eff function order.
const VariableName _rhovV_var_name
rho*v*V variable name for junction
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const std::string & cname() const
Get the component name.
Definition: Component.C:51
const Real & _tau_fr_const
Compressor friction constant.
const Real & _mdot_rated
Rated compressor mass flow rate.
const Real & _c0_rated
Rated compressor inlet stagnation sound speed.
const Real & _speed_cr_I
Compressor speed threshold for inertia.
const VariableName _rhowV_var_name
rho*w*V variable name for junction
std::vector< BoundaryName > _boundary_names
Boundary names of connected components.
ExecFlagEnum getDefaultExecFlagEnum()
Component that connects torque of turbomachinery components.
Definition: Shaft.h:17
static const std::string RHOUA
std::vector< UserObjectName > _numerical_flux_names
static const std::string RHOA
Base class for THM components.
Definition: Component.h:27
const Real _volume
Volume of the junction.
const ExecFlagType EXEC_LINEAR
const std::vector< FunctionName > & _Rp_functions
Names of the pressure ratio functions.
const ExecFlagType EXEC_NONLINEAR
const std::string _junction_uo_name
Name of junction user object name, if any.
Definition: FlowJunction.h:40
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual VariableName getOmegaVariableName() const
Definition: Shaft.C:129
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
void connectObject(const InputParameters &params, const std::string &mooseName, const std::string &name) const
Connect with control logic.
Definition: Component.C:98
UserObjectName _fp_name
Fluid property user object name.
Definition: FlowJunction.h:38
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
const std::vector< Real > & _inertia_coeff
Compressor inertia coefficients.
const std::vector< FunctionName > & _eff_functions
Names of the adiabatic efficiency functions.
static const std::string RHOEA
const VariableName _rhouV_var_name
rho*u*V variable name for junction
const std::vector< Real > & _tau_fr_coeff
Compressor friction coefficients.
const Real & _inertia_const
Compressor inertia constant.
std::vector< Real > _normals
Outward normals associated with connected components.
std::vector< RealVectorValue > _directions
Directions of connected components.
const VariableName _rhoEV_var_name
rho*E*V variable name for junction
subdomain_id_type _junction_subdomain_id
Junction subdomain ID.
const Real & _omega_rated
Rated compressor speed.
const ExecFlagType EXEC_INITIAL

◆ check()

void ShaftConnectedCompressor1Phase::check ( ) const
overrideprotectedvirtual

Check the component integrity.

Reimplemented from VolumeJunction1Phase.

Definition at line 103 of file ShaftConnectedCompressor1Phase.C.

104 {
106  checkShaftConnection(this);
107 }
virtual void checkShaftConnection(const Component *const component) const
virtual void check() const override
Check the component integrity.

◆ checkAllConnectionsHaveSame()

template<typename T >
void Component1DConnection::checkAllConnectionsHaveSame ( const std::vector< T > &  objects,
const std::string &  description 
) const
protectedinherited

Checks that all connections have the same of a certain type of object.

Template Parameters
Ttype of object to check
Parameters
[in]objectslist of objects corresponding to each connection
[in]descriptiondescription of the obect to check

Definition at line 177 of file Component1DConnection.h.

179 {
180  for (const auto & obj : objects)
181  if (obj != objects[0])
182  logError("All connections must have the same ", description);
183 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215

◆ checkComponentExistsByName()

void Component::checkComponentExistsByName ( const std::string &  comp_name) const
inherited

Checks that a component exists.

Parameters
[in]comp_namename of the component

Definition at line 151 of file Component.C.

152 {
153  if (!_sim.hasComponent(comp_name))
154  logError("The component '", comp_name, "' does not exist");
155 }
THMProblem & _sim
THM problem this component is part of TODO: make _sim private (applications need to switch to getters...
Definition: Component.h:443
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
bool hasComponent(const std::string &name) const
Find out if simulation has a component with the given name.
Definition: Simulation.C:1002

◆ checkComponentOfTypeExists()

template<typename T >
void Component::checkComponentOfTypeExists ( const std::string &  param) const
inherited

Checks that the component of a certain type exists, where the name is given by a parameter.

Template Parameters
Tenforced type of component
Parameters
[in]paramparameter name for component name

Definition at line 585 of file Component.h.

586 {
587  insistParameterExists<std::string>(__FUNCTION__, param);
588 
589  const std::string & comp_name = getParam<std::string>(param);
590  checkComponentOfTypeExistsByName<T>(comp_name);
591 }

◆ checkComponentOfTypeExistsByName()

template<typename T >
void Component::checkComponentOfTypeExistsByName ( const std::string &  comp_name) const
inherited

Checks that the component of a certain type exists.

Template Parameters
Tenforced type of component
Parameters
[in]comp_namecomponent name

Definition at line 595 of file Component.h.

596 {
597  if (!_sim.hasComponentOfType<T>(comp_name))
598  {
599  if (_sim.hasComponent(comp_name))
600  logError("The component '", comp_name, "' is not of type '", demangle(typeid(T).name()), "'");
601  else
602  logError("The component '", comp_name, "' does not exist");
603  }
604 }
THMProblem & _sim
THM problem this component is part of TODO: make _sim private (applications need to switch to getters...
Definition: Component.h:443
virtual const std::string & name() const
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
bool hasComponent(const std::string &name) const
Find out if simulation has a component with the given name.
Definition: Simulation.C:1002
std::string demangle(const char *name)
bool hasComponentOfType(const std::string &name) const
Find out if simulation has a component with the given name and specified type.
Definition: Simulation.h:493

◆ checkEqualSize()

template<typename T1 , typename T2 >
void Component::checkEqualSize ( const std::string &  param1,
const std::string &  param2 
) const
protectedinherited

Checks that the size of two vector parameters are equal.

Template Parameters
T1type of element in the first vector parameter
T2type of element in the second vector parameter
Parameters
[in]param1first parameter name
[in]param2second parameter name

Definition at line 651 of file Component.h.

652 {
653  insistParameterExists<std::vector<T1>>(__FUNCTION__, param1);
654  insistParameterExists<std::vector<T2>>(__FUNCTION__, param2);
655 
656  const auto & value1 = getParam<std::vector<T1>>(param1);
657  const auto & value2 = getParam<std::vector<T2>>(param2);
658  if (value1.size() != value2.size())
659  logError("The number of entries in parameter '",
660  param1,
661  "' (",
662  value1.size(),
663  ") must equal the number of entries of parameter '",
664  param2,
665  "' (",
666  value2.size(),
667  ")");
668 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215

◆ checkMutuallyExclusiveParameters()

void Component::checkMutuallyExclusiveParameters ( const std::vector< std::string > &  params,
bool  need_one_specified = true 
) const
protectedinherited

Checks that exactly one parameter out of a list is provided.

Parameters
[in]paramsvector of parameter names
[in]need_one_specifiedNeed one of the parameters specified?

Definition at line 246 of file Component.C.

Referenced by HeatStructureCylindrical::check(), and HeatStructurePlate::check().

248 {
249  unsigned int n_provided_params = 0;
250  for (const auto & param : params)
251  if (isParamValid(param))
252  n_provided_params++;
253 
254  if (n_provided_params != 1)
255  {
256  std::string params_list_string = "{'" + params[0] + "'";
257  for (unsigned int i = 1; i < params.size(); ++i)
258  params_list_string += ", '" + params[i] + "'";
259  params_list_string += "}";
260 
261  if (n_provided_params == 0 && need_one_specified)
262  logError("One of the parameters ", params_list_string, " must be provided");
263 
264  if (n_provided_params != 0)
265  logError("Only one of the parameters ", params_list_string, " can be provided");
266  }
267 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
bool isParamValid(const std::string &name) const

◆ checkNumberOfConnections()

void Component1DConnection::checkNumberOfConnections ( const unsigned int n_connections) const
protectedinherited

Checks that the number of connections is equal to the supplied value.

Parameters
[in]n_connectionsenforced number of connections

Definition at line 136 of file Component1DConnection.C.

Referenced by GateValve1Phase::check(), Component1DBoundary::check(), and JunctionOneToOne1Phase::check().

137 {
138  if (_connections.size() != n_connections)
139  logError("The number of connections (", _connections.size(), ") must equal ", n_connections);
140 }
std::vector< Connection > _connections
Vector of connections of this component.
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215

◆ checkParameterValueLessThan()

template<typename T >
void Component::checkParameterValueLessThan ( const std::string &  param,
const T &  value_max 
) const
protectedinherited

Checks that a parameter value is less than a value.

Template Parameters
Ttype of parameter
Parameters
[in]paramparameter name
[in]value_maxvalue which parameter value must be less than

Definition at line 608 of file Component.h.

609 {
610  insistParameterExists<T>(__FUNCTION__, param);
611 
612  const auto & value = getParam<T>(param);
613  if (value >= value_max)
614  logError("The value of parameter '", param, "' (", value, ") must be less than ", value_max);
615 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ checkSetupStatus()

void Component::checkSetupStatus ( const EComponentSetupStatus status) const
inherited

Throws an error if the supplied setup status of this component has not been reached.

This is useful for getter functions that rely on data initialized after the constructor; if an error is not thrown, then uninitialized data could be returned from these functions.

Parameters
[in]statusSetup status that this component must have reached

Definition at line 117 of file Component.C.

Referenced by FlowChannelBase::getAreaFunctionName(), Component2D::getBoundaryArea(), FileMeshComponent::getBoundaryInfo(), Component2D::getBoundaryInfo(), Component1DConnection::getBoundaryNames(), Component1D::getConnections(), Component::getCoordSysTypes(), Component::getElementIDs(), Component2D::getExternalBoundaryName(), Component2D::getExternalBoundaryType(), FlowChannelBase::getFlowModel(), FlowBoundary::getFluidPropertiesName(), FlowJunction::getFluidPropertiesName(), HeatTransferBase::getFluidPropertiesName(), HeatTransferBase::getHeatedPerimeterName(), FlowChannelBase::getHeatTransferNames(), FlowChannelBase::getHeatTransferNamesSuffix(), Component1DConnection::getNodeIDs(), Component::getNodeIDs(), Component1D::getNodesetID(), Component1D::getNodesetName(), Component::getSubdomainNames(), HeatTransfer1PhaseBase::getWallHeatTransferCoefficient1PhaseName(), HeatTransferBase::getWallTemperatureMatName(), HeatTransferBase::getWallTemperatureName(), FileMeshComponent::hasBoundary(), Component2D::hasBoundary(), Component2D::hasExternalBoundary(), and HeatStructureFromFile3D::hasRegion().

118 {
120  mooseError(name(),
121  ": The component setup status (",
123  ") is less than the required status (",
124  stringify(status),
125  ")");
126 }
std::string stringify(EComponentSetupStatus status) const
Return a string for the setup status.
Definition: Component.C:271
virtual const std::string & name() const
MPI_Status status
EComponentSetupStatus _component_setup_status
Component setup status.
Definition: Component.h:488
void mooseError(Args &&... args) const

◆ checkShaftConnection()

void ShaftConnectable::checkShaftConnection ( const Component *const  component) const
virtualinherited

Definition at line 29 of file ShaftConnectable.C.

Referenced by ShaftConnectedMotor::check(), check(), ShaftConnectedPump1Phase::check(), and ShaftConnectedTurbine1Phase::check().

30 {
32  component->logError("This component must be connected to a shaft.");
33 }
bool _connected_to_shaft
Flag indicating that a shaft has this component connected.
static const std::string component
Definition: NS.h:153

◆ checkSizeEqualsNumberOfConnections()

template<typename T >
void Component1DConnection::checkSizeEqualsNumberOfConnections ( const std::string &  param) const
protectedinherited

Checks that the size of a vector parameter equals the number of connections.

Template Parameters
Ttype of element in the vector parameter
Parameters
[in]paramvector parameter name

Definition at line 162 of file Component1DConnection.h.

163 {
164  const auto & value = getParam<std::vector<T>>(param);
165  if (value.size() != _connections.size())
166  logError("The number of entries in '",
167  param,
168  "' (",
169  value.size(),
170  ") must equal the number of connections (",
171  _connections.size(),
172  ")");
173 }
std::vector< Connection > _connections
Vector of connections of this component.
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ checkSizeEqualsParameterValue()

template<typename T1 , typename T2 >
void Component::checkSizeEqualsParameterValue ( const std::string &  param1,
const std::string &  param2 
) const
protectedinherited

Checks that the size of a vector parameter equals the value of another parameter.

Template Parameters
T1type of element in the vector parameter
T2type of the parameter whose value is compared to size
Parameters
[in]param1vector parameter name
[in]param2name of parameter whose value is compared to size

Definition at line 709 of file Component.h.

711 {
712  insistParameterExists<std::vector<T1>>(__FUNCTION__, param1);
713  insistParameterExists<T2>(__FUNCTION__, param2);
714 
715  const auto & value1 = getParam<std::vector<T1>>(param1);
716  const auto & value2 = getParam<T2>(param2);
717  if (value1.size() != value2)
718  logError("The number of entries in parameter '",
719  param1,
720  "' (",
721  value1.size(),
722  ") must be equal to the value of parameter '",
723  param2,
724  "' (",
725  value2,
726  ")");
727 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215

◆ checkSizeEqualsValue() [1/2]

template<typename T >
void Component::checkSizeEqualsValue ( const std::string &  param,
const unsigned int n_entries 
) const
protectedinherited

Checks that the size of a vector parameter equals a value.

This version does not supply a description to the value.

Template Parameters
Ttype of element in the vector parameter
Parameters
[in]paramparameter name
[in]n_entriesvalue which parameter size must be equal to

Definition at line 672 of file Component.h.

673 {
674  insistParameterExists<std::vector<T>>(__FUNCTION__, param);
675 
676  const auto & param_value = getParam<std::vector<T>>(param);
677  if (param_value.size() != n_entries)
678  logError("The number of entries in parameter '",
679  param,
680  "' (",
681  param_value.size(),
682  ") must be equal to ",
683  n_entries);
684 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215

◆ checkSizeEqualsValue() [2/2]

template<typename T >
void Component::checkSizeEqualsValue ( const std::string &  param,
const unsigned int n_entries,
const std::string &  description 
) const
protectedinherited

Checks that the size of a vector parameter equals a value.

This version supplies a description to the value.

Template Parameters
Ttype of element in the vector parameter
Parameters
[in]paramparameter name
[in]n_entriesvalue which parameter size must be equal to
[in]descriptiondescription of the value that size must be equal to

Definition at line 688 of file Component.h.

691 {
692  insistParameterExists<std::vector<T>>(__FUNCTION__, param);
693 
694  const auto & param_value = getParam<std::vector<T>>(param);
695  if (param_value.size() != n_entries)
696  logError("The number of entries in parameter '",
697  param,
698  "' (",
699  param_value.size(),
700  ") must be equal to ",
701  description,
702  " (",
703  n_entries,
704  ")");
705 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215

◆ checkSizeGreaterThan()

template<typename T >
void Component::checkSizeGreaterThan ( const std::string &  param,
const unsigned int n_entries 
) const
protectedinherited

Checks that the size of a vector parameter is greater than a value.

Template Parameters
Ttype of element in the vector parameter
Parameters
[in]paramparameter name
[in]n_entriesvalue which parameter size must be greater than

Definition at line 635 of file Component.h.

636 {
637  insistParameterExists<std::vector<T>>(__FUNCTION__, param);
638 
639  const auto & value = getParam<std::vector<T>>(param);
640  if (value.size() <= n_entries)
641  logError("The number of entries in the parameter '",
642  param,
643  "' (",
644  value.size(),
645  ") must be greater than ",
646  n_entries);
647 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ checkSizeLessThan()

template<typename T >
void Component::checkSizeLessThan ( const std::string &  param,
const unsigned int n_entries 
) const
protectedinherited

Checks that the size of a vector parameter is less than a value.

Template Parameters
Ttype of element in the vector parameter
Parameters
[in]paramparameter name
[in]n_entriesvalue which parameter size must be less than

Definition at line 619 of file Component.h.

620 {
621  insistParameterExists<std::vector<T>>(__FUNCTION__, param);
622 
623  const auto & value = getParam<std::vector<T>>(param);
624  if (value.size() >= n_entries)
625  logError("The number of entries in the parameter '",
626  param,
627  "' (",
628  value.size(),
629  ") must be less than ",
630  n_entries);
631 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ cname()

const std::string & Component::cname ( ) const
inherited

Get the component name.

Returns
The name of the component. For composite component, return its parent name

Definition at line 51 of file Component.C.

Referenced by buildVolumeJunctionUserObject(), ShaftConnectedTurbine1Phase::buildVolumeJunctionUserObject(), ShaftConnectedPump1Phase::buildVolumeJunctionUserObject(), Closures1PhaseSimple::checkFlowChannel(), Closures1PhaseSimple::checkHeatTransfer(), Component::cname(), Component::logError(), and Component::logWarning().

52 {
53  if (_parent)
54  return _parent->cname();
55  else
56  return name();
57 }
const std::string & cname() const
Get the component name.
Definition: Component.C:51
Component * _parent
Pointer to a parent component (used in composed components)
Definition: Component.h:438
virtual const std::string & name() const

◆ connectObject() [1/2]

void Component::connectObject ( const InputParameters params,
const std::string &  mooseName,
const std::string &  name 
) const
inherited

◆ connectObject() [2/2]

void Component::connectObject ( const InputParameters params,
const std::string &  mooseName,
const std::string &  name,
const std::string &  par_name 
) const
inherited

Connect with control logic.

Definition at line 106 of file Component.C.

110 {
111  MooseObjectParameterName alias("component", this->name(), name, "::");
112  MooseObjectParameterName par_value(params.get<std::string>("_moose_base"), mooseName, par_name);
114 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
InputParameterWarehouse & getInputParameterWarehouse()
virtual const std::string & name() const
void addControllableParameterAlias(const MooseObjectParameterName &alias, const MooseObjectParameterName &secondary)
MooseApp & _app

◆ constMesh()

const THMMesh& Component::constMesh ( ) const
inlineinherited

Const reference to mesh, which can be called at any point.

Note that overloading mesh() was not possible due to the need to call this const version, even when the component is not const.

Definition at line 62 of file Component.h.

Referenced by FileMeshPhysicsComponent::getMesh(), and Component1DJunction::initSecondary().

62 { return _mesh; }
THMMesh & _mesh
The THM mesh TODO: make _mesh private (applications need to switch to getters to avoid breaking) ...
Definition: Component.h:452

◆ executeCheck()

void Component::executeCheck ( ) const
inherited

Wrapper function for check() that marks the function as being called.

Definition at line 84 of file Component.C.

85 {
86  check();
88 }
virtual void check() const
Check the component integrity.
Definition: Component.h:301
EComponentSetupStatus _component_setup_status
Component setup status.
Definition: Component.h:488
mesh set up, called both inits, checked
Definition: Component.h:42

◆ executeInit()

void Component::executeInit ( )
inherited

Wrapper function for init() that marks the function as being called.

Definition at line 70 of file Component.C.

71 {
72  init();
74 }
mesh set up, called primary init
Definition: Component.h:40
virtual void init()
Initializes the component.
Definition: Component.h:290
EComponentSetupStatus _component_setup_status
Component setup status.
Definition: Component.h:488

◆ executeInitSecondary()

void Component::executeInitSecondary ( )
inherited

Wrapper function for initSecondary() that marks the function as being called.

Definition at line 77 of file Component.C.

78 {
79  initSecondary();
81 }
mesh set up, called both inits
Definition: Component.h:41
virtual void initSecondary()
Perform secondary initialization, which relies on init() being called for all components.
Definition: Component.h:296
EComponentSetupStatus _component_setup_status
Component setup status.
Definition: Component.h:488

◆ executeSetupMesh()

void Component::executeSetupMesh ( )
inherited

Wrapper function for setupMesh() that marks the function as being called.

Definition at line 91 of file Component.C.

92 {
93  setupMesh();
95 }
virtual void setupMesh()
Performs mesh setup such as creating mesh or naming mesh sets.
Definition: Component.h:306
EComponentSetupStatus _component_setup_status
Component setup status.
Definition: Component.h:488

◆ genName() [1/4]

std::string NamingInterface::genName ( const std::string &  prefix,
unsigned int  id,
const std::string &  suffix = "" 
) const
inlineinherited

Build a name from a prefix, number and possible suffix.

Definition at line 29 of file NamingInterface.h.

Referenced by Closures1PhaseBase::addAverageWallTemperatureMaterial(), FlowModel::addCommonInitialConditions(), FlowModel::addCommonMooseObjects(), FlowChannelBase::addCommonObjects(), Simulation::addComponentScalarIC(), HeatStructureBase::addConstantDensitySolidPropertiesMaterial(), Simulation::addConstantIC(), Simulation::addConstantScalarIC(), FlowModel1PhaseBase::addDensityAux(), FlowModelSinglePhase::addDensityIC(), FlowModelGasMix::addDensityIC(), FlowModel1PhaseBase::addEnergyGravityKernel(), FlowModelSinglePhase::addFluidPropertiesMaterials(), FlowModelGasMix::addFluidPropertiesMaterials(), FlowModel1PhaseBase::addFunctionIC(), Simulation::addFunctionIC(), HeatTransferBase::addHeatedPerimeter(), HeatConductionModel::addHeatEquationRZ(), HeatConductionModel::addHeatEquationXYZ(), HeatTransferFromTemperature1Phase::addHeatTransferKernels(), FlowChannel1PhaseBase::addHydraulicDiameterMaterial(), FlowModelGasMix::addMassDiffusionEnergyDGKernel(), FlowModelGasMix::addMassDiffusionSpeciesDGKernel(), FlowModelGasMix::addMassFractionAux(), HeatConductionModel::addMaterials(), FlowModel1PhaseBase::addMomentumAreaGradientKernel(), FlowModel1PhaseBase::addMomentumFrictionKernel(), FlowModel1PhaseBase::addMomentumGravityKernel(), HSBoundaryAmbientConvection::addMooseObjects(), HSBoundaryHeatFlux::addMooseObjects(), HSBoundaryRadiation::addMooseObjects(), InletVelocityTemperature1Phase::addMooseObjects(), HSBoundarySpecifiedTemperature::addMooseObjects(), FormLossFromFunction1Phase::addMooseObjects(), HeatSourceFromPowerDensity::addMooseObjects(), HeatSourceFromTotalPower::addMooseObjects(), HeatStructure2DCoupler::addMooseObjects(), HeatStructure2DRadiationCouplerRZ::addMooseObjects(), HeatTransferFromHeatFlux1Phase::addMooseObjects(), FormLossFromExternalApp1Phase::addMooseObjects(), GateValve1Phase::addMooseObjects(), HeatSourceVolumetric1Phase::addMooseObjects(), HeatTransferFromSpecifiedTemperature1Phase::addMooseObjects(), HSBoundaryExternalAppTemperature::addMooseObjects(), Shaft::addMooseObjects(), TotalPower::addMooseObjects(), VolumeJunction1Phase::addMooseObjects(), FormLoss1PhaseBase::addMooseObjects(), HeatTransferFromExternalAppHeatFlux1Phase::addMooseObjects(), ShaftConnectedTurbine1Phase::addMooseObjects(), HSBoundaryExternalAppConvection::addMooseObjects(), addMooseObjects(), ShaftConnectedPump1Phase::addMooseObjects(), HeatTransferBase::addMooseObjects(), HeatTransferFromHeatStructure3D1Phase::addMooseObjects(), HSCoupler2D2DRadiation::addMooseObjects(), SimpleTurbine1Phase::addMooseObjects(), HSCoupler2D3D::addMooseObjects(), HeatTransferFromHeatStructure1Phase::addMooseObjects(), HSBoundaryExternalAppHeatFlux::addMooseObjects(), JunctionOneToOne1Phase::addMooseObjects(), FlowChannelBase::addMooseObjects(), FunctorClosures::addMooseObjectsFlowChannel(), Closures1PhaseSimple::addMooseObjectsHeatTransfer(), FlowModelSinglePhase::addPressureAux(), FlowModelGasMix::addPressureAux(), FlowModelSinglePhase::addRDGAdvectionDGKernels(), FlowModelGasMix::addRDGAdvectionDGKernels(), FlowModel1PhaseBase::addRhoAIC(), FlowModelSinglePhase::addRhoEAIC(), FlowModelGasMix::addRhoEAIC(), FlowModel1PhaseBase::addRhoUAIC(), FlowModelSinglePhase::addSlopeReconstructionMaterial(), FlowModelGasMix::addSlopeReconstructionMaterial(), FlowModel1PhaseBase::addSpecificInternalEnergyAux(), FlowModel1PhaseBase::addSpecificInternalEnergyIC(), FlowModel1PhaseBase::addSpecificTotalEnthalpyAux(), FlowModel1PhaseBase::addSpecificTotalEnthalpyIC(), FlowModel1PhaseBase::addSpecificVolumeAux(), FlowModel1PhaseBase::addSpecificVolumeIC(), FlowModelSinglePhase::addTemperatureAux(), FlowModelGasMix::addTemperatureAux(), Closures1PhaseTHM::addTemperatureWallFromHeatFluxMaterial(), FlowModel1PhaseBase::addTimeDerivativeKernelIfTransient(), FlowChannelBase::addVariables(), FlowModel1PhaseBase::addVelocityAux(), FlowModel1PhaseBase::addVelocityIC(), VolumeJunction1Phase::addVolumeJunctionIC(), Closures1PhaseTHM::addWallFFMaterial(), Closures1PhaseBase::addWallFrictionFunctionMaterial(), Closures1PhaseTHM::addWallHTCMaterial(), ClosuresBase::addWallTemperatureFromAuxMaterial(), Closures1PhaseSimple::addWallTemperatureFromHeatFluxMaterial(), FlowBoundary1Phase::addWeakBCs(), FlowBoundaryGasMix::addWeakBCs(), ClosuresBase::addWeightedAverageMaterial(), FlowModelGasMix::addXiRhoAIC(), ClosuresBase::addZeroMaterial(), Component2D::buildMesh(), FileMeshComponent::buildMesh(), Component1D::buildMesh(), HeatSourceBase::HeatSourceBase(), and Simulation::setupInitialConditionsFromFile().

30  {
31  std::stringstream ss;
32  ss << prefix << ":" << id;
33  if (!suffix.empty())
34  ss << ":" << suffix;
35  return ss.str();
36  }

◆ genName() [2/4]

std::string NamingInterface::genName ( const std::string &  prefix,
unsigned int  i,
unsigned int  j,
const std::string &  suffix = "" 
) const
inlineinherited

Build a name from a prefix, 2 numbers and possible suffix.

Definition at line 41 of file NamingInterface.h.

45  {
46  std::stringstream ss;
47  ss << prefix << ":" << i << ":" << j;
48  if (!suffix.empty())
49  ss << ":" << suffix;
50  return ss.str();
51  }
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")

◆ genName() [3/4]

std::string NamingInterface::genName ( const std::string &  prefix,
const std::string &  name,
unsigned int  i 
) const
inlineinherited

Build a name from 2 strings and a number.

Definition at line 56 of file NamingInterface.h.

57  {
58  std::stringstream ss;
59  ss << prefix << ":" << name << ":" << i;
60  return ss.str();
61  }
const std::string name
Definition: Setup.h:20

◆ genName() [4/4]

std::string NamingInterface::genName ( const std::string &  prefix,
const std::string &  middle,
const std::string &  suffix = "" 
) const
inlineinherited

Build a name from strings.

Definition at line 66 of file NamingInterface.h.

69  {
70  std::stringstream ss;
71  ss << prefix << ":" << middle;
72  if (!suffix.empty())
73  ss << ":" << suffix;
74  return ss.str();
75  }

◆ genSafeName()

std::string NamingInterface::genSafeName ( const std::string &  prefix,
const std::string &  middle,
const std::string &  suffix = "" 
) const
inlineinherited

Build a name from strings that is safe to use in input files (i.e.

can be exposed to users)

Definition at line 80 of file NamingInterface.h.

Referenced by HSBoundaryAmbientConvection::addMooseObjects(), HSBoundaryRadiation::addMooseObjects(), HSBoundaryHeatFlux::addMooseObjects(), HSBoundaryExternalAppConvection::addMooseObjects(), and HSBoundaryExternalAppHeatFlux::addMooseObjects().

83  {
84  std::stringstream ss;
85  ss << prefix << "_" << middle;
86  if (!suffix.empty())
87  ss << "_" << suffix;
88  return ss.str();
89  }

◆ getBoundaryNames()

const std::vector< BoundaryName > & Component1DConnection::getBoundaryNames ( ) const
inherited

Gets the boundary names for this component.

Returns
boundary names for this component

Definition at line 151 of file Component1DConnection.C.

Referenced by FlowBoundary1Phase::addWeakBCs(), and FlowBoundaryGasMix::addWeakBCs().

152 {
154 
155  return _boundary_names;
156 }
std::vector< BoundaryName > _boundary_names
Boundary names of connected components.
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117

◆ getComponent()

template<typename T >
const T & Component::getComponent ( const std::string &  name) const
inherited

Return a reference to a component via a parameter name.

Template Parameters
Tthe type of the component we are requesting
Parameters
nameThe parameter name that has the component name

Definition at line 506 of file Component.h.

507 {
508  const std::string & comp_name = getParam<std::string>(pname);
509  return getComponentByName<T>(comp_name);
510 }

◆ getComponentByName()

template<typename T >
const T & Component::getComponentByName ( const std::string &  cname) const
inherited

Return a reference to a component given its name.

Template Parameters
Tthe type of the component we are requesting
Parameters
cnameThe name of the component

Definition at line 514 of file Component.h.

515 {
516  return _sim.getComponentByName<T>(comp_name);
517 }
THMProblem & _sim
THM problem this component is part of TODO: make _sim private (applications need to switch to getters...
Definition: Component.h:443
const T & getComponentByName(const std::string &name) const
Get component by its name.
Definition: Simulation.h:504

◆ getConnectedComponentNames()

const std::vector<std::string>& Component1DConnection::getConnectedComponentNames ( ) const
inlineinherited

Returns a list of names of components that are connected to this component.

Returns
list of names of components that are connected to this component

Definition at line 63 of file Component1DConnection.h.

Referenced by Simulation::identifyLoops().

64  {
66  }
std::vector< std::string > _connected_component_names
Vector of connected component names.

◆ getConnectedElementIDs()

const std::vector<dof_id_type>& Component1DJunction::getConnectedElementIDs ( )
inlineprotectedinherited

Gets the element IDs of the connected 1D components.

Definition at line 28 of file Component1DJunction.h.

Referenced by GateValve1Phase::setupMesh(), JunctionOneToOne1Phase::setupMesh(), and VolumeJunction1Phase::setupMesh().

28 { return _connected_elems; }
std::vector< dof_id_type > _connected_elems
Element IDs of connected 1D components.

◆ getConnectedProcessorIDs()

const std::vector<processor_id_type>& Component1DJunction::getConnectedProcessorIDs ( )
inlineprotectedinherited

◆ getConnectedSubdomainNames()

const std::vector<SubdomainName>& Component1DConnection::getConnectedSubdomainNames ( ) const
inlineinherited

Gets the vector of connected subdomain names.

Definition at line 71 of file Component1DConnection.h.

72  {
74  }
std::vector< SubdomainName > _connected_subdomain_names
Vector of subdomain names of the connected components.

◆ getConnections()

const std::vector<Connection>& Component1DConnection::getConnections ( ) const
inlineinherited

Returns the vector of connections of this component.

Returns
vector of connections of this component

Definition at line 56 of file Component1DConnection.h.

Referenced by GateValve1Phase::check(), Component1DBoundary::Component1DBoundary(), JunctionOneToOne1Phase::init(), and Component1DJunction::setupMesh().

56 { return _connections; }
std::vector< Connection > _connections
Vector of connections of this component.

◆ getCoordSysTypes()

const std::vector< Moose::CoordinateSystemType > & Component::getCoordSysTypes ( ) const
virtualinherited

Gets the coordinate system types for this component.

Returns
vector of coordinate system types for this component

Definition at line 315 of file Component.C.

316 {
318 
319  return _coord_sys;
320 }
std::vector< Moose::CoordinateSystemType > _coord_sys
List of coordinate system for each subdomain.
Definition: Component.h:464
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117

◆ getDependencies()

const std::vector<std::string>& Component::getDependencies ( ) const
inlineinherited

Returns a list of names of components that this component depends upon.

Definition at line 85 of file Component.h.

85 { return _dependencies; }
std::vector< std::string > _dependencies
List of names of components that this component depends upon.
Definition: Component.h:491

◆ getElementIDs()

const std::vector< dof_id_type > & Component::getElementIDs ( ) const
inherited

Gets the element IDs corresponding to this component.

Definition at line 299 of file Component.C.

Referenced by HeatTransferFromHeatStructure3D1Phase::setupMesh().

300 {
302 
303  return _elem_ids;
304 }
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
Definition: Component.h:457
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117

◆ getEnumParam()

template<typename T >
T Component::getEnumParam ( const std::string &  param) const
inherited

Gets an enum parameter.

This function takes the name of a MooseEnum parameter that is tied to an enum defined in THM. If the value is invalid, an error will be logged, and a negative integer will be cast into the enum type.

Template Parameters
Tenum type
Parameters
[in]paramname of the MooseEnum parameter

Definition at line 539 of file Component.h.

540 {
541  const MooseEnum & moose_enum = getParam<MooseEnum>(param);
542  const T value = THM::stringToEnum<T>(moose_enum);
543  if (static_cast<int>(value) < 0) // cast necessary for scoped enums
544  {
545  // Get the keys from the MooseEnum. Unfortunately, this returns a list of
546  // *all* keys, including the invalid key that was supplied. Thus, that key
547  // needs to be manually excluded below.
548  const std::vector<std::string> & keys = moose_enum.getNames();
549 
550  // Create the string of keys to go in the error message. The last element of
551  // keys is skipped because the invalid key should always be last.
552  std::string keys_string = "{";
553  for (unsigned int i = 0; i < keys.size() - 1; ++i)
554  {
555  if (i != 0)
556  keys_string += ",";
557  keys_string += "'" + keys[i] + "'";
558  }
559  keys_string += "}";
560 
561  logError("The parameter '" + param + "' was given an invalid value ('" +
562  std::string(moose_enum) + "'). Valid values (case-insensitive) are " + keys_string);
563  }
564 
565  return value;
566 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
std::vector< std::string > getNames() const

◆ getFluidPropertiesName()

const UserObjectName & FlowJunction::getFluidPropertiesName ( ) const
inherited

Gets the name of fluid properties used in all flow connections.

Returns
name of fluid properties used in all flow connections

Definition at line 78 of file FlowJunction.C.

79 {
81 
82  return _fp_name;
83 }
mesh set up, called primary init
Definition: Component.h:40
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117
UserObjectName _fp_name
Fluid property user object name.
Definition: FlowJunction.h:38

◆ getMomentofInertiaVariableName()

VariableName ShaftConnectable::getMomentofInertiaVariableName ( ) const
virtualinherited

Definition at line 36 of file ShaftConnectable.C.

37 {
39 }
VariableName _moment_of_inertia_var_name
Moment of inertia variable name.

◆ getNodeIDs()

const std::vector< dof_id_type > & Component1DConnection::getNodeIDs ( ) const
virtualinherited

Gets the list of boundary nodes connected to this component.

Returns
list of connected boundary nodes

Definition at line 143 of file Component1DConnection.C.

144 {
146 
147  return _nodes;
148 }
std::vector< dof_id_type > _nodes
Boundary node IDs from connected components.
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117

◆ getShaftConnectedUserObjectName()

virtual UserObjectName ShaftConnectedCompressor1Phase::getShaftConnectedUserObjectName ( ) const
inlineoverridevirtual

Reimplemented from ShaftConnectable.

Definition at line 25 of file ShaftConnectedCompressor1Phase.h.

Referenced by addMooseObjects(), and buildVolumeJunctionUserObject().

26  {
27  return _junction_uo_name;
28  }
const std::string _junction_uo_name
Name of junction user object name, if any.
Definition: FlowJunction.h:40

◆ getSubdomainNames()

const std::vector< SubdomainName > & Component::getSubdomainNames ( ) const
virtualinherited

Gets the subdomain names for this component.

Returns
vector of subdomain names for this component

Definition at line 307 of file Component.C.

Referenced by Closures1PhaseBase::addAverageWallTemperatureMaterial(), FlowModel::addCommonInitialConditions(), FlowModel::addCommonMooseObjects(), FlowChannelBase::addCommonObjects(), FlowModel::addCommonVariables(), HeatStructureBase::addConstantDensitySolidPropertiesMaterial(), FlowModel1PhaseBase::addDensityAux(), FlowModelSinglePhase::addDensityIC(), FlowModelGasMix::addDensityIC(), FlowModel1PhaseBase::addEnergyGravityKernel(), FlowModelSinglePhase::addFluidPropertiesMaterials(), FlowModelGasMix::addFluidPropertiesMaterials(), FlowModel1PhaseBase::addFunctionIC(), HeatConductionModel::addHeatEquationRZ(), HeatConductionModel::addHeatEquationXYZ(), FlowChannel1PhaseBase::addHydraulicDiameterMaterial(), HeatConductionModel::addInitialConditions(), VolumeJunction1Phase::addJunctionIC(), VolumeJunction1Phase::addJunctionVariable(), FlowModelGasMix::addMassDiffusionEnergyDGKernel(), FlowModelGasMix::addMassDiffusionSpeciesDGKernel(), FlowModelGasMix::addMassFractionAux(), HeatConductionModel::addMaterials(), FlowModel1PhaseBase::addMomentumAreaGradientKernel(), FlowModel1PhaseBase::addMomentumFrictionKernel(), FlowModel1PhaseBase::addMomentumGravityKernel(), HeatSourceVolumetric1Phase::addMooseObjects(), VolumeJunction1Phase::addMooseObjects(), addMooseObjects(), ShaftConnectedPump1Phase::addMooseObjects(), ShaftConnectedTurbine1Phase::addMooseObjects(), SimpleTurbine1Phase::addMooseObjects(), HeatTransferFromHeatStructure1Phase::addMooseObjects(), FlowChannelBase::addMooseObjects(), FunctorClosures::addMooseObjectsFlowChannel(), Closures1PhaseSimple::addMooseObjectsHeatTransfer(), FlowModelSinglePhase::addPressureAux(), FlowModelGasMix::addPressureAux(), FlowModelSinglePhase::addRDGAdvectionDGKernels(), FlowModelGasMix::addRDGAdvectionDGKernels(), FlowModel1PhaseBase::addRhoAIC(), FlowModelSinglePhase::addRhoEAIC(), FlowModelGasMix::addRhoEAIC(), FlowModel1PhaseBase::addRhoUAIC(), FlowModelSinglePhase::addSlopeReconstructionMaterial(), FlowModelGasMix::addSlopeReconstructionMaterial(), FlowModel1PhaseBase::addSpecificInternalEnergyAux(), FlowModel1PhaseBase::addSpecificInternalEnergyIC(), FlowModel1PhaseBase::addSpecificTotalEnthalpyAux(), FlowModel1PhaseBase::addSpecificTotalEnthalpyIC(), FlowModel1PhaseBase::addSpecificVolumeAux(), FlowModel1PhaseBase::addSpecificVolumeIC(), FlowModelSinglePhase::addTemperatureAux(), FlowModelGasMix::addTemperatureAux(), Closures1PhaseTHM::addTemperatureWallFromHeatFluxMaterial(), FlowModel1PhaseBase::addTimeDerivativeKernelIfTransient(), HSBoundaryExternalAppTemperature::addVariables(), HSBoundaryExternalAppConvection::addVariables(), FlowModel1PhaseBase::addVariables(), FlowModelGasMix::addVariables(), HSBoundaryExternalAppHeatFlux::addVariables(), HeatConductionModel::addVariables(), FlowChannelBase::addVariables(), FlowModel1PhaseBase::addVelocityAux(), FlowModel1PhaseBase::addVelocityIC(), VolumeJunction1Phase::addVolumeJunctionIC(), Closures1PhaseTHM::addWallFFMaterial(), Closures1PhaseBase::addWallFrictionFunctionMaterial(), Closures1PhaseTHM::addWallHTCMaterial(), ClosuresBase::addWallTemperatureFromAuxMaterial(), Closures1PhaseSimple::addWallTemperatureFromHeatFluxMaterial(), ClosuresBase::addWeightedAverageMaterial(), FlowModelGasMix::addXiRhoAIC(), ClosuresBase::addZeroMaterial(), FileMeshPhysicsComponent::getBlocks(), FormLoss1PhaseBase::init(), FileMeshPhysicsComponent::init(), HeatTransferFromHeatStructure3D1Phase::init(), HeatTransferBase::init(), and Component1DConnection::init().

308 {
310 
311  return _subdomain_names;
312 }
std::vector< SubdomainName > _subdomain_names
List of subdomain names this components owns.
Definition: Component.h:462
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117

◆ getTHMProblem()

THMProblem & Component::getTHMProblem ( ) const
inherited

Gets the THM problem.

Definition at line 135 of file Component.C.

Referenced by FlowChannelBase::addCommonObjects(), HeatStructureBase::addConstantDensitySolidPropertiesMaterial(), HeatTransferBase::addHeatedPerimeter(), HeatTransferFromTemperature1Phase::addHeatTransferKernels(), FlowChannel1PhaseBase::addHydraulicDiameterMaterial(), VolumeJunction1Phase::addJunctionIC(), VolumeJunction1Phase::addJunctionVariable(), FormLossFromFunction1Phase::addMooseObjects(), InletFunction1Phase::addMooseObjects(), HSBoundarySpecifiedTemperature::addMooseObjects(), InletMassFlowRateTemperature1Phase::addMooseObjects(), SolidWall1Phase::addMooseObjects(), HSBoundaryAmbientConvection::addMooseObjects(), HeatSourceFromTotalPower::addMooseObjects(), HSBoundaryHeatFlux::addMooseObjects(), InletStagnationPressureTemperature1Phase::addMooseObjects(), HeatTransferFromHeatFlux1Phase::addMooseObjects(), HeatStructure2DCoupler::addMooseObjects(), HSBoundaryRadiation::addMooseObjects(), HeatStructure2DRadiationCouplerRZ::addMooseObjects(), InletDensityVelocity1Phase::addMooseObjects(), InletVelocityTemperature1Phase::addMooseObjects(), Outlet1Phase::addMooseObjects(), HeatSourceFromPowerDensity::addMooseObjects(), GateValve1Phase::addMooseObjects(), HeatSourceVolumetric1Phase::addMooseObjects(), HSBoundaryExternalAppTemperature::addMooseObjects(), Shaft::addMooseObjects(), FormLossFromExternalApp1Phase::addMooseObjects(), HeatTransferFromSpecifiedTemperature1Phase::addMooseObjects(), TotalPower::addMooseObjects(), VolumeJunction1Phase::addMooseObjects(), FreeBoundary1Phase::addMooseObjects(), HeatTransferFromExternalAppHeatFlux1Phase::addMooseObjects(), addMooseObjects(), ShaftConnectedMotor::addMooseObjects(), ShaftConnectedPump1Phase::addMooseObjects(), ShaftConnectedTurbine1Phase::addMooseObjects(), FormLoss1PhaseBase::addMooseObjects(), SolidWallGasMix::addMooseObjects(), HSBoundaryExternalAppConvection::addMooseObjects(), HeatStructureBase::addMooseObjects(), HeatTransferBase::addMooseObjects(), SimpleTurbine1Phase::addMooseObjects(), HeatTransferFromHeatStructure3D1Phase::addMooseObjects(), HSCoupler2D2DRadiation::addMooseObjects(), HSCoupler2D3D::addMooseObjects(), HeatTransferFromHeatStructure1Phase::addMooseObjects(), HSBoundaryExternalAppHeatFlux::addMooseObjects(), JunctionOneToOne1Phase::addMooseObjects(), FlowChannelBase::addMooseObjects(), HeatTransferFromExternalAppTemperature1Phase::addVariables(), FormLossFromExternalApp1Phase::addVariables(), TotalPower::addVariables(), TotalPowerBase::addVariables(), HeatTransferFromTemperature1Phase::addVariables(), HSBoundaryExternalAppTemperature::addVariables(), HeatTransferFromSpecifiedTemperature1Phase::addVariables(), Shaft::addVariables(), HeatTransferFromExternalAppHeatFlux1Phase::addVariables(), HSBoundaryExternalAppConvection::addVariables(), HeatTransferFromHeatStructure3D1Phase::addVariables(), HeatTransferFromHeatStructure1Phase::addVariables(), HSBoundaryExternalAppHeatFlux::addVariables(), FlowChannelBase::addVariables(), VolumeJunction1Phase::addVolumeJunctionIC(), FlowBoundary1Phase::addWeakBCs(), FlowBoundaryGasMix::addWeakBCs(), FlowChannel1PhaseBase::buildFlowModel(), HeatStructureInterface::buildModel(), Pump1Phase::buildVolumeJunctionUserObject(), JunctionParallelChannels1Phase::buildVolumeJunctionUserObject(), SimpleTurbine1Phase::buildVolumeJunctionUserObject(), buildVolumeJunctionUserObject(), ShaftConnectedTurbine1Phase::buildVolumeJunctionUserObject(), ShaftConnectedPump1Phase::buildVolumeJunctionUserObject(), VolumeJunction1Phase::buildVolumeJunctionUserObject(), Shaft::check(), VolumeJunction1Phase::check(), FlowChannel1PhaseBase::check(), HeatStructureInterface::check(), FlowChannelGasMix::checkFluidProperties(), FlowChannel1Phase::checkFluidProperties(), GeometricalComponent::getVariableFn(), FlowJunction1Phase::init(), FlowBoundary1PhaseBase::init(), FlowBoundary::init(), FlowJunction::init(), Component1DConnection::init(), FlowChannelBase::init(), Component::problemIsTransient(), HeatStructure2DCouplerBase::setupMesh(), GateValve1Phase::setupMesh(), HSCoupler2D3D::setupMesh(), HSCoupler2D2DRadiation::setupMesh(), JunctionOneToOne1Phase::setupMesh(), HeatTransferFromHeatStructure1Phase::setupMesh(), VolumeJunction1Phase::setupMesh(), and HeatTransferFromHeatStructure3D1Phase::setupMesh().

136 {
137  return _sim;
138 }
THMProblem & _sim
THM problem this component is part of TODO: make _sim private (applications need to switch to getters...
Definition: Component.h:443

◆ getTorqueVariableName()

VariableName ShaftConnectable::getTorqueVariableName ( ) const
virtualinherited

Definition at line 42 of file ShaftConnectable.C.

43 {
44  return _torque_var_name;
45 }
VariableName _torque_var_name
Torque of variable name.

◆ hasComponent()

template<typename T >
bool Component::hasComponent ( const std::string &  name) const
inherited

Check the existence and type of a component via a parameter name.

Template Parameters
Tthe type of the component we are requesting
Parameters
nameThe parameter name that has the component name
Returns
true if the component with given name and type exists, otherwise false

Definition at line 521 of file Component.h.

522 {
523  const std::string & comp_name = getParam<std::string>(pname);
524  return hasComponentByName<T>(comp_name);
525 }

◆ hasComponentByName()

template<typename T >
bool Component::hasComponentByName ( const std::string &  cname) const
inherited

Check the existence and type of a component given its name.

Template Parameters
Tthe type of the component we are requesting
Parameters
cnameThe name of the component
Returns
true if the component with given name and type exists, otherwise false

Definition at line 529 of file Component.h.

530 {
531  if (_sim.hasComponentOfType<T>(comp_name))
532  return true;
533  else
534  return false;
535 }
THMProblem & _sim
THM problem this component is part of TODO: make _sim private (applications need to switch to getters...
Definition: Component.h:443
bool hasComponentOfType(const std::string &name) const
Find out if simulation has a component with the given name and specified type.
Definition: Simulation.h:493

◆ hasParam()

template<typename T >
bool Component::hasParam ( const std::string &  name) const
inherited

Test if a parameter exists in the object's input parameters.

Parameters
nameThe name of the parameter
Returns
true if the parameter exists, false otherwise

Definition at line 499 of file Component.h.

500 {
501  return parameters().have_parameter<T>(name);
502 }
virtual const std::string & name() const
bool have_parameter(std::string_view name) const
const InputParameters & parameters() const

◆ init()

void FlowJunction1Phase::init ( )
overrideprotectedvirtualinherited

Initializes the component.

The reason this function exists (as opposed to just having everything in the constructor) is because some initialization depends on all components existing, since many components couple to other components. Therefore, when deciding whether code should go into the constructor or this function, one should use the following reasoning: if an operation does not require the existence of other components, then put that operation in the constructor; otherwise, put it in this function.

Reimplemented from FlowJunction.

Reimplemented in JunctionOneToOne1Phase.

Definition at line 23 of file FlowJunction1Phase.C.

Referenced by JunctionOneToOne1Phase::init().

24 {
26 
27  for (const auto & connection : _connections)
28  {
29  const std::string comp_name = connection._component_name;
30  if (hasComponentByName<FlowChannel1Phase>(comp_name))
31  {
32  const FlowChannel1Phase & comp =
34 
36  }
37  }
38 }
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
virtual void init() override
Initializes the component.
Definition: FlowJunction.C:29
std::vector< Connection > _connections
Vector of connections of this component.
const UserObjectName & getNumericalFluxUserObjectName() const
Gets the numerical flux user object name.
Single-component, single-phase flow channel.
std::vector< UserObjectName > _numerical_flux_names
const T & getComponentByName(const std::string &name) const
Get component by its name.
Definition: Simulation.h:504

◆ initSecondary()

void Component1DJunction::initSecondary ( )
overrideprotectedvirtualinherited

Perform secondary initialization, which relies on init() being called for all components.

Reimplemented from Component.

Definition at line 71 of file Component1DJunction.C.

72 {
74 
75  for (auto & eid : _connected_elems)
76  {
77  const Elem * elem = constMesh().queryElemPtr(eid);
78  if (elem != nullptr && elem->processor_id() == processor_id())
79  _proc_ids.push_back(elem->processor_id());
80  else
81  _proc_ids.push_back(0);
82  }
83  comm().sum(_proc_ids);
84 }
std::vector< processor_id_type > _proc_ids
Processor IDs of connected 1D components.
const Parallel::Communicator & comm() const
virtual Elem * queryElemPtr(const dof_id_type i)
std::vector< dof_id_type > _connected_elems
Element IDs of connected 1D components.
virtual void initSecondary()
Perform secondary initialization, which relies on init() being called for all components.
Definition: Component.h:296
const THMMesh & constMesh() const
Const reference to mesh, which can be called at any point.
Definition: Component.h:62
processor_id_type processor_id() const

◆ insistParameterExists()

template<typename T >
void Component::insistParameterExists ( const std::string &  function_name,
const std::string &  param_name 
) const
protectedinherited

Runtime check to make sure that a parameter of specified type exists in the component's input parameters.

This is intended to help developers write code. The idea is to provide a useful message when developers make typos, etc. If this check fails, the code execution will be stopped.

Template Parameters
TThe type of the parameter to be checked
Parameters
function_nameThe name of the function calling this method
param_nameThe name of the parameter to be checked

Definition at line 570 of file Component.h.

572 {
573  if (!hasParam<T>(param_name))
574  mooseError(name(),
575  ": Calling ",
576  function_name,
577  " failed, parameter '",
578  param_name,
579  "' does not exist or does not have the type you requested. Double check your "
580  "spelling and/or type of the parameter.");
581 }
virtual const std::string & name() const
void mooseError(Args &&... args) const

◆ junctionVariableName()

std::string VolumeJunction1Phase::junctionVariableName ( const std::string &  var_base) const
protectedinherited

Returns the name of junction variable, depending on whether scalar.

Parameters
[in]var_baseBase variable name

Definition at line 297 of file VolumeJunction1Phase.C.

298 {
299  return var_base;
300 }

◆ logComponentError()

template<typename... Args>
void LoggingInterface::logComponentError ( const std::string &  component_name,
Args &&...  args 
) const
inlineinherited

Logs an error for a component.

Parameters
[in]component_nameName of the component

Definition at line 47 of file LoggingInterface.h.

Referenced by Closures1PhaseSimple::checkFlowChannel(), Closures1PhaseSimple::checkHeatTransfer(), and Component::logError().

48  {
49  _log.add(Logger::ERROR, component_name, ": ", std::forward<Args>(args)...);
50  }
void add(EMessageType type, Args &&... args)
Add a message to the log.
Definition: Logger.h:35

◆ logComponentWarning()

template<typename... Args>
void LoggingInterface::logComponentWarning ( const std::string &  component_name,
Args &&...  args 
) const
inlineinherited

Logs a warning for a component.

Parameters
[in]component_nameName of the component

Definition at line 67 of file LoggingInterface.h.

Referenced by Component::logWarning().

68  {
69  _log.add(Logger::WARNING, component_name, ": ", std::forward<Args>(args)...);
70  }
void add(EMessageType type, Args &&... args)
Add a message to the log.
Definition: Logger.h:35

◆ logError()

template<typename... Args>
void Component::logError ( Args &&...  args) const
inlineinherited

Logs an error.

Definition at line 215 of file Component.h.

Referenced by Component1DConnection::addConnection(), HSBoundary::check(), HeatSourceBase::check(), Component1DJunction::check(), SupersonicInlet::check(), HSBoundaryExternalAppHeatFlux::check(), Outlet1Phase::check(), HeatStructure2DCoupler::check(), InletStagnationEnthalpyMomentum1Phase::check(), InletMassFlowRateTemperature1Phase::check(), InletVelocityTemperature1Phase::check(), InletDensityVelocity1Phase::check(), InletStagnationPressureTemperature1Phase::check(), HeatStructure2DRadiationCouplerRZ::check(), HeatTransferFromExternalAppTemperature1Phase::check(), GeneratedMeshComponent::check(), HeatStructure2DCouplerBase::check(), Shaft::check(), HSCoupler2D2DRadiation::check(), HSCoupler2D3D::check(), HeatTransferFromHeatStructure1Phase::check(), VolumeJunction1Phase::check(), HeatTransferFromHeatStructure3D1Phase::check(), FlowChannel1PhaseBase::check(), HeatStructureInterface::check(), Component2D::check(), FlowChannelBase::check(), HSBoundary::checkAllComponent2DBoundariesAreExternal(), Component1DConnection::checkAllConnectionsHaveSame(), Component::checkComponentExistsByName(), Component::checkComponentOfTypeExistsByName(), Component::checkEqualSize(), FlowChannel1Phase::checkFluidProperties(), FlowChannelGasMix::checkFluidProperties(), Component::checkMutuallyExclusiveParameters(), Component1DConnection::checkNumberOfConnections(), Component::checkParameterValueLessThan(), Component1DConnection::checkSizeEqualsNumberOfConnections(), Component::checkSizeEqualsParameterValue(), Component::checkSizeEqualsValue(), Component::checkSizeGreaterThan(), Component::checkSizeLessThan(), ElbowPipe1Phase::ElbowPipe1Phase(), FreeBoundary::FreeBoundary(), GateValve::GateValve(), Component::getEnumParam(), HeatTransferFromHeatStructure3D1Phase::getFlowChannelAxisAlignment(), HeatGeneration::HeatGeneration(), HeatSourceVolumetric::HeatSourceVolumetric(), HeatStructureFromFile3D::HeatStructureFromFile3D(), HeatTransferFromHeatStructure3D1Phase::init(), Component1DConnection::init(), HeatTransfer1PhaseBase::initSecondary(), JunctionOneToOne::JunctionOneToOne(), LoggerTestComponent::LoggerTestComponent(), PrescribedReactorPower::PrescribedReactorPower(), Component1DConnection::setupMesh(), and SolidWall::SolidWall().

216  {
217  logComponentError(cname(), std::forward<Args>(args)...);
218  }
const std::string & cname() const
Get the component name.
Definition: Component.C:51
void logComponentError(const std::string &component_name, Args &&... args) const
Logs an error for a component.

◆ logWarning()

template<typename... Args>
void Component::logWarning ( Args &&...  args) const
inlineinherited

Logs a warning.

Definition at line 224 of file Component.h.

Referenced by GateValve1Phase::check(), LoggerTestComponent::LoggerTestComponent(), and VolumeJunction1Phase::VolumeJunction1Phase().

225  {
226  logComponentWarning(cname(), std::forward<Args>(args)...);
227  }
const std::string & cname() const
Get the component name.
Definition: Component.C:51
void logComponentWarning(const std::string &component_name, Args &&... args) const
Logs a warning for a component.

◆ makeFunctionControllableIfConstant()

void Component::makeFunctionControllableIfConstant ( const FunctionName &  fn_name,
const std::string &  control_name,
const std::string &  param = "value" 
) const
inherited

Makes a function controllable if it is constant.

Parameters
[in]fn_namename of the function
[in]control_namename of control parameter
[in]paramname of controlled parameter

Definition at line 141 of file Component.C.

Referenced by FlowModel::addCommonInitialConditions(), FlowChannelBase::addCommonObjects(), HeatTransferBase::addHeatedPerimeter(), FlowChannel1PhaseBase::addHydraulicDiameterMaterial(), HSBoundarySpecifiedTemperature::addMooseObjects(), ShaftConnectedMotor::addMooseObjects(), Closures1PhaseSimple::addMooseObjectsHeatTransfer(), HeatTransferFromSpecifiedTemperature1Phase::addVariables(), and Closures1PhaseBase::addWallFrictionFunctionMaterial().

144 {
145  const Function & fn = _sim.getFunction(fn_name);
146  if (dynamic_cast<const ConstantFunction *>(&fn) != nullptr)
147  connectObject(fn.parameters(), fn_name, control_name, param);
148 }
THMProblem & _sim
THM problem this component is part of TODO: make _sim private (applications need to switch to getters...
Definition: Component.h:443
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
void connectObject(const InputParameters &params, const std::string &mooseName, const std::string &name) const
Connect with control logic.
Definition: Component.C:98
const InputParameters & parameters() const

◆ mesh()

THMMesh & Component::mesh ( )
inherited

Non-const reference to THM mesh, which can only be called before the end of mesh setup.

Definition at line 60 of file Component.C.

Referenced by GeometricalComponent::addElement(), GeometricalComponent::addElementEdge2(), GeometricalComponent::addElementEdge3(), GeometricalComponent::addElementQuad4(), GeometricalComponent::addElementQuad9(), Component::addNode(), Component::addNodeElement(), Component2D::build2DMesh(), Component2D::build2DMesh2ndOrder(), Component2D::buildMesh(), FileMeshComponent::buildMesh(), Component1D::buildMesh(), Component::setSubdomainInfo(), Component1DJunction::setupMesh(), Component1DBoundary::setupMesh(), GeneratedMeshComponent::setupMesh(), VolumeJunction1Phase::setupMesh(), and FileMeshComponent::setupMesh().

61 {
63  mooseError(
64  "A non-const reference to the THM mesh cannot be obtained after mesh setup is complete.");
65  else
66  return _mesh;
67 }
EComponentSetupStatus _component_setup_status
Component setup status.
Definition: Component.h:488
void mooseError(Args &&... args) const
THMMesh & _mesh
The THM mesh TODO: make _mesh private (applications need to switch to getters to avoid breaking) ...
Definition: Component.h:452

◆ parent()

Component* Component::parent ( )
inlineinherited

Definition at line 54 of file Component.h.

54 { return _parent; }
Component * _parent
Pointer to a parent component (used in composed components)
Definition: Component.h:438

◆ passParameter() [1/2]

template<typename T >
void THMObject::passParameter ( const std::string &  name,
const std::string &  new_name,
InputParameters params 
) const
protectedinherited

Passes a parameter from this object's input parameters to another set of input parameters.

Template Parameters
Tthe type of the parameter to be passed
Parameters
name[in]name the name of this object's parameter
new_name[in]new_name the name of the corresponding parameters in params
params[in,out]params the parameters to which the parameter will be passed

Definition at line 54 of file THMObject.h.

57 {
58  if (isParamValid(name))
59  params.set<T>(new_name) = _pars.get<T>(name);
60 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
T & set(const std::string &name, bool quiet_mode=false)
virtual const std::string & name() const
bool isParamValid(const std::string &name) const
const InputParameters & _pars

◆ passParameter() [2/2]

template<typename T >
void THMObject::passParameter ( const std::string &  name,
InputParameters params 
) const
protectedinherited

Passes a parameter from this object's input parameters to another set of input parameters.

This version overloads the other by assuming that the parameter has the same name.

Template Parameters
Tthe type of the parameter to be passed
Parameters
name[in]name the name of the parameter
params[in,out]params the parameters to which the parameter will be passed

Definition at line 64 of file THMObject.h.

65 {
66  passParameter<T>(name, name, params);
67 }
virtual const std::string & name() const

◆ problemIsTransient()

bool Component::problemIsTransient ( ) const
inlineinherited

Whether the problem is transient.

Definition at line 252 of file Component.h.

Referenced by HeatConductionModel::addHeatEquationRZ(), HeatConductionModel::addHeatEquationXYZ(), and FlowModel1PhaseBase::addTimeDerivativeKernelIfTransient().

252 { return getTHMProblem().isTransient(); }
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
virtual bool isTransient() const override

◆ setShaftName()

void ShaftConnectable::setShaftName ( const std::string &  name) const
virtualinherited

Definition at line 54 of file ShaftConnectable.C.

Referenced by Shaft::init().

55 {
56  _shaft_name = name;
57  _connected_to_shaft = true;
58 }
bool _connected_to_shaft
Flag indicating that a shaft has this component connected.
std::string _shaft_name
Name of the shaft component.
const std::string name
Definition: Setup.h:20

◆ setSubdomainInfo()

void Component::setSubdomainInfo ( SubdomainID  subdomain_id,
const std::string &  subdomain_name,
const Moose::CoordinateSystemType coord_system = Moose::COORD_XYZ 
)
protectedvirtualinherited

Sets the next subdomain ID, name, and coordinate system.

Parameters
[in]subdomain_idsubdomain index
[in]subdomain_namename of the new subdomain
[in]coord_systemtype of coordinate system

Definition at line 229 of file Component.C.

Referenced by Component2D::buildMesh(), FileMeshComponent::buildMesh(), Component1D::buildMesh(), and VolumeJunction1Phase::setupMesh().

232 {
233  _subdomain_ids.push_back(subdomain_id);
234  _subdomain_names.push_back(subdomain_name);
235  _coord_sys.push_back(coord_system);
236  if (_parent)
237  {
238  _parent->_subdomain_ids.push_back(subdomain_id);
239  _parent->_subdomain_names.push_back(subdomain_name);
240  _parent->_coord_sys.push_back(coord_system);
241  }
242  mesh().setSubdomainName(subdomain_id, subdomain_name);
243 }
std::vector< SubdomainName > _subdomain_names
List of subdomain names this components owns.
Definition: Component.h:462
Component * _parent
Pointer to a parent component (used in composed components)
Definition: Component.h:438
std::vector< Moose::CoordinateSystemType > _coord_sys
List of coordinate system for each subdomain.
Definition: Component.h:464
void setSubdomainName(SubdomainID subdomain_id, const SubdomainName &name)
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
std::vector< SubdomainID > _subdomain_ids
List of subdomain IDs this components owns.
Definition: Component.h:460

◆ setupMesh()

void VolumeJunction1Phase::setupMesh ( )
overrideprotectedvirtualinherited

Performs mesh setup such as creating mesh or naming mesh sets.

Reimplemented from Component1DJunction.

Definition at line 90 of file VolumeJunction1Phase.C.

91 {
93 
94  // Add a NodeElem to the mesh
95  auto * node = addNode(_position);
96  auto * elem = addNodeElement(node->id());
98  elem->subdomain_id() = _junction_subdomain_id;
100 
101  // Add coupling between the flow channel end elements and the NodeElem
102  const auto & elem_ids = getConnectedElementIDs();
103  for (unsigned int i = 0; i < elem_ids.size(); i++)
104  getTHMProblem().augmentSparsity(elem_ids[i], elem->id());
105 }
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
virtual void setSubdomainInfo(SubdomainID subdomain_id, const std::string &subdomain_name, const Moose::CoordinateSystemType &coord_system=Moose::COORD_XYZ)
Sets the next subdomain ID, name, and coordinate system.
Definition: Component.C:229
Node * addNode(const Point &pt)
Definition: Component.C:213
virtual const std::string & name() const
Elem * addNodeElement(dof_id_type node)
Definition: Component.C:221
const std::vector< dof_id_type > & getConnectedElementIDs()
Gets the element IDs of the connected 1D components.
virtual SubdomainID getNextSubdomainId()
Gets the next subdomain ID.
Definition: THMMesh.C:202
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
const Point & _position
Spatial position of center of the junction.
subdomain_id_type _junction_subdomain_id
Junction subdomain ID.
virtual void augmentSparsity(const dof_id_type &elem_id1, const dof_id_type &elem_id2)
Hint how to augment sparsity pattern between two elements.
Definition: Simulation.C:71

◆ stringify()

std::string Component::stringify ( EComponentSetupStatus  status) const
inherited

Return a string for the setup status.

Definition at line 271 of file Component.C.

Referenced by Component::checkSetupStatus().

272 {
273  switch (status)
274  {
275  case CREATED:
276  return "component created";
277  case MESH_PREPARED:
278  return "component mesh set up";
279  case INITIALIZED_PRIMARY:
280  return "primary initialization completed";
282  return "secondary initialization completed";
283  case CHECKED:
284  return "component fully set up and checked";
285  default:
286  mooseError("Should not reach here");
287  }
288 }
only created
Definition: Component.h:38
MPI_Status status
mesh set up, called primary init
Definition: Component.h:40
mesh set up, called both inits
Definition: Component.h:41
void mooseError(Args &&... args) const
mesh set up, called both inits, checked
Definition: Component.h:42

◆ validParams()

InputParameters ShaftConnectedCompressor1Phase::validParams ( )
static

Definition at line 23 of file ShaftConnectedCompressor1Phase.C.

24 {
27  params.makeParamRequired<Real>("A_ref");
28  params.addRequiredParam<BoundaryName>("inlet", "Compressor inlet");
29  params.addRequiredParam<BoundaryName>("outlet", "Compressor outlet");
30  params.set<std::vector<BoundaryName>>("connections") = {};
31  params.suppressParameter<std::vector<BoundaryName>>("connections");
32  params.addParam<bool>("treat_as_turbine", false, "Treat the compressor as a turbine?");
33  params.addRequiredParam<Real>("omega_rated", "Rated compressor speed [rad/s]");
34  params.addRequiredParam<Real>("mdot_rated", "Rated compressor mass flow rate [kg/s]");
35  params.addRequiredParam<Real>("rho0_rated", "Rated compressor stagnation fluid density [kg/m^3]");
36  params.addRequiredParam<Real>("c0_rated", "Rated compressor stagnation sound speed [m/s]");
37  params.addRequiredParam<Real>("speed_cr_fr", "Compressor speed threshold for friction [-]");
38  params.addRequiredParam<Real>("tau_fr_const", "Compressor friction constant [N-m]");
39  params.addRequiredParam<std::vector<Real>>("tau_fr_coeff",
40  "Compressor friction coefficients [N-m]");
41  params.addRequiredParam<Real>("speed_cr_I", "Compressor speed threshold for inertia [-]");
42  params.addRequiredParam<Real>("inertia_const", "Compressor inertia constant [kg-m^2]");
43  params.addRequiredParam<std::vector<Real>>("inertia_coeff",
44  "Compressor inertia coefficients [kg-m^2]");
45  params.addRequiredParam<std::vector<Real>>(
46  "speeds",
47  "Relative corrected speeds. Order of speeds needs correspond to the "
48  "orders of `Rp_functions` and `eff_functions` [-]");
49  params.addRequiredParam<std::vector<FunctionName>>(
50  "Rp_functions",
51  "Functions of pressure ratio versus relative corrected flow. Each function is for a "
52  "different, constant relative corrected speed. The order of function names should correspond "
53  "to the order of speeds in the `speeds` parameter [-]");
54  params.addRequiredParam<std::vector<FunctionName>>(
55  "eff_functions",
56  "Functions of adiabatic efficiency versus relative corrected flow. Each function is for a "
57  "different, constant relative corrected speed. The order of function names should correspond "
58  "to the order of speeds in the `speeds` parameter [-]");
59  params.addParam<Real>("min_pressure_ratio", 0.0, "Minimum pressure ratio");
60  params.addParam<Real>("max_pressure_ratio", 50.0, "Maximum pressure ratio");
61 
62  params.addClassDescription(
63  "1-phase compressor that must be connected to a Shaft component. Compressor speed "
64  "is controlled by the connected shaft; Isentropic/Dissipation torque and delta_p are "
65  "computed by user input functions of inlet flow rate and shaft speed");
66 
67  return params;
68 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void suppressParameter(const std::string &name)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void makeParamRequired(const std::string &name)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _A_ref

const Real& VolumeJunction1Phase::_A_ref
protectedinherited

◆ _boundary_ids

std::vector<unsigned int> Component1DConnection::_boundary_ids
protectedinherited

Boundary IDs of connected components.

Definition at line 141 of file Component1DConnection.h.

Referenced by Component1DConnection::setupMesh().

◆ _boundary_names

std::vector<BoundaryName> Component1DConnection::_boundary_names
protectedinherited

◆ _c0_rated

const Real& ShaftConnectedCompressor1Phase::_c0_rated
protected

Rated compressor inlet stagnation sound speed.

Definition at line 45 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _connected_component_names

std::vector<std::string> Component1DConnection::_connected_component_names
protectedinherited

◆ _connected_elems

std::vector<dof_id_type> Component1DJunction::_connected_elems
protectedinherited

Element IDs of connected 1D components.

Definition at line 35 of file Component1DJunction.h.

Referenced by Component1DJunction::getConnectedElementIDs(), Component1DJunction::initSecondary(), and Component1DJunction::setupMesh().

◆ _connected_subdomain_names

std::vector<SubdomainName> Component1DConnection::_connected_subdomain_names
protectedinherited

Vector of subdomain names of the connected components.

Definition at line 154 of file Component1DConnection.h.

Referenced by Component1DConnection::getConnectedSubdomainNames(), and Component1DConnection::init().

◆ _connected_to_shaft

bool ShaftConnectable::_connected_to_shaft
mutableprotectedinherited

Flag indicating that a shaft has this component connected.

Definition at line 40 of file ShaftConnectable.h.

Referenced by ShaftConnectable::checkShaftConnection(), and ShaftConnectable::setShaftName().

◆ _connections

std::vector<Connection> Component1DConnection::_connections
protectedinherited

◆ _coord_sys

std::vector<Moose::CoordinateSystemType> Component::_coord_sys
protectedinherited

List of coordinate system for each subdomain.

Definition at line 464 of file Component.h.

Referenced by Component::getCoordSysTypes(), and Component::setSubdomainInfo().

◆ _delta_p_var_name

const VariableName ShaftConnectedCompressor1Phase::_delta_p_var_name
protected

Name of compressor delta_p variable.

Definition at line 66 of file ShaftConnectedCompressor1Phase.h.

Referenced by addMooseObjects(), and addVariables().

◆ _directions

std::vector<RealVectorValue> Component1DConnection::_directions
protectedinherited

◆ _dissipation_torque_var_name

const VariableName ShaftConnectedCompressor1Phase::_dissipation_torque_var_name
protected

Name of compressor dissipation torque variable.

Definition at line 70 of file ShaftConnectedCompressor1Phase.h.

Referenced by addMooseObjects(), and addVariables().

◆ _eff_functions

const std::vector<FunctionName>& ShaftConnectedCompressor1Phase::_eff_functions
protected

Names of the adiabatic efficiency functions.

Definition at line 64 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _elem_ids

std::vector<dof_id_type> Component::_elem_ids
protectedinherited

◆ _elems

std::vector<const Elem *> Component1DConnection::_elems
protectedinherited

Boundary elements of connected components.

Definition at line 135 of file Component1DConnection.h.

Referenced by Component1DBoundary::setupMesh(), and Component1DConnection::setupMesh().

◆ _end_type_to_enum

const std::map< std::string, Component1DConnection::EEndType > Component1DConnection::_end_type_to_enum {{"IN", IN}, {"OUT", OUT}}
staticinherited

Map of end type string to enum.

Definition at line 29 of file Component1DConnection.h.

Referenced by THM::stringToEnum().

◆ _factory

Factory& Component::_factory
protectedinherited

The Factory associated with the MooseApp.

Definition at line 446 of file Component.h.

Referenced by FlowChannelBase::addCommonObjects(), HeatStructureBase::addConstantDensitySolidPropertiesMaterial(), HeatTransferBase::addHeatedPerimeter(), HeatTransferFromTemperature1Phase::addHeatTransferKernels(), FlowChannel1PhaseBase::addHydraulicDiameterMaterial(), FormLossFromFunction1Phase::addMooseObjects(), InletMassFlowRateTemperature1Phase::addMooseObjects(), HSBoundaryRadiation::addMooseObjects(), HSBoundarySpecifiedTemperature::addMooseObjects(), HeatStructure2DCoupler::addMooseObjects(), InletFunction1Phase::addMooseObjects(), HeatStructure2DRadiationCouplerRZ::addMooseObjects(), InletDensityVelocity1Phase::addMooseObjects(), InletStagnationPressureTemperature1Phase::addMooseObjects(), Outlet1Phase::addMooseObjects(), HSBoundaryAmbientConvection::addMooseObjects(), HeatTransferFromHeatFlux1Phase::addMooseObjects(), SolidWall1Phase::addMooseObjects(), InletVelocityTemperature1Phase::addMooseObjects(), HeatSourceFromPowerDensity::addMooseObjects(), HeatSourceFromTotalPower::addMooseObjects(), HSBoundaryHeatFlux::addMooseObjects(), HeatSourceVolumetric1Phase::addMooseObjects(), FormLossFromExternalApp1Phase::addMooseObjects(), Shaft::addMooseObjects(), HeatTransferFromSpecifiedTemperature1Phase::addMooseObjects(), FreeBoundary1Phase::addMooseObjects(), GateValve1Phase::addMooseObjects(), TotalPower::addMooseObjects(), VolumeJunction1Phase::addMooseObjects(), HSBoundaryExternalAppTemperature::addMooseObjects(), SolidWallGasMix::addMooseObjects(), ShaftConnectedTurbine1Phase::addMooseObjects(), addMooseObjects(), HeatTransferFromExternalAppHeatFlux1Phase::addMooseObjects(), FormLoss1PhaseBase::addMooseObjects(), ShaftConnectedMotor::addMooseObjects(), ShaftConnectedPump1Phase::addMooseObjects(), HSBoundaryExternalAppConvection::addMooseObjects(), HSCoupler2D2DRadiation::addMooseObjects(), HSCoupler2D3D::addMooseObjects(), SimpleTurbine1Phase::addMooseObjects(), HeatTransferBase::addMooseObjects(), HeatTransferFromHeatStructure3D1Phase::addMooseObjects(), HeatTransferFromHeatStructure1Phase::addMooseObjects(), HSBoundaryExternalAppHeatFlux::addMooseObjects(), JunctionOneToOne1Phase::addMooseObjects(), FlowChannelBase::addMooseObjects(), Component::addRelationshipManager(), FlowChannelBase::addVariables(), VolumeJunction1Phase::addVolumeJunctionIC(), FlowBoundary1Phase::addWeakBCs(), FlowBoundaryGasMix::addWeakBCs(), FlowChannel1PhaseBase::buildFlowModel(), Pump1Phase::buildVolumeJunctionUserObject(), JunctionParallelChannels1Phase::buildVolumeJunctionUserObject(), SimpleTurbine1Phase::buildVolumeJunctionUserObject(), ShaftConnectedTurbine1Phase::buildVolumeJunctionUserObject(), buildVolumeJunctionUserObject(), ShaftConnectedPump1Phase::buildVolumeJunctionUserObject(), and VolumeJunction1Phase::buildVolumeJunctionUserObject().

◆ _flow_model

std::shared_ptr<const FlowModel> FlowJunction::_flow_model
protectedinherited

Flow model.

Definition at line 36 of file FlowJunction.h.

Referenced by FlowJunction::init().

◆ _flow_model_id

THM::FlowModelID FlowJunction::_flow_model_id
protectedinherited

Flow model ID.

Definition at line 34 of file FlowJunction.h.

Referenced by FlowJunction::init().

◆ _fp_name

UserObjectName FlowJunction::_fp_name
protectedinherited

◆ _friction_torque_var_name

const VariableName ShaftConnectedCompressor1Phase::_friction_torque_var_name
protected

Name of compressor friction torque variable.

Definition at line 72 of file ShaftConnectedCompressor1Phase.h.

Referenced by addMooseObjects(), and addVariables().

◆ _inertia_coeff

const std::vector<Real>& ShaftConnectedCompressor1Phase::_inertia_coeff
protected

Compressor inertia coefficients.

Definition at line 57 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _inertia_const

const Real& ShaftConnectedCompressor1Phase::_inertia_const
protected

Compressor inertia constant.

Definition at line 55 of file ShaftConnectedCompressor1Phase.h.

Referenced by addVariables(), and buildVolumeJunctionUserObject().

◆ _inlet

const BoundaryName& ShaftConnectedCompressor1Phase::_inlet
protected

Compressor inlet.

Definition at line 35 of file ShaftConnectedCompressor1Phase.h.

Referenced by ShaftConnectedCompressor1Phase().

◆ _isentropic_torque_var_name

const VariableName ShaftConnectedCompressor1Phase::_isentropic_torque_var_name
protected

Name of compressor isentropic torque variable.

Definition at line 68 of file ShaftConnectedCompressor1Phase.h.

Referenced by addMooseObjects(), and addVariables().

◆ _junction_subdomain_id

subdomain_id_type Component1DJunction::_junction_subdomain_id
protectedinherited

◆ _junction_uo_name

const std::string FlowJunction::_junction_uo_name
protectedinherited

◆ _K

const Real& VolumeJunction1Phase::_K
protectedinherited

◆ _log

Logger& LoggingInterface::_log
protectedinherited

◆ _mdot_rated

const Real& ShaftConnectedCompressor1Phase::_mdot_rated
protected

Rated compressor mass flow rate.

Definition at line 41 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _mesh

THMMesh& Component::_mesh
protectedinherited

The THM mesh TODO: make _mesh private (applications need to switch to getters to avoid breaking)

Definition at line 452 of file Component.h.

Referenced by Component::addRelationshipManager(), Component::constMesh(), and Component::mesh().

◆ _moi_var_name

const VariableName ShaftConnectedCompressor1Phase::_moi_var_name
protected

Name of compressor inertia variable.

Definition at line 74 of file ShaftConnectedCompressor1Phase.h.

◆ _moment_of_inertia_var_name

VariableName ShaftConnectable::_moment_of_inertia_var_name
protectedinherited

◆ _node_ids

std::vector<dof_id_type> Component::_node_ids
protectedinherited

◆ _nodes

std::vector<dof_id_type> Component1DConnection::_nodes
protectedinherited

◆ _normals

std::vector<Real> Component1DConnection::_normals
protectedinherited

◆ _numerical_flux_names

std::vector<UserObjectName> FlowJunction1Phase::_numerical_flux_names
protectedinherited

◆ _omega_rated

const Real& ShaftConnectedCompressor1Phase::_omega_rated
protected

Rated compressor speed.

Definition at line 39 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _outlet

const BoundaryName& ShaftConnectedCompressor1Phase::_outlet
protected

Compressor outlet.

Definition at line 37 of file ShaftConnectedCompressor1Phase.h.

Referenced by ShaftConnectedCompressor1Phase().

◆ _parent

Component* Component::_parent
protectedinherited

Pointer to a parent component (used in composed components)

Definition at line 438 of file Component.h.

Referenced by HeatStructureBase::addMooseObjects(), Component::cname(), Component::parent(), and Component::setSubdomainInfo().

◆ _position

const Point& VolumeJunction1Phase::_position
protectedinherited

Spatial position of center of the junction.

Definition at line 82 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::setupMesh().

◆ _positions

std::vector<Point> Component1DConnection::_positions
protectedinherited

Physical positions of connected components.

Definition at line 133 of file Component1DConnection.h.

Referenced by Component1DConnection::setupMesh().

◆ _pressure_var_name

const VariableName VolumeJunction1Phase::_pressure_var_name
protectedinherited

pressure variable name for junction

Definition at line 106 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addMooseObjects(), and VolumeJunction1Phase::addVariables().

◆ _proc_ids

std::vector<processor_id_type> Component1DJunction::_proc_ids
protectedinherited

Processor IDs of connected 1D components.

Definition at line 37 of file Component1DJunction.h.

Referenced by Component1DJunction::getConnectedProcessorIDs(), and Component1DJunction::initSecondary().

◆ _rho0_rated

const Real& ShaftConnectedCompressor1Phase::_rho0_rated
protected

Rated compressor inlet stagnation fluid density.

Definition at line 43 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _rhoEV_var_name

const VariableName VolumeJunction1Phase::_rhoEV_var_name
protectedinherited

◆ _rhouV_var_name

const VariableName VolumeJunction1Phase::_rhouV_var_name
protectedinherited

◆ _rhoV_var_name

const VariableName VolumeJunction1Phase::_rhoV_var_name
protectedinherited

◆ _rhovV_var_name

const VariableName VolumeJunction1Phase::_rhovV_var_name
protectedinherited

◆ _rhowV_var_name

const VariableName VolumeJunction1Phase::_rhowV_var_name
protectedinherited

◆ _Rp_functions

const std::vector<FunctionName>& ShaftConnectedCompressor1Phase::_Rp_functions
protected

Names of the pressure ratio functions.

Definition at line 62 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _scaling_factor_rhoEV

const Real& VolumeJunction1Phase::_scaling_factor_rhoEV
protectedinherited

Scaling factor for rho*E*V.

Definition at line 93 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addVariables().

◆ _scaling_factor_rhouV

const Real& VolumeJunction1Phase::_scaling_factor_rhouV
protectedinherited

Scaling factor for rho*u*V.

Definition at line 87 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addVariables().

◆ _scaling_factor_rhoV

const Real& VolumeJunction1Phase::_scaling_factor_rhoV
protectedinherited

Scaling factor for rho*V.

Definition at line 85 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addVariables().

◆ _scaling_factor_rhovV

const Real& VolumeJunction1Phase::_scaling_factor_rhovV
protectedinherited

Scaling factor for rho*v*V.

Definition at line 89 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addVariables().

◆ _scaling_factor_rhowV

const Real& VolumeJunction1Phase::_scaling_factor_rhowV
protectedinherited

Scaling factor for rho*w*V.

Definition at line 91 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addVariables().

◆ _shaft_name

std::string ShaftConnectable::_shaft_name
mutableprotectedinherited

◆ _sides

std::vector<unsigned short int> Component1DConnection::_sides
protectedinherited

Boundary sides of connected components.

Definition at line 137 of file Component1DConnection.h.

Referenced by Component1DBoundary::setupMesh(), and Component1DConnection::setupMesh().

◆ _sim

THMProblem& Component::_sim
protectedinherited

THM problem this component is part of TODO: make _sim private (applications need to switch to getters to avoid breaking).

Also, rename to "_thm_problem" at that point.

Definition at line 443 of file Component.h.

Referenced by Component::checkComponentExistsByName(), Component::checkComponentOfTypeExistsByName(), Component::getComponentByName(), Component::getTHMProblem(), Component::hasComponentByName(), and Component::makeFunctionControllableIfConstant().

◆ _speed_cr_fr

const Real& ShaftConnectedCompressor1Phase::_speed_cr_fr
protected

Compressor speed threshold for friction.

Definition at line 47 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _speed_cr_I

const Real& ShaftConnectedCompressor1Phase::_speed_cr_I
protected

Compressor speed threshold for inertia.

Definition at line 53 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _speeds

const std::vector<Real>& ShaftConnectedCompressor1Phase::_speeds
protected

Compressor speeds which correspond to Rp and eff function order.

Definition at line 60 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _subdomain_ids

std::vector<SubdomainID> Component::_subdomain_ids
protectedinherited

List of subdomain IDs this components owns.

Definition at line 460 of file Component.h.

Referenced by Component2D::build2DMesh(), Component2D::build2DMesh2ndOrder(), and Component::setSubdomainInfo().

◆ _subdomain_names

std::vector<SubdomainName> Component::_subdomain_names
protectedinherited

List of subdomain names this components owns.

Definition at line 462 of file Component.h.

Referenced by Component::getSubdomainNames(), and Component::setSubdomainInfo().

◆ _tau_fr_coeff

const std::vector<Real>& ShaftConnectedCompressor1Phase::_tau_fr_coeff
protected

Compressor friction coefficients.

Definition at line 51 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _tau_fr_const

const Real& ShaftConnectedCompressor1Phase::_tau_fr_const
protected

Compressor friction constant.

Definition at line 49 of file ShaftConnectedCompressor1Phase.h.

Referenced by buildVolumeJunctionUserObject().

◆ _temperature_var_name

const VariableName VolumeJunction1Phase::_temperature_var_name
protectedinherited

temperature variable name for junction

Definition at line 108 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addMooseObjects(), and VolumeJunction1Phase::addVariables().

◆ _torque_var_name

VariableName ShaftConnectable::_torque_var_name
protectedinherited

Torque of variable name.

Definition at line 34 of file ShaftConnectable.h.

Referenced by ShaftConnectable::getTorqueVariableName().

◆ _user_object_name

UserObjectName ShaftConnectable::_user_object_name
protectedinherited

Shaft-connectable user object name.

Definition at line 36 of file ShaftConnectable.h.

Referenced by ShaftConnectable::getShaftConnectedUserObjectName().

◆ _velocity_var_name

const VariableName VolumeJunction1Phase::_velocity_var_name
protectedinherited

velocity variable name for junction

Definition at line 110 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addMooseObjects(), and VolumeJunction1Phase::addVariables().

◆ _volume

const Real VolumeJunction1Phase::_volume
protectedinherited

◆ _zero

const Real& Component::_zero
protectedinherited

Definition at line 448 of file Component.h.

◆ N_EQ

const unsigned int VolumeJunction1Phase::N_EQ = 5
staticinherited

Number of equations for the junction.

Definition at line 35 of file VolumeJunction1Phase.h.

Referenced by VolumeJunction1Phase::addMooseObjects(), and ADVolumeJunction1PhaseUserObject::ADVolumeJunction1PhaseUserObject().


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