https://mooseframework.inl.gov
HeatStructureInterface.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "HeatStructureInterface.h"
11 #include "HeatConductionModel.h"
12 #include "GeometricalComponent.h"
13 
16 {
18 
19  params.addParam<FunctionName>("initial_T", "Initial temperature [K]");
20  params.addParam<Real>(
21  "scaling_factor_temperature", 1.0, "Scaling factor for solid temperature variable.");
22 
23  params.addPrivateParam<std::string>("component_type", "heat_struct");
24 
25  return params;
26 }
27 
29  : _geometrical_component_hsi(*geometrical_component)
30 {
31 }
32 
33 std::shared_ptr<HeatConductionModel>
35 {
37 
38  const std::string class_name = "HeatConductionModel";
39  InputParameters params = factory.getValidParams(class_name);
40  params.set<THMProblem *>("_thm_problem") = &_geometrical_component_hsi.getTHMProblem();
41  params.set<HeatStructureInterface *>("_hs") = this;
43  return factory.create<HeatConductionModel>(
44  class_name, _geometrical_component_hsi.name(), params, 0);
45 }
46 
47 void
49 {
51 }
52 
53 void
55 {
56  auto & moose_app = _geometrical_component_hsi.getMooseApp();
59  if (!ics_set && !moose_app.isRestarting())
60  _geometrical_component_hsi.logError("Missing initial condition for temperature.");
61 }
62 
63 void
65 {
66  _hc_model->addVariables();
68  _hc_model->addInitialConditions();
69 }
70 
71 void
73 {
75  _hc_model->addHeatEquationRZ();
76  else
77  _hc_model->addHeatEquationXYZ();
78 }
79 
80 FunctionName
82 {
84  return _geometrical_component_hsi.getParam<FunctionName>("initial_T");
85  else
88  ": The parameter 'initial_T' was requested but not supplied");
89 }
Specialization of FEProblem to run with component subsystem.
Definition: THMProblem.h:18
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addPrivateParam(const std::string &name, const T &value)
virtual std::shared_ptr< HeatConductionModel > buildModel()
Builds the heat conduction model.
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
T & set(const std::string &name, bool quiet_mode=false)
FunctionName getInitialT() const
Gets the initial temperature function name.
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
virtual const std::string & name() const
MooseApp & getMooseApp() const
InputParameters emptyInputParameters()
Factory & getFactory()
virtual bool useCylindricalTransformation() const =0
Use cylindrical transformation?
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
bool isParamValid(const std::string &name) const
void check() const
Method to be called in the component&#39;s check() method.
static InputParameters validParams()
const T & getParam(const std::string &name) const
Interface class for heat structure components.
std::shared_ptr< HeatConductionModel > _hc_model
The heat conduction model used by this heat structure.
GeometricalComponent & _geometrical_component_hsi
The geometrical component inheriting from this interface.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Intermediate class for components that have mesh.
void init()
Method to be called in the component&#39;s init() method.
void addMooseObjects()
Method to be called in the component&#39;s addMooseObjects() method.
void addVariables()
Method to be called in the component&#39;s addVariables() method.
void mooseError(Args &&... args) const
const InputParameters & parameters() const
HeatStructureInterface(GeometricalComponent *geometrical_component)
Provides functions to setup the heat conduction model.
bool hasInitialConditionsFromFile() const
Are initial conditions specified from a file.
Definition: Simulation.C:1070