https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADPipeInnerWallTemperatureScalarKernel.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
15
18{
20 params.addClassDescription("Assembles transport equation for the temperature of the "
21 "inner-surface radial node of a pipe wall.");
22 params.addCoupledVar("mass_flow_rate",
23 {},
24 "Mass flow rate in component. Takes a "
25 "scalar variable name");
26 params.addCoupledVar("outer_wall_temperature",
27 {},
28 "Temperature of the outer-surface wall node, on the other side of this "
29 "layer's radial conduction path. Takes a scalar variable name");
30 params.addCoupledVar("fluid_temperature",
31 {},
32 "Fluid temperature adjacent to this wall node. Takes a scalar variable "
33 "name");
34 params.addCoupledVar(
35 "upstream_fluid_temperature",
36 {},
37 "Fluid temperature adjacent to the upstream wall node. Takes a scalar variable "
38 "name");
39 params.addCoupledVar(
40 "downstream_fluid_temperature",
41 {},
42 "Fluid temperature adjacent to the downstream wall node. Takes a scalar variable "
43 "name");
44 params.addRequiredParam<MooseFunctorName>(
45 "wetted_perimeter", "Wetted perimeter of the fluid flow channel adjacent to this node [m]");
46 params.addRequiredParam<MooseFunctorName>("heat_transfer_coefficient",
47 "Heat transfer coefficient of the fluid [W/(m^2-K)]");
48 params.addParam<bool>(
49 "use_fluid_node_temp",
50 true,
51 "Whether to use fluid node temperature for wall heat transfer or a segment-averaged value.");
52
53 return params;
54}
55
57 const InputParameters & parameters)
58 : Base(parameters),
59 _m(ScalarCoupleable::adCoupledScalarValue("mass_flow_rate")),
60 _Tout(ScalarCoupleable::adCoupledScalarValue("outer_wall_temperature")),
61 _Tf(ScalarCoupleable::adCoupledScalarValue("fluid_temperature")),
62 _Tfup(ScalarCoupleable::adCoupledScalarValue("upstream_fluid_temperature")),
63 _Tfdown(ScalarCoupleable::adCoupledScalarValue("downstream_fluid_temperature")),
64 _wetted_perimeter(this->template getFunctor<ADReal>("wetted_perimeter")),
65 _h(this->template getFunctor<ADReal>("heat_transfer_coefficient"))
66{
67}
68
71{
72 const Moose::PointArg arg = {Point(1, 2, 3)};
73 const int i = 0;
75 // Upwind the segment inlet temperature on the flow direction
76 const auto Tin = 1.0 / 2.0 * (1 - _m[i] / sqrt(_m[i] * _m[i] + 1.0e-08)) * _Tfdown[i] +
77 1.0 / 2.0 * (1 + _m[i] / sqrt(_m[i] * _m[i] + 1.0e-08)) * _Tfup[i];
78
79 // Bulk fluid temperature seen by the wall: segment average or fluid node temperature
80 const bool node_bulk = getParam<bool>("use_fluid_node_temp");
81 const auto Tbulk = node_bulk ? ADReal(_Tf[i]) : ADReal((_Tf[i] + Tin) / 2.0);
82
83 // Convective heat transfer with the fluid
84 return _h(arg, state) * _wetted_perimeter(arg, state) * (Tbulk - Base::_u[i]);
85}
86
87Real
89{
90 mooseError("convectiveJacobian() should not be called in AD mode");
91 return 0;
92}
registerMooseObject("ThermalHydraulicsApp", ADPipeInnerWallTemperatureScalarKernel)
DualNumber< Real, DNDerivativeType, true > ADReal
Inner wall path-integrated incompressible conjugate heat transfer kernel.
const ADVariableValue & _Tfdown
Coupled fluid temperature adjacent to the downstream wall node.
const Moose::Functor< ADReal > & _h
Heat transfer coefficient from functor material.
const ADVariableValue & _Tfup
Coupled fluid temperature adjacent to the upstream wall node.
const ADVariableValue & _m
Coupled mass flow rate through the pipe.
const Moose::Functor< ADReal > & _wetted_perimeter
Wetted perimeter of the fluid flow channel adjacent to this wall node.
ADPipeInnerWallTemperatureScalarKernel(const InputParameters &parameters)
const ADVariableValue & _Tf
Coupled fluid temperature adjacent to this wall node.
virtual Real convectiveJacobian() const override
Derivative of convectiveLinearHeatRate() with respect to this node's own temperature.
virtual ADReal convectiveLinearHeatRate() const override
Heat flux exchanged with the fluid or ambient environment on this node's interface to the fluid/envir...
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()