https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SubChannelAddVariablesAction Class Reference

Action that adds SubChannel variables needs for the solve. More...

#include <SubChannelAddVariablesAction.h>

Inheritance diagram for SubChannelAddVariablesAction:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SubChannelAddVariablesAction (const InputParameters &parameters)
 
virtual void act () override
 
void timedAct ()
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (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
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) 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
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string unique_action_name_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

void addAuxVariable (const std::string &var_name, const std::vector< SubdomainName > &blocks)
 Add a block-restricted auxiliary variable unless the user already defined it.
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const MooseEnum _fe_family
 FE family of the aux variables added by this action.
 
const MooseEnum _fe_order
 FE order of the aux variables added by this action.
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Private Member Functions

bool addRelationshipManager (Moose::RelationshipManagerType input_rm_type, 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)
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValuegetMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const ParallelParamObject_parent
 
MooseApp_meta_data_app
 
const MooseObject *const _meta_data_object
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 

Detailed Description

Action that adds SubChannel variables needs for the solve.

Definition at line 19 of file SubChannelAddVariablesAction.h.

Constructor & Destructor Documentation

◆ SubChannelAddVariablesAction()

SubChannelAddVariablesAction::SubChannelAddVariablesAction ( const InputParameters parameters)

Definition at line 29 of file SubChannelAddVariablesAction.C.

33{
34}
static MooseEnum getAuxVariableFamilies()
static MooseEnum getAuxVariableOrders()
const InputParameters & parameters() const
const MooseEnum _fe_order
FE order of the aux variables added by this action.
const MooseEnum _fe_family
FE family of the aux variables added by this action.

Member Function Documentation

◆ act()

void SubChannelAddVariablesAction::act ( )
overridevirtual

Implements Action.

Definition at line 55 of file SubChannelAddVariablesAction.C.

56{
57 bool pin_mesh_exist = false;
58 bool duct_mesh_exist = false;
59
60 std::vector<SubdomainName> fluid_blocks;
61 std::vector<SubdomainName> pin_blocks;
62 std::vector<SubdomainName> duct_blocks;
63
64 const auto & mesh_actions = _awh.getActions<AddMeshGeneratorAction>();
65
66 for (const auto * mesh_action : mesh_actions)
67 {
68 if (!mesh_action->parameters().isParamValid("type"))
69 continue;
70
71 const auto & generator_type = mesh_action->getParam<std::string>("type");
72
73 if (generator_type == "SCMQuadAssemblyMeshGenerator")
74 {
75 fluid_blocks = {"subchannel"};
76 const auto & mesh_generator_params = mesh_action->getObjectParams();
77 const auto nx = mesh_generator_params.get<unsigned int>("nx");
78 const auto ny = mesh_generator_params.get<unsigned int>("ny");
79 if (nx > 1 && ny > 1)
80 {
81 pin_mesh_exist = true;
82 pin_blocks = {"fuel_pins"};
83 }
84 }
85 else if (generator_type == "SCMTriAssemblyMeshGenerator")
86 {
87 fluid_blocks = {"subchannel"};
88 pin_mesh_exist = true;
89 pin_blocks = {"fuel_pins"};
90 }
91 else if (generator_type == "SCMQuadSubChannelMeshGenerator" ||
92 generator_type == "SCMTriSubChannelMeshGenerator")
93 {
94 // Use the user-provided mesh generator block name
95 fluid_blocks = {mesh_action->name()};
96 }
97
98 if (generator_type == "SCMTriPinMeshGenerator" || generator_type == "SCMQuadPinMeshGenerator")
99 {
100 pin_mesh_exist = true;
101 // Use the user-provided mesh generator block name
102 pin_blocks = {mesh_action->name()};
103 }
104
105 if (generator_type == "SCMTriDuctMeshGenerator" || generator_type == "SCMQuadDuctMeshGenerator")
106 {
107 duct_mesh_exist = true;
108 // Use the user-provided mesh generator block name
109 duct_blocks = {mesh_action->name()};
110 }
111 }
112
113 // Backward-compatible fallback if no explicit subchannel mesh generator name was found
114 if (fluid_blocks.empty())
115 fluid_blocks = {"subchannel"};
116
117 std::vector<std::pair<std::string, std::vector<SubdomainName>>> vars_to_add;
118
119 // Always-fluid variables
120 vars_to_add.push_back({SubChannelApp::MASS_FLOW_RATE, fluid_blocks});
121 vars_to_add.push_back({SubChannelApp::SURFACE_AREA, fluid_blocks});
122 vars_to_add.push_back({SubChannelApp::SUM_CROSSFLOW, fluid_blocks});
123 vars_to_add.push_back({SubChannelApp::PRESSURE, fluid_blocks});
124 vars_to_add.push_back({SubChannelApp::WETTED_PERIMETER, fluid_blocks});
125 vars_to_add.push_back({SubChannelApp::ENTHALPY, fluid_blocks});
126 vars_to_add.push_back({SubChannelApp::TEMPERATURE, fluid_blocks});
127 vars_to_add.push_back({SubChannelApp::DENSITY, fluid_blocks});
128 vars_to_add.push_back({SubChannelApp::VISCOSITY, fluid_blocks});
129 vars_to_add.push_back({SubChannelApp::DISPLACEMENT, fluid_blocks});
130
131 // q_prime lives on pins if pins exist, otherwise on the fluid mesh
132 if (pin_mesh_exist)
133 vars_to_add.push_back({SubChannelApp::LINEAR_HEAT_RATE, pin_blocks});
134 else
135 vars_to_add.push_back({SubChannelApp::LINEAR_HEAT_RATE, fluid_blocks});
136
137 // Pin-only variables
138 if (pin_mesh_exist)
139 {
140 vars_to_add.push_back({SubChannelApp::PIN_TEMPERATURE, pin_blocks});
141 vars_to_add.push_back({SubChannelApp::PIN_DIAMETER, pin_blocks});
142 // HTC is a subchannel-average output stored on the fluid mesh.
143 vars_to_add.push_back({SubChannelApp::HEAT_TRANSFER_COEFFICIENT, fluid_blocks});
144 }
145
146 // Duct-only variables
147 if (duct_mesh_exist)
148 {
149 vars_to_add.push_back({SubChannelApp::DUCT_HEAT_FLUX, duct_blocks});
150 vars_to_add.push_back({SubChannelApp::DUCT_TEMPERATURE, duct_blocks});
151 }
152
153 if (getParam<bool>("full_output"))
154 {
155 vars_to_add.push_back({SubChannelApp::PRESSURE_DROP, fluid_blocks});
156 vars_to_add.push_back({SubChannelApp::FRICTION_FACTOR, fluid_blocks});
157 }
158
159 for (const auto & var_info : vars_to_add)
160 addAuxVariable(var_info.first, var_info.second);
161}
std::vector< const T * > getActions()
ActionWarehouse & _awh
const T & getParam(const std::string &name) const
void addAuxVariable(const std::string &var_name, const std::vector< SubdomainName > &blocks)
Add a block-restricted auxiliary variable unless the user already defined it.
static const std::string ENTHALPY
static const std::string DISPLACEMENT
static const std::string PRESSURE_DROP
static const std::string WETTED_PERIMETER
static const std::string PRESSURE
static const std::string DUCT_TEMPERATURE
static const std::string FRICTION_FACTOR
static const std::string MASS_FLOW_RATE
static const std::string SURFACE_AREA
static const std::string VISCOSITY
static const std::string DENSITY
static const std::string PIN_DIAMETER
static const std::string HEAT_TRANSFER_COEFFICIENT
static const std::string LINEAR_HEAT_RATE
static const std::string DUCT_HEAT_FLUX
static const std::string SUM_CROSSFLOW
static const std::string PIN_TEMPERATURE
static const std::string TEMPERATURE

◆ addAuxVariable()

void SubChannelAddVariablesAction::addAuxVariable ( const std::string &  var_name,
const std::vector< SubdomainName > &  blocks 
)
protected

Add a block-restricted auxiliary variable unless the user already defined it.

Definition at line 37 of file SubChannelAddVariablesAction.C.

39{
40 const auto & aux_actions = _awh.getActions<AddAuxVariableAction>();
41
42 for (const auto * aux_action : aux_actions)
43 if (aux_action->name() == var_name)
44 return;
45
46 auto params = _factory.getValidParams("MooseVariable");
47 params.set<MooseEnum>("family") = _fe_family;
48 params.set<MooseEnum>("order") = _fe_order;
49 params.set<std::vector<SubdomainName>>("block") = blocks;
50
51 _problem->addAuxVariable("MooseVariable", var_name, params);
52}
std::shared_ptr< FEProblemBase > & _problem
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
const std::string & name() const
Factory & _factory
if(subdm)

Referenced by act().

◆ validParams()

InputParameters SubChannelAddVariablesAction::validParams ( )
static

Definition at line 21 of file SubChannelAddVariablesAction.C.

22{
24 params.addClassDescription("Adds the variables associated with the subchannel problem");
25 params.addParam<bool>("full_output", false, "Add optional subchannel output variables");
26 return params;
27}
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _fe_family

const MooseEnum SubChannelAddVariablesAction::_fe_family
protected

FE family of the aux variables added by this action.

Definition at line 33 of file SubChannelAddVariablesAction.h.

Referenced by addAuxVariable().

◆ _fe_order

const MooseEnum SubChannelAddVariablesAction::_fe_order
protected

FE order of the aux variables added by this action.

Definition at line 35 of file SubChannelAddVariablesAction.h.

Referenced by addAuxVariable().


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