https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
11#include "HeatConductionModel.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
33std::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
47void
52
53void
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
63void
65{
66 _hc_model->addVariables();
68 _hc_model->addInitialConditions();
69}
70
71void
73{
75 _hc_model->addHeatEquationRZ();
76 else
77 _hc_model->addHeatEquationXYZ();
78}
79
80FunctionName
82{
84 return _geometrical_component_hsi.getParam<FunctionName>("initial_T");
85 else
88 ": The parameter 'initial_T' was requested but not supplied");
89}
InputParameters emptyInputParameters()
void logError(Args &&... args) const
Logs an error.
Definition Component.h:226
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition Component.C:135
Intermediate class for components that have mesh.
Provides functions to setup the heat conduction model.
Interface class for heat structure components.
std::shared_ptr< HeatConductionModel > _hc_model
The heat conduction model used by this heat structure.
void addMooseObjects()
Method to be called in the component's addMooseObjects() method.
GeometricalComponent & _geometrical_component_hsi
The geometrical component inheriting from this interface.
virtual bool useCylindricalTransformation() const =0
Use cylindrical transformation?
HeatStructureInterface(GeometricalComponent *geometrical_component)
virtual std::shared_ptr< HeatConductionModel > buildModel()
Builds the heat conduction model.
void check() const
Method to be called in the component's check() method.
FunctionName getInitialT() const
Gets the initial temperature function name.
void init()
Method to be called in the component's init() method.
void addVariables()
Method to be called in the component's addVariables() method.
static InputParameters validParams()
void addPrivateParam(const std::string &name, const T &value)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
Factory & getFactory()
const InputParameters & parameters() const
const std::string & name() const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
MooseApp & getMooseApp() const
bool hasInitialConditionsFromFile() const
Are initial conditions specified from a file.
Specialization of FEProblem to run with component subsystem.
Definition THMProblem.h:19