1ph short circuit: calculate ip/ith, and honour the neutral earthing impedance of trafo3w - #3083
Open
binggao1230 wants to merge 1 commit into
Open
Conversation
Two things the single-phase path silently dropped: - calc_sc(..., fault="1ph", ip=True, ith=True) accepted both options but _calc_sc_1ph never called _calc_ip/_calc_ith, so res_bus_sc.ip_ka and ith_ka were returned as all NaN with no warning. kappa was already being calculated on that path, it was just never used. - The zero sequence model of a three winding transformer ignored any neutral earthing impedance. net.trafo has had xn_ohm/rn_ohm for a long time; trafo3w now takes the same per winding, as xn_hv_ohm/rn_hv_ohm, xn_mv_ohm/rn_mv_ohm and xn_lv_ohm/rn_lv_ohm, adding 3*Z_N in series with that winding's zero sequence branch. With both in place the IEC 60909-4 single-phase test can be un-skipped: the 10 kV network of iec_60909_4() is earthed only through T6, over the 100 Ohm reactor the network builder already mentions in a comment but could not model. Modelling it reproduces the published I"k1 at all ten buses within the existing atol of 1e-4, and the commented out ip assertion now holds as well (ip = kappa*sqrt(2)*I"k1).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3083 +/- ##
===========================================
+ Coverage 72.12% 72.15% +0.02%
===========================================
Files 355 355
Lines 39376 39417 +41
===========================================
+ Hits 28400 28441 +41
Misses 10976 10976 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Two things
calc_sc(..., fault="1ph")silently dropped. Fixing both letstest_iec_60909_4_1ph, skipped since early 2021 with "1ph gen-close sc calculation still under develop", be un-skipped and pass against the IEC 60909-4 reference values.1.
ip/ithwere accepted but never calculated_calc_current()(3ph/2ph) calls_calc_ip/_calc_ith;_calc_sc_1ph()never did. No warning, no error, the columns are just NaN._add_kappa_to_ppcwas already being called on the 1ph path, so kappa was there all along, only unused.The
ipvalues already sitting in the skipped test are the check: the kappa pandapower computes on that path (method C, positive sequence) timessqrt(2)times the publishedI"k1reproduces the publishedip1to six significant figures at the five buses whereI"k1was already correct.ipsqrt(2)*kappa*I"k12.
trafo3wignored the neutral earthing impedancenet.trafohas hadxn_ohm/rn_ohmfor a while (andrn_ohmwas added in #3016);net.trafo3whad no equivalent, so a star point earthed through a neutral reactor or resistor could not be modelled at all. Since a three-winding transformer can have more than one earthed star point, the columns are per winding:xn_hv_ohm/rn_hv_ohm,xn_mv_ohm/rn_mv_ohm,xn_lv_ohm/rn_lv_ohm.3*Z_Ngoes in series with that winding's zero-sequence branch, exactly as for the two-winding case.Why the skipped test failed, and why it now passes
iec_60909_4()builds the 10 kV network with T5 (Yyd) and T6 (Yynd), so T6's mv winding is the only earth of that network, and it is earthed through the 100 Ohm reactor the builder already mentions:Without it the 10 kV buses came out solidly earthed and the current was about 400x too high (25.485 kA computed vs 0.06337 kA published at bus 6). With
xn_mv_ohm=100.all ten buses match the publishedI"k1within the test's existingatol=1e-4, and the previously commented outipassertion holds atatol=1e-3(the same tolerance the 2ph test already uses forip; the reference values are quoted to four decimals). The published currents pin the reactor tightly,xn_mv_ohm=100.5already breaks the assertion, so this is not a fitted parameter.Tests
test_iec_60909_4_1phun-skipped,ipassertion re-enabled,ithchecked for finiteness andith >= ikss.test_trafo3w_neutral_earthing_impedance: parametrised over hv/mv/lv, two vector groups each, bothinverse_ypaths. AssertsZ_Nadds exactly3*Z_Ntork0_ohm/xk0_ohm, leaves the positive sequence untouched and reducesikss_ka. The hv bus is fed through a delta so the ext_grid is not in parallel with the transformer's earth, and the rated voltages differ from the bus voltages so that referringZ_Nwith the wrong base is caught.test_1ph_ip_ith:ip/ithare finite,ip == sqrt(2)*kappa*iksswith kappa taken from the 3ph run at the same buses, and they stay unset when not requested.pytest --ignore=pandapower/test/opfis otherwise unchanged (my environment misses geopandas/pyproj/matplotlib, so six geo/plotting tests fail identically before and after).One thing this does not fix
The other two
1ph gen-closeskips intest_1ph.pystay skipped. Different cause, at the 110 kV buses, and I could not reconcile their references.test_iec_60909_4_small_with_t2_1phexpects[24.57717, 16.96235, 11.6109, 18.07836], but its network is electrically identical to the one intest_iec60909_example_4_two_trafo3w, which passes today against[24.5772, 14.7247, 8.1060, 15.2749](labelled as PowerFactory results): emptyingnet.genleaves only a dead-endYdtransformer, which contributes nothing in either sequence, and the computed values are bit-identical to the passing test. So one of those two reference sets has to be wrong and I did not want to guess which. Both tests also still readnet.res_bus_ikss_kainstead ofnet.res_bus_sc.ikss_ka, so they would raise before reaching the assert. I left them alone rather than touch tests I cannot make pass.