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