Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DC-OPF with correct PU and additional flow limit constraints #714

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

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

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
src/model/core/transmission/dcopf_transmission.jl Outdated Show resolved Hide resolved
sum(inputs["pNet_Map"][l, z] * vANGLE[z, t] for z in 1:Z))

Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

sambuddhac and others added 2 commits June 24, 2024 07:49
Adding transformer details; work in progress
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@sambuddhac sambuddhac linked an issue Jun 24, 2024 that may be closed by this pull request
Comment on lines 53 to 97
##Adding Transformer data
line_transformer_MVA_base = :Transformer_MVA_Base

##Transformer LT side data
# LT Base voltage (in kV)
transformer_lt_voltage_kV_Base = to_floats(:Transformer_LT_Voltage_kV_Base)
#Transformer LT Reactance in Ohms
line_transformer_lt_reactance = :Transformer_LT_Reactance_Ohms
#Transformer LT Turns
line_transformer_lt_turns = :Transformer_LT_Turns
# LT Base reactance
lt_reactance_Base = (transformer_lt_voltage_kV_Base .^ 2) ./ line_transformer_MVA_base
#Transformer LT Reactance in pu
transformer_lt_reactance_pu = :Transformer_LT_Reactance_Ohms ./ lt_reactance_Base


##Transformer HT side data
# HT Base voltage (in kV)
transformer_ht_voltage_kV_Base = to_floats(:Transformer_HT_Voltage_kV_Base)
#Transformer HT Reactance in Ohms
line_transformer_ht_reactance = :Transformer_HT_Reactance_Ohms
#Transformer HT Turns
line_transformer_ht_turns = :Transformer_HT_Turns
# HT Base reactance
ht_reactance_Base = (transformer_ht_voltage_kV_Base .^ 2) ./ line_transformer_MVA_base
#Transformer LT Reactance in pu
transformer_ht_reactance_pu = :Transformer_HT_Reactance_Ohms ./ ht_reactance_Base


#LT Transformer Reactance referred to HT side in Ohms
lt_reactance_referred_to_ht = ((line_transformer_ht_turns ./ line_transformer_lt_turns) .^ 2) .* line_transformer_lt_reactance
#HT Transformer Reactance referred to LT side in Ohms
ht_reactance_referred_to_lt = ((line_transformer_lt_turns ./ line_transformer_ht_turns) .^ 2) .* line_transformer_ht_reactance
#Total LT Reactance in Ohms
total_lt_reactance_ohms = line_transformer_lt_reactance + ht_reactance_referred_to_lt
#Total LT Reactance in pu
total_lt_reactance_pu = total_lt_reactance_ohms ./ lt_reactance_Base
#Total HT Reactance in Ohms
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

#Conversion of Transformer pu reactance to system pu
total_ht_reactance_system_pu = total_ht_reactance_pu .* ((transformer_ht_voltage_kV_Base ./ line_voltage_kV) .^ 2) .* (MVA_Base ./ line_transformer_MVA_base)
total_lt_reactance_system_pu = total_lt_reactance_pu .* ((transformer_lt_voltage_kV_Base ./ line_voltage_kV) .^ 2) .* (MVA_Base ./ line_transformer_MVA_base)
Copy link
Contributor

Choose a reason for hiding this comment

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

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
##Adding Transformer data
line_transformer_MVA_base = :Transformer_MVA_Base
##Transformer LT side data
# LT Base voltage (in kV)
transformer_lt_voltage_kV_Base = to_floats(:Transformer_LT_Voltage_kV_Base)
#Transformer LT Reactance in Ohms
line_transformer_lt_reactance = :Transformer_LT_Reactance_Ohms
#Transformer LT Turns
line_transformer_lt_turns = :Transformer_LT_Turns
# LT Base reactance
lt_reactance_Base = (transformer_lt_voltage_kV_Base .^ 2) ./ line_transformer_MVA_base
#Transformer LT Reactance in pu
transformer_lt_reactance_pu = :Transformer_LT_Reactance_Ohms ./ lt_reactance_Base
##Transformer HT side data
# HT Base voltage (in kV)
transformer_ht_voltage_kV_Base = to_floats(:Transformer_HT_Voltage_kV_Base)
#Transformer HT Reactance in Ohms
line_transformer_ht_reactance = :Transformer_HT_Reactance_Ohms
#Transformer HT Turns
line_transformer_ht_turns = :Transformer_HT_Turns
# HT Base reactance
ht_reactance_Base = (transformer_ht_voltage_kV_Base .^ 2) ./ line_transformer_MVA_base
#Transformer LT Reactance in pu
transformer_ht_reactance_pu = :Transformer_HT_Reactance_Ohms ./ ht_reactance_Base
#LT Transformer Reactance referred to HT side in Ohms
lt_reactance_referred_to_ht = ((line_transformer_ht_turns ./ line_transformer_lt_turns) .^ 2) .* line_transformer_lt_reactance
#HT Transformer Reactance referred to LT side in Ohms
ht_reactance_referred_to_lt = ((line_transformer_lt_turns ./ line_transformer_ht_turns) .^ 2) .* line_transformer_ht_reactance
#Total LT Reactance in Ohms
total_lt_reactance_ohms = line_transformer_lt_reactance + ht_reactance_referred_to_lt
#Total LT Reactance in pu
total_lt_reactance_pu = total_lt_reactance_ohms ./ lt_reactance_Base
#Total HT Reactance in Ohms
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
#Conversion of Transformer pu reactance to system pu
total_ht_reactance_system_pu = total_ht_reactance_pu .* ((transformer_ht_voltage_kV_Base ./ line_voltage_kV) .^ 2) .* (MVA_Base ./ line_transformer_MVA_base)
total_lt_reactance_system_pu = total_lt_reactance_pu .* ((transformer_lt_voltage_kV_Base ./ line_voltage_kV) .^ 2) .* (MVA_Base ./ line_transformer_MVA_base)
##Adding Transformer data
line_transformer_MVA_base = :Transformer_MVA_Base
##Transformer LT side data
# LT Base voltage (in kV)
transformer_lt_voltage_kV_Base = to_floats(:Transformer_LT_Voltage_kV_Base)
#Transformer LT Reactance in Ohms
line_transformer_lt_reactance = :Transformer_LT_Reactance_Ohms
#Transformer LT Turns
line_transformer_lt_turns = :Transformer_LT_Turns
# LT Base reactance
lt_reactance_Base = (transformer_lt_voltage_kV_Base .^ 2) ./
line_transformer_MVA_base
#Transformer LT Reactance in pu
transformer_lt_reactance_pu = :Transformer_LT_Reactance_Ohms ./
lt_reactance_Base
##Transformer HT side data
# HT Base voltage (in kV)
transformer_ht_voltage_kV_Base = to_floats(:Transformer_HT_Voltage_kV_Base)
#Transformer HT Reactance in Ohms
line_transformer_ht_reactance = :Transformer_HT_Reactance_Ohms
#Transformer HT Turns
line_transformer_ht_turns = :Transformer_HT_Turns
# HT Base reactance
ht_reactance_Base = (transformer_ht_voltage_kV_Base .^ 2) ./
line_transformer_MVA_base
#Transformer LT Reactance in pu
transformer_ht_reactance_pu = :Transformer_HT_Reactance_Ohms ./
ht_reactance_Base
#LT Transformer Reactance referred to HT side in Ohms
lt_reactance_referred_to_ht = ((line_transformer_ht_turns ./
line_transformer_lt_turns) .^ 2) .*
line_transformer_lt_reactance
#HT Transformer Reactance referred to LT side in Ohms
ht_reactance_referred_to_lt = ((line_transformer_lt_turns ./
line_transformer_ht_turns) .^ 2) .*
line_transformer_ht_reactance
#Total LT Reactance in Ohms
total_lt_reactance_ohms = line_transformer_lt_reactance +
ht_reactance_referred_to_lt
#Total LT Reactance in pu
total_lt_reactance_pu = total_lt_reactance_ohms ./ lt_reactance_Base
#Total HT Reactance in Ohms
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
#Conversion of Transformer pu reactance to system pu
total_ht_reactance_system_pu = total_ht_reactance_pu .*
((transformer_ht_voltage_kV_Base ./
line_voltage_kV) .^ 2) .*
(MVA_Base ./ line_transformer_MVA_base)
total_lt_reactance_system_pu = total_lt_reactance_pu .*
((transformer_lt_voltage_kV_Base ./
line_voltage_kV) .^ 2) .*
(MVA_Base ./ line_transformer_MVA_base)

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
1 participant