https://mooseframework.inl.gov
HeatSourceVolumetric1Phase.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 "FlowChannel1Phase.h"
12 #include "FlowModelSinglePhase.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", HeatSourceVolumetric1Phase);
15 
18 {
20  params.addRequiredParam<std::string>("flow_channel",
21  "Flow channel name in which to apply heat source");
22  params.addRequiredParam<FunctionName>("q", "Volumetric heat source [W/m^3]");
23  params.addClassDescription("Volumetric heat source applied on a flow channel");
24  return params;
25 }
26 
28  : Component(parameters)
29 {
30 }
31 
32 void
34 {
36 
37  checkComponentOfTypeExists<FlowChannel1Phase>("flow_channel");
38 }
39 
40 void
42 {
43  const FlowChannelBase & fch = getComponent<FlowChannel1Phase>("flow_channel");
44 
45  {
46  std::string class_name = "OneD3EqnEnergyHeatSource";
47  InputParameters pars = _factory.getValidParams(class_name);
48  pars.set<NonlinearVariableName>("variable") = FlowModelSinglePhase::RHOEA;
49  pars.set<std::vector<SubdomainName>>("block") = fch.getSubdomainNames();
50  pars.set<FunctionName>("q") = getParam<FunctionName>("q");
51  pars.set<std::vector<VariableName>>("A") = {FlowModel::AREA};
52  getTHMProblem().addKernel(class_name, genName(name(), "rhoE_heat_source"), pars);
53  }
54 }
static InputParameters validParams()
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.
static const std::string AREA
Definition: FlowModel.h:102
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
HeatSourceVolumetric1Phase(const InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
A base class for flow channels.
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
static InputParameters validParams()
Definition: Component.C:18
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual void check() const
Check the component integrity.
Definition: Component.h:301
virtual void addMooseObjects() override
registerMooseObject("ThermalHydraulicsApp", HeatSourceVolumetric1Phase)
Base class for THM components.
Definition: Component.h:27
Volumetric heat source applied on a 1-phase flow channel.
virtual void check() const override
Check the component integrity.
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
void addClassDescription(const std::string &doc_string)
static const std::string RHOEA
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
Definition: Component.C:307