summaryrefslogtreecommitdiffstats
path: root/Project/SyncGenerator.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-09-09 19:11:41 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-09-09 19:11:41 -0300
commit91b9c3f9909955443e74dedb248fc48fa984709b (patch)
treec1bf65c2bd297d44e258067155292d9798f4c8c9 /Project/SyncGenerator.cpp
parent9e1f6849c929506a17fa12185c5c0185d5287177 (diff)
downloadPSP.git-91b9c3f9909955443e74dedb248fc48fa984709b.tar.gz
PSP.git-91b9c3f9909955443e74dedb248fc48fa984709b.tar.xz
PSP.git-91b9c3f9909955443e74dedb248fc48fa984709b.zip
Data report fully implemented
Diffstat (limited to 'Project/SyncGenerator.cpp')
-rw-r--r--Project/SyncGenerator.cpp40
1 files changed, 13 insertions, 27 deletions
diff --git a/Project/SyncGenerator.cpp b/Project/SyncGenerator.cpp
index 5718090..709e456 100644
--- a/Project/SyncGenerator.cpp
+++ b/Project/SyncGenerator.cpp
@@ -107,35 +107,21 @@ SyncGeneratorElectricalData SyncGenerator::GetPUElectricalData(double systemPowe
double machineBaseImpedance = (baseVoltage * baseVoltage) / machineBasePower;
// Fault data
+ if(data.useMachineBase) {
+ data.positiveResistance = (data.positiveResistance * machineBaseImpedance) / systemBaseImpedance;
+ data.positiveReactance = (data.positiveReactance * machineBaseImpedance) / systemBaseImpedance;
+ data.negativeResistance = (data.negativeResistance * machineBaseImpedance) / systemBaseImpedance;
+ data.negativeReactance = (data.negativeReactance * machineBaseImpedance) / systemBaseImpedance;
+ data.zeroResistance = (data.zeroResistance * machineBaseImpedance) / systemBaseImpedance;
+ data.zeroReactance = (data.zeroReactance * machineBaseImpedance) / systemBaseImpedance;
+ data.groundResistance = (data.groundResistance * machineBaseImpedance) / systemBaseImpedance;
+ data.groundReactance = (data.groundReactance * machineBaseImpedance) / systemBaseImpedance;
+ }
- // Pos. seq. resistance
- double r1 = data.positiveResistance;
- if(data.useMachineBase) data.positiveResistance = (r1 * machineBaseImpedance) / systemBaseImpedance;
-
- // Pos. seq. reactance
- double x1 = data.positiveReactance;
- if(data.useMachineBase) data.positiveReactance = (x1 * machineBaseImpedance) / systemBaseImpedance;
-
- // Neg. seq. resistance
- double r2 = data.negativeResistance;
- if(data.useMachineBase) data.negativeResistance = (r2 * machineBaseImpedance) / systemBaseImpedance;
-
- // Neg. seq. reactance
- double x2 = data.negativeReactance;
- if(data.useMachineBase) data.negativeReactance = (x2 * machineBaseImpedance) / systemBaseImpedance;
-
- // Zero seq. resistance
- double r0 = data.zeroResistance;
- if(data.useMachineBase) data.zeroResistance = (r0 * machineBaseImpedance) / systemBaseImpedance;
-
- // Zero seq. reactance
- double x0 = data.zeroReactance;
- if(data.useMachineBase) data.zeroReactance = (x0 * machineBaseImpedance) / systemBaseImpedance;
-
if(!m_online) {
- data.faultCurrent[0] = std::complex<double>(0,0);
- data.faultCurrent[1] = std::complex<double>(0,0);
- data.faultCurrent[2] = std::complex<double>(0,0);
+ data.faultCurrent[0] = std::complex<double>(0, 0);
+ data.faultCurrent[1] = std::complex<double>(0, 0);
+ data.faultCurrent[2] = std::complex<double>(0, 0);
}
return data;