Skip to content

Conversation

@sambuddhac
Copy link
Collaborator

@sambuddhac sambuddhac commented Jun 24, 2024

This PR attempts to correct enhance flexibility of per-unit system of units in the DC-OPF and also impose line-flow MW limit constraint to represent thermally constrained lines.

Description

This PR attempts to correct enhance flexibility of per-unit system of units in the DC-OPF and also impose line-flow MW limit constraint to represent thermally constrained lines.

What type of PR is this? (check all applicable)

  • Feature
  • Bug Fix
  • Documentation Update
  • Code Refactor
  • Performance Improvements

Related Tickets & Documents

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and .md files under /docs/src have been updated if necessary.
  • The latest changes on the target branch have been incorporated, so that any conflicts are taken care of before merging. This can be accomplished either by merging in the target branch (e.g. 'git merge develop') or by rebasing on top of the target branch (e.g. 'git rebase develop'). Please do not hesitate to reach out to the GenX development team if you need help with this.
  • Code has been tested to ensure all functionality works as intended.
  • CHANGELOG.md has been updated (if this is a 'notable' change).
  • I consent to the release of this PR's code under the GNU General Public license.

How this can be tested

Post-approval checklist for GenX core developers

After the PR is approved

  • Check that the latest changes on the target branch are incorporated, either via merge or rebase
  • Remember to squash and merge if incorporating into develop

@sambuddhac sambuddhac linked an issue Jun 24, 2024 that may be closed by this pull request
@sambuddhac sambuddhac marked this pull request as ready for review June 13, 2025 20:36
@sambuddhac sambuddhac requested a review from lbonaldo June 13, 2025 20:36
sambuddhac and others added 16 commits June 18, 2025 10:56
This PR attempts to correct enhance flexibility of per-unit system of units in the DC-OPF and also impose line-flow MW limit constraint to represent thermally constrained lines.
Added base quantity definitions explicitly
Added pu reactance instead of P DC Coefficient
Adding transformer details; work in progress
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Added transformer data for HT and LT sides
Added completed transformer details
…on of transformer reactance to line reactance remaining
@lbonaldo lbonaldo force-pushed the sambuddhac-patch-6 branch from 90f2cdc to c039a0d Compare June 18, 2025 09:16
Copy link
Collaborator

@lbonaldo lbonaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sambuddhac, thanks for this PR! I’ve added a few comments to the changes, let me know your thoughts.

I've also rebased the branch onto the current develop.

As a note for the next release: this PR breaks backward compatibility by changing some column names in the Network.csv file used when DC-OPF: 1 (see the tests, for example).

inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / scale_factor # convert to GW
if setup["DC_OPF"] == 1
# DC-OPF requires the transmission capacity to be in pu
inputs_nw["pTrans_Max"] = to_floats(:Line_Max_Flow_MW) / to_floats(:MVA_Base)[1] # convert to GW
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is using only the first entry of MVA_Base intended?

Also, is the comment # convert to GW still valid?

Comment on lines +40 to +44
inputs_nw["kV_LT"] = to_floats(:Line_Voltage_kV_LT)
inputs_nw["kV_HT"] = to_floats(:Line_Voltage_kV_HT)
# Transmission line resistance (in Ohms) - Used when modeling quadratic transmission losses
inputs_nw["Ohms"] = to_floats(:Line_Resistance_Ohms)
inputs_nw["Ohms_LT"] = to_floats(:Line_Resistance_Ohms_LT)
inputs_nw["Ohms_HT"] = to_floats(:Line_Resistance_Ohms_HT)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to save these values in the inputs Dict? They don't seem to be used elsewhere in the code.

println("Total HT reactance in Ohms", total_ht_reactance_txr_line_Ohms)
println("Total LT reactance in Ohms", total_lt_reactance_txr_line_Ohms)
#DC-OPF coefficient for each line (in MW when not scaled, in p.u. when scaled)
inputs_nw["pDC_OPF_coeff_ht"] = 1 ./ (total_ht_reactance_txr_line_system_pu)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn’t find any usage of pDC_OPF_coeff_ht elsewhere in the code. Was it intended to be used somewhere? Should we remove it?

total_ht_reactance_ohms = line_transformer_ht_reactance + lt_reactance_referred_to_ht
#Total HT Reactance in pu
total_ht_reactance_pu = total_ht_reactance_ohms ./ ht_reactance_Base
println("P.U. values of Total LT Reactance")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be helpful to add some documentation for these equations to make the code easier to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per unit system of DCOPF + AC DC line in the same system

2 participants