GenXProject / GenX.jl

GenX: a configurable power system capacity expansion model for studying low-carbon energy futures. More details at : https://genx.mit.edu
https://genxproject.github.io/GenX.jl/
GNU General Public License v2.0
256 stars 105 forks source link

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

Open xuqingyu opened 1 month ago

xuqingyu commented 1 month ago

Feature description

It's crucial to note that in many scenarios, the transmission network parameters are presented in the per-unit system. This allows us to make the transformer equivalent and remove it. However, the current dcopf_transmission.jl code does not yet support this per-unit system. Furthermore, it seems that the current code does not support the scenario where DClines and AClines are both presented in the system, is it true?

Motivation

No response

Implementation strategy

Although we can put voltage as 1 and reactance as per unit * 100MVA to circumvent the situation, we should be clear about that.

Additional context

No response

sambuddhac commented 1 month ago

Thanks @xuqingyu . Will start working on the issues this week, including this.

sambuddhac commented 2 weeks ago

Hi @xuqingyu

Thanks for submitting the issue. Here's some explanation:

If you take a look at the file src/load_inputs/load_network_data.jl, in lines 38-55, you can see that we tried to convert to PU system (I am pasting the code-snippet here:

   ## Inputs for the DC-OPF 
    if setup["DC_OPF"] == 1
        if setup["NetworkExpansion"] == 1
            @warn("Because the DC_OPF flag is active, GenX will not allow any transmission capacity expansion. Set the DC_OPF flag to 0 if you want to optimize tranmission capacity expansion.")
            setup["NetworkExpansion"] = 0
        end
        println("Reading DC-OPF values...")
        # Transmission line voltage (in kV)
        line_voltage_kV = to_floats(:Line_Voltage_kV)
        # Transmission line reactance (in Ohms)
        line_reactance_Ohms = to_floats(:Line_Reactance_Ohms)
        # Line angle limit (in radians)
        inputs_nw["Line_Angle_Limit"] = to_floats(:Angle_Limit_Rad)
        # DC-OPF coefficient for each line (in MW when not scaled, in GW when scaled) 
        # MW = (kV)^2/Ohms 
        inputs_nw["pDC_OPF_coeff"] = ((line_voltage_kV .^ 2) ./ line_reactance_Ohms) /
                                     scale_factor
    end

Additionally, I have started drafting a PR in which I am about to make rooms for consideration for base MVA other than 100 MVA (It seems the present code assumes a base MVA of 100 always). I will tag you as a reviewer once I am done and also link the PR to this issue. Please let me know of your thoughts.

sambuddhac commented 1 week ago

Also @xuqingyu could you please clarify if by DC lines and AC lines, you mean DC tie lines, along with the usual transmission lines (that are AC)? Additionally, I am trying to code up explicitly as part of the new draft PR (in which I tagged you a reviewer) presence of transformers in the system with different turns ratio and different levels of kV and MVA and pu reactances in the HT and LT sides. Is that a good mdification of the existing code?