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
Component2D Class Referenceabstract

#include <Component2D.h>

Inheritance diagram for Component2D:
[legend]

Public Types

enum  ExternalBoundaryType { ExternalBoundaryType::INNER = 0, ExternalBoundaryType::OUTER = 1, ExternalBoundaryType::START = 2, ExternalBoundaryType::END = 3 }
 External boundary type. More...
 
enum  EComponentSetupStatus {
  CREATED, MESH_PREPARED, INITIALIZED_PRIMARY, INITIALIZED_SECONDARY,
  CHECKED
}
 Component setup status type. More...
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 Component2D (const InputParameters &params)
 
virtual void buildMesh () override
 
const RealgetTotalWidth () const
 Gets the total width of all transverse regions. More...
 
unsigned int getNumRegions () const
 Gets the number of transverse regions. More...
 
bool hasBlock (const std::string &name) const
 Returns true if there is a transverse region of a given name. More...
 
const std::vector< std::string > & getNames () const
 Gets the names of the transverse regions. More...
 
const std::vector< Real > & getVolumes () const
 Gets the volumes of the transverse regions. More...
 
bool isBoundaryInVector (const BoundaryName &boundary_name, const std::vector< BoundaryName > &boundary_name_vector) const
 Returns true if the supplied boundary is in the given vector. More...
 
bool hasBoundary (const BoundaryName &boundary_name) const
 Returns true if this component has the supplied boundary. More...
 
bool hasExternalBoundary (const BoundaryName &boundary_name) const
 Returns true if this component has the supplied external boundary. More...
 
const std::vector< std::tuple< dof_id_type, unsigned short int > > & getBoundaryInfo (const BoundaryName &boundary_name) const
 Gets boundary info associated with the component boundary. More...
 
const std::vector< std::tuple< dof_id_type, unsigned short int > > & getBoundaryInfo (const ExternalBoundaryType &boundary_type) const
 Gets boundary info associated with a external boundary type. More...
 
ExternalBoundaryType getExternalBoundaryType (const BoundaryName &boundary_name) const
 Gets the external boundary type of the given boundary. More...
 
Real getAxialOffset () const
 Gets the axial offset for the mesh. More...
 
const BoundaryName & getExternalBoundaryName (const ExternalBoundaryType &boundary_type) const
 Gets the name of an external boundary by type. More...
 
const RealgetBoundaryArea (const BoundaryName &boundary_name) const
 Gets the area for a boundary. More...
 
virtual Real computeRadialBoundaryArea (const Real &length, const Real &y) const =0
 Computes the area of a radial boundary. More...
 
virtual Real computeAxialBoundaryArea (const Real &y_min, const Real &y_max) const =0
 Computes the area of an axial boundary. 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...
 
virtual void addVariables ()
 
virtual void addMooseObjects ()
 
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 > & getNodeIDs () const
 Gets the node IDs corresponding to this component. 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 Point getPosition () const
 
virtual RealVectorValue getDirection () const
 
virtual Real getRotation () const
 
virtual Real getNumElems () const
 
virtual Real getLength () const
 
Real computeAxialCoordinate (const Point &p) const
 
Real computeRadialCoordinate (const Point &p) const
 
unsigned int getAxialSectionIndex (const Point &p) const
 
unsigned int getAxialElementIndex (const Point &p_center) const
 
Point computeRealPointFromReferencePoint (const Point &p) const
 Computes point in 3-D space from a point in reference space. More...
 
Point computeReferencePointFromRealPoint (const Point &p) const
 Computes point in reference space from a point in 3-D space. More...
 
MooseEnum getAlignmentAxis () const
 Gets an axis MooseEnum for the axis the component is aligned with. More...
 
std::vector< RealgetElementBoundaryCoordinates () const
 Gets the element boundary coordinates for the aligned axis. More...
 

Static Public Member Functions

static InputParameters validParams ()
 
static MooseEnum getExternalBoundaryTypeMooseEnum (const std::string &default_value="")
 Gets the MooseEnum corresponding to ExternalBoundaryType. More...
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 
static Point computeRealPointFromReferencePoint (const Point &p, const RealVectorValue &position, const RealTensorValue &R, const RealTensorValue &Rx)
 Computes point in 3-D space from a point in reference space. More...
 
static Point computeReferencePointFromRealPoint (const Point &p, const RealVectorValue &position, const RealTensorValue &R_inv, const RealTensorValue &Rx_inv)
 Computes point in reference space from a point in 3-D space. More...
 
static MooseEnum getAlignmentAxis (const RealVectorValue &dir)
 Gets an axis MooseEnum for the axis the component is aligned with. More...
 
static std::vector< RealgetElementBoundaryCoordinates (const RealVectorValue &position, const RealVectorValue &orientation, const Real &rotation, const std::vector< Real > &lengths, const std::vector< unsigned int > &n_elems)
 Gets the element boundary coordinates for the aligned axis. More...
 
static RealTensorValue computeDirectionTransformationTensor (const RealVectorValue &dir)
 Computes the direction transformation tensor. More...
 
static RealTensorValue computeXRotationTransformationTensor (const Real &rotation)
 Computes the rotation transformation tensor. More...
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static const std::map< std::string, ExternalBoundaryType_external_boundary_type_to_enum
 map of external boundary type string to enum More...
 

Protected Member Functions

virtual void check () const override
 Check the component integrity. More...
 
void build2DMesh ()
 Builds a 2D, first-order mesh. More...
 
void build2DMesh2ndOrder ()
 Builds a 2D, second-order mesh. More...
 
virtual void setupMesh () override
 Performs mesh setup such as creating mesh or naming mesh sets. More...
 
virtual bool usingSecondOrderMesh () const =0
 Check if second order mesh is being used by this geometrical component. More...
 
Elem * addElement (libMesh::ElemType elem_type, const std::vector< dof_id_type > &node_ids)
 
Elem * addElementEdge2 (dof_id_type node0, dof_id_type node1)
 
Elem * addElementEdge3 (dof_id_type node0, dof_id_type node1, dof_id_type node2)
 
Elem * addElementQuad4 (dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3)
 
Elem * addElementQuad9 (dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3, dof_id_type node4, dof_id_type node5, dof_id_type node6, dof_id_type node7, dof_id_type node8)
 
const FunctionName & getVariableFn (const FunctionName &fn_param_name)
 Makes a constant function parameter controllable and returns its name. More...
 
virtual void init ()
 Initializes the component. More...
 
virtual void initSecondary ()
 Perform secondary initialization, which relies on init() being called for all components. 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

unsigned int _n_regions
 Number of transverse regions. More...
 
std::vector< std::string > _names
 Names of each transverse region. More...
 
std::vector< Real_width
 Width of each transverse region. More...
 
Real _total_width
 Total width of all transverse regions. More...
 
std::vector< Real_volume
 Volume of each transverse region. More...
 
std::vector< unsigned int_n_part_elems
 Number of elements in each transverse region. More...
 
unsigned int _total_elem_number
 Total number of transverse elements. More...
 
unsigned int _outer_bc_id
 BC ID of the component (outer) More...
 
unsigned int _inner_bc_id
 BC ID of the component (inner) More...
 
unsigned int _start_bc_id
 BC ID of the component (start) More...
 
unsigned int _end_bc_id
 BC ID of the component (end) More...
 
std::vector< unsigned int_interior_axial_per_radial_section_bc_id
 BC ID of the interior axial boundaries (per radial section) of the component. More...
 
std::vector< unsigned int_axial_outer_bc_id
 BC ID of the axial regions of the outer boundary of the component. More...
 
std::vector< unsigned int_axial_inner_bc_id
 BC ID of the axial regions of the inner boundary of the component. More...
 
std::vector< unsigned int_radial_start_bc_id
 BC ID of the radial regions of the start boundary of the component. More...
 
std::vector< unsigned int_radial_end_bc_id
 BC ID of the radial regions of the end boundary of the component. More...
 
std::vector< unsigned int_inner_radial_bc_id
 BC ID of the inner radial boundary regions of the component. More...
 
BoundaryName _boundary_name_outer
 Boundary name of the outer side of the component. More...
 
BoundaryName _boundary_name_inner
 Boundary name of the inner side of the component. More...
 
BoundaryName _boundary_name_start
 Boundary name of the start side of the component. More...
 
BoundaryName _boundary_name_end
 Boundary name of the end side of the component. More...
 
std::vector< BoundaryName > _boundary_names_interior_axial_per_radial_section
 Boundary names of the interior axial boundaries (per radial section) of the component. More...
 
std::vector< BoundaryName > _boundary_names_axial_outer
 Boundary names of the axial regions of the outer side of the component. More...
 
std::vector< BoundaryName > _boundary_names_axial_inner
 Boundary names of the axial regions of the inner side of the component. More...
 
std::vector< BoundaryName > _boundary_names_radial_start
 Boundary names of the radial regions of the start side of the component. More...
 
std::vector< BoundaryName > _boundary_names_radial_end
 Boundary names of the radial regions of the end side of the component. More...
 
std::vector< BoundaryName > _boundary_names_inner_radial
 Boundary names of the inner radial boundary regions of the component. More...
 
std::map< BoundaryName, Real_boundary_name_to_area
 Map of boundary name to boundary area. More...
 
std::map< BoundaryName, std::vector< std::tuple< dof_id_type, unsigned short int > > > _boundary_info
 Map of boundary name to list of tuples of element and side IDs for that boundary. More...
 
Real _axial_offset
 Distance by which to offset the mesh from the component axis. More...
 
const std::vector< std::string > & _axial_region_names
 Axial region names. More...
 
std::vector< Real_node_locations
 Node locations along the main axis. 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
 
const Point & _position
 Start position of axis in 3-D space. More...
 
const RealVectorValue_dir_unnormalized
 Unnormalized direction of axis from start position to end position. More...
 
const RealVectorValue _dir
 Normalized direction of axis from start position to end position. More...
 
const Real_rotation
 Angle of rotation about the x-axis. More...
 
std::vector< Real_lengths
 Length of each axial section. More...
 
Real _length
 Total axial length. More...
 
const std::vector< unsigned int > & _n_elems
 Number of elements in each axial section. More...
 
const unsigned int _n_elem
 Total number of axial elements. More...
 
const unsigned int _n_sections
 Number of axial sections. More...
 
std::vector< Real_section_end
 Axial coordinate of the end of each axial section using the line 'position' as the origin. More...
 
std::vector< Real_x_centers
 Center axial coordinate of each axial element. More...
 
const RealTensorValue _R
 Direction transformation tensor. More...
 
const RealTensorValue _Rx
 Rotational transformation tensor about x-axis. More...
 
const RealTensorValue _R_inv
 Inverse direction transformation tensor. More...
 
const RealTensorValue _Rx_inv
 Inverse rotational transformation tensor about x-axis. More...
 
const std::string _moose_object_name_dlsi
 Name of the MOOSE object. More...
 

Detailed Description

Definition at line 14 of file Component2D.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

◆ ExternalBoundaryType

External boundary type.

Enumerator
INNER 
OUTER 
START 
END 

Definition at line 18 of file Component2D.h.

19  {
20  INNER = 0,
21  OUTER = 1,
22  START = 2,
23  END = 3
24  };

Constructor & Destructor Documentation

◆ Component2D()

Component2D::Component2D ( const InputParameters params)

Definition at line 41 of file Component2D.C.

43 {
44 }
Real _axial_offset
Distance by which to offset the mesh from the component axis.
Definition: Component2D.h:220
unsigned int _total_elem_number
Total number of transverse elements.
Definition: Component2D.h:169
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157
GeneratedMeshComponent(const InputParameters &parameters)

Member Function Documentation

◆ 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

◆ addElement()

Elem * GeometricalComponent::addElement ( libMesh::ElemType  elem_type,
const std::vector< dof_id_type > &  node_ids 
)
protectedinherited

Definition at line 27 of file GeometricalComponent.C.

Referenced by FileMeshComponent::buildMesh().

29 {
30  auto elem = mesh().addElement(elem_type, node_ids);
31  _elem_ids.push_back(elem->id());
32  return elem;
33 }
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
Definition: Component.h:457
Elem * addElement(libMesh::ElemType elem_type, const std::vector< dof_id_type > &node_ids)
Add a new element into the mesh.
Definition: THMMesh.C:103
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60

◆ addElementEdge2()

Elem * GeometricalComponent::addElementEdge2 ( dof_id_type  node0,
dof_id_type  node1 
)
protectedinherited

Definition at line 36 of file GeometricalComponent.C.

Referenced by Component1D::buildMesh().

37 {
38  auto elem = mesh().addElementEdge2(node0, node1);
39  _elem_ids.push_back(elem->id());
40  return elem;
41 }
Elem * addElementEdge2(dof_id_type node0, dof_id_type node1)
Definition: THMMesh.C:128
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

◆ addElementEdge3()

Elem * GeometricalComponent::addElementEdge3 ( dof_id_type  node0,
dof_id_type  node1,
dof_id_type  node2 
)
protectedinherited

Definition at line 44 of file GeometricalComponent.C.

Referenced by Component1D::buildMesh().

45 {
46  auto elem = mesh().addElementEdge3(node0, node1, node2);
47  _elem_ids.push_back(elem->id());
48  return elem;
49 }
Elem * addElementEdge3(dof_id_type node0, dof_id_type node1, dof_id_type node2)
Definition: THMMesh.C:141
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

◆ addElementQuad4()

Elem * GeometricalComponent::addElementQuad4 ( dof_id_type  node0,
dof_id_type  node1,
dof_id_type  node2,
dof_id_type  node3 
)
protectedinherited

Definition at line 52 of file GeometricalComponent.C.

Referenced by build2DMesh().

56 {
57  auto elem = mesh().addElementQuad4(node0, node1, node2, node3);
58  _elem_ids.push_back(elem->id());
59  return elem;
60 }
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
Definition: Component.h:457
Elem * addElementQuad4(dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3)
Definition: THMMesh.C:155
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60

◆ addElementQuad9()

Elem * GeometricalComponent::addElementQuad9 ( dof_id_type  node0,
dof_id_type  node1,
dof_id_type  node2,
dof_id_type  node3,
dof_id_type  node4,
dof_id_type  node5,
dof_id_type  node6,
dof_id_type  node7,
dof_id_type  node8 
)
protectedinherited

Definition at line 63 of file GeometricalComponent.C.

Referenced by build2DMesh2ndOrder().

72 {
73  auto elem = mesh().addElementQuad9(node0, node1, node2, node3, node4, node5, node6, node7, node8);
74  _elem_ids.push_back(elem->id());
75  return elem;
76 }
std::vector< dof_id_type > _elem_ids
Element IDs of this component.
Definition: Component.h:457
Elem * addElementQuad9(dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3, dof_id_type node4, dof_id_type node5, dof_id_type node6, dof_id_type node7, dof_id_type node8)
Definition: THMMesh.C:170
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60

◆ addMooseObjects()

virtual void Component::addMooseObjects ( )
inlinevirtualinherited

Reimplemented in FlowChannelBase, FileMeshPhysicsComponent, JunctionOneToOne1Phase, HSBoundaryExternalAppHeatFlux, HeatStructureFromFile3D, HeatTransferFromHeatStructure1Phase, HeatStructureBase, HeatTransferBase, HeatTransferFromHeatStructure3D1Phase, HSCoupler2D2DRadiation, HSCoupler2D3D, SimpleTurbine1Phase, FlowChannel1PhaseBase, FormLoss1PhaseBase, HeatTransferFromExternalAppHeatFlux1Phase, HSBoundaryExternalAppConvection, ShaftConnectedCompressor1Phase, ShaftConnectedMotor, ShaftConnectedPump1Phase, ShaftConnectedTurbine1Phase, SolidWallGasMix, FormLossFromExternalApp1Phase, FreeBoundary1Phase, GateValve1Phase, HeatSourceVolumetric1Phase, HeatTransferFromExternalAppTemperature1Phase, HeatTransferFromSpecifiedTemperature1Phase, HeatTransferFromTemperature1Phase, HSBoundaryExternalAppTemperature, Shaft, TotalPower, VolumeJunction1Phase, FormLossFromFunction1Phase, HeatSourceFromPowerDensity, HeatSourceFromTotalPower, HeatStructure2DCoupler, HeatStructure2DRadiationCouplerRZ, HeatTransfer1PhaseBase, HeatTransferFromHeatFlux1Phase, HSBoundaryAmbientConvection, HSBoundaryHeatFlux, HSBoundaryRadiation, HSBoundarySpecifiedTemperature, InletDensityVelocity1Phase, InletMassFlowRateTemperature1Phase, InletStagnationEnthalpyMomentum1Phase, InletStagnationPressureTemperature1Phase, InletVelocityTemperature1Phase, Outlet1Phase, SolidWall1Phase, SupersonicInlet, and InletFunction1Phase.

Definition at line 114 of file Component.h.

Referenced by HeatStructure2DCoupler::addMooseObjects(), and HeatStructure2DRadiationCouplerRZ::addMooseObjects().

114 {}

◆ addNode()

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

Definition at line 213 of file Component.C.

Referenced by build2DMesh(), 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()

virtual void Component::addVariables ( )
inlinevirtualinherited

◆ build2DMesh()

void Component2D::build2DMesh ( )
protected

Builds a 2D, first-order mesh.

Definition at line 65 of file Component2D.C.

Referenced by buildMesh().

66 {
67  unsigned int n_axial_positions = _node_locations.size();
68  std::vector<std::vector<unsigned int>> node_ids(
69  n_axial_positions, std::vector<unsigned int>(_total_elem_number + 1));
70 
71  // loop over axial positions
72  for (unsigned int i = 0; i < n_axial_positions; i++)
73  {
74  Point p(_node_locations[i], _axial_offset, 0);
75 
76  Node * nd = addNode(p);
77  node_ids[i][0] = nd->id();
78 
79  // loop over regions
80  unsigned int l = 1;
81  for (unsigned int j = 0; j < _n_regions; j++)
82  {
83  Real elem_length = _width[j] / _n_part_elems[j];
84  for (unsigned int k = 0; k < _n_part_elems[j]; k++, l++)
85  {
86  p(1) += elem_length;
87  nd = addNode(p);
88  node_ids[i][l] = nd->id();
89  }
90  }
91  }
92 
93  auto & boundary_info = mesh().getMesh().get_boundary_info();
94 
95  // create elements from nodes
96  unsigned int i = 0;
97  for (unsigned int i_section = 0; i_section < _n_sections; i_section++)
98  {
99  // element axial index for end of axial section
100  unsigned int i_section_end = 0;
101  for (unsigned int ii_section = 0; ii_section <= i_section; ++ii_section)
102  i_section_end += _n_elems[ii_section];
103  i_section_end -= 1;
104 
105  for (unsigned int i_local = 0; i_local < _n_elems[i_section]; i_local++)
106  {
107  unsigned int j = 0;
108  for (unsigned int j_section = 0; j_section < _n_regions; j_section++)
109  for (unsigned int j_local = 0; j_local < _n_part_elems[j_section]; j_local++)
110  {
111  Elem * elem = addElementQuad4(
112  node_ids[i][j + 1], node_ids[i][j], node_ids[i + 1][j], node_ids[i + 1][j + 1]);
113  elem->subdomain_id() = _subdomain_ids[j_section];
114 
115  // exterior axial boundaries (all radial sections)
116  if (i == 0)
117  {
118  boundary_info.add_side(elem, 0, _start_bc_id);
120  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
121  }
122  if (i == _n_elem - 1)
123  {
124  boundary_info.add_side(elem, 2, _end_bc_id);
126  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
127  }
128 
129  // exterior axial boundaries (per radial section)
130  if (_names.size() > 1)
131  {
132  if (i == 0)
133  {
134  boundary_info.add_side(elem, 0, _radial_start_bc_id[j_section]);
135  _boundary_info[_boundary_names_radial_start[j_section]].push_back(
136  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
137  }
138  if (i == _n_elem - 1)
139  {
140  boundary_info.add_side(elem, 2, _radial_end_bc_id[j_section]);
141  _boundary_info[_boundary_names_radial_end[j_section]].push_back(
142  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
143  }
144  }
145 
146  // interior axial boundaries (per radial section)
147  if (_n_sections > 1 && _axial_region_names.size() == _n_sections &&
148  i_section != _n_sections - 1 && i == i_section_end)
149  {
150  const unsigned int k = i_section * _n_regions + j_section;
151  boundary_info.add_side(elem, 2, _interior_axial_per_radial_section_bc_id[k]);
153  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
154  }
155 
156  // exterior radial boundaries (all axial sections)
157  if (j == 0)
158  {
159  boundary_info.add_side(elem, 1, _inner_bc_id);
161  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
162  }
163  if (j == _total_elem_number - 1)
164  {
165  boundary_info.add_side(elem, 3, _outer_bc_id);
167  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
168  }
169 
170  // exterior radial boundaries (per axial section)
171  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
172  {
173  if (j == 0)
174  {
175  boundary_info.add_side(elem, 1, _axial_inner_bc_id[i_section]);
176  _boundary_info[_boundary_names_axial_inner[i_section]].push_back(
177  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
178  }
179  if (j == _total_elem_number - 1)
180  {
181  boundary_info.add_side(elem, 3, _axial_outer_bc_id[i_section]);
182  _boundary_info[_boundary_names_axial_outer[i_section]].push_back(
183  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
184  }
185  }
186 
187  // interior radial boundaries (all axial sections)
188  if (_n_regions > 1 && _names.size() == _n_regions && j_section != 0)
189  {
190  unsigned int j_section_begin = 0;
191  for (unsigned int jj_section = 0; jj_section < j_section; ++jj_section)
192  j_section_begin += _n_part_elems[jj_section];
193 
194  if (j == j_section_begin)
195  {
196  boundary_info.add_side(elem, 1, _inner_radial_bc_id[j_section - 1]);
197  _boundary_info[_boundary_names_inner_radial[j_section - 1]].push_back(
198  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
199  }
200  }
201 
202  j++;
203  }
204 
205  i++;
206  }
207  }
208 }
unsigned int _start_bc_id
BC ID of the component (start)
Definition: Component2D.h:176
unsigned int _inner_bc_id
BC ID of the component (inner)
Definition: Component2D.h:174
std::vector< BoundaryName > _boundary_names_inner_radial
Boundary names of the inner radial boundary regions of the component.
Definition: Component2D.h:211
std::vector< BoundaryName > _boundary_names_radial_end
Boundary names of the radial regions of the end side of the component.
Definition: Component2D.h:209
std::vector< unsigned int > _interior_axial_per_radial_section_bc_id
BC ID of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:180
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
Real _axial_offset
Distance by which to offset the mesh from the component axis.
Definition: Component2D.h:220
std::vector< unsigned int > _inner_radial_bc_id
BC ID of the inner radial boundary regions of the component.
Definition: Component2D.h:190
Node * addNode(const Point &pt)
Definition: Component.C:213
std::vector< BoundaryName > _boundary_names_axial_inner
Boundary names of the axial regions of the inner side of the component.
Definition: Component2D.h:205
std::vector< unsigned int > _axial_inner_bc_id
BC ID of the axial regions of the inner boundary of the component.
Definition: Component2D.h:184
std::vector< unsigned int > _radial_start_bc_id
BC ID of the radial regions of the start boundary of the component.
Definition: Component2D.h:186
unsigned int _total_elem_number
Total number of transverse elements.
Definition: Component2D.h:169
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157
std::map< BoundaryName, std::vector< std::tuple< dof_id_type, unsigned short int > > > _boundary_info
Map of boundary name to list of tuples of element and side IDs for that boundary. ...
Definition: Component2D.h:217
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159
MeshBase & getMesh()
unsigned int _outer_bc_id
BC ID of the component (outer)
Definition: Component2D.h:172
std::vector< unsigned int > _n_part_elems
Number of elements in each transverse region.
Definition: Component2D.h:167
std::vector< BoundaryName > _boundary_names_interior_axial_per_radial_section
Boundary names of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:201
const unsigned int _n_sections
Number of axial sections.
std::vector< BoundaryName > _boundary_names_radial_start
Boundary names of the radial regions of the start side of the component.
Definition: Component2D.h:207
std::vector< BoundaryName > _boundary_names_axial_outer
Boundary names of the axial regions of the outer side of the component.
Definition: Component2D.h:203
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
const std::vector< unsigned int > & _n_elems
Number of elements in each axial section.
const unsigned int _n_elem
Total number of axial elements.
Elem * addElementQuad4(dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _width
Width of each transverse region.
Definition: Component2D.h:161
std::vector< SubdomainID > _subdomain_ids
List of subdomain IDs this components owns.
Definition: Component.h:460
std::vector< unsigned int > _radial_end_bc_id
BC ID of the radial regions of the end boundary of the component.
Definition: Component2D.h:188
unsigned int _end_bc_id
BC ID of the component (end)
Definition: Component2D.h:178
std::vector< unsigned int > _axial_outer_bc_id
BC ID of the axial regions of the outer boundary of the component.
Definition: Component2D.h:182
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197
std::vector< Real > _node_locations
Node locations along the main axis.
static const std::string k
Definition: NS.h:130
const std::vector< std::string > & _axial_region_names
Axial region names.

◆ build2DMesh2ndOrder()

void Component2D::build2DMesh2ndOrder ( )
protected

Builds a 2D, second-order mesh.

Definition at line 211 of file Component2D.C.

Referenced by buildMesh().

212 {
213  unsigned int n_axial_positions = _node_locations.size();
214  std::vector<std::vector<unsigned int>> node_ids(
215  n_axial_positions, std::vector<unsigned int>(2 * _total_elem_number + 1));
216 
217  // loop over axial positions
218  for (unsigned int i = 0; i < n_axial_positions; i++)
219  {
220  Point p(_node_locations[i], _axial_offset, 0);
221 
222  const Node * nd = addNode(p);
223  node_ids[i][0] = nd->id();
224 
225  // loop over regions
226  unsigned int l = 1;
227  for (unsigned int j = 0; j < _n_regions; j++)
228  {
229  Real elem_length = _width[j] / (2. * _n_part_elems[j]);
230  for (unsigned int k = 0; k < 2. * _n_part_elems[j]; k++, l++)
231  {
232  p(1) += elem_length;
233  nd = addNode(p);
234  node_ids[i][l] = nd->id();
235  }
236  }
237  }
238 
239  auto & boundary_info = mesh().getMesh().get_boundary_info();
240 
241  // create elements from nodes
242  unsigned int i = 0;
243  for (unsigned int i_section = 0; i_section < _n_sections; i_section++)
244  for (unsigned int i_local = 0; i_local < _n_elems[i_section]; i_local++)
245  {
246  unsigned int j = 0;
247  for (unsigned int j_section = 0; j_section < _n_regions; j_section++)
248  for (unsigned int j_local = 0; j_local < _n_part_elems[j_section]; j_local++)
249  {
250  Elem * elem = addElementQuad9(node_ids[2 * i][2 * j],
251  node_ids[2 * i][2 * (j + 1)],
252  node_ids[2 * (i + 1)][2 * (j + 1)],
253  node_ids[2 * (i + 1)][2 * j],
254  node_ids[2 * i][(2 * j) + 1],
255  node_ids[(2 * i) + 1][2 * (j + 1)],
256  node_ids[2 * (i + 1)][(2 * j) + 1],
257  node_ids[(2 * i) + 1][(2 * j)],
258  node_ids[(2 * i) + 1][(2 * j) + 1]);
259  elem->subdomain_id() = _subdomain_ids[j_section];
260 
261  if (i == 0)
262  {
263  boundary_info.add_side(elem, 0, _start_bc_id);
265  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
266  }
267  if (i == _n_elem - 1)
268  {
269  boundary_info.add_side(elem, 2, _end_bc_id);
271  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
272  }
273  if (_names.size() > 1)
274  {
275  if (i == 0)
276  {
277  boundary_info.add_side(elem, 0, _radial_start_bc_id[j_section]);
278  _boundary_info[_boundary_names_radial_start[j_section]].push_back(
279  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
280  }
281  if (i == _n_elem - 1)
282  {
283  boundary_info.add_side(elem, 2, _radial_end_bc_id[j_section]);
284  _boundary_info[_boundary_names_radial_end[j_section]].push_back(
285  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
286  }
287  }
288 
289  if (j == 0)
290  {
291  boundary_info.add_side(elem, 3, _inner_bc_id);
293  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
294  }
295  if (j == _total_elem_number - 1)
296  {
297  boundary_info.add_side(elem, 1, _outer_bc_id);
299  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
300  }
301 
302  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
303  {
304  if (j == 0)
305  {
306  boundary_info.add_side(elem, 1, _axial_inner_bc_id[i_section]);
307  _boundary_info[_boundary_names_axial_inner[i_section]].push_back(
308  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
309  }
310  if (j == _total_elem_number - 1)
311  {
312  boundary_info.add_side(elem, 3, _axial_outer_bc_id[i_section]);
313  _boundary_info[_boundary_names_axial_outer[i_section]].push_back(
314  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
315  }
316  }
317 
318  // interior radial boundaries
319  if (_n_regions > 1 && _names.size() == _n_regions && j_section != 0)
320  {
321  unsigned int j_section_begin = 0;
322  for (unsigned int jj_section = 0; jj_section < j_section; ++jj_section)
323  j_section_begin += _n_part_elems[jj_section];
324 
325  if (j == j_section_begin)
326  {
327  boundary_info.add_side(elem, 1, _inner_radial_bc_id[j_section - 1]);
328  _boundary_info[_boundary_names_inner_radial[j_section - 1]].push_back(
329  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
330  }
331  }
332 
333  j++;
334  }
335 
336  i++;
337  }
338 }
unsigned int _start_bc_id
BC ID of the component (start)
Definition: Component2D.h:176
unsigned int _inner_bc_id
BC ID of the component (inner)
Definition: Component2D.h:174
std::vector< BoundaryName > _boundary_names_inner_radial
Boundary names of the inner radial boundary regions of the component.
Definition: Component2D.h:211
std::vector< BoundaryName > _boundary_names_radial_end
Boundary names of the radial regions of the end side of the component.
Definition: Component2D.h:209
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
Real _axial_offset
Distance by which to offset the mesh from the component axis.
Definition: Component2D.h:220
std::vector< unsigned int > _inner_radial_bc_id
BC ID of the inner radial boundary regions of the component.
Definition: Component2D.h:190
Node * addNode(const Point &pt)
Definition: Component.C:213
std::vector< BoundaryName > _boundary_names_axial_inner
Boundary names of the axial regions of the inner side of the component.
Definition: Component2D.h:205
std::vector< unsigned int > _axial_inner_bc_id
BC ID of the axial regions of the inner boundary of the component.
Definition: Component2D.h:184
std::vector< unsigned int > _radial_start_bc_id
BC ID of the radial regions of the start boundary of the component.
Definition: Component2D.h:186
unsigned int _total_elem_number
Total number of transverse elements.
Definition: Component2D.h:169
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157
std::map< BoundaryName, std::vector< std::tuple< dof_id_type, unsigned short int > > > _boundary_info
Map of boundary name to list of tuples of element and side IDs for that boundary. ...
Definition: Component2D.h:217
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159
MeshBase & getMesh()
unsigned int _outer_bc_id
BC ID of the component (outer)
Definition: Component2D.h:172
std::vector< unsigned int > _n_part_elems
Number of elements in each transverse region.
Definition: Component2D.h:167
const unsigned int _n_sections
Number of axial sections.
std::vector< BoundaryName > _boundary_names_radial_start
Boundary names of the radial regions of the start side of the component.
Definition: Component2D.h:207
std::vector< BoundaryName > _boundary_names_axial_outer
Boundary names of the axial regions of the outer side of the component.
Definition: Component2D.h:203
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
const std::vector< unsigned int > & _n_elems
Number of elements in each axial section.
const unsigned int _n_elem
Total number of axial elements.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _width
Width of each transverse region.
Definition: Component2D.h:161
std::vector< SubdomainID > _subdomain_ids
List of subdomain IDs this components owns.
Definition: Component.h:460
std::vector< unsigned int > _radial_end_bc_id
BC ID of the radial regions of the end boundary of the component.
Definition: Component2D.h:188
unsigned int _end_bc_id
BC ID of the component (end)
Definition: Component2D.h:178
std::vector< unsigned int > _axial_outer_bc_id
BC ID of the axial regions of the outer boundary of the component.
Definition: Component2D.h:182
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197
std::vector< Real > _node_locations
Node locations along the main axis.
static const std::string k
Definition: NS.h:130
const std::vector< std::string > & _axial_region_names
Axial region names.
Elem * addElementQuad9(dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3, dof_id_type node4, dof_id_type node5, dof_id_type node6, dof_id_type node7, dof_id_type node8)

◆ buildMesh()

void Component2D::buildMesh ( )
overridevirtual

Implements GeneratedMeshComponent.

Definition at line 341 of file Component2D.C.

342 {
343  if (_n_part_elems.size() != _n_regions || _width.size() != _n_regions)
344  return;
345 
346  // Assign subdomain to each transverse region
347  for (unsigned int i = 0; i < _n_regions; i++)
348  {
349  // The coordinate system for MOOSE is always XYZ, even for axisymmetric
350  // components, since we do the RZ integration ourselves until we can set
351  // arbitrary number of axis symmetries in MOOSE.
352  setSubdomainInfo(mesh().getNextSubdomainId(), genName(_name, _names[i]), Moose::COORD_XYZ);
353  }
354 
355  // Create boundary IDs and associated boundary names
358  _boundary_name_inner = genName(name(), "inner");
359  _boundary_name_outer = genName(name(), "outer");
363  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
364  for (unsigned int i = 0; i < _n_sections; i++)
365  {
366  _axial_inner_bc_id.push_back(mesh().getNextBoundaryId());
367  _axial_outer_bc_id.push_back(mesh().getNextBoundaryId());
368  const BoundaryName boundary_name_axial_inner =
369  genName(name(), _axial_region_names[i], "inner");
370  const BoundaryName boundary_name_axial_outer =
371  genName(name(), _axial_region_names[i], "outer");
372  _boundary_names_axial_inner.push_back(boundary_name_axial_inner);
373  _boundary_names_axial_outer.push_back(boundary_name_axial_outer);
374  _boundary_name_to_area[boundary_name_axial_inner] =
376  _boundary_name_to_area[boundary_name_axial_outer] =
378  }
379 
380  // exterior axial boundaries
383  _boundary_name_start = genName(name(), "start");
384  _boundary_name_end = genName(name(), "end");
387  if (_names.size() > 1)
388  {
389  Real y1 = 0.0;
390  for (unsigned int i = 0; i < _names.size(); i++)
391  {
392  const Real y2 = y1 + _width[i];
393 
394  _radial_start_bc_id.push_back(mesh().getNextBoundaryId());
395  _radial_end_bc_id.push_back(mesh().getNextBoundaryId());
396  const BoundaryName boundary_name_radial_start = genName(name(), _names[i], "start");
397  const BoundaryName boundary_name_radial_end = genName(name(), _names[i], "end");
398  _boundary_names_radial_start.push_back(boundary_name_radial_start);
399  _boundary_names_radial_end.push_back(boundary_name_radial_end);
400  _boundary_name_to_area[boundary_name_radial_start] = computeAxialBoundaryArea(y1, y2);
401  _boundary_name_to_area[boundary_name_radial_end] = computeAxialBoundaryArea(y1, y2);
402  if (i != _names.size() - 1)
403  {
404  _inner_radial_bc_id.push_back(mesh().getNextBoundaryId());
405  const BoundaryName boundary_name_inner_radial = genName(name(), _names[i], _names[i + 1]);
406  _boundary_names_inner_radial.push_back(boundary_name_inner_radial);
407  _boundary_name_to_area[boundary_name_inner_radial] = computeRadialBoundaryArea(_length, y2);
408  }
409  y1 = y2;
410  }
411  }
412 
413  // interior axial boundaries
414  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
415  for (unsigned int i = 0; i < _n_sections - 1; i++)
416  {
417  Real y1 = 0.0;
418  for (unsigned int j = 0; j < _names.size(); j++)
419  {
420  const Real y2 = y1 + _width[j];
421 
422  _interior_axial_per_radial_section_bc_id.push_back(mesh().getNextBoundaryId());
423  const BoundaryName boundary_name_interior_axial_per_radial_section =
426  boundary_name_interior_axial_per_radial_section);
427  _boundary_name_to_area[boundary_name_interior_axial_per_radial_section] =
428  computeAxialBoundaryArea(y1, y2);
429  y1 = y2;
430  }
431  }
432 
433  // Build the mesh
434  if (usingSecondOrderMesh())
436  else
437  build2DMesh();
438 
439  // Set boundary names
440  auto & binfo = mesh().getMesh().get_boundary_info();
441  binfo.sideset_name(_inner_bc_id) = _boundary_name_inner;
442  binfo.sideset_name(_outer_bc_id) = _boundary_name_outer;
443  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
444  for (unsigned int i = 0; i < _n_sections; i++)
445  {
446  binfo.sideset_name(_axial_inner_bc_id[i]) = _boundary_names_axial_inner[i];
447  binfo.sideset_name(_axial_outer_bc_id[i]) = _boundary_names_axial_outer[i];
448  }
449  binfo.sideset_name(_start_bc_id) = _boundary_name_start;
450  binfo.sideset_name(_end_bc_id) = _boundary_name_end;
451  if (_names.size() > 1)
452  for (unsigned int i = 0; i < _names.size(); i++)
453  {
454  binfo.sideset_name(_radial_start_bc_id[i]) = _boundary_names_radial_start[i];
455  binfo.sideset_name(_radial_end_bc_id[i]) = _boundary_names_radial_end[i];
456  if (i != _names.size() - 1)
457  binfo.sideset_name(_inner_radial_bc_id[i]) = _boundary_names_inner_radial[i];
458  }
459  for (unsigned int k = 0; k < _interior_axial_per_radial_section_bc_id.size(); k++)
460  binfo.sideset_name(_interior_axial_per_radial_section_bc_id[k]) =
462 }
unsigned int _start_bc_id
BC ID of the component (start)
Definition: Component2D.h:176
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.
unsigned int _inner_bc_id
BC ID of the component (inner)
Definition: Component2D.h:174
std::vector< BoundaryName > _boundary_names_inner_radial
Boundary names of the inner radial boundary regions of the component.
Definition: Component2D.h:211
std::vector< BoundaryName > _boundary_names_radial_end
Boundary names of the radial regions of the end side of the component.
Definition: Component2D.h:209
std::vector< unsigned int > _interior_axial_per_radial_section_bc_id
BC ID of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:180
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
virtual Real computeAxialBoundaryArea(const Real &y_min, const Real &y_max) const =0
Computes the area of an axial boundary.
std::vector< Real > _lengths
Length of each axial section.
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
std::vector< unsigned int > _inner_radial_bc_id
BC ID of the inner radial boundary regions of the component.
Definition: Component2D.h:190
virtual const std::string & name() const
std::vector< BoundaryName > _boundary_names_axial_inner
Boundary names of the axial regions of the inner side of the component.
Definition: Component2D.h:205
virtual Real computeRadialBoundaryArea(const Real &length, const Real &y) const =0
Computes the area of a radial boundary.
std::vector< unsigned int > _axial_inner_bc_id
BC ID of the axial regions of the inner boundary of the component.
Definition: Component2D.h:184
std::vector< unsigned int > _radial_start_bc_id
BC ID of the radial regions of the start boundary of the component.
Definition: Component2D.h:186
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157
void build2DMesh()
Builds a 2D, first-order mesh.
Definition: Component2D.C:65
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159
MeshBase & getMesh()
unsigned int _outer_bc_id
BC ID of the component (outer)
Definition: Component2D.h:172
std::vector< unsigned int > _n_part_elems
Number of elements in each transverse region.
Definition: Component2D.h:167
std::vector< BoundaryName > _boundary_names_interior_axial_per_radial_section
Boundary names of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:201
const unsigned int _n_sections
Number of axial sections.
const std::string _name
std::vector< BoundaryName > _boundary_names_radial_start
Boundary names of the radial regions of the start side of the component.
Definition: Component2D.h:207
void build2DMesh2ndOrder()
Builds a 2D, second-order mesh.
Definition: Component2D.C:211
std::vector< BoundaryName > _boundary_names_axial_outer
Boundary names of the axial regions of the outer side of the component.
Definition: Component2D.h:203
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< BoundaryName, Real > _boundary_name_to_area
Map of boundary name to boundary area.
Definition: Component2D.h:214
std::vector< Real > _width
Width of each transverse region.
Definition: Component2D.h:161
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
Definition: THMMesh.C:209
std::vector< unsigned int > _radial_end_bc_id
BC ID of the radial regions of the end boundary of the component.
Definition: Component2D.h:188
unsigned int _end_bc_id
BC ID of the component (end)
Definition: Component2D.h:178
std::vector< unsigned int > _axial_outer_bc_id
BC ID of the axial regions of the outer boundary of the component.
Definition: Component2D.h:182
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Real & getTotalWidth() const
Gets the total width of all transverse regions.
Definition: Component2D.h:33
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197
static const std::string k
Definition: NS.h:130
virtual bool usingSecondOrderMesh() const =0
Check if second order mesh is being used by this geometrical component.
const std::vector< std::string > & _axial_region_names
Axial region names.

◆ check()

void Component2D::check ( ) const
overrideprotectedvirtual

Check the component integrity.

Reimplemented from GeneratedMeshComponent.

Reimplemented in HeatStructureBase, HeatStructurePlate, and HeatStructureCylindrical.

Definition at line 47 of file Component2D.C.

Referenced by HeatStructureBase::check().

48 {
50 
51  if (getParam<std::vector<std::string>>("axial_region_names").size())
52  checkEqualSize<std::string, Real>("axial_region_names", "length");
53  else if (_n_sections > 1)
54  logError("If there is more than 1 axial region, then the parameter 'axial_region_names' must "
55  "be specified.");
56 }
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
virtual void check() const override
Check the component integrity.
const T & getParam(const std::string &name) const
const unsigned int _n_sections
Number of axial sections.

◆ 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

◆ 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(), getBoundaryArea(), FileMeshComponent::getBoundaryInfo(), getBoundaryInfo(), Component1DConnection::getBoundaryNames(), Component1D::getConnections(), Component::getCoordSysTypes(), Component::getElementIDs(), getExternalBoundaryName(), 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(), hasBoundary(), 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

◆ 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 ShaftConnectedCompressor1Phase::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

◆ computeAxialBoundaryArea()

virtual Real Component2D::computeAxialBoundaryArea ( const Real y_min,
const Real y_max 
) const
pure virtual

Computes the area of an axial boundary.

Parameters
[in]y_minMinimum transverse position of the surface, which ranges from 0 (inner) to total width (outer).
[in]y_maxMaximum transverse position of the surface, which ranges from 0 (inner) to total width (outer).

Implemented in HeatStructureCylindricalBase, and HeatStructurePlate.

Referenced by buildMesh().

◆ computeAxialCoordinate()

Real DiscreteLineSegmentInterface::computeAxialCoordinate ( const Point &  p) const
inherited

Definition at line 107 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue(), DiscreteLineSegmentInterface::getAxialElementIndex(), and DiscreteLineSegmentInterface::getAxialSectionIndex().

108 {
109  const Real ax_coord = _dir * (p - _position);
110  if (MooseUtils::absoluteFuzzyLessThan(ax_coord, 0.0) ||
113  ": The point ",
114  p,
115  " has an invalid axial coordinate (",
116  ax_coord,
117  "). Valid axial coordinates are in the range (0,",
118  _length,
119  ").");
120  else
121  return ax_coord;
122 }
void mooseError(Args &&... args)
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
bool absoluteFuzzyLessThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
const Point & _position
Start position of axis in 3-D space.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _moose_object_name_dlsi
Name of the MOOSE object.
bool absoluteFuzzyGreaterThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)

◆ computeDirectionTransformationTensor()

RealTensorValue DiscreteLineSegmentInterface::computeDirectionTransformationTensor ( const RealVectorValue dir)
staticinherited

Computes the direction transformation tensor.

Parameters
[in]dirDirection vector

Definition at line 82 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterface::getElementBoundaryCoordinates().

83 {
84  if (MooseUtils::absoluteFuzzyEqual(dir.norm(), 0.0))
85  mooseError("The direction vector must not be the zero vector.");
86 
87  const auto dir_normalized = dir / dir.norm();
88  const Real theta = acos(dir_normalized(2));
89  const Real aphi = atan2(dir_normalized(1), dir_normalized(0));
90  return RealTensorValue(
91  RealVectorValue(cos(aphi) * sin(theta), -sin(aphi), -cos(aphi) * cos(theta)),
92  RealVectorValue(sin(aphi) * sin(theta), cos(aphi), -sin(aphi) * cos(theta)),
93  RealVectorValue(cos(theta), 0.0, sin(theta)));
94 }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
auto norm() const -> decltype(std::norm(Real()))
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void mooseError(Args &&... args)
TensorValue< Real > RealTensorValue
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeRadialBoundaryArea()

virtual Real Component2D::computeRadialBoundaryArea ( const Real length,
const Real y 
) const
pure virtual

Computes the area of a radial boundary.

Parameters
[in]lengthLength of the radial boundary
[in]yTransverse position of the surface, which ranges from 0 (inner) to total width (outer).

Implemented in HeatStructureCylindricalBase, and HeatStructurePlate.

Referenced by buildMesh().

◆ computeRadialCoordinate()

Real DiscreteLineSegmentInterface::computeRadialCoordinate ( const Point &  p) const
inherited

Definition at line 125 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue().

126 {
127  const RealVectorValue v = (p - _position);
128  return v.cross(_dir).norm();
129 }
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const Point & _position
Start position of axis in 3-D space.
static const std::string v
Definition: NS.h:84

◆ computeRealPointFromReferencePoint() [1/2]

Point DiscreteLineSegmentInterface::computeRealPointFromReferencePoint ( const Point &  p) const
inherited

Computes point in 3-D space from a point in reference space.

Parameters
[in]pPoint in reference space

Definition at line 163 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterface::getElementBoundaryCoordinates(), and GeneratedMeshComponent::setupMesh().

164 {
166 }
const Point & _position
Start position of axis in 3-D space.
const RealTensorValue _Rx
Rotational transformation tensor about x-axis.
const RealTensorValue _R
Direction transformation tensor.
Point computeRealPointFromReferencePoint(const Point &p) const
Computes point in 3-D space from a point in reference space.

◆ computeRealPointFromReferencePoint() [2/2]

Point DiscreteLineSegmentInterface::computeRealPointFromReferencePoint ( const Point &  p,
const RealVectorValue position,
const RealTensorValue R,
const RealTensorValue Rx 
)
staticinherited

Computes point in 3-D space from a point in reference space.

Parameters
[in]pPoint in reference space

Definition at line 154 of file DiscreteLineSegmentInterface.C.

158 {
159  return R * (Rx * p) + position;
160 }
static const std::string R
Definition: NS.h:162

◆ computeReferencePointFromRealPoint() [1/2]

Point DiscreteLineSegmentInterface::computeReferencePointFromRealPoint ( const Point &  p) const
inherited

Computes point in reference space from a point in 3-D space.

Parameters
[in]pPoint in 3-D space

Definition at line 178 of file DiscreteLineSegmentInterface.C.

179 {
181 }
const RealTensorValue _Rx_inv
Inverse rotational transformation tensor about x-axis.
const Point & _position
Start position of axis in 3-D space.
Point computeReferencePointFromRealPoint(const Point &p) const
Computes point in reference space from a point in 3-D space.
const RealTensorValue _R_inv
Inverse direction transformation tensor.

◆ computeReferencePointFromRealPoint() [2/2]

Point DiscreteLineSegmentInterface::computeReferencePointFromRealPoint ( const Point &  p,
const RealVectorValue position,
const RealTensorValue R_inv,
const RealTensorValue Rx_inv 
)
staticinherited

Computes point in reference space from a point in 3-D space.

Parameters
[in]pPoint in 3-D space

Definition at line 169 of file DiscreteLineSegmentInterface.C.

173 {
174  return Rx_inv * R_inv * (p - position);
175 }

◆ computeXRotationTransformationTensor()

RealTensorValue DiscreteLineSegmentInterface::computeXRotationTransformationTensor ( const Real rotation)
staticinherited

Computes the rotation transformation tensor.

Parameters
[in]rotationRotation about the x-axis, in degrees

Definition at line 97 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterface::getElementBoundaryCoordinates().

98 {
99  const Real rotation_rad = M_PI * rotation / 180.;
100  const RealVectorValue Rx_x(1., 0., 0.);
101  const RealVectorValue Rx_y(0., cos(rotation_rad), -sin(rotation_rad));
102  const RealVectorValue Rx_z(0., sin(rotation_rad), cos(rotation_rad));
103  return RealTensorValue(Rx_x, Rx_y, Rx_z);
104 }
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sin(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tan
TensorValue< Real > RealTensorValue
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template cos(_arg) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(cos
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ 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(), FormLossFromFunction1Phase::addMooseObjects(), HeatSourceFromPowerDensity::addMooseObjects(), HeatSourceFromTotalPower::addMooseObjects(), HeatStructure2DCoupler::addMooseObjects(), HeatStructure2DRadiationCouplerRZ::addMooseObjects(), HeatTransferFromHeatFlux1Phase::addMooseObjects(), HSBoundaryAmbientConvection::addMooseObjects(), HSBoundaryHeatFlux::addMooseObjects(), HSBoundaryRadiation::addMooseObjects(), InletVelocityTemperature1Phase::addMooseObjects(), HSBoundarySpecifiedTemperature::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(), ShaftConnectedCompressor1Phase::addMooseObjects(), ShaftConnectedPump1Phase::addMooseObjects(), HeatTransferFromHeatStructure3D1Phase::addMooseObjects(), HeatTransferBase::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(), 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  }

◆ getAlignmentAxis() [1/2]

MooseEnum DiscreteLineSegmentInterface::getAlignmentAxis ( ) const
inherited

Gets an axis MooseEnum for the axis the component is aligned with.

If the axis does not align with the x, y, or z axis, then an invalid MooseEnum is returned.

Definition at line 198 of file DiscreteLineSegmentInterface.C.

Referenced by CoupledHeatTransferAction::addUserObjects(), CoupledHeatTransferAction::CoupledHeatTransferAction(), and DiscreteLineSegmentInterface::getElementBoundaryCoordinates().

199 {
200  return getAlignmentAxis(_dir);
201 }
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
MooseEnum getAlignmentAxis() const
Gets an axis MooseEnum for the axis the component is aligned with.

◆ getAlignmentAxis() [2/2]

MooseEnum DiscreteLineSegmentInterface::getAlignmentAxis ( const RealVectorValue dir)
staticinherited

Gets an axis MooseEnum for the axis the component is aligned with.

If the axis does not align with the x, y, or z axis, then an invalid MooseEnum is returned.

Definition at line 184 of file DiscreteLineSegmentInterface.C.

185 {
186  MooseEnum axis("x y z");
187  if (THM::areParallelVectors(dir, RealVectorValue(1, 0, 0)))
188  axis = "x";
189  else if (THM::areParallelVectors(dir, RealVectorValue(0, 1, 0)))
190  axis = "y";
191  else if (THM::areParallelVectors(dir, RealVectorValue(0, 0, 1)))
192  axis = "z";
193 
194  return axis;
195 }
static const std::string axis
Definition: NS.h:27
bool areParallelVectors(const RealVectorValue &a, const RealVectorValue &b, const Real &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Tests if two real-valued vectors are parallel within some absolute tolerance.
Definition: Numerics.C:26

◆ getAxialElementIndex()

unsigned int DiscreteLineSegmentInterface::getAxialElementIndex ( const Point &  p_center) const
inherited

Definition at line 143 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue().

144 {
145  const Real axial_coordinate = computeAxialCoordinate(p_center);
146  for (unsigned int i = 0; i < _n_elem; ++i)
147  if (MooseUtils::absoluteFuzzyEqual(axial_coordinate, _x_centers[i]))
148  return i;
149 
150  mooseError("No axial element index was found.");
151 }
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void mooseError(Args &&... args)
Real computeAxialCoordinate(const Point &p) const
const unsigned int _n_elem
Total number of axial elements.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _x_centers
Center axial coordinate of each axial element.

◆ getAxialOffset()

Real Component2D::getAxialOffset ( ) const
inline

Gets the axial offset for the mesh.

Definition at line 110 of file Component2D.h.

110 { return _axial_offset; }
Real _axial_offset
Distance by which to offset the mesh from the component axis.
Definition: Component2D.h:220

◆ getAxialSectionIndex()

unsigned int DiscreteLineSegmentInterface::getAxialSectionIndex ( const Point &  p) const
inherited

Definition at line 132 of file DiscreteLineSegmentInterface.C.

Referenced by DiscreteLineSegmentInterfaceTestAux::computeValue().

133 {
134  const Real axial_coordinate = computeAxialCoordinate(p);
135  for (unsigned int i = 0; i < _n_sections; ++i)
136  if (MooseUtils::absoluteFuzzyLessEqual(axial_coordinate, _section_end[i]))
137  return i;
138 
139  mooseError("No axial section index was found.");
140 }
void mooseError(Args &&... args)
Real computeAxialCoordinate(const Point &p) const
std::vector< Real > _section_end
Axial coordinate of the end of each axial section using the line &#39;position&#39; as the origin...
const unsigned int _n_sections
Number of axial sections.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool absoluteFuzzyLessEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)

◆ getBoundaryArea()

const Real & Component2D::getBoundaryArea ( const BoundaryName &  boundary_name) const

Gets the area for a boundary.

Definition at line 570 of file Component2D.C.

Referenced by HeatStructure2DCouplerBase::init().

571 {
573 
574  if (_boundary_name_to_area.find(boundary_name) != _boundary_name_to_area.end())
575  return _boundary_name_to_area.at(boundary_name);
576  else
577  mooseError(name(), ": The boundary '", boundary_name, "' does not exist on this component.");
578 }
virtual const std::string & name() const
std::map< BoundaryName, Real > _boundary_name_to_area
Map of boundary name to boundary area.
Definition: Component2D.h:214
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
void mooseError(Args &&... args) const

◆ getBoundaryInfo() [1/2]

const std::vector< std::tuple< dof_id_type, unsigned short int > > & Component2D::getBoundaryInfo ( const BoundaryName &  boundary_name) const

Gets boundary info associated with the component boundary.

Parameters
[in]boundaryBoundary name of a component boundary
Returns
The list of tuples (element id, local side id) that is associated with boundary boundary

Definition at line 519 of file Component2D.C.

Referenced by getBoundaryInfo(), HeatStructure2DCouplerBase::setupMesh(), and HeatTransferFromHeatStructure1Phase::setupMesh().

520 {
522 
523  if (_boundary_info.find(boundary_name) != _boundary_info.end())
524  return _boundary_info.at(boundary_name);
525  else
526  mooseError(name(), ": The boundary '", boundary_name, "' does not exist on this component.");
527 }
virtual const std::string & name() const
std::map< BoundaryName, std::vector< std::tuple< dof_id_type, unsigned short int > > > _boundary_info
Map of boundary name to list of tuples of element and side IDs for that boundary. ...
Definition: Component2D.h:217
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
void mooseError(Args &&... args) const

◆ getBoundaryInfo() [2/2]

const std::vector< std::tuple< dof_id_type, unsigned short int > > & Component2D::getBoundaryInfo ( const ExternalBoundaryType boundary_type) const

Gets boundary info associated with a external boundary type.

Parameters
[in]boundary_typeThe external boundary type
Returns
The list of tuples (element id, local side id) associated the external boundary type

Definition at line 530 of file Component2D.C.

531 {
533 
534  switch (boundary_type)
535  {
544  default:
545  mooseError(name(), ": Invalid external boundary type.");
546  }
547 }
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
virtual const std::string & name() const
const std::vector< std::tuple< dof_id_type, unsigned short int > > & getBoundaryInfo(const BoundaryName &boundary_name) const
Gets boundary info associated with the component boundary.
Definition: Component2D.C:519
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
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
void mooseError(Args &&... args) const
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197

◆ 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

◆ 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

◆ getDirection()

virtual RealVectorValue DiscreteLineSegmentInterface::getDirection ( ) const
inlinevirtualinherited

◆ getElementBoundaryCoordinates() [1/2]

std::vector< Real > DiscreteLineSegmentInterface::getElementBoundaryCoordinates ( ) const
inherited

Gets the element boundary coordinates for the aligned axis.

Definition at line 254 of file DiscreteLineSegmentInterface.C.

Referenced by CoupledHeatTransferAction::addUserObjects().

255 {
257 }
std::vector< Real > _lengths
Length of each axial section.
const Real & _rotation
Angle of rotation about the x-axis.
const RealVectorValue _dir
Normalized direction of axis from start position to end position.
const Point & _position
Start position of axis in 3-D space.
const std::vector< unsigned int > & _n_elems
Number of elements in each axial section.
std::vector< Real > getElementBoundaryCoordinates() const
Gets the element boundary coordinates for the aligned axis.

◆ getElementBoundaryCoordinates() [2/2]

std::vector< Real > DiscreteLineSegmentInterface::getElementBoundaryCoordinates ( const RealVectorValue position,
const RealVectorValue orientation,
const Real rotation,
const std::vector< Real > &  lengths,
const std::vector< unsigned int > &  n_elems 
)
staticinherited

Gets the element boundary coordinates for the aligned axis.

Parameters
[in]positionStart position of axis in 3-D space
[in]orientationDirection of axis from start position to end position
[in]rotationAngle of rotation about the x-axis, in degrees
[in]lengthsLength of each axial section
[in]n_elemsNumber of elements in each axial section

Definition at line 204 of file DiscreteLineSegmentInterface.C.

210 {
211  const auto axis = getAlignmentAxis(orientation);
212 
213  unsigned int d;
214  if (axis == "x")
215  d = 0;
216  else if (axis == "y")
217  d = 1;
218  else if (axis == "z")
219  d = 2;
220  else
221  mooseError("Invalid axis.");
222 
223  const auto R = computeDirectionTransformationTensor(orientation);
224  const auto Rx = computeXRotationTransformationTensor(rotation);
225 
226  const unsigned int n_elems_total = std::accumulate(n_elems.begin(), n_elems.end(), 0);
227  const unsigned int n_sections = lengths.size();
228 
229  unsigned int i_section_start = 0;
230  Real section_start_ref_position = 0.0;
231  std::vector<Real> element_boundary_coordinates(n_elems_total + 1);
232  element_boundary_coordinates[0] =
233  computeRealPointFromReferencePoint(Point(0, 0, 0), position, R, Rx)(d);
234  for (unsigned int j = 0; j < n_sections; ++j)
235  {
236  const Real section_dx = lengths[j] / n_elems[j];
237  for (unsigned int k = 0; k < n_elems[j]; ++k)
238  {
239  const unsigned int i = i_section_start + k + 1;
240  const Real ref_position = section_start_ref_position + section_dx * k;
241  const Point ref_point = Point(ref_position, 0, 0);
242  element_boundary_coordinates[i] =
243  computeRealPointFromReferencePoint(ref_point, position, R, Rx)(d);
244  }
245 
246  section_start_ref_position += lengths[j];
247  i_section_start += n_elems[j];
248  }
249 
250  return element_boundary_coordinates;
251 }
void mooseError(Args &&... args)
static RealTensorValue computeXRotationTransformationTensor(const Real &rotation)
Computes the rotation transformation tensor.
static RealTensorValue computeDirectionTransformationTensor(const RealVectorValue &dir)
Computes the direction transformation tensor.
static const std::string axis
Definition: NS.h:27
static const std::string R
Definition: NS.h:162
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseEnum getAlignmentAxis() const
Gets an axis MooseEnum for the axis the component is aligned with.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Point computeRealPointFromReferencePoint(const Point &p) const
Computes point in 3-D space from a point in reference space.
static const std::string k
Definition: NS.h:130

◆ 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

◆ getExternalBoundaryName()

const BoundaryName & Component2D::getExternalBoundaryName ( const ExternalBoundaryType boundary_type) const

Gets the name of an external boundary by type.

Parameters
[in]boundary_typeThe external boundary type

Definition at line 550 of file Component2D.C.

Referenced by HSBoundaryInterface::getHSBoundaryName().

551 {
553 
554  switch (boundary_type)
555  {
557  return _boundary_name_outer;
559  return _boundary_name_inner;
561  return _boundary_name_start;
563  return _boundary_name_end;
564  default:
565  mooseError(name(), ": Invalid external boundary type.");
566  }
567 }
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
virtual const std::string & name() const
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
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
void mooseError(Args &&... args) const
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197

◆ getExternalBoundaryType()

Component2D::ExternalBoundaryType Component2D::getExternalBoundaryType ( const BoundaryName &  boundary_name) const

Gets the external boundary type of the given boundary.

An error is thrown if the supplied boundary name does not exist in this component or if the boundary is interior.

Parameters
[in]boundary_nameBoundary name for which to get boundary type

Definition at line 496 of file Component2D.C.

Referenced by HSBoundary::check(), and HeatStructure2DCouplerBase::init().

497 {
499 
500  if (boundary_name == _boundary_name_inner ||
503  else if (boundary_name == _boundary_name_outer ||
506  else if (boundary_name == _boundary_name_start ||
509  else if (boundary_name == _boundary_name_end ||
512  else if (hasBoundary(boundary_name))
513  mooseError(name(), ": The boundary '", boundary_name, "' is an interior boundary.");
514  else
515  mooseError(name(), ": The boundary '", boundary_name, "' does not exist on this component.");
516 }
bool hasBoundary(const BoundaryName &boundary_name) const
Returns true if this component has the supplied boundary.
Definition: Component2D.C:473
std::vector< BoundaryName > _boundary_names_radial_end
Boundary names of the radial regions of the end side of the component.
Definition: Component2D.h:209
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
virtual const std::string & name() const
std::vector< BoundaryName > _boundary_names_axial_inner
Boundary names of the axial regions of the inner side of the component.
Definition: Component2D.h:205
std::vector< BoundaryName > _boundary_names_radial_start
Boundary names of the radial regions of the start side of the component.
Definition: Component2D.h:207
std::vector< BoundaryName > _boundary_names_axial_outer
Boundary names of the axial regions of the outer side of the component.
Definition: Component2D.h:203
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
bool isBoundaryInVector(const BoundaryName &boundary_name, const std::vector< BoundaryName > &boundary_name_vector) const
Returns true if the supplied boundary is in the given vector.
Definition: Component2D.C:465
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
void mooseError(Args &&... args) const
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197

◆ getExternalBoundaryTypeMooseEnum()

MooseEnum Component2D::getExternalBoundaryTypeMooseEnum ( const std::string &  default_value = "")
static

Gets the MooseEnum corresponding to ExternalBoundaryType.

Parameters
[in]default_valueDefault value; omit to have no default

Definition at line 21 of file Component2D.C.

Referenced by HSBoundaryInterface::validParams().

22 {
23  return THM::getMooseEnum<ExternalBoundaryType>(name, _external_boundary_type_to_enum);
24 }
virtual const std::string & name() const
static const std::map< std::string, ExternalBoundaryType > _external_boundary_type_to_enum
map of external boundary type string to enum
Definition: Component2D.h:234

◆ getLength()

virtual Real DiscreteLineSegmentInterface::getLength ( ) const
inlinevirtualinherited

◆ getNames()

const std::vector<std::string>& Component2D::getNames ( ) const
inline

Gets the names of the transverse regions.

Definition at line 50 of file Component2D.h.

Referenced by HeatStructureBase::addConstantDensitySolidPropertiesMaterial().

50 { return _names; }
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159

◆ getNodeIDs()

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

Gets the node IDs corresponding to this component.

Definition at line 291 of file Component.C.

292 {
294 
295  return _node_ids;
296 }
std::vector< dof_id_type > _node_ids
Node IDs of this component.
Definition: Component.h:455
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

◆ getNumElems()

virtual Real DiscreteLineSegmentInterface::getNumElems ( ) const
inlinevirtualinherited

Definition at line 31 of file DiscreteLineSegmentInterface.h.

Referenced by HeatTransferFromHeatStructure1Phase::check(), and HeatTransferFromHeatStructure3D1Phase::init().

31 { return _n_elem; }
const unsigned int _n_elem
Total number of axial elements.

◆ getNumRegions()

unsigned int Component2D::getNumRegions ( ) const
inline

Gets the number of transverse regions.

Definition at line 38 of file Component2D.h.

38 { return _n_regions; }
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157

◆ getPosition()

virtual Point DiscreteLineSegmentInterface::getPosition ( ) const
inlinevirtualinherited

◆ getRotation()

virtual Real DiscreteLineSegmentInterface::getRotation ( ) const
inlinevirtualinherited

Definition at line 29 of file DiscreteLineSegmentInterface.h.

29 { return _rotation; }
const Real & _rotation
Angle of rotation about the x-axis.

◆ 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(), ShaftConnectedCompressor1Phase::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(), InletVelocityTemperature1Phase::addMooseObjects(), HeatStructure2DRadiationCouplerRZ::addMooseObjects(), HeatStructure2DCoupler::addMooseObjects(), HeatTransferFromHeatFlux1Phase::addMooseObjects(), InletStagnationPressureTemperature1Phase::addMooseObjects(), HSBoundaryHeatFlux::addMooseObjects(), HeatSourceFromTotalPower::addMooseObjects(), HSBoundaryAmbientConvection::addMooseObjects(), SolidWall1Phase::addMooseObjects(), InletMassFlowRateTemperature1Phase::addMooseObjects(), InletDensityVelocity1Phase::addMooseObjects(), HSBoundarySpecifiedTemperature::addMooseObjects(), HSBoundaryRadiation::addMooseObjects(), InletFunction1Phase::addMooseObjects(), HeatSourceFromPowerDensity::addMooseObjects(), Outlet1Phase::addMooseObjects(), GateValve1Phase::addMooseObjects(), HeatSourceVolumetric1Phase::addMooseObjects(), HSBoundaryExternalAppTemperature::addMooseObjects(), Shaft::addMooseObjects(), FormLossFromExternalApp1Phase::addMooseObjects(), HeatTransferFromSpecifiedTemperature1Phase::addMooseObjects(), TotalPower::addMooseObjects(), VolumeJunction1Phase::addMooseObjects(), FreeBoundary1Phase::addMooseObjects(), HeatTransferFromExternalAppHeatFlux1Phase::addMooseObjects(), ShaftConnectedCompressor1Phase::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(), ShaftConnectedCompressor1Phase::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

◆ getTotalWidth()

const Real& Component2D::getTotalWidth ( ) const
inline

Gets the total width of all transverse regions.

Definition at line 33 of file Component2D.h.

Referenced by buildMesh().

33 { return _total_width; }
Real _total_width
Total width of all transverse regions.
Definition: Component2D.h:163

◆ getVariableFn()

const FunctionName & GeometricalComponent::getVariableFn ( const FunctionName &  fn_param_name)
protectedinherited

Makes a constant function parameter controllable and returns its name.

Parameters
[in]fn_param_nameFunctionName parameter

Definition at line 79 of file GeometricalComponent.C.

80 {
81  const FunctionName & fn_name = getParam<FunctionName>(fn_param_name);
82  const Function & fn = getTHMProblem().getFunction(fn_name);
83 
84  if (dynamic_cast<const ConstantFunction *>(&fn) != nullptr)
85  {
86  connectObject(fn.parameters(), fn_name, fn_param_name, "value");
87  }
88 
89  return fn_name;
90 }
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
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

◆ getVolumes()

const std::vector<Real>& Component2D::getVolumes ( ) const
inline

Gets the volumes of the transverse regions.

Definition at line 55 of file Component2D.h.

55 { return _volume; }
std::vector< Real > _volume
Volume of each transverse region.
Definition: Component2D.h:165

◆ hasBlock()

bool Component2D::hasBlock ( const std::string &  name) const

Returns true if there is a transverse region of a given name.

Parameters
nameThe name of the transverse region

Definition at line 59 of file Component2D.C.

Referenced by HeatSourceBase::check().

60 {
61  return std::find(_names.begin(), _names.end(), name) != _names.end();
62 }
virtual const std::string & name() const
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159

◆ hasBoundary()

bool Component2D::hasBoundary ( const BoundaryName &  boundary_name) const

Returns true if this component has the supplied boundary.

Parameters
[in]boundary_nameBoundary name to check

Definition at line 473 of file Component2D.C.

Referenced by HeatStructure2DRadiationCouplerRZ::check(), HeatStructure2DCouplerBase::check(), getExternalBoundaryType(), HeatStructure2DCouplerBase::init(), and HeatStructure2DCouplerBase::setupMesh().

474 {
476 
477  return hasExternalBoundary(boundary_name) ||
480 }
std::vector< BoundaryName > _boundary_names_inner_radial
Boundary names of the inner radial boundary regions of the component.
Definition: Component2D.h:211
std::vector< BoundaryName > _boundary_names_interior_axial_per_radial_section
Boundary names of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:201
bool isBoundaryInVector(const BoundaryName &boundary_name, const std::vector< BoundaryName > &boundary_name_vector) const
Returns true if the supplied boundary is in the given vector.
Definition: Component2D.C:465
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
bool hasExternalBoundary(const BoundaryName &boundary_name) const
Returns true if this component has the supplied external boundary.
Definition: Component2D.C:483

◆ 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

◆ hasExternalBoundary()

bool Component2D::hasExternalBoundary ( const BoundaryName &  boundary_name) const

Returns true if this component has the supplied external boundary.

Parameters
[in]boundary_nameBoundary name to check

Definition at line 483 of file Component2D.C.

Referenced by HSBoundary::check(), and hasBoundary().

484 {
486 
487  return boundary_name == _boundary_name_inner || boundary_name == _boundary_name_outer ||
488  boundary_name == _boundary_name_start || boundary_name == _boundary_name_end ||
493 }
std::vector< BoundaryName > _boundary_names_radial_end
Boundary names of the radial regions of the end side of the component.
Definition: Component2D.h:209
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
std::vector< BoundaryName > _boundary_names_axial_inner
Boundary names of the axial regions of the inner side of the component.
Definition: Component2D.h:205
std::vector< BoundaryName > _boundary_names_radial_start
Boundary names of the radial regions of the start side of the component.
Definition: Component2D.h:207
std::vector< BoundaryName > _boundary_names_axial_outer
Boundary names of the axial regions of the outer side of the component.
Definition: Component2D.h:203
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
bool isBoundaryInVector(const BoundaryName &boundary_name, const std::vector< BoundaryName > &boundary_name_vector) const
Returns true if the supplied boundary is in the given vector.
Definition: Component2D.C:465
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
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197

◆ 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()

virtual void Component::init ( )
inlineprotectedvirtualinherited

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 in FlowChannelBase, Component1DConnection, HeatTransferBase, HeatStructureBase, FlowChannel1PhaseBase, HeatTransferFromHeatStructure3D1Phase, HeatStructureFromFile3D, HeatTransfer1PhaseBase, FileMeshPhysicsComponent, FlowBoundary, FlowJunction, Shaft, HeatStructure2DCouplerBase, JunctionOneToOne1Phase, FlowBoundary1PhaseBase, HeatSourceFromTotalPower, HeatStructure2DRadiationCouplerRZ, FlowJunction1Phase, TestSetupStatusComponent, and FormLoss1PhaseBase.

Definition at line 290 of file Component.h.

Referenced by Component::executeInit(), FormLoss1PhaseBase::init(), HeatSourceFromTotalPower::init(), HeatStructure2DCouplerBase::init(), Shaft::init(), FileMeshPhysicsComponent::init(), HeatStructureFromFile3D::init(), HeatTransferFromHeatStructure3D1Phase::init(), HeatStructureBase::init(), HeatTransferBase::init(), Component1DConnection::init(), and FlowChannelBase::init().

290 {}

◆ initSecondary()

virtual void Component::initSecondary ( )
inlineprotectedvirtualinherited

◆ 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

◆ isBoundaryInVector()

bool Component2D::isBoundaryInVector ( const BoundaryName &  boundary_name,
const std::vector< BoundaryName > &  boundary_name_vector 
) const

Returns true if the supplied boundary is in the given vector.

Definition at line 465 of file Component2D.C.

Referenced by getExternalBoundaryType(), hasBoundary(), and hasExternalBoundary().

467 {
468  return std::find(boundary_name_vector.begin(), boundary_name_vector.end(), boundary_name) !=
469  boundary_name_vector.end();
470 }

◆ 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(), 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(), build2DMesh(), build2DMesh2ndOrder(), 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

◆ 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 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 GeneratedMeshComponent::setupMesh ( )
overrideprotectedvirtualinherited

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

Reimplemented from Component.

Reimplemented in HeatStructureCylindricalBase.

Definition at line 38 of file GeneratedMeshComponent.C.

Referenced by HeatStructureCylindricalBase::setupMesh().

39 {
41 
42  buildMesh();
43 
44  // displace nodes
45  for (auto && node_id : _node_ids)
46  {
47  Node & curr_node = mesh().nodeRef(node_id);
48  RealVectorValue p(curr_node(0), curr_node(1), curr_node(2));
50  }
51 }
void generateNodeLocations()
Generates axial node locations and stores in _node_locations.
virtual const Node & nodeRef(const dof_id_type i) const
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
virtual void buildMesh()=0
Point computeRealPointFromReferencePoint(const Point &p) const
Computes point in 3-D space from a point in reference space.

◆ 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

◆ usingSecondOrderMesh()

virtual bool GeneratedMeshComponent::usingSecondOrderMesh ( ) const
protectedpure virtualinherited

Check if second order mesh is being used by this geometrical component.

Returns
true if second order mesh is being used, otherwise false

Implemented in Component1D, and HeatStructureBase.

Referenced by buildMesh(), GeneratedMeshComponent::check(), and GeneratedMeshComponent::computeNumberOfNodes().

◆ validParams()

InputParameters Component2D::validParams ( )
static

Definition at line 35 of file Component2D.C.

Referenced by HeatStructureBase::validParams().

36 {
38  return params;
39 }
static InputParameters validParams()

Member Data Documentation

◆ _axial_inner_bc_id

std::vector<unsigned int> Component2D::_axial_inner_bc_id
protected

BC ID of the axial regions of the inner boundary of the component.

Definition at line 184 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _axial_offset

Real Component2D::_axial_offset
mutableprotected

Distance by which to offset the mesh from the component axis.

Definition at line 220 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), getAxialOffset(), and HeatStructureCylindricalBase::setupMesh().

◆ _axial_outer_bc_id

std::vector<unsigned int> Component2D::_axial_outer_bc_id
protected

BC ID of the axial regions of the outer boundary of the component.

Definition at line 182 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _axial_region_names

const std::vector<std::string>& GeneratedMeshComponent::_axial_region_names
protectedinherited

◆ _boundary_info

std::map<BoundaryName, std::vector<std::tuple<dof_id_type, unsigned short int> > > Component2D::_boundary_info
protected

Map of boundary name to list of tuples of element and side IDs for that boundary.

Definition at line 217 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and getBoundaryInfo().

◆ _boundary_name_end

BoundaryName Component2D::_boundary_name_end
protected

Boundary name of the end side of the component.

Definition at line 199 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getBoundaryInfo(), getExternalBoundaryName(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_name_inner

BoundaryName Component2D::_boundary_name_inner
protected

Boundary name of the inner side of the component.

Definition at line 195 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getBoundaryInfo(), getExternalBoundaryName(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_name_outer

BoundaryName Component2D::_boundary_name_outer
protected

Boundary name of the outer side of the component.

Definition at line 193 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getBoundaryInfo(), getExternalBoundaryName(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_name_start

BoundaryName Component2D::_boundary_name_start
protected

Boundary name of the start side of the component.

Definition at line 197 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getBoundaryInfo(), getExternalBoundaryName(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_name_to_area

std::map<BoundaryName, Real> Component2D::_boundary_name_to_area
protected

Map of boundary name to boundary area.

Definition at line 214 of file Component2D.h.

Referenced by buildMesh(), and getBoundaryArea().

◆ _boundary_names_axial_inner

std::vector<BoundaryName> Component2D::_boundary_names_axial_inner
protected

Boundary names of the axial regions of the inner side of the component.

Definition at line 205 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_names_axial_outer

std::vector<BoundaryName> Component2D::_boundary_names_axial_outer
protected

Boundary names of the axial regions of the outer side of the component.

Definition at line 203 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_names_inner_radial

std::vector<BoundaryName> Component2D::_boundary_names_inner_radial
protected

Boundary names of the inner radial boundary regions of the component.

Definition at line 211 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), and hasBoundary().

◆ _boundary_names_interior_axial_per_radial_section

std::vector<BoundaryName> Component2D::_boundary_names_interior_axial_per_radial_section
protected

Boundary names of the interior axial boundaries (per radial section) of the component.

Definition at line 201 of file Component2D.h.

Referenced by build2DMesh(), buildMesh(), and hasBoundary().

◆ _boundary_names_radial_end

std::vector<BoundaryName> Component2D::_boundary_names_radial_end
protected

Boundary names of the radial regions of the end side of the component.

Definition at line 209 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _boundary_names_radial_start

std::vector<BoundaryName> Component2D::_boundary_names_radial_start
protected

Boundary names of the radial regions of the start side of the component.

Definition at line 207 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), getExternalBoundaryType(), and hasExternalBoundary().

◆ _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().

◆ _dir

const RealVectorValue DiscreteLineSegmentInterface::_dir
protectedinherited

◆ _dir_unnormalized

const RealVectorValue& DiscreteLineSegmentInterface::_dir_unnormalized
protectedinherited

Unnormalized direction of axis from start position to end position.

Definition at line 93 of file DiscreteLineSegmentInterface.h.

◆ _elem_ids

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

◆ _end_bc_id

unsigned int Component2D::_end_bc_id
protected

BC ID of the component (end)

Definition at line 178 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _external_boundary_type_to_enum

const std::map< std::string, Component2D::ExternalBoundaryType > Component2D::_external_boundary_type_to_enum
static
Initial value:

map of external boundary type string to enum

Definition at line 234 of file Component2D.h.

Referenced by getExternalBoundaryTypeMooseEnum(), and 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(), ShaftConnectedCompressor1Phase::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(), ShaftConnectedCompressor1Phase::buildVolumeJunctionUserObject(), ShaftConnectedPump1Phase::buildVolumeJunctionUserObject(), and VolumeJunction1Phase::buildVolumeJunctionUserObject().

◆ _inner_bc_id

unsigned int Component2D::_inner_bc_id
protected

BC ID of the component (inner)

Definition at line 174 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _inner_radial_bc_id

std::vector<unsigned int> Component2D::_inner_radial_bc_id
protected

BC ID of the inner radial boundary regions of the component.

Definition at line 190 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _interior_axial_per_radial_section_bc_id

std::vector<unsigned int> Component2D::_interior_axial_per_radial_section_bc_id
protected

BC ID of the interior axial boundaries (per radial section) of the component.

Definition at line 180 of file Component2D.h.

Referenced by build2DMesh(), and buildMesh().

◆ _length

Real DiscreteLineSegmentInterface::_length
protectedinherited

◆ _lengths

std::vector<Real> DiscreteLineSegmentInterface::_lengths
protectedinherited

◆ _log

Logger& LoggingInterface::_log
protectedinherited

◆ _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().

◆ _moose_object_name_dlsi

const std::string DiscreteLineSegmentInterface::_moose_object_name_dlsi
protectedinherited

Name of the MOOSE object.

Definition at line 128 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::computeAxialCoordinate().

◆ _n_elem

const unsigned int DiscreteLineSegmentInterface::_n_elem
protectedinherited

◆ _n_elems

const std::vector<unsigned int>& DiscreteLineSegmentInterface::_n_elems
protectedinherited

◆ _n_part_elems

std::vector<unsigned int> Component2D::_n_part_elems
protected

Number of elements in each transverse region.

Definition at line 167 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), buildMesh(), HeatStructureCylindrical::HeatStructureCylindrical(), and HeatStructurePlate::HeatStructurePlate().

◆ _n_regions

unsigned int Component2D::_n_regions
protected

◆ _n_sections

const unsigned int DiscreteLineSegmentInterface::_n_sections
protectedinherited

◆ _names

std::vector<std::string> Component2D::_names
protected

◆ _node_ids

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

◆ _node_locations

std::vector<Real> GeneratedMeshComponent::_node_locations
protectedinherited

◆ _outer_bc_id

unsigned int Component2D::_outer_bc_id
protected

BC ID of the component (outer)

Definition at line 172 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _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& DiscreteLineSegmentInterface::_position
protectedinherited

◆ _R

const RealTensorValue DiscreteLineSegmentInterface::_R
protectedinherited

Direction transformation tensor.

Definition at line 118 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::computeRealPointFromReferencePoint().

◆ _R_inv

const RealTensorValue DiscreteLineSegmentInterface::_R_inv
protectedinherited

Inverse direction transformation tensor.

Definition at line 123 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::computeReferencePointFromRealPoint().

◆ _radial_end_bc_id

std::vector<unsigned int> Component2D::_radial_end_bc_id
protected

BC ID of the radial regions of the end boundary of the component.

Definition at line 188 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _radial_start_bc_id

std::vector<unsigned int> Component2D::_radial_start_bc_id
protected

BC ID of the radial regions of the start boundary of the component.

Definition at line 186 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _rotation

const Real& DiscreteLineSegmentInterface::_rotation
protectedinherited

◆ _Rx

const RealTensorValue DiscreteLineSegmentInterface::_Rx
protectedinherited

Rotational transformation tensor about x-axis.

Definition at line 120 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::computeRealPointFromReferencePoint().

◆ _Rx_inv

const RealTensorValue DiscreteLineSegmentInterface::_Rx_inv
protectedinherited

Inverse rotational transformation tensor about x-axis.

Definition at line 125 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::computeReferencePointFromRealPoint().

◆ _section_end

std::vector<Real> DiscreteLineSegmentInterface::_section_end
protectedinherited

Axial coordinate of the end of each axial section using the line 'position' as the origin.

Definition at line 112 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::DiscreteLineSegmentInterface(), and DiscreteLineSegmentInterface::getAxialSectionIndex().

◆ _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().

◆ _start_bc_id

unsigned int Component2D::_start_bc_id
protected

BC ID of the component (start)

Definition at line 176 of file Component2D.h.

Referenced by build2DMesh(), build2DMesh2ndOrder(), and buildMesh().

◆ _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 build2DMesh(), 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().

◆ _total_elem_number

unsigned int Component2D::_total_elem_number
protected

◆ _total_width

Real Component2D::_total_width
protected

◆ _volume

std::vector<Real> Component2D::_volume
protected

Volume of each transverse region.

Definition at line 165 of file Component2D.h.

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

◆ _width

std::vector<Real> Component2D::_width
protected

◆ _x_centers

std::vector<Real> DiscreteLineSegmentInterface::_x_centers
protectedinherited

Center axial coordinate of each axial element.

Definition at line 115 of file DiscreteLineSegmentInterface.h.

Referenced by DiscreteLineSegmentInterface::DiscreteLineSegmentInterface(), and DiscreteLineSegmentInterface::getAxialElementIndex().

◆ _zero

const Real& Component::_zero
protectedinherited

Definition at line 448 of file Component.h.


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