case module
Module: case.py
Description
Operating-case data model for PyPacity ampacity calculations.
Copyright
Copyright (c) 2026 Group of Advanced Electro-Technologies (GTEA). Universidad de Cantabria. All rights reserved.
License
SPDX-License-Identifier: GPL-3.0-only
Notes
This module is part of the PyPacity project.
References
IEEE Std 738-2012, IEEE Standard for Calculating the Current-Temperature Relationship of Bare Overhead Conductors
CIGRE Technical Brochure 601, Guide for Thermal Rating Calculations of Overhead Lines
CIGRE Technical Brochure 207, Thermal Rating of Overhead Lines
- class pypacity.case.case.Case
Bases:
objectEnvironmental and operational inputs for an ampacity study.
Collects all inputs required by the IEEE 738 and CIGRE TB 601/207 solvers and exposes the results once the solver completes. Inputs are set directly on the instance; results are read from the same object after the solver method returns.
Simulation inputs
Attribute
Type
Standard
Description
NSELECTint
Both
Analysis mode:
1steady-state conductor temperature,2steady-state ampacity,3transient conductor temperature,4transient thermal rating.TTint
Both
Total simulation time. Units are controlled by
SORM.SORMint
Both
Time unit selector:
0for seconds,1for minutes.DELTIMEint
Both
Simulation time step in seconds.
IORTPRELOADint
IEEE 738
Initial condition mode for transient analyses (
NSELECT = 3or4):1computesTCDRPRELOADfromXIPRELOADvia iteration,2usesTCDRPRELOADdirectly (only valid forNSELECT = 4).TCDRPRELOADfloat
Both
Initial or target steady-state conductor temperature in deg C.
XIPRELOADfloat
Both
Initial (preload) current in amperes.
XISTEPfloat
Both
Final step current in amperes.
TTfromSTint
CIGRE
Transient start mode:
1starts from the steady-state temperature,0starts fromTCDRinitial. Defaults to1.TCDRinitialfloat
CIGRE
Initial conductor temperature in deg C when
TTfromST = 0.Environmental conditions
Attribute
Type
Standard
Description
TAMBfloat
Both
Ambient air temperature in deg C.
VWINDfloat
Both
Wind speed in m/s.
DWIND_DEGfloat
Both
Wind direction in degrees (compass bearing).
WINDANG_DEGfloat
Both
Effective angle between wind direction and conductor axis in degrees. IEEE 738 and CIGRE TB 601 compute it automatically from
DWIND_DEGandZ1_DEG; CIGRE TB 207 reads it directly, so it must already be set when 207 runs standalone.CDR_ELEVfloat
Both
Conductor elevation above sea level in meters.
Z1_DEGfloat
Both
Conductor direction clockwise from north in degrees.
CDR_LAT_DEGfloat
Both
Conductor latitude in degrees.
betafloat
CIGRE
Conductor inclination to the horizontal in degrees. Defaults to
0.Solar settings
Attribute
Type
Standard
Description
SUN_TIMEfloat
Both
Solar hour in the range 0-24. Set to
99(or any value≥ 24) to useSolarRadiationdirectly as the solar irradiance instead of computing it from position, date, and time.NDAYint
Both
Day of year in the range 1 to 365.
A3int
Both
Atmospheric clarity selector:
0for clear air,1for industrial atmosphere.Nsfloat
CIGRE
Clearness ratio as defined in CIGRE TB 601. Defaults to
1.0(clear sky).SolarRadiationfloat
Both
Measured solar radiation intensity in W/m2.
ALBEDOfloat
CIGRE
Ground reflectance coefficient. Defaults to
0.0.SOLARint
CIGRE
Solar source selector:
0usesSolarRadiation,1computes solar heat gain from date, time, and location.Results
Attribute
Type
Standard
Description
TRfloat
Both
Steady-state thermal rating in amperes. Populated after
NSELECT = 2.TCDRPRELOADfloat
Both
Also used as a result: steady-state conductor temperature in deg C populated after
NSELECT = 1.XISTEPfloat
Both
Transient thermal rating current in amperes. Populated after
NSELECT = 4.ATCDRlist
Both
Transient conductor temperature trace in deg C. Populated after
NSELECT = 3or4.TIMElist
Both
Transient time trace in seconds. Populated after
NSELECT = 3or4.QSfloat
Both
Solar heat gain rate in W/m.
QRfloat
Both
Radiative heat loss rate in W/m.
QCfloat
Both
Convective heat loss rate in W/m.
QJfloat
CIGRE
Joule heating rate (I2 x Rac) in W/m.
RACfloat
CIGRE
Conductor AC resistance at the operating temperature in ohm/m.
KTIMEMAXint
IEEE 738
Total number of time steps computed. Populated after
NSELECT = 3or4.Note
The following attributes are internal solver variables used as intermediate working storage during iteration and should not be modified directly:
XLO,XHI,W4,R5,Q1,Q2,T3,T4,T5,U1,P1,K1,YC,WINDANG_RAD,NFLAG,AT,TCDR,XIDUMMY,Bstring, and others initialised in__init__.- demo(NSELECT)
Populate the case with sensible default values for a quick-start study.
Provides a baseline configuration drawn from the IEEE 738 standard sample calculations. The defaults can be used as-is with the IEEE 738 solver or overridden by the caller before passing the case to a CIGRE solver. CIGRE-specific attributes (
Ns,ALBEDO,SOLAR,beta,TTfromST,TCDRinitial) are not set here and retain their__init__defaults; override them after calling this method if a CIGRE study requires non-default values. Solar heat input is taken from the measuredSolarRadiationvalue (SUN_TIME = 99) instead of being computed from the Sun’s position. The following base values are set for all modes:Attribute
Value
Description
TAMB40 °C
Ambient temperature.
VWIND0.61 m/s
Wind speed.
DWIND_DEG90°
Wind direction.
WINDANG_DEG90°
Wind perpendicular to conductor axis.
CDR_LAT_DEG43°
Conductor latitude.
CDR_ELEV0 m
Sea level.
Z1_DEG0°
Conductor direction.
NDAY161
Day of year (June 10).
SUN_TIME99
Use measured
SolarRadiationas the irradiance instead of computing it.A30
Clear atmosphere.
SolarRadiation708.6 W/m2
Used as solar irradiance Q3 when
SUN_TIME = 99.IORTPRELOAD1
Preload temperature computed from
XIPRELOAD.TCDRPRELOAD101.1 °C
Initial conductor temperature.
XIPRELOAD1000 A
Preload current.
XISTEP1000 A
Step current.
SORM0
Time expressed in seconds.
TT6000 s
Total simulation time (100 min).
DELTIME10 s
Simulation time step.
- Parameters:
NSELECT (int) –
Analysis mode.
NSELECT = 1andNSELECT = 2use only the base values above.NSELECT = 3andNSELECT = 4apply the following overrides on top:3(transient conductor temperature):XIPRELOAD = 400 A,XISTEP = 1200 A,SORM = 1,TT = 7200,DELTIME = 30 s,HNH = 2.4(transient thermal rating):IORTPRELOAD = 2,TCDRPRELOAD = 40 °C,TCDRMAX = 150 °C,SORM = 1,TT = 1800,DELTIME = 60 s,HNH = 2.
Note
The base values listed above are overwritten on this instance. CIGRE-specific attributes and solver state variables retain their
__init__defaults.
- print_ver()
Print the module name and release date to standard output.