From c7ef9a883031c68506357f9ef1b1a0b79c79f4da Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 25 Jul 2019 01:11:17 -0300 Subject: Motor integration with PF Newton bug fixed Newton inertia implemented Gauss-Newton implemented --- Project/ElectricCalculation.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Project/ElectricCalculation.cpp') diff --git a/Project/ElectricCalculation.cpp b/Project/ElectricCalculation.cpp index 7b03eeb..a2db413 100644 --- a/Project/ElectricCalculation.cpp +++ b/Project/ElectricCalculation.cpp @@ -397,6 +397,33 @@ void ElectricCalculation::UpdateElementsPowerFlow(std::vectorGetElectricalData(); + if(motor->IsOnline() && data.calcQInPowerFlow) { + double reactivePower = data.qValue * systemPowerBase; + + switch(data.reactivePowerUnit) { + case UNIT_PU: { + reactivePower /= systemPowerBase; + } break; + case UNIT_kVAr: { + reactivePower /= 1e3; + } break; + case UNIT_MVAr: { + reactivePower /= 1e6; + } break; + default: + break; + } + + data.reactivePower = reactivePower; + + motor->SetElectricalData(data); + } + } + // Synchronous machines for(int i = 0; i < (int)m_busList.size(); i++) { Bus* bus = m_busList[i]; -- cgit