https://mooseframework.inl.gov
HeatTransfer1PhaseBase.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 "HeatTransfer1PhaseBase.h"
11 #include "FlowModelSinglePhase.h"
12 #include "FlowChannel1PhaseBase.h"
13 #include "ClosuresBase.h"
14 #include "MooseUtils.h"
15 
18 {
20  params.addParam<FunctionName>("Hw", "Convective heat transfer coefficient [W/(m^2-K)]");
21  params.declareControllable("Hw");
22  return params;
23 }
24 
26  : HeatTransferBase(parameters)
27 {
28 }
29 
30 void
32 {
34 }
35 
36 void
38 {
40 
41  // determine names of heat transfer variables
42  if (hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
43  {
44  const FlowChannel1PhaseBase & flow_channel =
45  getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name);
46  const std::string Hw_suffix = flow_channel.getHeatTransferNamesSuffix(name());
47 
49  }
50  else
51  logError("Coupled component '", _flow_channel_name, "' must be a single phase flow channel.");
52 }
53 
54 void
56 {
58 
59  for (const auto & closures : _closures_objects)
60  if (closures && hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
61  closures->checkHeatTransfer(*this,
62  getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
63 }
64 
65 void
67 {
69 
70  for (const auto & closures : _closures_objects)
71  closures->addMooseObjectsHeatTransfer(
72  *this, getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
73 }
74 
75 const MaterialPropertyName &
77 {
79 
80  return _Hw_1phase_name;
81 }
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
std::vector< std::shared_ptr< ClosuresBase > > _closures_objects
Used closures object(s)
static const std::string HEAT_TRANSFER_COEFFICIENT_WALL
virtual void addMooseObjects() override
MaterialPropertyName _Hw_1phase_name
1-phase wall heat transfer coefficient name
virtual const std::string & name() const
HeatTransfer1PhaseBase(const InputParameters &parameters)
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
virtual void check() const override
Check the component integrity.
virtual void check() const override
Check the component integrity.
virtual void addMooseObjects() override
mesh set up, called both inits
Definition: Component.h:41
Base class for heat transfer connections.
static InputParameters validParams()
const MaterialPropertyName & getWallHeatTransferCoefficient1PhaseName() const
Returns 1-phase wall heat transfer coefficient name.
const std::string _flow_channel_name
name of the connected flow channel
static InputParameters validParams()
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117
virtual void init() override
Initializes the component.
std::string getHeatTransferNamesSuffix(const std::string &ht_name) const
Gets suffix to add to heat-transfer-related names in a heat transfer component.
virtual void init() override
Initializes the component.
Base class for single-phase flow channels.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.