Skip to content

TAMU Transformer pu conversion #742

@trevorb1

Description

@trevorb1

Version Checks (indicate both or one)

The Issue

The TAMU network groups lines and transformers together in the branches.csv file. When PyPSA-USA ingests this file, it adds lines and transformers separately. The pu/base unit conversions are the same, though?

def add_branches_from_file(n: pypsa.Network, fn_branches: str) -> pypsa.Network:
branches = pd.read_csv(
fn_branches,
dtype={"from_bus_id": str, "to_bus_id": str},
index_col=0,
).query("from_bus_id in @n.buses.index and to_bus_id in @n.buses.index")
branches.loc[branches.rateA == 0, "rateA"] = 0.01
for tech in ["Line", "Transformer"]:
tech_branches = branches.query("branch_device_type == @tech")
logger.info(f"Adding {len(tech_branches)} branches as {tech}s to the network.")
# S_base = 100 MVA
n.madd(
tech,
tech_branches.index,
bus0=tech_branches.from_bus_id,
bus1=tech_branches.to_bus_id,
r=tech_branches.r * (n.buses.loc[tech_branches.from_bus_id]["v_nom"].values ** 2) / 100,
x=tech_branches.x * (n.buses.loc[tech_branches.from_bus_id]["v_nom"].values ** 2) / 100,
b=tech_branches.b / (n.buses.loc[tech_branches.from_bus_id]["v_nom"].values ** 2),
s_nom=tech_branches.rateA,
v_nom=tech_branches.from_bus_id.map(n.buses.v_nom),
interconnect=tech_branches.interconnect,
type="temp", # temporarily then over ridden by assign_line_types
carrier="AC",
underwater_fraction=0.0,
)
return n

The line calculations seem fine, however, PyPSA uses percentages of the nominal power ranking to describe x and r for transformers?

https://github.com/PyPSA/PyPSA/blob/c45f75089d22bc9972a9500929dd7b854acdd9fb/pypsa/network/power_flow.py#L773-L785

Therefore, when PyPSA calculates the pu value, wont they be off?

I don't have a processed PyPSA-USA/TAMU network on hand to check! So apologies if I am just missing a conversion somewhere.

Steps To Reproduce

No response

Error Message

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions