Commit 6cd55e63 authored by Jan Dinkelbach's avatar Jan Dinkelbach
Browse files

fix cim power read in according to new sign convention (pos=generation, neg=consumption)

parent e15940a0
......@@ -178,8 +178,8 @@ class System():
for obj_SvPowerFlow in list_SvPowerFlow:
if obj_SvPowerFlow.Terminal.TopologicalNode.mRID == uuid_TPNode:
pInj += obj_SvPowerFlow.p
qInj += obj_SvPowerFlow.q
pInj -= obj_SvPowerFlow.p
qInj -= obj_SvPowerFlow.q
for obj_Terminal in list_Terminals_ES:
if obj_Terminal.TopologicalNode.mRID == uuid_TPNode:
for obj_EnergySource in list_EnergySources:
......@@ -190,8 +190,8 @@ class System():
if obj_Terminal.TopologicalNode.mRID == uuid_TPNode:
for obj_EnergyConsumer in list_EnergyConsumer:
if obj_EnergyConsumer.mRID == obj_Terminal.ConductingEquipment.mRID:
pInj += obj_EnergyConsumer.p
qInj += obj_EnergyConsumer.q
pInj -= obj_EnergyConsumer.p
qInj -= obj_EnergyConsumer.q
base_voltage = TPNode.BaseVoltage.nominalVoltage
self.nodes.append(Node(name=name, uuid=uuid_TPNode, base_voltage=base_voltage, v_mag=vmag,
......@@ -102,6 +102,7 @@ class Results():
def calculateI(self):
To calculate the branch currents
Note: branch current flowing into start node coming from end node
for branch in self.branches:
fr = branch.topology_branch.start_node.index
......@@ -111,7 +112,8 @@ class Results():
def calculateIinj(self):
calculate current injections at a node
Calculate current injections at a node
Note: node current flowing into the node
for node in self.nodes:
to = complex(0, 0) # sum of the currents flowing to the node
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment