Skip to content

Commit

Permalink
resolve rebase conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: martin.moraga <[email protected]>
  • Loading branch information
martinmoraga committed Mar 6, 2024
1 parent 5d23651 commit 79c7225
Show file tree
Hide file tree
Showing 39 changed files with 992 additions and 2,735 deletions.
39 changes: 20 additions & 19 deletions dpsim-models/include/dpsim-models/Base/Base_Exciter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,30 @@

#pragma once

#include <dpsim-models/Definitions.h>

namespace CPS {
namespace Base {

class ExciterParameters {
public:
ExciterParameters() { };
virtual ~ExciterParameters() = default;
};

/// @brief Base model for exciters
class Exciter {

public:
///
virtual void setParameters(std::shared_ptr<Base::ExciterParameters> parameters) = 0;
class ExciterParameters {
public:
ExciterParameters(){};
virtual ~ExciterParameters() = default;
};

/// Initializes exciter variables
virtual void initialize(Real Vh_init, Real Ef_init) = 0;
/// @brief Base model for exciters
class Exciter {

/// @param V_pss: Output of PSS
virtual Real step(Real Vd, Real Vq, Real dt, Real Vpss = 0) = 0;
};
}
}
public:
///
virtual void
setParameters(std::shared_ptr<Base::ExciterParameters> parameters) = 0;

/// Initializes exciter variables
virtual void initialize(Real Vh_init, Real Ef_init) = 0;

/// @param V_pss: Output of PSS
virtual Real step(Real Vd, Real Vq, Real dt, Real Vpss = 0) = 0;
};
} // namespace Base
} // namespace CPS
40 changes: 20 additions & 20 deletions dpsim-models/include/dpsim-models/Base/Base_Governor.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@

#pragma once

#include <dpsim-models/Definitions.h>

namespace CPS {
namespace Base {

class GovernorParameters {
public:
GovernorParameters() { };
virtual ~GovernorParameters() = default;
};

/// @brief Base model for Governors
class Governor {

public:

///
virtual void setParameters(std::shared_ptr<Base::GovernorParameters> parameters) = 0;
class GovernorParameters {
public:
GovernorParameters(){};
virtual ~GovernorParameters() = default;
};

/// Initializes Governor variables
virtual void initialize(Real PmRef) = 0;
/// @brief Base model for Governors
class Governor {

/// @param V_pss: Output of PSS
virtual Real step(Real Omega, Real dt) = 0;
};
}
}
public:
///
virtual void
setParameters(std::shared_ptr<Base::GovernorParameters> parameters) = 0;

/// Initializes Governor variables
virtual void initialize(Real PmRef) = 0;

/// @param V_pss: Output of PSS
virtual Real step(Real Omega, Real dt) = 0;
};
} // namespace Base
} // namespace CPS
46 changes: 23 additions & 23 deletions dpsim-models/include/dpsim-models/Base/Base_PSS.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
namespace CPS {
namespace Base {

class PSSParameters {
public:
PSSParameters() { };
virtual ~PSSParameters() = default;
};

/// @brief Base model for exciters
class PSS {

public:
///
virtual void setParameters(std::shared_ptr<Base::PSSParameters> parameters) = 0;

/// Initializes exciter variables
virtual void initialize(Real omega, Real activePower, Real Vd, Real Vq) = 0;

/// @param V_pss: Output of PSS
virtual Real step(Real omega, Real activePower, Real Vd, Real Vq, Real dt) = 0;
};
}
}


class PSSParameters {
public:
PSSParameters(){};
virtual ~PSSParameters() = default;
};

/// @brief Base model for exciters
class PSS {

public:
///
virtual void
setParameters(std::shared_ptr<Base::PSSParameters> parameters) = 0;

/// Initializes exciter variables
virtual void initialize(Real omega, Real activePower, Real Vd, Real Vq) = 0;

/// @param V_pss: Output of PSS
virtual Real step(Real omega, Real activePower, Real Vd, Real Vq,
Real dt) = 0;
};
} // namespace Base
} // namespace CPS
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

#include <dpsim-models/Base/Base_Exciter.h>
#include <dpsim-models/Base/Base_Governor.h>
#include <dpsim-models/Base/Base_PSS.h>
#include <dpsim-models/Base/Base_Turbine.h>
#include <dpsim-models/MNASimPowerComp.h>
#include <dpsim-models/Solver/MNAInterface.h>

namespace CPS {
namespace Base {
Expand Down Expand Up @@ -94,27 +97,28 @@ class ReducedOrderSynchronGenerator : public MNASimPowerComp<VarType> {
/// Add Governor/TurbineGovernor
void addTurbine(std::shared_ptr<Base::Turbine> turbine);

/// Add Governor/TurbineGovernor
//void addGovernor(std::shared_ptr<CPS::Base::GovernorParameters> governorParameters, GovernorType governorType = GovernorType::TurbineGovernorType1);
void addGovernor(std::shared_ptr<Base::Governor> governor);
//Add Steam Turbine and Governor separately
//it is adviced to choose Pminit of turbine to mPref of the Governor by f_ref=f_n (50Hz/60Hz)
//void addSteamTurbine(Real Fhp, Real Fip, Real Flp, Real Tch, Real Trh, Real Tco, Real Pminit);
//void addSteamTurbine(std::shared_ptr<Signal::SteamTurbine> steamTurbine);
//Add Steam Turbine Governor
//void addSteamTurbineGovernor(Real OmRef, Real Pref, Real R, Real T2, Real T3,
// Real dPmax, Real dPmin, Real Pmax, Real Pmin);
//void addSteamTurbineGovernor(std::shared_ptr<Signal::SteamTurbineGovernor> steamTurbineGovernor);
//Add Hydro Turbine and Governor separately
//it is adviced to choose Pminit of turbine to mPref of the Governor by f_ref=f_n (50Hz/60Hz)
//void addHydroTurbine(Real Tw, Real Pminit);
//void addHydroTurbine(std::shared_ptr<Signal::HydroTurbine> HydroTurbine);
//Add Hydrp Turbine Governor
//void addHydroTurbineGovernor(Real OmRef, Real Pref, Real R, Real T1, Real T2, Real T3,
// Real Pmax, Real Pmin);
//void addHydroTurbineGovernor(std::shared_ptr<Signal::HydroTurbineGovernor> hydroTurbineGovernor);

protected:
using MNASimPowerComp<VarType>::mRightVector;
using MNASimPowerComp<VarType>::mIntfVoltage;
using MNASimPowerComp<VarType>::MnaPreStep;
using MNASimPowerComp<VarType>::MnaPostStep;

///
ReducedOrderSynchronGenerator(String uid, String name,
Logger::Level logLevel);
///
void calculateVBRconstants();
///
void calculateResistanceMatrixConstants();
///
virtual void initializeResistanceMatrix() = 0;
///
void initializeFromNodesAndTerminals(Real frequency);
/// Function to initialize the specific variables of each SG model
virtual void specificInitialization() = 0;
/// Model specific step
virtual void stepInPerUnit() = 0;

// ### MNA Section ###
///
void mnaCompInitialize(Real omega, Real timeStep,
Expand Down Expand Up @@ -254,32 +258,6 @@ class ReducedOrderSynchronGenerator : public MNASimPowerComp<VarType> {
/// Flag to remember when initial values are set
Bool mInitialValuesSet = false;

// #### Controllers ####
/// Determines if Turbine and Governor are activated
Bool mHasTurbineGovernor = false;
/// Determines if Exciter is activated
Bool mHasExciter = false;
/// Signal component modelling governor control and steam turbine
std::shared_ptr<Signal::TurbineGovernorType1> mTurbineGovernor;
/// Signal component modelling voltage regulator and exciter
std::shared_ptr<Signal::Exciter> mExciter;

// #### Controllers ####
/// Determines if Turbine and Governor are activated
Bool mHasTurbineGovernor = false;
/// Determines if Exciter is activated
Bool mHasExciter = false;
/// Determines if Exciter is activated
Bool mHasPSS = false;
/// Signal component modelling governor control and steam turbine
std::shared_ptr<Signal::TurbineGovernorType1> mTurbineGovernor;
/// Signal component modelling voltage regulator and exciter
std::shared_ptr<Base::Exciter> mExciter;
/// Signal component modelling voltage regulator and exciter
std::shared_ptr<Signal::PSSType2> mPSS;
///
Real mVpss = 0;

// #### Controllers ####
/// Determines if Exciter is activated
Bool mHasExciter = false;
Expand All @@ -302,34 +280,10 @@ class ReducedOrderSynchronGenerator : public MNASimPowerComp<VarType> {
///
Real mVpss = 0;

/// Signal component modelling voltage regulator and exciter
std::shared_ptr<Base::Exciter> mExciter;
/// Signal component modelling power system stabilizer
std::shared_ptr<Base::PSS> mPSS;
/// Signal component modelling Turbine
//std::shared_ptr<Signal::Turbine> mTurbine;
/// Signal component modelling governor control
std::shared_ptr<Base::Governor> mGovernor;

///
Real mVpss = 0;

/// Signal component modelling voltage regulator and exciter
std::shared_ptr<Base::Exciter> mExciter;
/// Signal component modelling power system stabilizer
std::shared_ptr<Signal::PSS1A> mPSS;
/// Signal component modelling Turbine
//std::shared_ptr<Signal::Turbine> mTurbine;
/// Signal component modelling governor control
std::shared_ptr<Base::Governor> mGovernor;

///
Real mVpss = 0;

///
Real mTimeStep;
///
Real mSimTime;
};
} // namespace Base
} // namespace CPS
} // namespace CPS
Loading

0 comments on commit 79c7225

Please sign in to comment.