Skip to content

Commit

Permalink
Fix tests, compute Reynolds number as in Cigre207 report
Browse files Browse the repository at this point in the history
  • Loading branch information
Halvor Lund committed May 30, 2024
1 parent 2e22bcb commit fe42a31
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 308 deletions.
34 changes: 8 additions & 26 deletions linerate/equations/cigre207/ac_resistance.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,27 @@
from typing import Union

from linerate.units import OhmPerMeter, Ampere, SquareMeter, Unitless, SquareMeterPerAmpere
from linerate.units import OhmPerMeter


def correct_resistance_acsr_magnetic_core_loss_simple(
ac_resistance: OhmPerMeter,
current: Ampere,
aluminium_cross_section_area: SquareMeter,
constant_magnetic_effect: Union[Unitless, None],
current_density_proportional_magnetic_effect: Union[SquareMeterPerAmpere, None],
max_relative_increase: Unitless,
def correct_resistance_for_skin_effect(
dc_resistance: OhmPerMeter,
) -> OhmPerMeter:
r"""
Return resistance with constant correction for magnetic effects, using simple method from
Return resistance with constant correction for skin effect, using simple method from
Cigre 207, see section 2.1.1.
Parameters
----------
ac_resistance:
:math:`R~\left[\Omega\right]`. The AC resistance of the conductor.
current:
:math:`I~\left[\text{A}\right]`. The current going through the conductor.
aluminium_cross_section_area:
:math:`A_{\text{Al}}~\left[\text{m}^2\right]`. The cross sectional area of the aluminium
strands in the conductor.
constant_magnetic_effect:
:math:`b`. The constant magnetic effect, most likely equal to 1. If ``None``, then no
correction is used (useful for non-ACSR cables).
current_density_proportional_magnetic_effect:
:math:`m`. The current density proportional magnetic effect. If ``None``, then it is
assumed equal to 0.
max_relative_increase:
:math:`c_\text{max}`. Saturation point of the relative increase in conductor resistance.
dc_resistance:
:math:`R~\left[\Omega\right]`. The DC resistance of the conductor.
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`R_\text{corrected}~\left[\Omega\right]`. The resistance of the conductor after
taking steel core magnetization effects into account.
taking skin effect into account.
"""
return 1.0123 * ac_resistance
return 1.0123 * dc_resistance


# TODO: Implement section 2.1.2?
38 changes: 37 additions & 1 deletion linerate/equations/cigre207/convective_cooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
MeterPerSecond,
Radian,
Unitless,
WattPerMeterPerKelvin,
WattPerMeterPerKelvin, SquareMeterPerSecond,
)


Expand Down Expand Up @@ -107,6 +107,42 @@ def compute_prandtl_number(
return 0.715 - 2.5e-4*film_temperature


def compute_reynolds_number(
wind_speed: MeterPerSecond,
conductor_diameter: Meter,
kinematic_viscosity_of_air: SquareMeterPerSecond,
relative_air_density: Unitless
) -> Unitless:
r"""Compute the Reynolds number using the conductor diameter as characteristic length scale.
Defined on page 5 of :cite:p:`cigre207`.
This is a non-standard definition which seems to indicate that the kinematic viscosity has to
be corrected for the density.
Parameters
----------
wind_speed:
:math:`v~\left[\text{m}~\text{s}^{-1}\right]`. The wind speed.
conductor_diameter:
:math:`D~\left[\text{m}\right]`. Outer diameter of the conductor.
kinematic_viscosity_of_air:
:math:`\nu_f~\left[\text{m}^2~\text{s}^{-1}\right]`. The kinematic viscosity of air.
relative_air_density:
:math:`\rho_r~1`. The air density relative to density at sea level.
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`\text{Re}`. The Reynolds number.
"""
v = wind_speed
D = conductor_diameter
nu_f = kinematic_viscosity_of_air
rho_r = relative_air_density
return rho_r * v * D / nu_f



## Nusselt number calculation
#############################

Expand Down
2 changes: 1 addition & 1 deletion linerate/models/Cigre207.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Cigre 207 vs 601

The Cigre 601 report states that 601 takes into account improvements in the calculation of AC resistance of stranded
conductors, includes a more realistic estimation of the axial and radial temeprature distributions, more coherent
conductors, includes a more realistic estimation of the axial and radial temperature distributions, more coherent
convection model for low wind speeds, and has a more flexible solar radiation model.

## Skin effect
Expand Down
49 changes: 45 additions & 4 deletions linerate/models/cigre207.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from abc import abstractmethod

from linerate import ThermalModel, Span, Weather
from linerate.equations import solar_angles, cigre601, math, cigre207, dimensionless, convective_cooling
from linerate.equations import solar_angles, cigre601, math, cigre207, dimensionless, convective_cooling, joule_heating
from linerate.equations.math import switch_cos_sin
from linerate.model import _copy_method_docstring
from linerate.units import Date, Celsius, Ampere, WattPerMeter
from linerate.units import Date, Celsius, Ampere, WattPerMeter, OhmPerMeter


class Cigre207(ThermalModel):
Expand Down Expand Up @@ -63,8 +65,8 @@ def compute_convective_cooling(
) -> WattPerMeter:
D = self.span.conductor.conductor_diameter
d = self.span.conductor.outer_layer_strand_diameter
y = self.span.conductor_altitude
V = self.weather.wind_speed
y = self.span.conductor_altitude
T_a = self.weather.air_temperature
T_c = conductor_temperature
T_f = 0.5 * (T_c + T_a)
Expand All @@ -80,7 +82,8 @@ def compute_convective_cooling(
# Reynolds number is defined in the text on page 5 of :cite:p:`cigre207`.
# The definition includes a relative air density, which does not make sense, so we omit it here and use the
# standard definition of Reynolds number instead.
Re = dimensionless.compute_reynolds_number(V, D, nu_f)
rho_r = cigre207.convective_cooling.compute_relative_air_density(y)
Re = cigre207.convective_cooling.compute_reynolds_number(V, D, nu_f, rho_r)
Gr = dimensionless.compute_grashof_number(D, T_c, T_a, nu_f)
Pr = cigre207.convective_cooling.compute_prandtl_number(T_f)
Rs = dimensionless.compute_conductor_roughness(D, d)
Expand Down Expand Up @@ -115,3 +118,41 @@ def compute_radiative_cooling(
return super().compute_radiative_cooling(
conductor_temperature=conductor_temperature, current=current
)

@abstractmethod
def compute_resistance(self, conductor_temperature: Celsius, current: Ampere) -> OhmPerMeter:
r"""Compute the conductor resistance, :math:`R~\left[\Omega~\text{m}^{-1}\right]`.
Parameters
----------
conductor_temperature:
:math:`T_\text{av}~\left[^\circ\text{C}\right]`. The average conductor temperature.
current:
:math:`I~\left[\text{A}\right]`. The current.
Returns
-------
Union[float, float64, ndarray[Any, dtype[float64]]]
:math:`R~\left[\Omega\right]`. The resistance at the given temperature and current.
"""
resistance = joule_heating.compute_resistance(
conductor_temperature,
temperature1=self.span.conductor.temperature1,
temperature2=self.span.conductor.temperature2,
resistance_at_temperature1=self.span.conductor.resistance_at_temperature1,
resistance_at_temperature2=self.span.conductor.resistance_at_temperature2,
)

A = self.span.conductor.aluminium_cross_section_area
b = self.span.conductor.constant_magnetic_effect
m = self.span.conductor.current_density_proportional_magnetic_effect
max_increase = self.span.conductor.max_magnetic_core_relative_resistance_increase

return joule_heating.correct_resistance_acsr_magnetic_core_loss(
ac_resistance=resistance,
current=current,
aluminium_cross_section_area=A,
constant_magnetic_effect=b,
current_density_proportional_magnetic_effect=m,
max_relative_increase=max_increase,
)
Loading

0 comments on commit fe42a31

Please sign in to comment.