https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADPipeOuterWallCoupledConvectiveTemperatureScalarKernel.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
12#include "ScalarCoupleable.h"
13
14registerMooseObject("ThermalHydraulicsApp",
16
19{
22 "Assembles transport equation for the temperature of the outer-surface radial node of a pipe "
23 "wall, "
24 "convectively coupled to a secondary-side flowing fluid, such as the shell side of a "
25 "heat exchanger.");
26 params.addCoupledVar("mass_flow_rate",
27 {},
28 "Mass flow rate of the secondary-side fluid. Takes a "
29 "scalar variable name");
30 params.addCoupledVar("inner_wall_temperature",
31 {},
32 "Temperature of the inner-surface wall node, on the other side of this "
33 "layer's radial conduction path. Takes a scalar variable name");
34 params.addCoupledVar("fluid_temperature",
35 {},
36 "Secondary-side fluid temperature adjacent to this wall node. Takes a "
37 "scalar variable name");
38 params.addCoupledVar(
39 "upstream_fluid_temperature",
40 {},
41 "Secondary-side fluid temperature adjacent to the upstream wall node. Takes a scalar "
42 "variable name");
43 params.addCoupledVar(
44 "downstream_fluid_temperature",
45 {},
46 "Secondary-side fluid temperature adjacent to the downstream wall node. Takes a scalar "
47 "variable name");
48 params.addRequiredParam<MooseFunctorName>(
49 "wetted_perimeter",
50 "Wetted perimeter of the secondary-side flow channel adjacent to this node [m]");
51 params.addRequiredParam<MooseFunctorName>(
52 "heat_transfer_coefficient",
53 "Heat transfer coefficient of the secondary-side fluid [W/(m^2-K)]");
54 params.addParam<bool>(
55 "use_fluid_node_temp",
56 true,
57 "Whether to use fluid node temperature for wall heat transfer or a segment-averaged value.");
58
59 return params;
60}
61
64 : Base(parameters),
65 _m(ScalarCoupleable::adCoupledScalarValue("mass_flow_rate")),
66 _Tin(ScalarCoupleable::adCoupledScalarValue("inner_wall_temperature")),
67 _Tf(ScalarCoupleable::adCoupledScalarValue("fluid_temperature")),
68 _Tfup(ScalarCoupleable::adCoupledScalarValue("upstream_fluid_temperature")),
69 _Tfdown(ScalarCoupleable::adCoupledScalarValue("downstream_fluid_temperature")),
70 _wetted_perimeter(this->template getFunctor<ADReal>("wetted_perimeter")),
71 _h(this->template getFunctor<ADReal>("heat_transfer_coefficient"))
72{
73}
74
77{
78 const Moose::PointArg arg = {Point(1, 2, 3)};
79 const int i = 0;
81 // Upwind the segment inlet temperature on the flow direction
82 const auto Tin = 1.0 / 2.0 * (1 - _m[i] / sqrt(_m[i] * _m[i] + 1.0e-08)) * _Tfdown[i] +
83 1.0 / 2.0 * (1 + _m[i] / sqrt(_m[i] * _m[i] + 1.0e-08)) * _Tfup[i];
84
85 // Bulk fluid temperature seen by the wall: segment average or fluid node temperature
86 const bool node_bulk = getParam<bool>("use_fluid_node_temp");
87 const auto Tbulk = node_bulk ? ADReal(_Tf[i]) : ADReal((_Tf[i] + Tin) / 2.0);
88
89 // Convective heat transfer with the secondary-side fluid
90 return _h(arg, state) * _wetted_perimeter(arg, state) * (Tbulk - Base::_u[i]);
91}
92
93Real
95{
96 mooseError("convectiveJacobian() should not be called in AD mode");
97 return 0;
98}
registerMooseObject("ThermalHydraulicsApp", ADPipeOuterWallCoupledConvectiveTemperatureScalarKernel)
DualNumber< Real, DNDerivativeType, true > ADReal
Outer wall path-integrated incompressible conjugate heat transfer kernel with a coupled secondary sid...
virtual ADReal convectiveLinearHeatRate() const override
Heat flux exchanged with the fluid or ambient environment on this node's interface to the fluid/envir...
const ADVariableValue & _Tfup
Coupled secondary-side fluid temperature adjacent to the upstream wall node.
virtual Real convectiveJacobian() const override
Derivative of convectiveLinearHeatRate() with respect to this node's own temperature.
const Moose::Functor< ADReal > & _wetted_perimeter
Wetted perimeter of the secondary-side flow channel adjacent to this wall node.
const Moose::Functor< ADReal > & _h
Secondary-side heat transfer coefficient.
const ADVariableValue & _Tf
Coupled secondary-side fluid temperature adjacent to this wall node.
const ADVariableValue & _Tfdown
Coupled secondary-side fluid temperature adjacent to the downstream wall node.
const ADVariableValue & _m
Coupled mass flow rate of the secondary-side fluid.
Base class for path-integrated incompressible conjugate heat transfer kernels.
const bool _is_implicit
Property state integration flag.
const ADVariableValue & _u
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void mooseError(Args &&... args) const
StateArg oldState()
StateArg currentState()