@@ -40,7 +40,8 @@ class HeatFluxBC(HeatChargeBC):
40
40
units = HEAT_FLUX ,
41
41
)
42
42
43
- #TODO Should I adapt to Tidy3D units (e.g. micrometers), or keep the original ones?
43
+
44
+ # TODO Should I adapt to Tidy3D units (e.g. micrometers), or keep the original ones?
44
45
THERMAL_CONDUCTIVITY_UNITS = "W/(m*K)"
45
46
DYNAMIC_VISCOSITY_UNITS = "Pa*s"
46
47
SPECIFIC_HEAT_UNITS = "J/(kg*K)"
@@ -49,6 +50,7 @@ class HeatFluxBC(HeatChargeBC):
49
50
LENGTH_UNITS = "m"
50
51
ACCELERATION_UNITS = "m/s**2"
51
52
53
+
52
54
class NaturalConvectionVerticalSpec (HeatChargeBC ):
53
55
"""
54
56
Specification for natural convection from a vertical plate.
@@ -58,6 +60,7 @@ class NaturalConvectionVerticalSpec(HeatChargeBC):
58
60
values as 'base' and 'exponent' for a generalized heat flux equation
59
61
q = base * (T_surf - T_fluid)^exponent.
60
62
"""
63
+
61
64
# --- Input Parameters ---
62
65
fluid_k : pd .NonNegativeFloat = pd .Field (
63
66
title = "Fluid Thermal Conductivity" ,
@@ -98,14 +101,9 @@ class NaturalConvectionVerticalSpec(HeatChargeBC):
98
101
)
99
102
100
103
def _compute_parameters (self ):
101
-
102
104
# Calculate the Rayleigh Number (Ra_L)
103
105
rayleigh_numerator_notemp = (
104
- self .gravity
105
- * self .fluid_beta
106
- * self .fluid_rho ** 2
107
- * self .fluid_Cp
108
- * self .plate_L ** 3
106
+ self .gravity * self .fluid_beta * self .fluid_rho ** 2 * self .fluid_Cp * self .plate_L ** 3
109
107
)
110
108
rayleigh_denominator = self .fluid_mu * self .fluid_k
111
109
Ra_L = rayleigh_numerator_notemp / rayleigh_denominator
@@ -122,19 +120,22 @@ def _compute_parameters(self):
122
120
if Ra_L <= 1e9 :
123
121
# Laminar Flow
124
122
h_factor_linear = 0.68
125
- h_factor_non_linear = (0.670 * Ra_L ** (1 / 6 )) / pr_denominator
123
+ h_factor_non_linear = (0.670 * Ra_L ** (1 / 6 )) / pr_denominator
126
124
elif 1e9 < Ra_L <= 1e13 :
127
125
# Turbulent Flow
128
126
h_factor_linear = 0.825
129
127
h_factor_non_linear = (0.387 * Ra_L ** (1 / 6 )) / pr_denominator
130
128
else :
131
- raise ValueError (f"Ra_l={ Ra_L } should be smaller than 1e13 for NaturalConvectionVerticalSpec" )
129
+ raise ValueError (
130
+ f"Ra_L={ Ra_L } should be smaller than 1e13 for NaturalConvectionVerticalSpec"
131
+ )
132
132
133
133
h = (self .fluid_k / self .plate_L ) * h_factor_linear
134
134
h_nonlinear = (self .fluid_k / self .plate_L ) * h_factor_non_linear
135
- exponent = 1 + 1 / 6
135
+ exponent = 1 + 1 / 6
136
136
return h , h_nonlinear , exponent
137
137
138
+
138
139
class ConvectionBC (HeatChargeBC ):
139
140
"""Convective thermal boundary conditions.
140
141
@@ -156,6 +157,7 @@ class ConvectionBC(HeatChargeBC):
156
157
units = HEAT_TRANSFER_COEFF ,
157
158
)
158
159
159
- #TODO Maybe I should find a better place for these lines.
160
+
161
+ # TODO Maybe I should find a better place for these lines.
160
162
NaturalConvectionVerticalSpec .update_forward_refs ()
161
163
ConvectionBC .update_forward_refs ()
0 commit comments