2121
2222get_transformer (tw:: ThreeWindingTransformerWinding ) = tw. transformer
2323get_winding_number (tw:: ThreeWindingTransformerWinding ) = tw. winding_number
24+ get_transformer_type (
25+ :: ThreeWindingTransformerWinding{T} ,
26+ ) where {T <: PSY.ThreeWindingTransformer } = T
2427
2528function get_name (three_wt_winding:: ThreeWindingTransformerWinding )
2629 transformer = get_transformer (three_wt_winding)
@@ -34,6 +37,70 @@ function get_series_susceptance(segment::ThreeWindingTransformerWinding)
3437 return PSY. get_series_susceptances (tfw)[winding_int]
3538end
3639
40+ """
41+ get_equivalent_r(tw::ThreeWindingTransformerWinding)
42+
43+ Get the resistance for a specific winding of a three-winding transformer.
44+ Returns the winding-specific series resistance.
45+ """
46+ function get_equivalent_r (tw:: ThreeWindingTransformerWinding )
47+ tfw = get_transformer (tw)
48+ winding_num = get_winding_number (tw)
49+
50+ if winding_num == 1
51+ return PSY. get_r_primary (tfw)
52+ elseif winding_num == 2
53+ return PSY. get_r_secondary (tfw)
54+ elseif winding_num == 3
55+ return PSY. get_r_tertiary (tfw)
56+ else
57+ throw (ArgumentError (" Invalid winding number: $winding_num " ))
58+ end
59+ end
60+
61+ """
62+ get_equivalent_x(tw::ThreeWindingTransformerWinding)
63+
64+ Get the reactance for a specific winding of a three-winding transformer.
65+ Returns the winding-specific series reactance.
66+ """
67+ function get_equivalent_x (tw:: ThreeWindingTransformerWinding )
68+ tfw = get_transformer (tw)
69+ winding_num = get_winding_number (tw)
70+
71+ if winding_num == 1
72+ return PSY. get_x_primary (tfw)
73+ elseif winding_num == 2
74+ return PSY. get_x_secondary (tfw)
75+ elseif winding_num == 3
76+ return PSY. get_x_tertiary (tfw)
77+ else
78+ throw (ArgumentError (" Invalid winding number: $winding_num " ))
79+ end
80+ end
81+
82+ """
83+ get_equivalent_b(tw::ThreeWindingTransformerWinding)
84+
85+ Get the susceptance for a specific winding of a three-winding transformer.
86+ For the primary winding (winding 1), returns the shunt susceptance from the transformer.
87+ For secondary and tertiary windings, returns 0.0 as the shunt is only on the primary side.
88+ """
89+ function get_equivalent_b (tw:: ThreeWindingTransformerWinding )
90+ tfw = get_transformer (tw)
91+ winding_num = get_winding_number (tw)
92+
93+ if winding_num == 1
94+ # Only the primary winding has the shunt susceptance
95+ return (from = PSY. get_b (tfw), to = 0.0 )
96+ elseif winding_num == 2 || winding_num == 3
97+ # Secondary and tertiary windings don't have shunt susceptance
98+ return (from = 0.0 , to = 0.0 )
99+ else
100+ throw (ArgumentError (" Invalid winding number: $winding_num " ))
101+ end
102+ end
103+
37104"""
38105 get_equivalent_rating(tw::ThreeWindingTransformerWinding)
39106
@@ -107,6 +174,52 @@ function get_arc_tuple(tr::ThreeWindingTransformerWinding)
107174 end
108175end
109176
177+ """
178+ get_equivalent_tap(tw::ThreeWindingTransformerWinding)
179+
180+ Get the tap (turns ratio) for a specific winding of a three-winding transformer.
181+ Returns the winding-specific turns ratio for phase shifting transformers.
182+ """
183+ function get_equivalent_tap (
184+ tw:: ThreeWindingTransformerWinding{PSY.PhaseShiftingTransformer3W} ,
185+ )
186+ tfw = get_transformer (tw)
187+ winding_num = get_winding_number (tw)
188+
189+ if winding_num == 1
190+ return PSY. get_primary_turns_ratio (tfw)
191+ elseif winding_num == 2
192+ return PSY. get_secondary_turns_ratio (tfw)
193+ elseif winding_num == 3
194+ return PSY. get_tertiary_turns_ratio (tfw)
195+ else
196+ throw (ArgumentError (" Invalid winding number: $winding_num " ))
197+ end
198+ end
199+
200+ """
201+ get_equivalent_α(tw::ThreeWindingTransformerWinding)
202+
203+ Get the phase angle (α) for a specific winding of a three-winding transformer.
204+ Returns the winding-specific phase shift angle for phase shifting transformers.
205+ """
206+ function get_equivalent_α (
207+ tw:: ThreeWindingTransformerWinding{PSY.PhaseShiftingTransformer3W} ,
208+ )
209+ tfw = get_transformer (tw)
210+ winding_num = get_winding_number (tw)
211+
212+ if winding_num == 1
213+ return PSY. get_α_primary (tfw)
214+ elseif winding_num == 2
215+ return PSY. get_α_secondary (tfw)
216+ elseif winding_num == 3
217+ return PSY. get_α_tertiary (tfw)
218+ else
219+ throw (ArgumentError (" Invalid winding number: $winding_num " ))
220+ end
221+ end
222+
110223function add_to_map (device:: ThreeWindingTransformerWinding , filters:: Dict )
111224 return add_to_map (get_transformer (device), filters)
112225end
0 commit comments