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  return params;
22 }
23 
25  : HeatTransferBase(parameters)
26 {
27 }
28 
29 void
31 {
33 }
34 
35 void
37 {
39 
40  // determine names of heat transfer variables
41  if (hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
42  {
43  const FlowChannel1PhaseBase & flow_channel =
44  getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name);
45  const std::string Hw_suffix = flow_channel.getHeatTransferNamesSuffix(name());
46 
48  }
49  else
50  logError("Coupled component '", _flow_channel_name, "' must be a single phase flow channel.");
51 }
52 
53 void
55 {
57 
58  for (const auto & closures : _closures_objects)
59  if (closures && hasComponentByName<FlowChannel1PhaseBase>(_flow_channel_name))
60  closures->checkHeatTransfer(*this,
61  getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
62 }
63 
64 void
66 {
68 
69  for (const auto & closures : _closures_objects)
70  closures->addMooseObjectsHeatTransfer(
71  *this, getComponentByName<FlowChannel1PhaseBase>(_flow_channel_name));
72 }
73 
74 const MaterialPropertyName &
76 {
78 
79  return _Hw_1phase_name;
80 }
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
HeatTransfer1PhaseBase(const InputParameters &parameters)
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:226
const std::string & name() const
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:42
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.
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.