Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added scale parameter to HeatTransferFromHeatStructure1Phase #28669

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ The parameter [!param](/Components/HSBoundaryAmbientConvection/T_ambient) gives
[!param](/Components/HSBoundaryAmbientConvection/htc_ambient) gives the heat transfer coefficient $\mathcal{H}$.

The parameter [!param](/Components/HSBoundaryAmbientConvection/scale) specifies
the name of a [functor](Functors/index.md) $f$ that can scale the boundary conditions.
the name of a [functor](Functors/index.md) $f$ that can scale the boundary conditions, for
example, a functor material property created with [FinEnhancementFactorFunctorMaterial.md]
for heat transfer enhancement due to fins.

!syntax parameters /Components/HSBoundaryAmbientConvection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ side of the connected heat structure that is coupled to the flow channel.
The flow channel axis must be parallel to the heat structure axis and have
the same discretization along their axes.

The parameter [!param](/Components/HeatTransferFromHeatStructure1Phase/scale) specifies
the name of a [functor](Functors/index.md) $f$ that can scale the heat flux, for
example, a functor material property created with [FinEnhancementFactorFunctorMaterial.md]
for heat transfer enhancement due to fins.

!syntax parameters /Components/HeatTransferFromHeatStructure1Phase

## Formulation
Expand All @@ -30,15 +35,15 @@ and heat structure, with the flow channel receiving the following wall heat
flux:

!equation
q_\text{wall} = \mathcal{H}(T_s - T) \eqc
q_\text{wall} = f \mathcal{H}(T_s - T) \eqc

where $\mathcal{H}$ is the heat transfer coefficient, $T_s$ is the heat
structure surface temperature, and $T$ is the fluid temperature. On the heat
structure surface temperature, $T$ is the fluid temperature, and $f$ is an optional scaling factor. On the heat
structure side, the incoming boundary flux is the opposite of that going into
the flow channel:

!equation
q_b = -q_\text{wall} = \mathcal{H}(T - T_s) \eqp
q_b = -q_\text{wall} = f \mathcal{H}(T - T_s) \eqp

!syntax inputs /Components/HeatTransferFromHeatStructure1Phase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class ADHeatFluxFromHeatStructure3EqnUserObject : public ADHeatFluxFromHeatStruc
const ADMaterialProperty<Real> & _Hw;
const ADMaterialProperty<Real> & _T;

/// Functor by which to scale the heat flux
const Moose::Functor<ADReal> & _scale;

public:
static InputParameters validParams();
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

#include "ElementUserObject.h"
#include "MeshAlignment.h"
#include "ADFunctorInterface.h"

/**
* Base class for caching quantities computed between flow channels and heat structures.
*/
class FlowChannelHeatStructureCouplerUserObject : public ElementUserObject
class FlowChannelHeatStructureCouplerUserObject : public ElementUserObject,
public ADFunctorInterface
{
public:
FlowChannelHeatStructureCouplerUserObject(const InputParameters & parameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ HeatTransferFromHeatStructure1Phase::validParams()
InputParameters params = HeatTransferFromTemperature1Phase::validParams();
params += HSBoundaryInterface::validParams();

params.addParam<MooseFunctorName>("scale", 1.0, "Functor by which to scale the heat flux");

params.addClassDescription("Connects a 1-phase flow channel and a heat structure");

return params;
Expand Down Expand Up @@ -143,6 +145,7 @@ HeatTransferFromHeatStructure1Phase::addMooseObjects()
params.set<std::vector<VariableName>>("P_hf") = {_P_hf_name};
params.set<MaterialPropertyName>("Hw") = _Hw_1phase_name;
params.set<MaterialPropertyName>("T") = FlowModelSinglePhase::TEMPERATURE;
params.set<MooseFunctorName>("scale") = getParam<MooseFunctorName>("scale");
params.set<ExecFlagEnum>("execute_on") = execute_on;
getTHMProblem().addUserObject(class_name, heat_flux_uo_name, params);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ADHeatFluxFromHeatStructure3EqnUserObject::validParams()
params.addRequiredParam<MaterialPropertyName>("T_wall", "Wall temperature");
params.addRequiredParam<MaterialPropertyName>("T", "Fluid temperature");
params.addRequiredParam<MaterialPropertyName>("Hw", "Convective heat transfer coefficient");
params.addParam<MooseFunctorName>("scale", 1.0, "Functor by which to scale the heat flux");
params.addClassDescription(
"Cache the heat flux between a single phase flow channel and a heat structure");
return params;
Expand All @@ -28,12 +29,14 @@ ADHeatFluxFromHeatStructure3EqnUserObject::ADHeatFluxFromHeatStructure3EqnUserOb
: ADHeatFluxFromHeatStructureBaseUserObject(parameters),
_T_wall(getADMaterialProperty<Real>("T_wall")),
_Hw(getADMaterialProperty<Real>("Hw")),
_T(getADMaterialProperty<Real>("T"))
_T(getADMaterialProperty<Real>("T")),
_scale(getFunctor<ADReal>("scale"))
{
}

ADReal
ADHeatFluxFromHeatStructure3EqnUserObject::computeQpHeatFlux()
{
return _Hw[_qp] * (_T_wall[_qp] - _T[_qp]);
const Moose::ElemQpArg space_arg = {_current_elem, _qp, _qrule, _q_point[_qp]};
return _Hw[_qp] * (_T_wall[_qp] - _T[_qp]) * _scale(space_arg, Moose::currentState());
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ InputParameters
FlowChannelHeatStructureCouplerUserObject::validParams()
{
InputParameters params = ElementUserObject::validParams();
params += ADFunctorInterface::validParams();
params.addRequiredParam<MeshAlignment *>("_mesh_alignment", "Mesh alignment object");
params.addClassDescription(
"Base class for caching quantities computed between flow channels and heat structures.");
Expand All @@ -23,6 +24,7 @@ FlowChannelHeatStructureCouplerUserObject::validParams()
FlowChannelHeatStructureCouplerUserObject::FlowChannelHeatStructureCouplerUserObject(
const InputParameters & parameters)
: ElementUserObject(parameters),
ADFunctorInterface(this),
_fc_elem_id(0),
_hs_elem_id(0),
_fc_qp(0),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
# This test has 2 pipes, each surrounded by a cylindrical HS:
#
# - pipe1: no fin heat transfer enhancement
# - pipe2: fin heat transfer enhancement

diam = 0.01
area = ${fparse 0.25 * pi * diam^2}

length = 1.0
n_elems = 10

t_hs = 0.02
n_elems_radial = 5

rho_inlet = 1359.792245 # @ T = 300 K, p = 1e5 Pa
vel_inlet = 1.0
T_inlet = 300
p_outlet = 1e5
T_initial_hs = 800
mfr_inlet = ${fparse rho_inlet * vel_inlet * area}

htc = 100

# Suppose that there are 20 rectangular, 1-mm-thick fins of height 1 mm over the length
# of the cooled section.
n_fin = 20
h_fin = 0.001
t_fin = 0.001
A_fin_single = ${fparse (2 * h_fin + t_fin ) * length}
A_fin = ${fparse n_fin * A_fin_single}
A_cooled = ${fparse pi * diam * length}
A_total = ${fparse A_fin + A_cooled - n_fin * t_fin * length}
fin_area_fraction = ${fparse A_fin / A_total}
area_increase_factor = ${fparse A_total / A_cooled}
fin_perimeter_area_ratio = ${fparse (2 * length + 2 * t_fin) / (length * t_fin)}

k_fin = 15.0

[FluidProperties]
[fp]
type = StiffenedGasFluidProperties
gamma = 2.35
q = -1167e3
q_prime = 0
p_inf = 1e9
cv = 1816
[]
[]

[Closures]
[simple_closures]
type = Closures1PhaseSimple
[]
[]

[SolidProperties]
[sp_ss316]
type = ThermalSS316Properties
[]
[]

[FunctorMaterials]
[fin_efficiency_fmat]
type = FinEfficiencyFunctorMaterial
fin_height = ${h_fin}
fin_perimeter_area_ratio = ${fparse fin_perimeter_area_ratio}
heat_transfer_coefficient = ${htc}
thermal_conductivity = ${k_fin}
fin_efficiency_name = fin_efficiency
[]
[fin_enhancement_fmat]
type = FinEnhancementFactorFunctorMaterial
fin_efficiency = fin_efficiency
fin_area_fraction = ${fin_area_fraction}
area_increase_factor = ${area_increase_factor}
fin_enhancement_factor_name = fin_enhancement
[]
[]

[Components]
# pipe1

[pipe1_inlet]
type = InletMassFlowRateTemperature1Phase
m_dot = ${mfr_inlet}
T = ${T_inlet}
input = 'pipe1:in'
[]
[pipe1]
type = FlowChannel1Phase
gravity_vector = '0 0 0'
position = '0 0 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
A = ${area}
initial_T = ${T_inlet}
initial_p = ${p_outlet}
initial_vel = ${vel_inlet}
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[pipe1_outlet]
type = Outlet1Phase
p = ${p_outlet}
input = 'pipe1:out'
[]
[ht1]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe1
hs = hs1
hs_side = inner
Hw = ${htc}
[]
[hs1]
type = HeatStructureCylindrical
position = '0 0 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
inner_radius = ${fparse 0.5 * diam}
names = 'main'
solid_properties = 'sp_ss316'
solid_properties_T_ref = '300'
widths = '${t_hs}'
n_part_elems = '${n_elems_radial}'
initial_T = ${T_initial_hs}
scaling_factor_temperature = 1e-5
[]

# pipe 2

[pipe2_inlet]
type = InletMassFlowRateTemperature1Phase
m_dot = ${mfr_inlet}
T = ${T_inlet}
input = 'pipe2:in'
[]
[pipe2]
type = FlowChannel1Phase
gravity_vector = '0 0 0'
position = '0 0.5 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
A = ${area}
initial_T = ${T_inlet}
initial_p = ${p_outlet}
initial_vel = ${vel_inlet}
fp = fp
closures = simple_closures
f = 0
scaling_factor_1phase = '1 1 1e-5'
[]
[pipe2_outlet]
type = Outlet1Phase
p = ${p_outlet}
input = 'pipe2:out'
[]
[ht2]
type = HeatTransferFromHeatStructure1Phase
flow_channel = pipe2
hs = hs2
hs_side = inner
Hw = ${htc}
scale = fin_enhancement
[]
[hs2]
type = HeatStructureCylindrical
position = '0 0.5 0'
orientation = '0 0 1'
length = ${length}
n_elems = ${n_elems}
inner_radius = ${fparse 0.5 * diam}
names = 'main'
solid_properties = 'sp_ss316'
solid_properties_T_ref = '300'
widths = '${t_hs}'
n_part_elems = '${n_elems_radial}'
initial_T = ${T_initial_hs}
scaling_factor_temperature = 1e-5
[]
[]

[Postprocessors]
[pipe1_T_avg]
type = ElementAverageValue
variable = T
block = 'pipe1'
execute_on = 'INITIAL TIMESTEP_END'
[]
[pipe2_T_avg]
type = ElementAverageValue
variable = T
block = 'pipe2'
execute_on = 'INITIAL TIMESTEP_END'
[]

[hs1_T_avg]
type = SideAverageValue
variable = T_solid
boundary = 'hs1:inner'
execute_on = 'INITIAL TIMESTEP_END'
[]
[hs2_T_avg]
type = SideAverageValue
variable = T_solid
boundary = 'hs2:inner'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]

[Preconditioning]
[pc]
type = SMP
full = true
[]
[]

[Executioner]
type = Transient
scheme = 'bdf2'

end_time = 10.0
dt = 1.0

solve_type = NEWTON
nl_rel_tol = 0
nl_abs_tol = 1e-6
nl_max_its = 15

l_tol = 1e-3
l_max_its = 10
[]

[Outputs]
csv = true
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
time,hs1_T_avg,hs2_T_avg,pipe1_T_avg,pipe2_T_avg
0,800,800,300,300
1,796.72027289917,792.64935813428,301.31617250519,302.94516242609
2,794.69166436377,788.135459307,301.85991116439,304.1516529957
3,793.45033687317,785.39526446055,301.93833543943,304.30895984674
4,792.57973655753,783.48384183056,301.89517128134,304.19899179588
5,791.88836565408,781.97071598749,301.86391390055,304.12099654351
6,791.3019994347,780.69049835119,301.85504385904,304.09522697609
7,790.78896970435,779.57285794509,301.85392032277,304.08744860216
8,790.33185491519,778.57901794532,301.85317904221,304.08098041844
9,789.91907595949,777.68318259154,301.85182073494,304.07360162723
10,789.54231108575,776.86683869353,301.85032225901,304.06632651112
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@
requirement = "The system shall conserve energy after reaching steady-state when a flow channel is coupled to a heat structure."
issues = '#19754'
[]
[fin_enhancement]
type = CSVDiff
input = 'fin_enhancement.i'
csvdiff = 'fin_enhancement_out.csv'
requirement = 'The system shall be able to enhance heat transfer between a flow channel and heat structure using fins.'
issues = '#25275'
[]

# Error checking
[err:not_a_pipe]
Expand Down