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

Main class for simulation (the driver of the simulation) More...

#include <Simulation.h>

Inheritance diagram for Simulation:
[legend]

Classes

struct  ICInfo
 
struct  VariableInfo
 Variable information. More...
 

Public Member Functions

 Simulation (FEProblemBase &fe_problem, const InputParameters &params)
 
virtual ~Simulation ()
 
const libMesh::FEType & getFlowFEType () const
 Gets the FE type for the flow in this simulation.
 
virtual void setupQuadrature ()
 Sets up quadrature rules.
 
virtual void initSimulation ()
 Initialize this simulation.
 
virtual void initComponents ()
 Initialize this simulation's components.
 
void identifyLoops ()
 Identifies the component loops.
 
void printComponentLoops () const
 Prints the component loops.
 
virtual void run ()
 Run the simulation.
 
virtual void addComponent (const std::string &type, const std::string &name, InputParameters params)
 Add a component into this simulation.
 
bool hasComponent (const std::string &name) const
 Find out if simulation has a component with the given name.
 
template<typename T >
bool hasComponentOfType (const std::string &name) const
 Find out if simulation has a component with the given name and specified type.
 
template<typename T >
const T & getComponentByName (const std::string &name) const
 Get component by its name.
 
const std::vector< std::shared_ptr< Component > > & getComponents () const
 Return list of components available in the simulation.
 
virtual void addClosures (const std::string &type, const std::string &name, InputParameters params)
 Add a closures object into this simulation.
 
bool hasClosures (const std::string &name) const
 Return whether the simulation has a closures object.
 
std::shared_ptr< ClosuresBase > getClosures (const std::string &name) const
 Get a pointer to a closures object.
 
void addSimVariable (bool nl, const VariableName &name, libMesh::FEType fe_type, Real scaling_factor=1.0, const SolverSystemName &solver_sys="nl0")
 Queues a variable of type MooseVariableScalar to be added to the nonlinear or aux system.
 
void addSimVariable (bool nl, const VariableName &name, libMesh::FEType fe_type, const std::vector< SubdomainName > &subdomain_names, Real scaling_factor=1.0, const SolverSystemName &solver_sys="nl0")
 Queues a variable of type MooseVariable to be added to the nonlinear or aux system.
 
void addSimVariable (bool nl, const std::string &var_type, const VariableName &name, const InputParameters &params)
 Queues a generic variable to be added to the nonlinear or aux system.
 
void checkVariableNameLength (const std::string &name) const
 Reports an error if the variable name is too long.
 
void addConstantIC (const VariableName &var_name, Real value, const std::vector< SubdomainName > &block_names)
 
void addFunctionIC (const VariableName &var_name, const std::string &func_name, const std::vector< SubdomainName > &block_names)
 
void addConstantScalarIC (const VariableName &var_name, Real value)
 
void addComponentScalarIC (const VariableName &var_name, const std::vector< Real > &value)
 
void addSimInitialCondition (const std::string &type, const std::string &name, InputParameters params)
 
void addControl (const std::string &type, const std::string &name, InputParameters params)
 Add a control.
 
void addFileOutputter (const std::string &name)
 
void addScreenOutputter (const std::string &name)
 
std::vector< OutputName > getOutputsVector (const std::string &key) const
 Gets the vector of output names corresponding to a 1-word key string.
 
virtual void buildMesh ()
 Create mesh for this simulation.
 
virtual void addVariables ()
 Add variables involved in this simulation.
 
virtual void addMooseObjects ()
 Add component MOOSE objects.
 
virtual void setupMesh ()
 Perform mesh setup actions such as setting up the coordinate system(s) and creating ghosted elements.
 
virtual void integrityCheck () const
 Check the integrity of the simulation.
 
virtual void advanceState ()
 Advance all of the state holding vectors / datastructures so that we can move to the next timestep.
 
virtual void controlDataIntegrityCheck ()
 Check the integrity of the control data.
 
virtual void couplingMatrixIntegrityCheck () const
 Check integrity of coupling matrix used by the preconditioner.
 
template<typename T >
bool hasControlData (const std::string &name)
 Query if control data with name 'name' exists.
 
template<typename T >
ControlData< T > * getControlData (const std::string &name)
 Get control data of type T and name 'name', if it does not exist it will be created.
 
template<typename T >
ControlData< T > * declareControlData (const std::string &name, THMControl *ctrl)
 Declare control data of type T and name 'name', if it does not exist it will be created.
 
const bool & getImplicitTimeIntegrationFlag ()
 Gets the flag indicating whether an implicit time integration scheme is being used.
 
bool hasInitialConditionsFromFile () const
 Are initial conditions specified from a file.
 
Logger & log ()
 
void setCheckJacobian (bool state)
 Enable Jacobian checking.
 
virtual void augmentSparsity (const dof_id_type &elem_id1, const dof_id_type &elem_id2)
 Hint how to augment sparsity pattern between two elements.
 
bool getVectorValuedVelocity ()
 Is velocity output as vector-valued field.
 
void setVectorValuedVelocity (bool vector_velocity)
 Set if velocity is being output as a vector-valued field.
 
void addRelationshipManagers ()
 Add additional relationship managers to run the simulation.
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
template<typename... Args>
void logError (Args &&... args) const
 Logs an error.
 
template<typename... Args>
void logComponentError (const std::string &component_name, Args &&... args) const
 Logs an error for a component.
 
template<typename... Args>
void logWarning (Args &&... args) const
 Logs a warning.
 
template<typename... Args>
void logComponentWarning (const std::string &component_name, Args &&... args) const
 Logs a warning for a component.
 
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.
 
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.
 
std::string genName (const std::string &prefix, const std::string &name, unsigned int i) const
 Build a name from 2 strings and a number.
 
std::string genName (const std::string &prefix, const std::string &middle, const std::string &suffix="") const
 Build a name from strings.
 
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.
 

Static Public Member Functions

static void setComponentVariableOrder (const VariableName &var, int index)
 Sets a component variable order index.
 

Public Attributes

Real _zero
 

Protected Member Functions

void setupEquations ()
 Setup equations to be solved in this simulation.
 
void setupInitialConditionsFromFile ()
 Setup reading initial conditions from a specified file, see 'initial_from_file', 'initial_from_file_timestep', and 'initial_from_file_weighting_type' parameters.
 
void setupInitialConditionObjects ()
 
void setupCoordinateSystem ()
 Sets the coordinate system for each subdomain.
 
void setupCriticalHeatFluxTable ()
 Setup ctirical heat flux table user object.
 

Protected Attributes

MooseMesh & _thm_mesh
 THM mesh.
 
FEProblemBase & _fe_problem
 Pointer to FEProblem representing this simulation.
 
MooseApp & _thm_app
 The application this is associated with.
 
Factory & _thm_factory
 The Factory associated with the MooseApp.
 
std::vector< std::shared_ptr< Component > > _components
 List of components in this simulation.
 
std::map< std::string, std::shared_ptr< Component > > _comp_by_name
 Map of components by their names.
 
std::map< std::string, std::string > _component_name_to_loop_name
 Map of component name to component loop name.
 
std::map< std::string, THM::FlowModelID > _loop_name_to_model_id
 Map of loop name to model type.
 
std::map< std::string, std::shared_ptr< ClosuresBase > > _closures_by_name
 Map of closures by their names.
 
std::map< VariableName, VariableInfo > _vars
 variables for this simulation (name and info about the var)
 
std::map< std::string, ICInfo > _ics
 
const InputParameters & _thm_pars
 "Global" of this simulation
 
libMesh::FEType _flow_fe_type
 finite element type for the flow in the simulation
 
std::vector< OutputName > _outputters_all
 
std::vector< OutputName > _outputters_file
 
std::vector< OutputName > _outputters_screen
 
std::map< std::string, ControlDataValue * > _control_data
 Control data created in the control logic system.
 
bool _implicit_time_integration
 true if using implicit time integration scheme
 
Logger _log
 
bool _check_jacobian
 True if checking jacobian.
 
std::map< dof_id_type, std::vector< dof_id_type > > _sparsity_elem_augmentation
 Additional sparsity pattern that needs to be added into the Jacobian matrix.
 
bool _output_vector_velocity
 Flag indicating if velocity is output as vector-valued field.
 
const Parallel::Communicator & _communicator
 

Private Member Functions

std::vector< VariableName > sortAddedComponentVariables () const
 Returns a sorted list of the variables added by components.
 

Static Private Attributes

static std::map< VariableName, int > _component_variable_order_map
 Component variable order map; see setComponentVariableOrder for more info.
 

Detailed Description

Main class for simulation (the driver of the simulation)

Definition at line 29 of file Simulation.h.

Constructor & Destructor Documentation

◆ Simulation()

Simulation::Simulation ( FEProblemBase &  fe_problem,
const InputParameters &  params 
)

Definition at line 42 of file Simulation.C.

43 : ParallelObject(fe_problem.comm()),
45 _thm_mesh(*pars.get<MooseMesh *>("mesh")),
46 _fe_problem(fe_problem),
49 _thm_pars(pars),
50 _flow_fe_type(FEType(CONSTANT, MONOMIAL).set_p_refinement(false)),
52 _check_jacobian(false),
54 _zero(0)
55{
56 bool second_order_mesh = pars.get<bool>("2nd_order_mesh");
58 second_order_mesh ? FEType(SECOND, LAGRANGE) : FEType(FIRST, LAGRANGE);
59}
static libMesh::FEType _fe_type
Interface class for logging errors and warnings.
Factory & getFactory()
static const std::string app_param
bool _output_vector_velocity
Flag indicating if velocity is output as vector-valued field.
Definition Simulation.h:475
MooseMesh & _thm_mesh
THM mesh.
Definition Simulation.h:389
FEProblemBase & _fe_problem
Pointer to FEProblem representing this simulation.
Definition Simulation.h:392
libMesh::FEType _flow_fe_type
finite element type for the flow in the simulation
Definition Simulation.h:431
const InputParameters & _thm_pars
"Global" of this simulation
Definition Simulation.h:428
bool _implicit_time_integration
true if using implicit time integration scheme
Definition Simulation.h:464
MooseApp & _thm_app
The application this is associated with.
Definition Simulation.h:395
Factory & _thm_factory
The Factory associated with the MooseApp.
Definition Simulation.h:398
Logger _log
Definition Simulation.h:466
bool _check_jacobian
True if checking jacobian.
Definition Simulation.h:469
ParallelObject(const Parallel::Communicator &comm_in)
const Parallel::Communicator & comm() const

◆ ~Simulation()

Simulation::~Simulation ( )
virtual

Definition at line 61 of file Simulation.C.

62{
63 for (auto && k : _control_data)
64 delete k.second;
65}
std::map< std::string, ControlDataValue * > _control_data
Control data created in the control logic system.
Definition Simulation.h:461

Member Function Documentation

◆ addClosures()

void Simulation::addClosures ( const std::string &  type,
const std::string &  name,
InputParameters  params 
)
virtual

Add a closures object into this simulation.

Parameters
[in]typeClosures class name
[in]nameClosures object name
[in]paramsInput parameters

Definition at line 1034 of file Simulation.C.

1035{
1036 std::shared_ptr<ClosuresBase> obj_ptr = _thm_factory.create<ClosuresBase>(type, name, params);
1037 if (_closures_by_name.find(name) == _closures_by_name.end())
1038 _closures_by_name[name] = obj_ptr;
1039 else
1040 logError("A closures object with the name '", name, "' already exists.");
1041}
const std::string name
Definition Setup.h:21
Base class for closures implementations.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
void logError(Args &&... args) const
Logs an error.
std::map< std::string, std::shared_ptr< ClosuresBase > > _closures_by_name
Map of closures by their names.
Definition Simulation.h:410

Referenced by AddClosuresAction::act().

◆ addComponent()

void Simulation::addComponent ( const std::string &  type,
const std::string &  name,
InputParameters  params 
)
virtual

Add a component into this simulation.

Parameters
typeType (the registered class name) of the component
nameName of the component
paramsInput parameters

Definition at line 1016 of file Simulation.C.

1017{
1018 std::shared_ptr<Component> comp = _thm_factory.create<Component>(type, name, params);
1019 if (_comp_by_name.find(name) == _comp_by_name.end())
1020 _comp_by_name[name] = comp;
1021 else
1022 logError("Component with name '", name, "' already exists");
1023 _components.push_back(comp);
1024}
Base class for THM components.
Definition Component.h:32
std::map< std::string, std::shared_ptr< Component > > _comp_by_name
Map of components by their names.
Definition Simulation.h:403
std::vector< std::shared_ptr< Component > > _components
List of components in this simulation.
Definition Simulation.h:401

Referenced by AddComponentAction::act(), and THMActionComponent::addTHMComponent().

◆ addComponentScalarIC()

void Simulation::addComponentScalarIC ( const VariableName &  var_name,
const std::vector< Real > &  value 
)

Definition at line 574 of file Simulation.C.

575{
577 return;
578
579 std::string class_name = "ScalarComponentIC";
580 InputParameters params = _thm_factory.getValidParams(class_name);
581 params.set<VariableName>("variable") = var_name;
582 params.set<std::vector<Real>>("values") = value;
583 addSimInitialCondition(class_name, genName(var_name, "ic"), params);
584}
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
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.
bool hasInitialConditionsFromFile() const
Are initial conditions specified from a file.
void addSimInitialCondition(const std::string &type, const std::string &name, InputParameters params)
Definition Simulation.C:504

◆ addConstantIC()

void Simulation::addConstantIC ( const VariableName &  var_name,
Real  value,
const std::vector< SubdomainName > &  block_names 
)

Definition at line 521 of file Simulation.C.

524{
526 return;
527
528 std::string blk_str = block_names[0];
529 for (unsigned int i = 1; i < block_names.size(); i++)
530 blk_str += ":" + block_names[i];
531
532 std::string class_name = "ConstantIC";
533 InputParameters params = _thm_factory.getValidParams(class_name);
534 params.set<VariableName>("variable") = var_name;
535 params.set<Real>("value") = value;
536 params.set<std::vector<SubdomainName>>("block") = block_names;
537 addSimInitialCondition(class_name, genName(var_name, blk_str, "ic"), params);
538}
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by FlowModel::addCommonInitialConditions(), VolumeJunction1Phase::addJunctionIC(), and HeatTransferFromExternalAppHeatFlux1Phase::addVariables().

◆ addConstantScalarIC()

void Simulation::addConstantScalarIC ( const VariableName &  var_name,
Real  value 
)

Definition at line 561 of file Simulation.C.

562{
564 return;
565
566 std::string class_name = "ScalarConstantIC";
567 InputParameters params = _thm_factory.getValidParams(class_name);
568 params.set<VariableName>("variable") = var_name;
569 params.set<Real>("value") = value;
570 addSimInitialCondition(class_name, genName(var_name, "ic"), params);
571}

Referenced by Shaft::addVariables(), and TotalPower::addVariables().

◆ addControl()

void Simulation::addControl ( const std::string &  type,
const std::string &  name,
InputParameters  params 
)

Add a control.

Parameters
typeType (registered name) of the control
nameName of the control
paramsInput parameters

Definition at line 496 of file Simulation.C.

497{
498 params.addPrivateParam<FEProblemBase *>("_fe_problem_base", &_fe_problem);
499 std::shared_ptr<Control> control = _thm_factory.create<Control>(type, name, params);
501}
void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
void addPrivateParam(const std::string &name, const T &value)

◆ addFileOutputter()

void Simulation::addFileOutputter ( const std::string &  name)

Definition at line 1060 of file Simulation.C.

1061{
1062 _outputters_all.push_back(name);
1063 _outputters_file.push_back(name);
1064}
std::vector< OutputName > _outputters_file
Definition Simulation.h:457
std::vector< OutputName > _outputters_all
Definition Simulation.h:456

Referenced by THMSetupOutputAction::act().

◆ addFunctionIC()

void Simulation::addFunctionIC ( const VariableName &  var_name,
const std::string &  func_name,
const std::vector< SubdomainName > &  block_names 
)

Definition at line 541 of file Simulation.C.

544{
546 return;
547
548 std::string blk_str = block_names[0];
549 for (unsigned int i = 1; i < block_names.size(); i++)
550 blk_str += ":" + block_names[i];
551
552 std::string class_name = "FunctionIC";
553 InputParameters params = _thm_factory.getValidParams(class_name);
554 params.set<VariableName>("variable") = var_name;
555 params.set<std::vector<SubdomainName>>("block") = block_names;
556 params.set<FunctionName>("function") = func_name;
557 addSimInitialCondition(class_name, genName(var_name, blk_str, "ic"), params);
558}

Referenced by FlowModel::addCommonInitialConditions(), HeatTransferBase::addHeatedPerimeter(), HeatConductionModel::addInitialConditions(), HeatTransferFromExternalAppTemperature1Phase::addVariables(), HeatTransferFromHeatStructure1Phase::addVariables(), HeatTransferFromHeatStructure3D1Phase::addVariables(), and HeatTransferFromSpecifiedTemperature1Phase::addVariables().

◆ addMooseObjects()

void Simulation::addMooseObjects ( )
virtual

Add component MOOSE objects.

Definition at line 763 of file Simulation.C.

764{
765 for (auto && comp : _components)
766 comp->addMooseObjects();
767}
virtual void addMooseObjects()
Add component MOOSE objects.
Definition Simulation.C:763

Referenced by AddComponentMooseObjectsAction::act().

◆ addRelationshipManagers()

void Simulation::addRelationshipManagers ( )

Add additional relationship managers to run the simulation.

Definition at line 770 of file Simulation.C.

771{
772 {
773 const std::string class_name = "AugmentSparsityBetweenElements";
774 auto params = _thm_factory.getValidParams(class_name);
775 params.set<Moose::RelationshipManagerType>("rm_type") =
776 Moose::RelationshipManagerType::COUPLING | Moose::RelationshipManagerType::ALGEBRAIC |
777 Moose::RelationshipManagerType::GEOMETRIC;
778 params.set<std::string>("for_whom") = _fe_problem.name();
779 params.set<MooseMesh *>("mesh") = &_thm_mesh;
780 params.set<std::map<dof_id_type, std::vector<dof_id_type>> *>("_elem_map") =
782 auto rm =
783 _thm_factory.create<RelationshipManager>(class_name, "thm:sparsity_btw_elems", params);
786 }
787
788 for (auto && comp : _components)
790 Moose::RelationshipManagerType::ALGEBRAIC |
791 Moose::RelationshipManagerType::GEOMETRIC);
792}
void releaseSharedObjects(const MooseObject &moose_object, THREAD_ID tid=0)
bool addRelationshipManager(std::shared_ptr< RelationshipManager > relationship_manager)
const std::string & name() const
void addRelationshipManagers()
Add additional relationship managers to run the simulation.
Definition Simulation.C:770
std::map< dof_id_type, std::vector< dof_id_type > > _sparsity_elem_augmentation
Additional sparsity pattern that needs to be added into the Jacobian matrix.
Definition Simulation.h:472
RelationshipManagerType

Referenced by THMAddRelationshipManagersAction::act().

◆ addScreenOutputter()

void Simulation::addScreenOutputter ( const std::string &  name)

Definition at line 1067 of file Simulation.C.

1068{
1069 _outputters_all.push_back(name);
1070 _outputters_screen.push_back(name);
1071}
std::vector< OutputName > _outputters_screen
Definition Simulation.h:458

Referenced by THMSetupOutputAction::act().

◆ addSimInitialCondition()

void Simulation::addSimInitialCondition ( const std::string &  type,
const std::string &  name,
InputParameters  params 
)

◆ addSimVariable() [1/3]

void Simulation::addSimVariable ( bool  nl,
const std::string &  var_type,
const VariableName &  name,
const InputParameters &  params 
)

Queues a generic variable to be added to the nonlinear or aux system.

Parameters
[in]nlTrue if this is a nonlinear (solution) variable
[in]var_typeType (class) of the variable
[in]nameName of the variable
[in]paramsInput parameters for the variable

Definition at line 414 of file Simulation.C.

418{
420
421 if (_vars.find(name) == _vars.end()) // variable is new
422 {
423 VariableInfo vi;
424 vi._nl = nl;
425 vi._var_type = var_type;
426 vi._params = params;
427
428 _vars[name] = vi;
429 }
430 else // variable was previously added
431 {
432 VariableInfo & vi = _vars[name];
433 InputParameters & vi_params = vi._params;
434
435 if (vi._nl != nl)
436 mooseError("The variable '",
437 name,
438 "' has already been added in a different system (nonlinear or aux).");
439
440 if (vi._var_type != var_type)
441 mooseError("The variable '",
442 name,
443 "' has already been added with a different type than '",
444 var_type,
445 "'.");
446
447 // Check that all valid parameters (other than 'block') are consistent
448 for (auto it = params.begin(); it != params.end(); it++)
449 {
450 const std::string param_name = it->first;
451 if (param_name == "block")
452 {
453 if (vi_params.isParamValid("block"))
454 {
455 auto blocks = vi_params.get<std::vector<SubdomainName>>("block");
456 const auto new_blocks = params.get<std::vector<SubdomainName>>("block");
457 for (const auto & subdomain_name : new_blocks)
458 if (std::find(blocks.begin(), blocks.end(), subdomain_name) == blocks.end())
459 blocks.push_back(subdomain_name);
460 vi_params.set<std::vector<SubdomainName>>("block") = blocks;
461 }
462 else
463 mooseError("The variable '", name, "' was added previously without block restriction.");
464 }
465 else if (params.isParamValid(param_name))
466 {
467 if (vi_params.isParamValid(param_name))
468 {
469 if (params.rawParamVal(param_name) != vi_params.rawParamVal(param_name))
470 mooseError("The variable '",
471 name,
472 "' was added previously with a different value for the parameter '",
473 param_name,
474 "'.");
475 }
476 else
477 mooseError("The variable '",
478 name,
479 "' was added previously without the parameter '",
480 param_name,
481 "'.");
482 }
483 }
484 }
485}
char ** blocks
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
std::string rawParamVal(const std::string &param) const
bool isParamValid(const std::string &name) const
std::map< VariableName, VariableInfo > _vars
variables for this simulation (name and info about the var)
Definition Simulation.h:413
void checkVariableNameLength(const std::string &name) const
Reports an error if the variable name is too long.
Definition Simulation.C:488
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
if(subdm)

◆ addSimVariable() [2/3]

void Simulation::addSimVariable ( bool  nl,
const VariableName &  name,
libMesh::FEType  fe_type,
const std::vector< SubdomainName > &  subdomain_names,
Real  scaling_factor = 1.0,
const SolverSystemName &  solver_sys = "nl0" 
)

Queues a variable of type MooseVariable to be added to the nonlinear or aux system.

Parameters
[in]nlTrue if this is a nonlinear (solution) variable
[in]nameName of the variable
[in]fe_typeFEType of the variable
[in]subdomain_namesList of subdomain names to add the variable to
[in]scaling_factorScaling factor for the variable
[in]solver_sysName of the solver system to add the variable to; only used for nonlinear variables (aux variables are always added to the aux system)

◆ addSimVariable() [3/3]

void Simulation::addSimVariable ( bool  nl,
const VariableName &  name,
libMesh::FEType  fe_type,
Real  scaling_factor = 1.0,
const SolverSystemName &  solver_sys = "nl0" 
)

Queues a variable of type MooseVariableScalar to be added to the nonlinear or aux system.

Parameters
[in]nlTrue if this is a nonlinear (solution) variable
[in]nameName of the variable
[in]fe_typeFEType of the variable
[in]scaling_factorScaling factor for the variable
[in]solver_sysName of the solver system to add the variable to; only used for nonlinear variables (aux variables are always added to the aux system)

Referenced by FlowModel::addCommonVariables(), HeatTransferBase::addHeatedPerimeter(), HeatConductionModel::addVariables(), FlowModel1PhaseBase::addVariables(), FlowModelGasMix::addVariables(), FlowModelSinglePhase::addVariables(), FormLossFromExternalApp1Phase::addVariables(), HeatTransferFromExternalAppHeatFlux1Phase::addVariables(), HeatTransferFromHeatStructure3D1Phase::addVariables(), HeatTransferFromTemperature1Phase::addVariables(), HSBoundaryExternalAppConvection::addVariables(), HSBoundaryExternalAppHeatFlux::addVariables(), HSBoundaryExternalAppTemperature::addVariables(), Shaft::addVariables(), TotalPowerBase::addVariables(), and SegregatedTestComponent::addVariables().

◆ addVariables()

void Simulation::addVariables ( )
virtual

Add variables involved in this simulation.

Definition at line 643 of file Simulation.C.

644{
645 TransientBase * trex = dynamic_cast<TransientBase *>(_thm_app.getExecutioner());
646 if (trex)
647 {
649 // This is only needed for the listed time integrators that are using the original approach to
650 // explicit integration in MOOSE. Currently, the new time integrators like
651 // ActuallyExplicitEuler do not need the implicit flag to be set.
652 if (ti_type == Moose::TI_EXPLICIT_TVD_RK_2 || ti_type == Moose::TI_EXPLICIT_MIDPOINT ||
653 ti_type == Moose::TI_EXPLICIT_EULER)
655 }
656
657 if (_components.size() == 0)
658 return;
659
660 // Cache the variables that components request to add
661 for (auto && comp : _components)
662 comp->addVariables();
663
664 // Sort the variables for a consistent ordering
665 const auto var_names = sortAddedComponentVariables();
666
667 // Report the ordering if the executioner is verbose
668 if (_fe_problem.getParam<MooseEnum>("verbose_setup") != "false")
669 {
670 std::stringstream ss;
671 ss << "The system ordering of variables added by Components is as follows:\n";
672 for (const auto & var : var_names)
673 ss << " " << var << "\n";
674 mooseInfo(ss.str());
675 }
676
677 // Add the variables to the problem
678 for (const auto & name : var_names)
679 {
680 VariableInfo & vi = _vars[name];
681
682 if (vi._nl)
683 _fe_problem.addVariable(vi._var_type, name, vi._params);
684 else
685 _fe_problem.addAuxVariable(vi._var_type, name, vi._params);
686 }
687
690 else
692}
void mooseInfo(Args &&... args)
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Executioner * getExecutioner() const
const T & getParam(const std::string &name) const
virtual void addVariables()
Add variables involved in this simulation.
Definition Simulation.C:643
std::vector< VariableName > sortAddedComponentVariables() const
Returns a sorted list of the variables added by components.
Definition Simulation.C:587
void setupInitialConditionObjects()
Definition Simulation.C:752
void setupInitialConditionsFromFile()
Setup reading initial conditions from a specified file, see 'initial_from_file', 'initial_from_file_t...
Definition Simulation.C:695
Moose::TimeIntegratorType getTimeScheme() const
TimeIntegratorType
TI_EXPLICIT_EULER
TI_EXPLICIT_TVD_RK_2
TI_EXPLICIT_MIDPOINT

Referenced by THMAddVariablesAction::act().

◆ advanceState()

void Simulation::advanceState ( )
virtual

Advance all of the state holding vectors / datastructures so that we can move to the next timestep.

Reimplemented in THMProblem.

Definition at line 1101 of file Simulation.C.

1102{
1103 for (auto && i : _control_data)
1104 i.second->copyValuesBack();
1105}

Referenced by THMProblem::advanceState(), and THMProblem::copySolutionsBackwards().

◆ augmentSparsity()

void Simulation::augmentSparsity ( const dof_id_type &  elem_id1,
const dof_id_type &  elem_id2 
)
virtual

Hint how to augment sparsity pattern between two elements.

The augmentation will be symmetric

Definition at line 68 of file Simulation.C.

69{
70 auto it = _sparsity_elem_augmentation.find(elem_id1);
71 if (it == _sparsity_elem_augmentation.end())
73 {elem_id1, std::vector<dof_id_type>()});
74 it->second.push_back(elem_id2);
75
76 it = _sparsity_elem_augmentation.find(elem_id2);
77 if (it == _sparsity_elem_augmentation.end())
79 {elem_id2, std::vector<dof_id_type>()});
80 it->second.push_back(elem_id1);
81}

Referenced by GateValve1Phase::setupMesh(), HeatStructure2DCouplerBase::setupMesh(), HeatTransferFromHeatStructure1Phase::setupMesh(), HeatTransferFromHeatStructure3D1Phase::setupMesh(), HSCoupler2D2DRadiation::setupMesh(), HSCoupler2D3D::setupMesh(), JunctionOneToOne1Phase::setupMesh(), and VolumeJunction1Phase::setupMesh().

◆ buildMesh()

void Simulation::buildMesh ( )
virtual

Create mesh for this simulation.

Definition at line 84 of file Simulation.C.

85{
86 if (_components.size() == 0)
87 return;
88
89 // build mesh
90 for (auto && comp : _components)
91 comp->executeSetupMesh();
92}

Referenced by THMBuildMeshAction::act().

◆ checkVariableNameLength()

void Simulation::checkVariableNameLength ( const std::string &  name) const

Reports an error if the variable name is too long.

Definition at line 488 of file Simulation.C.

489{
490 if (name.size() > THM::MAX_VARIABLE_LENGTH)
492 "Variable name '", name, "' is too long. The limit is ", THM::MAX_VARIABLE_LENGTH, ".");
493}
static const size_t MAX_VARIABLE_LENGTH

Referenced by addSimVariable().

◆ controlDataIntegrityCheck()

void Simulation::controlDataIntegrityCheck ( )
virtual

Check the integrity of the control data.

Definition at line 936 of file Simulation.C.

937{
938 if (_check_jacobian)
939 return;
940
941 // check that control data are consistent
942 for (auto && i : _control_data)
943 {
944 if (!i.second->getDeclared())
945 logError("Control data '",
946 i.first,
947 "' was requested, but was not declared by any active control object.");
948 }
949
951
953
954 // initialize THM control objects
955 for (auto && i : ctrl_wh.getObjects())
956 {
957 THMControl * ctrl = dynamic_cast<THMControl *>(i.get());
958 if (ctrl != nullptr)
959 ctrl->init();
960 }
961
962 for (auto && i : ctrl_wh.getObjects())
963 {
964 THMControl * ctrl = dynamic_cast<THMControl *>(i.get());
965 // if it is a THM control
966 if (ctrl != nullptr)
967 {
968 // get its dependencies on control data
969 auto & cd_deps = ctrl->getControlDataDependencies();
970 for (auto && cd_name : cd_deps)
971 {
972 ControlDataValue * cdv = _control_data[cd_name];
973 // find out which control object built the control data
974 std::string dep_name = cdv->getControl()->name();
975 auto & deps = ctrl->getDependencies();
976 // and if it is not in its dependency list, add it
977 auto it = std::find(deps.begin(), deps.end(), dep_name);
978 if (it == deps.end())
979 deps.push_back(dep_name);
980 }
981 }
982 }
983
984 // Find all `TerminateControl`s and all their dependencies. Then add those
985 // objects into TIMESTEP_END control warehouse
986 MooseObjectWarehouse<Control> & ctrl_wh_tse =
988 for (auto && i : ctrl_wh.getObjects())
989 {
990 if (TerminateControl * ctrl = dynamic_cast<TerminateControl *>(i.get()))
991 {
992 std::list<const THMControl *> l;
993 l.push_back(ctrl);
994 while (l.size() > 0)
995 {
996 const THMControl * ctrl = l.front();
997 auto & cd_deps = ctrl->getControlDataDependencies();
998 for (auto && cd_name : cd_deps)
999 {
1000 ControlDataValue * cdv = _control_data[cd_name];
1001 l.push_back(cdv->getControl());
1002 }
1003 ctrl_wh_tse.addObject(ctrl_wh.getObject(ctrl->name()));
1004 l.pop_front();
1005 }
1006 }
1007 }
1008}
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_TIMESTEP_BEGIN
Abstract definition of a ControlData value.
Definition ControlData.h:21
const THMControl * getControl() const
Get the pointer to the control object that declared this control data.
Definition ControlData.h:55
std::vector< std::string > & getDependencies()
void emitLoggedErrors() const
Calls mooseError if there are any logged errors.
Definition Logger.C:21
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
virtual void init()
Definition THMControl.h:21
const std::vector< std::string > & getControlDataDependencies() const
Return the Controls that must run before this Control.
Definition THMControl.h:26
This control block will terminate a run if its input indicates so.

Referenced by ControlDataIntegrityCheckAction::act().

◆ couplingMatrixIntegrityCheck()

void Simulation::couplingMatrixIntegrityCheck ( ) const
virtual

Check integrity of coupling matrix used by the preconditioner.

Definition at line 832 of file Simulation.C.

833{
835 return;
836
837 const TimeIntegrator * ti = nullptr;
838 const auto & time_integrators =
840 if (!time_integrators.empty())
841 ti = time_integrators.front().get();
842 // Yes, this is horrible. Don't ask why...
843 if ((dynamic_cast<const ExplicitTimeIntegrator *>(ti) != nullptr) ||
844 (dynamic_cast<const ExplicitEuler *>(ti) != nullptr) ||
845 (dynamic_cast<const ExplicitRK2 *>(ti) != nullptr) ||
846 (dynamic_cast<const ExplicitTVDRK2 *>(ti) != nullptr))
847 return;
848
849 const CouplingMatrix * cm = _fe_problem.couplingMatrix(/*nl_sys_num=*/0);
850 if (cm == nullptr)
851 mooseError("Coupling matrix does not exists. Something really bad happened.");
852
853 bool full = true;
854 for (unsigned int i = 0; i < cm->size(); i++)
855 for (unsigned int j = 0; j < cm->size(); j++)
856 full &= (*cm)(i, j);
857
858 if (!full)
860 "Single matrix preconditioning with full coupling is required to run. Please, check that "
861 "your input file has the following preconditioning block:\n\n"
862 "[Preconditioning]\n"
863 " [pc]\n"
864 " type = SMP\n"
865 " full = true\n"
866 " []\n"
867 "[].\n");
868}
bool shouldSolve() const
const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
const std::vector< std::shared_ptr< TimeIntegrator > > & getTimeIntegrators()

Referenced by THMPreconditioningIntegrityCheckAction::act().

◆ declareControlData()

template<typename T >
ControlData< T > * Simulation::declareControlData ( const std::string &  name,
THMControl *  ctrl 
)
inline

Declare control data of type T and name 'name', if it does not exist it will be created.

Parameters
nameThe unique name of the control data
Returns
Pointer to the control data of type T

Definition at line 312 of file Simulation.h.

313 {
314 ControlData<T> * data = getControlData<T>(name);
315 if (!data->getDeclared())
316 {
317 // Mark the data for error checking
318 data->setDeclared();
319 data->setControl(ctrl);
320 }
321 else
322 logError("Trying to declare '", name, "', but it was already declared.");
323
324 return data;
325 }
bool getDeclared()
Get the declared state.
Definition ControlData.h:70
void setControl(THMControl *ctrl)
Set the pointer to the control object that declared this control data.
Definition ControlData.h:60
void setDeclared()
Mark the data as declared.
Definition ControlData.h:65
Concrete definition of a parameter value for a specified type.
Definition ControlData.h:92

Referenced by THMControl::declareComponentControlData(), and THMControl::declareControlData().

◆ genName() [1/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 }

◆ genName() [2/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 }

◆ genName() [3/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 }

◆ genName() [4/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.

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

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

◆ 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.

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

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

◆ getClosures()

std::shared_ptr< ClosuresBase > Simulation::getClosures ( const std::string &  name) const

Get a pointer to a closures object.

Parameters
[in]nameClosures object name

Definition at line 1050 of file Simulation.C.

1051{
1052 auto it = _closures_by_name.find(name);
1053 if (it != _closures_by_name.end())
1054 return it->second;
1055 else
1056 mooseError("The requested closures object '", name, "' does not exist.");
1057}

Referenced by FlowChannelBase::init().

◆ getComponentByName()

template<typename T >
const T & Simulation::getComponentByName ( const std::string &  name) const

Get component by its name.

Template Parameters
Tthe type of the component we are requesting
Parameters
nameThe name of the component
Returns
Pointer to the component if found, otherwise throws and error

Definition at line 505 of file Simulation.h.

506{
507 auto it = _comp_by_name.find(name);
508 if (it != _comp_by_name.end())
509 return *dynamic_cast<T *>((it->second).get());
510 else
511 mooseError("Component '",
512 name,
513 "' does not exist in the simulation. Use hasComponent or "
514 "checkComponnetByName before calling getComponent.");
515}
const double T
const Elem & get(const ElemType type_in)

Referenced by VolumeJunctionCoupledFlux1Phase::addFluxPostprocessor(), VolumeJunctionCoupledFlux1Phase::addVolumeJunctionKernel(), Component::getComponentByName(), Component1DConnection::init(), FlowBoundary::init(), FlowBoundary1PhaseBase::init(), FlowJunction::init(), and FlowJunction1Phase::init().

◆ getComponents()

const std::vector< std::shared_ptr< Component > > & Simulation::getComponents ( ) const
inline

Return list of components available in the simulation.

Definition at line 117 of file Simulation.h.

117{ return _components; }

Referenced by ComponentsConvergence::initialSetup(), and ParaviewComponentAnnotationMap::output().

◆ getControlData()

template<typename T >
ControlData< T > * Simulation::getControlData ( const std::string &  name)
inline

Get control data of type T and name 'name', if it does not exist it will be created.

Parameters
nameThe unique name of the control data
Returns
Pointer to the control data of type T

Definition at line 291 of file Simulation.h.

292 {
293 ControlData<T> * data = nullptr;
294 if (_control_data.find(name) == _control_data.end())
295 {
296 data = new ControlData<T>(_thm_app, name);
297 _control_data[name] = data;
298 }
299 else
300 data = dynamic_cast<ControlData<T> *>(_control_data[name]);
301
302 return data;
303 }

Referenced by BoolControlDataValuePostprocessor::BoolControlDataValuePostprocessor(), THMControl::getControlDataByName(), THMControl::getControlDataOldByName(), THMParsedFunctionWrapper::initialize(), and RealControlDataValuePostprocessor::RealControlDataValuePostprocessor().

◆ getFlowFEType()

const libMesh::FEType & Simulation::getFlowFEType ( ) const
inline

Gets the FE type for the flow in this simulation.

Definition at line 48 of file Simulation.h.

48{ return _flow_fe_type; }

Referenced by setupQuadrature().

◆ getImplicitTimeIntegrationFlag()

const bool & Simulation::getImplicitTimeIntegrationFlag ( )
inline

◆ getOutputsVector()

std::vector< OutputName > Simulation::getOutputsVector ( const std::string &  key) const

Gets the vector of output names corresponding to a 1-word key string.

Parameters
[in]keystring key that corresponds to an output names vector
Returns
output names vector corresponding to key

Definition at line 1074 of file Simulation.C.

1075{
1076 std::string key_lowercase = key;
1077 std::transform(key_lowercase.begin(), key_lowercase.end(), key_lowercase.begin(), ::tolower);
1078
1079 std::vector<OutputName> outputs;
1080 if (key_lowercase == "none")
1081 outputs.push_back("none"); // provide non-existent name, so it does not get printed out
1082 else if (key_lowercase == "screen")
1083 outputs = _outputters_screen;
1084 else if (key_lowercase == "file")
1085 outputs = _outputters_file;
1086 else if (key_lowercase == "both")
1087 outputs = _outputters_all;
1088 else
1089 mooseError("The outputs vector key '" + key_lowercase + "' is invalid");
1090
1091 return outputs;
1092}

◆ getVectorValuedVelocity()

bool Simulation::getVectorValuedVelocity ( )
inline

Is velocity output as vector-valued field.

Returns
true for vector-valued field, false for scalar

Definition at line 360 of file Simulation.h.

360{ return _output_vector_velocity; }

Referenced by FlowChannel1PhaseBase::buildFlowModel().

◆ hasClosures()

bool Simulation::hasClosures ( const std::string &  name) const

Return whether the simulation has a closures object.

Parameters
[in]nameClosures object name

Definition at line 1044 of file Simulation.C.

1045{
1046 return _closures_by_name.find(name) != _closures_by_name.end();
1047}

◆ hasComponent()

bool Simulation::hasComponent ( const std::string &  name) const

Find out if simulation has a component with the given name.

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

Definition at line 1027 of file Simulation.C.

1028{
1029 auto it = _comp_by_name.find(name);
1030 return (it != _comp_by_name.end());
1031}

Referenced by Component::checkComponentExistsByName(), Component::checkComponentOfTypeExistsByName(), and initSimulation().

◆ hasComponentOfType()

template<typename T >
bool Simulation::hasComponentOfType ( const std::string &  name) const

Find out if simulation has a component with the given name and specified type.

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

Definition at line 494 of file Simulation.h.

495{
496 auto it = _comp_by_name.find(name);
497 if (it != _comp_by_name.end())
498 return dynamic_cast<T *>((it->second).get()) != nullptr;
499 else
500 return false;
501}

Referenced by Component::checkComponentOfTypeExistsByName(), and Component::hasComponentByName().

◆ hasControlData()

template<typename T >
bool Simulation::hasControlData ( const std::string &  name)
inline

Query if control data with name 'name' exists.

Parameters
nameThe unique name of the control data
Returns
true if control data 'name' exists, false otherwise

Definition at line 276 of file Simulation.h.

277 {
278 if (_control_data.find(name) == _control_data.end())
279 return false;
280 else
281 return dynamic_cast<ControlData<T> *>(_control_data[name]) != NULL;
282 }

Referenced by THMParsedFunctionWrapper::initialize().

◆ hasInitialConditionsFromFile()

bool Simulation::hasInitialConditionsFromFile ( ) const

Are initial conditions specified from a file.

Returns
true if initial conditions are specified from a file

Definition at line 1095 of file Simulation.C.

1096{
1097 return _thm_pars.isParamValid("initial_from_file");
1098}

Referenced by addComponentScalarIC(), addConstantIC(), addConstantScalarIC(), addFunctionIC(), addSimInitialCondition(), addVariables(), HeatStructureInterface::check(), FlowChannel1PhaseBase::check(), Shaft::check(), and VolumeJunction1Phase::check().

◆ identifyLoops()

void Simulation::identifyLoops ( )

Identifies the component loops.

Definition at line 161 of file Simulation.C.

162{
163 // loop over junctions and boundaries (non-geometrical components)
164 for (const auto & component : _components)
165 {
166 const auto flow_connection =
167 MooseSharedNamespace::dynamic_pointer_cast<Component1DConnection>(component);
168 if (flow_connection)
169 {
170 // create vector of names of this component and its connected flow channels, and then sort
171 // them
172 std::vector<std::string> names = flow_connection->getConnectedComponentNames();
173 names.push_back(component->name());
174 std::sort(names.begin(), names.end());
175
176 // pick first name alphabetically to be the proposed loop name
177 std::string proposed_loop_name = names[0];
178
179 for (const std::string & name : names)
180 {
181 // if the name is not yet in the map
183 // just add the new map key; nothing else needs updating
184 _component_name_to_loop_name[name] = proposed_loop_name;
185 else
186 {
187 // compare to the existing loop name for this component to make sure the
188 // proposed loop name is first alphabetically
189 const std::string current_loop_name = _component_name_to_loop_name[name];
190 // if proposed loop name comes later, change map values of the current
191 // loop name to be the proposed name, and then update the proposed name
192 // to be the current name
193 if (proposed_loop_name > current_loop_name)
194 {
195 for (auto && entry : _component_name_to_loop_name)
196 if (entry.second == proposed_loop_name)
197 entry.second = current_loop_name;
198 proposed_loop_name = current_loop_name;
199 }
200 // if proposed loop name comes earlier, change map values of the current
201 // loop name to be the proposed name
202 else if (proposed_loop_name < current_loop_name)
203 {
204 for (auto && entry : _component_name_to_loop_name)
205 if (entry.second == current_loop_name)
206 entry.second = proposed_loop_name;
207 }
208 }
209 }
210 }
211 }
212
213 // get the list of loops
214 std::vector<std::string> loops;
215 for (const auto & entry : _component_name_to_loop_name)
216 if (std::find(loops.begin(), loops.end(), entry.second) == loops.end())
217 loops.push_back(entry.second);
218
219 // fill the map of loop name to model ID
220 for (const auto & loop : loops)
221 {
222 // find a flow channel in this loop and get its model ID
223 THM::FlowModelID model_id;
224 bool found_model_id = false;
225 for (const auto & component : _components)
226 {
227 const auto flow_chan_base_component =
228 MooseSharedNamespace::dynamic_pointer_cast<FlowChannelBase>(component);
229 if (flow_chan_base_component && (_component_name_to_loop_name[component->name()] == loop))
230 {
231 model_id = flow_chan_base_component->getFlowModelID();
232 found_model_id = true;
233 break;
234 }
235 }
236 // set the value in the map or throw an error
237 if (found_model_id)
238 _loop_name_to_model_id[loop] = model_id;
239 else
240 logError("No FlowChannelBase-derived components were found in loop '", loop, "'");
241 }
242}
std::map< std::string, std::string > _component_name_to_loop_name
Map of component name to component loop name.
Definition Simulation.h:405
std::map< std::string, THM::FlowModelID > _loop_name_to_model_id
Map of loop name to model type.
Definition Simulation.h:407
T component(const RankTwoTensorTempl< T > &r2tensor, unsigned int i, unsigned int j)
unsigned int FlowModelID

Referenced by IdentifyLoopsAction::act().

◆ initComponents()

void Simulation::initComponents ( )
virtual

Initialize this simulation's components.

Definition at line 148 of file Simulation.C.

149{
150 // initialize components
151 for (auto && comp : _components)
152 comp->executeInit();
153
154 // perform secondary initialization, which relies on init() being called
155 // already for all components
156 for (auto && comp : _components)
157 comp->executeInitSecondary();
158}

Referenced by THMInitComponentsAction::act().

◆ initSimulation()

void Simulation::initSimulation ( )
virtual

Initialize this simulation.

Definition at line 132 of file Simulation.C.

133{
134 // sort the components using dependency resolver
136 for (const auto & comp : _components)
137 {
138 dependency_resolver.addNode(comp);
139 for (const auto & dep : comp->getDependencies())
140 if (hasComponent(dep))
141 dependency_resolver.addEdge(_comp_by_name[dep], comp);
142 }
143
144 _components = dependency_resolver.dfs();
145}
void addNode(const T &a)
const std::vector< T > & dfs()
bool hasComponent(const std::string &name) const
Find out if simulation has a component with the given name.

Referenced by THMInitSimulationAction::act().

◆ integrityCheck()

void Simulation::integrityCheck ( ) const
virtual

Check the integrity of the simulation.

Definition at line 871 of file Simulation.C.

872{
873 if (_components.size() == 0)
874 return;
875
876 if (_check_jacobian)
877 return;
878
879 // go over components and put flow channels into one "bucket"
880 std::vector<Component *> flow_channels;
881 for (auto && comp : _components)
882 {
883 auto flow_channel = dynamic_cast<FlowChannelBase *>(comp.get());
884 if (flow_channel != nullptr)
885 flow_channels.push_back(flow_channel);
886 }
887
888 // initialize number of connected flow channel inlets and outlets to zero
889 std::map<std::string, unsigned int> flow_channel_inlets;
890 std::map<std::string, unsigned int> flow_channel_outlets;
891 for (auto && comp : flow_channels)
892 {
893 flow_channel_inlets[comp->name()] = 0;
894 flow_channel_outlets[comp->name()] = 0;
895 }
896
897 // mark connections of any Component1DConnection components
898 for (const auto & comp : _components)
899 {
900 auto pc_comp = dynamic_cast<Component1DConnection *>(comp.get());
901 if (pc_comp != nullptr)
902 {
903 for (const auto & connection : pc_comp->getConnections())
904 {
905 if (connection._end_type == Component1DConnection::IN)
906 flow_channel_inlets[connection._component_name]++;
907 else if (connection._end_type == Component1DConnection::OUT)
908 flow_channel_outlets[connection._component_name]++;
909 }
910 }
911 }
912
913 // finally, check that each flow channel has exactly one input and one output
914 for (auto && comp : flow_channels)
915 {
916 if (flow_channel_inlets[comp->name()] == 0)
917 logError("Component '", comp->name(), "' does not have connected inlet.");
918 else if (flow_channel_inlets[comp->name()] > 1)
919 logError("Multiple inlets specified for component '", comp->name(), "'.");
920
921 if (flow_channel_outlets[comp->name()] == 0)
922 logError("Component '", comp->name(), "' does not have connected outlet.");
923 else if (flow_channel_outlets[comp->name()] > 1)
924 logError("Multiple outlets specified for component '", comp->name(), "'.");
925 }
926
927 // let components check themselves
928 for (auto && comp : _components)
929 comp->executeCheck();
930
933}
Base class for 1D component junctions and boundaries.
A base class for flow channels.
void emitLoggedWarnings() const
Calls mooseWarning if there are any logged warnings.
Definition Logger.C:35

Referenced by IntegrityCheckAction::act().

◆ log()

Logger & Simulation::log ( )
inline

Definition at line 339 of file Simulation.h.

339{ return _log; }

Referenced by AddClosuresAction::act().

◆ 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.

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
@ ERROR
Definition Logger.h:25

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

◆ 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.

68 {
69 _log.add(Logger::WARNING, component_name, ": ", std::forward<Args>(args)...);
70 }
@ WARNING
Definition Logger.h:26

Referenced by Component::logWarning().

◆ logError()

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

Logs an error.

Definition at line 36 of file LoggingInterface.h.

37 {
38 _log.add(Logger::ERROR, std::forward<Args>(args)...);
39 }

Referenced by addClosures(), addComponent(), controlDataIntegrityCheck(), declareControlData(), identifyLoops(), and integrityCheck().

◆ logWarning()

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

Logs a warning.

Definition at line 56 of file LoggingInterface.h.

57 {
58 _log.add(Logger::WARNING, std::forward<Args>(args)...);
59 }

◆ printComponentLoops()

void Simulation::printComponentLoops ( ) const

Prints the component loops.

Definition at line 245 of file Simulation.C.

246{
247 // get the list of loops
248 std::vector<std::string> loops;
249 for (auto && entry : _component_name_to_loop_name)
250 if (std::find(loops.begin(), loops.end(), entry.second) == loops.end())
251 loops.push_back(entry.second);
252
253 // for each loop
254 Moose::out << "\nListing of component loops:" << std::endl;
255 for (unsigned int i = 0; i < loops.size(); i++)
256 {
257 Moose::out << "\n Loop " << i + 1 << ":" << std::endl;
258
259 // print out each component in the loop
260 for (auto && entry : _component_name_to_loop_name)
261 if (entry.second == loops[i])
262 Moose::out << " " << entry.first << std::endl;
263 }
264 Moose::out << std::endl;
265}
OStreamProxy out(std::cout)

Referenced by THMPrintComponentLoopsAction::act().

◆ run()

void Simulation::run ( )
virtual

Run the simulation.

Definition at line 1011 of file Simulation.C.

1012{
1013}

◆ setCheckJacobian()

void Simulation::setCheckJacobian ( bool  state)
inline

Enable Jacobian checking.

Parameters
stateTrue for Jacobian checking, otherwise false

Definition at line 346 of file Simulation.h.

346{ _check_jacobian = state; }

Referenced by THMDebugAction::act().

◆ setComponentVariableOrder()

void Simulation::setComponentVariableOrder ( const VariableName &  var,
int  index 
)
static

Sets a component variable order index.

See Component system documentation for more information.

Parameters
[in]varVariable to order
[in]indexOrder index

Definition at line 37 of file Simulation.C.

38{
40}
static std::map< VariableName, int > _component_variable_order_map
Component variable order map; see setComponentVariableOrder for more info.
Definition Simulation.h:489

Referenced by ThermalHydraulicsApp::registerAll().

◆ setupCoordinateSystem()

void Simulation::setupCoordinateSystem ( )
protected

Sets the coordinate system for each subdomain.

Definition at line 795 of file Simulation.C.

796{
797 MultiMooseEnum coord_types("XYZ RZ RSPHERICAL");
798 std::vector<SubdomainName> blocks;
799
800 for (auto && comp : _components)
801 {
802 if (comp->parent() == nullptr)
803 {
804 const auto & subdomains = comp->getSubdomainNames();
805 const auto & coord_sys = comp->getCoordSysTypes();
806
807 for (unsigned int i = 0; i < subdomains.size(); i++)
808 {
809 blocks.push_back(subdomains[i]);
810 // coord_types.push_back("XYZ");
811 coord_types.setAdditionalValue(coord_sys[i] == Moose::COORD_RZ ? "RZ" : "XYZ");
812 }
813 }
814 }
815 _fe_problem.setCoordSystem(blocks, coord_types);
816
817 // RZ geometries are always aligned with x-axis
818 MooseEnum rz_coord_axis("X=0 Y=1", "X");
820}
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)

Referenced by setupMesh().

◆ setupCriticalHeatFluxTable()

void Simulation::setupCriticalHeatFluxTable ( )
protected

Setup ctirical heat flux table user object.

◆ setupEquations()

void Simulation::setupEquations ( )
protected

Setup equations to be solved in this simulation.

◆ setupInitialConditionObjects()

void Simulation::setupInitialConditionObjects ( )
protected

Definition at line 752 of file Simulation.C.

753{
754 for (auto && i : _ics)
755 {
756 const std::string & name = i.first;
757 ICInfo & ic = i.second;
758 _fe_problem.addInitialCondition(ic._type, name, ic._params);
759 }
760}
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)

Referenced by addVariables().

◆ setupInitialConditionsFromFile()

void Simulation::setupInitialConditionsFromFile ( )
protected

Setup reading initial conditions from a specified file, see 'initial_from_file', 'initial_from_file_timestep', and 'initial_from_file_weighting_type' parameters.

Definition at line 695 of file Simulation.C.

696{
697 const UserObjectName suo_name = genName("thm", "suo");
698 {
699 const std::string class_name = "SolutionUserObject";
700 InputParameters params = _thm_factory.getValidParams(class_name);
701 params.set<MeshFileName>("mesh") = _thm_pars.get<FileName>("initial_from_file");
702 params.set<std::string>("timestep") = _thm_pars.get<std::string>("initial_from_file_timestep");
703 _fe_problem.addUserObject(class_name, suo_name, params);
704 }
705
706 for (auto && v : _vars)
707 {
708 const VariableName & var_name = v.first;
709 const VariableInfo & vi = v.second;
710
711 if (vi._var_type == "MooseVariableScalar")
712 {
713 std::string class_name = "ScalarSolutionIC";
714 InputParameters params = _thm_factory.getValidParams(class_name);
715 params.set<VariableName>("variable") = var_name;
716 params.set<VariableName>("from_variable") = var_name;
717 params.set<UserObjectName>("solution_uo") = suo_name;
718 _fe_problem.addInitialCondition(class_name, genName(var_name, "ic"), params);
719 }
720 else
721 {
722 const std::string class_name = "SolutionIC";
723 InputParameters params = _thm_factory.getValidParams(class_name);
724 params.set<VariableName>("variable") = var_name;
725 params.set<VariableName>("from_variable") = var_name;
726 params.set<UserObjectName>("solution_uo") = suo_name;
727 if (_thm_pars.isParamSetByUser("initial_from_file_weighting_type"))
728 params.set<MooseEnum>("weighting_type") =
729 _thm_pars.get<MooseEnum>("initial_from_file_weighting_type");
730
731 if (vi._params.isParamValid("block"))
732 {
733 const auto & block_names = vi._params.get<std::vector<SubdomainName>>("block");
734
735 for (const auto & block_name : block_names)
736 {
737 InputParameters block_params = params;
738 block_params.set<std::vector<SubdomainName>>("block") = {block_name};
739 block_params.set<std::vector<SubdomainName>>("from_subdomains") = {block_name};
740
742 class_name, genName(var_name, block_name, "ic"), block_params);
743 }
744 }
745 else
746 _fe_problem.addInitialCondition(class_name, genName(var_name, "ic"), params);
747 }
748 }
749}
const double v
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
bool isParamSetByUser(const std::string &name) const

Referenced by addVariables().

◆ setupMesh()

void Simulation::setupMesh ( )
virtual

Perform mesh setup actions such as setting up the coordinate system(s) and creating ghosted elements.

Definition at line 823 of file Simulation.C.

824{
825 if (_components.size() == 0)
826 return;
827
829}
void setupCoordinateSystem()
Sets the coordinate system for each subdomain.
Definition Simulation.C:795

Referenced by THMSetupMeshAction::act().

◆ setupQuadrature()

void Simulation::setupQuadrature ( )
virtual

Sets up quadrature rules.

Definition at line 95 of file Simulation.C.

96{
97 if (_components.size() == 0)
98 return;
99
100 Order order = CONSTANT;
101 unsigned int n_flow_channels = 0;
102 unsigned int n_heat_structures = 0;
103
104 for (auto && comp : _components)
105 {
106 auto flow_channel = dynamic_cast<FlowChannelBase *>(comp.get());
107 if (flow_channel != nullptr)
108 n_flow_channels++;
109
110 auto hs_interface = dynamic_cast<HeatStructureInterface *>(comp.get());
111 if (hs_interface)
112 n_heat_structures++;
113 }
114
115 if (n_flow_channels > 0)
116 {
117 const FEType & fe_type = getFlowFEType();
118 if (fe_type.default_quadrature_order() > order)
119 order = fe_type.default_quadrature_order();
120 }
121 if (n_heat_structures > 0)
122 {
123 const FEType & fe_type = HeatConductionModel::feType();
124 if (fe_type.default_quadrature_order() > order)
125 order = fe_type.default_quadrature_order();
126 }
127
128 _fe_problem.createQRules(libMesh::QGAUSS, order, order, order);
129}
virtual void createQRules(libMesh::QuadratureType type, libMesh::Order order, libMesh::Order volume_order=libMesh::INVALID_ORDER, libMesh::Order face_order=libMesh::INVALID_ORDER, SubdomainID block=Moose::ANY_BLOCK_ID, bool allow_negative_qweights=true)
static const libMesh::FEType & feType()
Get the FE type used for heat conduction.
Interface class for heat structure components.
const libMesh::FEType & getFlowFEType() const
Gets the FE type for the flow in this simulation.
Definition Simulation.h:48

Referenced by THMSetupQuadratureAction::act().

◆ setVectorValuedVelocity()

void Simulation::setVectorValuedVelocity ( bool  vector_velocity)
inline

Set if velocity is being output as a vector-valued field.

Definition at line 365 of file Simulation.h.

365{ _output_vector_velocity = vector_velocity; }

Referenced by THMOutputVectorVelocityAction::act().

◆ sortAddedComponentVariables()

std::vector< VariableName > Simulation::sortAddedComponentVariables ( ) const
private

Returns a sorted list of the variables added by components.

See Component system documentation for more information.

Definition at line 587 of file Simulation.C.

588{
589 // Check that no index in order map is used more than once.
590 // Also, convert the map to a vector of pairs to be sorted.
591 std::set<int> indices;
592 std::vector<std::pair<VariableName, int>> registered_var_index_pairs;
593 for (const auto & var_and_index : _component_variable_order_map)
594 {
595 registered_var_index_pairs.push_back(var_and_index);
596
597 const auto ind = var_and_index.second;
598 auto insert_return = indices.insert(ind);
599 if (!insert_return.second)
600 mooseError("The index ", ind, " was used for multiple component variables.");
601 }
602
603 // Collect all of the added variable names into an unsorted vector.
604 std::vector<VariableName> vars_unsorted;
605 for (const auto & var_and_data : _vars)
606 vars_unsorted.push_back(var_and_data.first);
607
608 // The sorting works as follows. For those variables that are listed in
609 // _component_variable_order_map, these are ordered before those that are not,
610 // in the order of their indices in the map. Those not in the map are sorted
611 // alphabetically.
612
613 // Sort registered_var_index_pairs by value (index)
614 std::sort(registered_var_index_pairs.begin(),
615 registered_var_index_pairs.end(),
616 [](const std::pair<VariableName, int> & a, const std::pair<VariableName, int> & b)
617 { return a.second < b.second; });
618
619 // Loop over the ordered, registered variable names and add a variable to the
620 // sorted list if in vars_unsorted. When this happens, delete the element from
621 // vars_unsorted, leaving only unregistered variable names after the loop.
622 std::vector<VariableName> vars_sorted;
623 for (const auto & var_index_pair : registered_var_index_pairs)
624 {
625 const auto & var = var_index_pair.first;
626 if (std::find(vars_unsorted.begin(), vars_unsorted.end(), var) != vars_unsorted.end())
627 {
628 vars_sorted.push_back(var);
629 vars_unsorted.erase(std::remove(vars_unsorted.begin(), vars_unsorted.end(), var),
630 vars_unsorted.end());
631 }
632 }
633
634 // Sort the remaining (unregistered) variables alphabetically and then add
635 // them to the end of the full list.
636 std::sort(vars_unsorted.begin(), vars_unsorted.end());
637 vars_sorted.insert(vars_sorted.end(), vars_unsorted.begin(), vars_unsorted.end());
638
639 return vars_sorted;
640}

Referenced by addVariables().

Member Data Documentation

◆ _check_jacobian

bool Simulation::_check_jacobian
protected

True if checking jacobian.

Definition at line 469 of file Simulation.h.

Referenced by controlDataIntegrityCheck(), integrityCheck(), and setCheckJacobian().

◆ _closures_by_name

std::map<std::string, std::shared_ptr<ClosuresBase> > Simulation::_closures_by_name
protected

Map of closures by their names.

Definition at line 410 of file Simulation.h.

Referenced by addClosures(), getClosures(), and hasClosures().

◆ _comp_by_name

std::map<std::string, std::shared_ptr<Component> > Simulation::_comp_by_name
protected

Map of components by their names.

Definition at line 403 of file Simulation.h.

Referenced by addComponent(), getComponentByName(), hasComponent(), hasComponentOfType(), and initSimulation().

◆ _component_name_to_loop_name

std::map<std::string, std::string> Simulation::_component_name_to_loop_name
protected

Map of component name to component loop name.

Definition at line 405 of file Simulation.h.

Referenced by identifyLoops(), and printComponentLoops().

◆ _component_variable_order_map

std::map< VariableName, int > Simulation::_component_variable_order_map
staticprivate

Component variable order map; see setComponentVariableOrder for more info.

Definition at line 489 of file Simulation.h.

Referenced by setComponentVariableOrder(), and sortAddedComponentVariables().

◆ _components

std::vector<std::shared_ptr<Component> > Simulation::_components
protected

◆ _control_data

std::map<std::string, ControlDataValue *> Simulation::_control_data
protected

Control data created in the control logic system.

Definition at line 461 of file Simulation.h.

Referenced by advanceState(), controlDataIntegrityCheck(), getControlData(), hasControlData(), and ~Simulation().

◆ _fe_problem

FEProblemBase& Simulation::_fe_problem
protected

◆ _flow_fe_type

libMesh::FEType Simulation::_flow_fe_type
protected

finite element type for the flow in the simulation

Definition at line 431 of file Simulation.h.

Referenced by getFlowFEType().

◆ _ics

std::map<std::string, ICInfo> Simulation::_ics
protected

Definition at line 425 of file Simulation.h.

Referenced by addSimInitialCondition(), and setupInitialConditionObjects().

◆ _implicit_time_integration

bool Simulation::_implicit_time_integration
protected

true if using implicit time integration scheme

Definition at line 464 of file Simulation.h.

Referenced by addVariables(), and getImplicitTimeIntegrationFlag().

◆ _log

Logger Simulation::_log
protected

Definition at line 466 of file Simulation.h.

Referenced by controlDataIntegrityCheck(), integrityCheck(), and log().

◆ _loop_name_to_model_id

std::map<std::string, THM::FlowModelID> Simulation::_loop_name_to_model_id
protected

Map of loop name to model type.

Definition at line 407 of file Simulation.h.

Referenced by identifyLoops().

◆ _output_vector_velocity

bool Simulation::_output_vector_velocity
protected

Flag indicating if velocity is output as vector-valued field.

Definition at line 475 of file Simulation.h.

Referenced by getVectorValuedVelocity(), and setVectorValuedVelocity().

◆ _outputters_all

std::vector<OutputName> Simulation::_outputters_all
protected

Definition at line 456 of file Simulation.h.

Referenced by addFileOutputter(), addScreenOutputter(), and getOutputsVector().

◆ _outputters_file

std::vector<OutputName> Simulation::_outputters_file
protected

Definition at line 457 of file Simulation.h.

Referenced by addFileOutputter(), and getOutputsVector().

◆ _outputters_screen

std::vector<OutputName> Simulation::_outputters_screen
protected

Definition at line 458 of file Simulation.h.

Referenced by addScreenOutputter(), and getOutputsVector().

◆ _sparsity_elem_augmentation

std::map<dof_id_type, std::vector<dof_id_type> > Simulation::_sparsity_elem_augmentation
protected

Additional sparsity pattern that needs to be added into the Jacobian matrix.

Definition at line 472 of file Simulation.h.

Referenced by addRelationshipManagers(), and augmentSparsity().

◆ _thm_app

MooseApp& Simulation::_thm_app
protected

The application this is associated with.

Definition at line 395 of file Simulation.h.

Referenced by addRelationshipManagers(), addVariables(), and getControlData().

◆ _thm_factory

Factory& Simulation::_thm_factory
protected

◆ _thm_mesh

MooseMesh& Simulation::_thm_mesh
protected

THM mesh.

Definition at line 389 of file Simulation.h.

Referenced by addRelationshipManagers().

◆ _thm_pars

const InputParameters& Simulation::_thm_pars
protected

"Global" of this simulation

Definition at line 428 of file Simulation.h.

Referenced by hasInitialConditionsFromFile(), and setupInitialConditionsFromFile().

◆ _vars

std::map<VariableName, VariableInfo> Simulation::_vars
protected

variables for this simulation (name and info about the var)

Definition at line 413 of file Simulation.h.

Referenced by addSimVariable(), addVariables(), setupInitialConditionsFromFile(), and sortAddedComponentVariables().

◆ _zero

Real Simulation::_zero

Definition at line 478 of file Simulation.h.


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