diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-23 22:10:08 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-23 22:10:08 -0300 |
commit | 54cf77fe93d3862d8718c6c85c83cf8f8317e68d (patch) | |
tree | 48c0b6a6711933624178baed323492886910b3a8 /Project/Electromechanical.h | |
parent | daff46ee3b27b1fc2088de6b49682b4f41aeb080 (diff) | |
download | PSP.git-54cf77fe93d3862d8718c6c85c83cf8f8317e68d.tar.gz PSP.git-54cf77fe93d3862d8718c6c85c83cf8f8317e68d.tar.xz PSP.git-54cf77fe93d3862d8718c6c85c83cf8f8317e68d.zip |
Saturation Implemented
Finally!
The calculations are converging!
Need to be tested.
Diffstat (limited to 'Project/Electromechanical.h')
-rw-r--r-- | Project/Electromechanical.h | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/Project/Electromechanical.h b/Project/Electromechanical.h index b25a53b..37ea4f2 100644 --- a/Project/Electromechanical.h +++ b/Project/Electromechanical.h @@ -7,6 +7,29 @@ class ControlElementSolver; +/** + * @brief Synchronous machine data for different models + * + * This struct have the parameters and calculated data that depends on each machine model. + */ +struct SyncMachineModelData { + /** Direct-axis reactance (transient for models 1, 2 and 3; subtransient for models 4 and 5) */ + double xd; + /** Quadrature-axis reactance (transient for models 1, 2 and 3; subtransient for models 4 and 5) */ + double xq; + /** Direct-axis internal voltage (transient for models 1, 2 and 3; subtransient for models 4 and 5) */ + double ed; + /** Quadrature-axis internal voltage (transient for models 1, 2 and 3; subtransient for models 4 and 5) */ + double eq; +}; + +/** + * @class Electromechanical + * @author Thales Lima Oliveira <thales@ufu.br> + * @date 23/09/2017 + * @file Electromechanical.h + * @brief Calculates the electromechanical transient based on disturbances (e.g. system fault). + */ class Electromechanical : public ElectricCalculation { public: @@ -28,18 +51,32 @@ class Electromechanical : public ElectricCalculation void SetEvent(double currentTime); inline bool EventTrigger(double eventTime, double currentTime); - double GetPowerValue(double value, ElectricalUnit unit); + // double GetPowerValue(double value, ElectricalUnit unit); void InsertSyncMachinesOnYBus(); std::complex<double> GetSyncMachineAdmittance(SyncGenerator* generator); bool InitializeDynamicElements(); - void CalculateMachinesCurrents(); + bool CalculateMachinesCurrents(); void CalculateIntegrationConstants(SyncGenerator* syncGenerator, double id, double iq, double k = 1.0); bool SolveSynchronousMachines(); void SetSyncMachinesModel(); - double CalculateSyncMachineIntVariables(SyncGenerator* syncGenerator, double id, double iq, double pe, double k = 1.0); - void CalculateSyncMachineNonIntVariables(SyncGenerator* syncGenerator, double& id, double& iq, double& pe, double k = 1.0); + SyncMachineModelData GetSyncMachineModelData(SyncGenerator* syncMachine); + double CalculateSyncMachineIntVariables(SyncGenerator* syncGenerator, + double id, + double iq, + double sd, + double sq, + double pe, + double k = 1.0); + void CalculateSyncMachineNonIntVariables(SyncGenerator* syncGenerator, + double& id, + double& iq, + double& sd, + double& sq, + double& pe, + double k = 1.0); void CalculateReferenceSpeed(); + bool CalculateSyncMachineSaturation(SyncGenerator* syncMachine, double k = 1.0); void SaveData(); @@ -64,6 +101,7 @@ class Electromechanical : public ElectricCalculation double m_ctrlTimeStepMultiplier = 0.1; double m_tolerance = 1e-8; int m_maxIterations = 100; + double m_saturationTolerance = 1e-4; std::vector<double> m_eventTimeList; std::vector<bool> m_eventOccurrenceList; |