Transformer
The Transformer is the main object that needs to be defined to work with our thermal model.
Transformer
Transformer(
cooling_type: CoolerType,
cooling_controller: CoolingSwitchController
| None = None,
)
Bases: ABC
Abstract class to define the transformer object.
Depending on the type of transformer (either PowerTransformer or DistributionTransformer), the transformer attains certain default attributes. These attributes can be overwritten by using the TR_Specs dictionary.
Attributes:
| Name | Type | Description |
|---|---|---|
cooling_type |
CoolerType
|
The cooling type. Can be CoolerType.ONAN or CoolerType.ONAF. |
(TransformerSpecifications): The transformer specifications that you need to provide to build the transformer. Any optional specifications not provided will be taken from the default specifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cooling_type
|
CoolerType
|
The cooling type. Can be ONAN, ONAF. |
required |
cooling_controller
|
CoolingSwitchController | None
|
The cooling controller that handles the ONAN/ONAF switching logic. |
None
|
Source code in transformer_thermal_model/transformer/base.py
33 34 35 36 37 38 39 40 41 42 43 44 | |
defaults
abstractmethod
property
defaults: BaseDefaultTransformerSpecifications
The default transformer specifications.
set_ONAN_ONAF_first_timestamp
set_ONAN_ONAF_first_timestamp(
init_top_oil_temp: float,
) -> None
Delegate initial cooling type logic to CoolingSwitchController.
Source code in transformer_thermal_model/transformer/base.py
46 47 48 49 50 51 | |
set_cooling_switch_controller_specs
set_cooling_switch_controller_specs(
top_oil_temp: float,
previous_top_oil_temp: float,
index: int,
) -> BaseTransformerSpecifications | None
Delegate ONAN/ONAF switch logic to CoolingSwitchController.
Source code in transformer_thermal_model/transformer/base.py
53 54 55 56 57 58 59 | |
PowerTransformer
PowerTransformer(
user_specs: UserTransformerSpecifications,
cooling_type: CoolerType,
internal_component_specs: TransformerComponentSpecifications
| None = None,
cooling_switch_settings: CoolingSwitchSettings
| None = None,
)
Bases: Transformer
A power transformer.
This class represents a power transformer. This class inherits from the Transformer class.
Example: initialise a power transformer:
>>> from transformer_thermal_model.schemas import UserTransformerSpecifications
>>> from transformer_thermal_model.cooler import CoolerType
>>> from transformer_thermal_model.transformer import PowerTransformer
>>> user_specs = UserTransformerSpecifications(
... load_loss=1000,
... nom_load_sec_side=1500,
... no_load_loss=200,
... )
>>> cooling_type = CoolerType.ONAN
>>> transformer = PowerTransformer(
... user_specs=user_specs,
... cooling_type=cooling_type
... )
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_specs
|
UserTransformerSpecifications
|
The transformer specifications that you need to provide to build the transformer. Any optional specifications not provided will be taken from the default specifications. |
required |
cooling_type
|
CoolerType
|
The cooling type. Can be ONAN or ONAF. |
required |
internal_component_specs
|
TransformerComponentSpecifications
|
The internal component specifications, which are used to calculate the limiting component. Defaults to None. |
None
|
cooling_switch_settings
|
CoolingSwitchSettings
|
The ONAF switch settings. Only used when the cooling type is ONAF. |
None
|
Source code in transformer_thermal_model/transformer/power.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
defaults
property
defaults: DefaultTransformerSpecifications
The ClassVar for default TransformerSpecifications.
If PowerTransformer is not initialised, uses the ONAF specifications.
tap_changer_capacity_ratio
property
tap_changer_capacity_ratio: float | None
The ratio between the tap changer capacity and the nominal load of the transformer.
primary_bushing_capacity_ratio
property
primary_bushing_capacity_ratio: float | None
The ratio between the primary bushing capacity and the nominal load of the transformer.
secondary_bushing_capacity_ratio
property
secondary_bushing_capacity_ratio: float | None
The ratio between the secondary bushing capacity and the nominal load of the transformer.
int_cur_trans_capacity_ratio
property
int_cur_trans_capacity_ratio: float | None
The ratio between the internal current transformer capacity and the nominal load of the transformer.
component_capacities
property
component_capacities: dict
Puts the limits of all transformer components in a single dictionary.
DistributionTransformer
DistributionTransformer(
user_specs: UserTransformerSpecifications,
)
Bases: Transformer
A distribution transformer.
The DistributionTransformer class represents a distribution transformer. This class inherits from the Transformer class. This transformer can only be used with ONAN (Oil Natural Air Natural) cooling type.
Initialising a distribution transformer.
>>> from transformer_thermal_model.schemas import UserTransformerSpecifications
>>> from transformer_thermal_model.transformer import DistributionTransformer
>>> transformer_specifications = UserTransformerSpecifications(
... load_loss=5200, # Transformer load loss [W]
... nom_load_sec_side=900, # Transformer nominal current secondary side [A]
... no_load_loss=800, # Transformer no-load loss [W]
... )
>>> # note that no cooling type can be specified here, as this is a distribution transformer
>>> my_transformer = DistributionTransformer(user_specs=transformer_specifications)
>>> # the default specifications that will be used when not provided
>>> print(my_transformer.defaults)
time_const_oil=180.0 top_oil_temp_rise=60.0 oil_const_k11=1.0
winding_const_k21=1 winding_const_k22=2 oil_exp_x=0.8 winding_exp_y=1.6 end_temp_reduction=0.0
amb_temp_surcharge=10.0 time_const_windings=4.0 winding_oil_gradient=23.0 hot_spot_fac=1.2
>>> # the combination of the user specifications and the default specifications
>>> print(my_transformer.specs)
no_load_loss=800.0 amb_temp_surcharge=10.0 time_const_oil=180.0 top_oil_temp_rise=60.0
oil_const_k11=1.0 winding_const_k21=1 winding_const_k22=2
oil_exp_x=0.8 winding_exp_y=1.6 end_temp_reduction=0.0 load_loss=5200.0
nom_load_sec_side=900.0 winding_oil_gradient=23.0 time_const_windings=4.0 hot_spot_fac=1.2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_specs
|
UserTransformerSpecifications
|
The transformer specifications that you need to provide to build the transformer. Any optional specifications not provided will be taken from the default specifications. |
required |
Source code in transformer_thermal_model/transformer/distribution.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
defaults
property
defaults: DefaultTransformerSpecifications
Return the default transformer specifications.
ThreeWindingTransformer
ThreeWindingTransformer(
user_specs: UserThreeWindingTransformerSpecifications,
cooling_type: CoolerType,
cooling_switch_settings: ThreeWindingCoolingSwitchSettings
| None = None,
)
Bases: Transformer
A three-winding transformer.
This class represents a Three winding transformer. This class inherits from the Transformer class.
Example: initialise a three winding transformer:
>>> from transformer_thermal_model.schemas import UserThreeWindingTransformerSpecifications, WindingSpecifications
>>> from transformer_thermal_model.transformer import ThreeWindingTransformer
>>> user_specs = UserThreeWindingTransformerSpecifications(
... no_load_loss=20,
... amb_temp_surcharge=10,
... lv_winding=WindingSpecifications(nom_load=1000, winding_oil_gradient=20, hot_spot_fac=1.2,
... time_const_winding=1, nom_power=1000),
... mv_winding=WindingSpecifications(nom_load=1000, winding_oil_gradient=20, hot_spot_fac=1.2,
... time_const_winding=1, nom_power=1000),
... hv_winding=WindingSpecifications(nom_load=1000, winding_oil_gradient=20, hot_spot_fac=1.2,
... time_const_winding=1000000, nom_power=1000),
... load_loss_hv_lv=100,
... load_loss_hv_mv=100,
... load_loss_mv_lv=100,
... )
>>> transformer = ThreeWindingTransformer(user_specs=user_specs, cooling_type=CoolerType.ONAN)
>>> # the combination of the user specifications and the default specifications
>>> print(transformer.specs)
no_load_loss=20.0 amb_temp_surcharge=10.0 time_const_oil=210.0 top_oil_temp_rise=60.0
oil_const_k11=0.5 winding_const_k21=2 winding_const_k22=2 oil_exp_x=0.8 winding_exp_y=1.3
end_temp_reduction=0.0
lv_winding=WindingSpecifications(winding_oil_gradient=20.0, time_const_winding=1.0, hot_spot_fac=1.2,
nom_load=1000.0, nom_power=1000.0)
mv_winding=WindingSpecifications(winding_oil_gradient=20.0, time_const_winding=1.0, hot_spot_fac=1.2,
nom_load=1000.0, nom_power=1000.0)
hv_winding=WindingSpecifications(winding_oil_gradient=20.0, time_const_winding=1000000.0, hot_spot_fac=1.2,
nom_load=1000.0, nom_power=1000.0)
load_loss_hv_lv=100.0 load_loss_hv_mv=100.0 load_loss_mv_lv=100.0 load_loss_total_user=None
Source code in transformer_thermal_model/transformer/threewinding.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
defaults
property
The ClassVar for default TransformerSpecifications.