import numpy as np
from linerate.units import (
BoolOrBoolArray,
Meter,
Radian,
Unitless,
WattPerSquareMeter,
)
_clear_atmosphere_polynomial = np.poly1d(
[-4.07608e-9, 1.94318e-6, -3.61118e-4, 3.46921e-2, -1.9220, 63.8044, -42.2391]
)
_industrial_atmosphere_polynomial = np.poly1d(
[1.3236e-8, -4.3446e-6, 5.4654e-4, -3.1658e-2, 6.6138e-1, 14.2110, 53.1821]
)
[docs]
def compute_total_heat_flux_density(
sin_solar_altitude: Radian,
clear_atmosphere: BoolOrBoolArray,
) -> WattPerSquareMeter:
r"""Compute the heat flux density received by a surface at sea level.
Equation (18) on page 19 of :cite:p:`ieee738`.
This function takes in the sin of the solar altitude, :math`H_c`, in radians.
This is because this is what is calculated in compute_sin_solar_altitude.
This function therefore takes the arcsin of sin_solar_altitude, and then
converts it do degrees.
Parameters
----------
sin_solar_altitude:
:math:`sin(H_c)~\left[\text{radian}~\right]`. The sin of the solar altitude.
clear_atmosphere:
True or False. True: clear atmosphere. False: industrial atmosphere.
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`Q_s~\left[\text{W}~\text{m}^{-2}\right]`
"""
sin_H_c = sin_solar_altitude
H_c = np.degrees(np.arcsin(sin_H_c))
Q_S = np.where(
clear_atmosphere,
_clear_atmosphere_polynomial(H_c),
_industrial_atmosphere_polynomial(H_c),
)
return np.where(Q_S >= 0, Q_S, 0 * Q_S)
[docs]
def compute_solar_altitude_correction_factor(
height_above_sea_level_of_conductor: Meter,
) -> Unitless:
r"""Compute the solar altitude correction factor.
Equation (20) on page 20 of :cite:p:`ieee738`.
Parameters
----------
height_above_sea_level_of_conductor:
:math:`H_e~\left[\text{m}~\right]`. The elevation of the conductor.
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`K_{solar}`
"""
H_e = height_above_sea_level_of_conductor
A = 1
B = 1.148e-4
C = -1.108e-8
return np.poly1d([C, B, A])(H_e)
[docs]
def compute_elevation_correction_factor(
solar_altitude_correction_factor: Unitless,
total_heat_flux_density: WattPerSquareMeter,
) -> WattPerSquareMeter:
r"""Compute the elevation correction factor.
Equation (19) on page 19 of :cite:p:`ieee738`.
The equation is used to correct the solar heat intensity for altitude.
Parameters
----------
solar_altitude_correction_factor:
:math:`K_{solar}\left[ \right]`
total_heat_flux_density:
:math:`Q_s~\left[\text{W}~\text{m}^{-2}\right]`
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`Q_{se}~\left[\text{W}~\text{m}^{-2}\right]`. The elevation correction factor.
"""
K_solar = solar_altitude_correction_factor
Q_s = total_heat_flux_density
return K_solar * Q_s
[docs]
def compute_global_radiation_intensity(
elevation_correction_factor: WattPerSquareMeter,
sin_solar_effective_incidence_angle: Radian,
) -> WattPerSquareMeter:
r"""Compute the global radiation intensity experienced by the conductor.
Equation (8) on page 13 of :cite:p:`ieee738`, but without absorptivity and area of conductor.
Parameters
----------
elevation_correction_factor:
:math:`Q_{se}~\left[\text{W}~\text{m}^{-2}\right]`.The elevation correction factor.
sin_solar_effective_incidence_angle:
:math:`sin(\theta)~\left[\text{radian}\right]`. The sine of the effective angle of
incidence of the sun’s rays.
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`I_T~\left[\text{W}~\text{m}^{-2}\right]`. The solar heating of the conductor.
"""
Q_se = elevation_correction_factor
sin_theta = sin_solar_effective_incidence_angle
return Q_se * sin_theta