DSS C-API and dss.hpp
DSS C-API and dss.hpp expose a customized and extended implementation of OpenDSS to C and C++.
|
Classes | |
struct | Properties |
Public Types | |
enum class | GeneratorDispatchMode : int32_t { Default = 0 , LoadLevel = 1 , Price = 2 } |
Generator: Dispatch Mode (DSS enumeration for Generator) More... | |
enum class | GeneratorStatus : int32_t { Variable = 0 , Fixed = 1 } |
Generator: Status (DSS enumeration for Generator) More... | |
Public Member Functions | |
Generator (APIUtil *util=nullptr, void *ptr_=nullptr) | |
Create wrapper directly by a given object handle/pointer. | |
Generator (APIUtil *util, int32_t idx) | |
Create a wrapper for an element given by the integer index "idx". | |
Generator (APIUtil *util, char *name) | |
Create a wrapper for an element given its name. | |
const char * | name () |
Returns the object's name. | |
Generator & | begin_edit () |
Marks an object for edition. More... | |
Generator & | end_edit (int32_t num_edits=1) |
Finalizes an object edition. More... | |
int32_t | phases () |
Number of Phases, this Generator. More... | |
Generator & | phases (int32_t value) |
string | bus1 () |
Bus to which the Generator is connected. More... | |
Generator & | bus1 (const string &value) |
Generator & | bus1 (const char *value) |
double | kv () |
Nominal rated (1.0 per unit) voltage, kV, for Generator. More... | |
Generator & | kv (double value) |
double | kW () |
Total base kW for the Generator. More... | |
Generator & | kW (double value) |
double | pf () |
Generator power factor. More... | |
Generator & | pf (double value) |
double | kvar () |
Specify the base kvar. More... | |
Generator & | kvar (double value) |
int32_t | model () |
Integer code for the model to use for generation variation with voltage. More... | |
Generator & | model (int32_t value) |
double | Vminpu () |
Default = 0.90. More... | |
Generator & | Vminpu (double value) |
double | Vmaxpu () |
Default = 1.10. More... | |
Generator & | Vmaxpu (double value) |
string | yearly () |
Dispatch shape to use for yearly simulations. More... | |
Generator & | yearly (const string &value) |
Generator & | yearly (dss::obj::LoadShape &value) |
dss::obj::LoadShape | yearly_obj () |
Dispatch shape to use for yearly simulations. More... | |
Generator & | yearly_obj (dss::obj::LoadShape &value) |
string | daily () |
Dispatch shape to use for daily simulations. More... | |
Generator & | daily (const string &value) |
Generator & | daily (dss::obj::LoadShape &value) |
dss::obj::LoadShape | daily_obj () |
Dispatch shape to use for daily simulations. More... | |
Generator & | daily_obj (dss::obj::LoadShape &value) |
string | duty () |
Load shape to use for duty cycle dispatch simulations such as for wind generation. More... | |
Generator & | duty (const string &value) |
Generator & | duty (dss::obj::LoadShape &value) |
dss::obj::LoadShape | duty_obj () |
Load shape to use for duty cycle dispatch simulations such as for wind generation. More... | |
Generator & | duty_obj (dss::obj::LoadShape &value) |
GeneratorDispatchMode | dispmode () |
{Default* | Loadlevel | Price } Default = Default. More... | |
Generator & | dispmode (int32_t value) |
Generator & | dispmode (GeneratorDispatchMode value) |
Generator & | dispmode (const string &value) |
Generator & | dispmode (const char *value) |
string | dispmode_str () |
{Default* | Loadlevel | Price } Default = Default. More... | |
Generator & | dispmode_str (const string &value) |
{Default* | Loadlevel | Price } Default = Default. More... | |
double | dispvalue () |
Dispatch value. More... | |
Generator & | dispvalue (double value) |
Connection | conn () |
={wye|LN|delta|LL}. More... | |
Generator & | conn (int32_t value) |
Generator & | conn (Connection value) |
Generator & | conn (const string &value) |
Generator & | conn (const char *value) |
string | conn_str () |
={wye|LN|delta|LL}. More... | |
Generator & | conn_str (const string &value) |
={wye|LN|delta|LL}. More... | |
GeneratorStatus | status () |
={Fixed | Variable*}. More... | |
Generator & | status (int32_t value) |
Generator & | status (GeneratorStatus value) |
Generator & | status (const string &value) |
Generator & | status (const char *value) |
string | status_str () |
={Fixed | Variable*}. More... | |
Generator & | status_str (const string &value) |
={Fixed | Variable*}. More... | |
int32_t | cls () |
An arbitrary integer number representing the class of Generator so that Generator values may be segregated by class. More... | |
Generator & | cls (int32_t value) |
double | Vpu () |
Per Unit voltage set point for Model = 3 (typical power flow model). More... | |
Generator & | Vpu (double value) |
double | maxkvar () |
Maximum kvar limit for Model = 3. More... | |
Generator & | maxkvar (double value) |
double | minkvar () |
Minimum kvar limit for Model = 3. More... | |
Generator & | minkvar (double value) |
double | pvfactor () |
Deceleration factor for P-V generator model (Model=3). More... | |
Generator & | pvfactor (double value) |
bool | forceon () |
{Yes | No} Forces generator ON despite requirements of other dispatch modes. More... | |
Generator & | forceon (bool value) |
double | kVA () |
kVA rating of electrical machine. More... | |
Generator & | kVA (double value) |
double | MVA () |
MVA rating of electrical machine. More... | |
Generator & | MVA (double value) |
double | Xd () |
Per unit synchronous reactance of machine. More... | |
Generator & | Xd (double value) |
double | Xdp () |
Per unit transient reactance of the machine. More... | |
Generator & | Xdp (double value) |
double | Xdpp () |
Per unit subtransient reactance of the machine. More... | |
Generator & | Xdpp (double value) |
double | H () |
Per unit mass constant of the machine. More... | |
Generator & | H (double value) |
double | D () |
Damping constant. More... | |
Generator & | D (double value) |
string | UserModel () |
Name of DLL containing user-written model, which computes the terminal currents for Dynamics studies, overriding the default model. More... | |
Generator & | UserModel (const string &value) |
Generator & | UserModel (const char *value) |
string | UserData () |
String (in quotes or parentheses) that gets passed to user-written model for defining the data required for that model. More... | |
Generator & | UserData (const string &value) |
Generator & | UserData (const char *value) |
string | ShaftModel () |
Name of user-written DLL containing a Shaft model, which models the prime mover and determines the power on the shaft for Dynamics studies. More... | |
Generator & | ShaftModel (const string &value) |
Generator & | ShaftModel (const char *value) |
string | ShaftData () |
String (in quotes or parentheses) that gets passed to user-written shaft dynamic model for defining the data for that model. More... | |
Generator & | ShaftData (const string &value) |
Generator & | ShaftData (const char *value) |
double | DutyStart () |
Starting time offset [hours] into the duty cycle shape for this generator, defaults to 0. More... | |
Generator & | DutyStart (double value) |
bool | debugtrace () |
{Yes | No } Default is no. More... | |
Generator & | debugtrace (bool value) |
bool | Balanced () |
{Yes | No*} Default is No. More... | |
Generator & | Balanced (bool value) |
double | XRdp () |
Default is 20. More... | |
Generator & | XRdp (double value) |
bool | UseFuel () |
{Yes | *No}. More... | |
Generator & | UseFuel (bool value) |
double | FuelkWh () |
{*0}Is the nominal level of fuel for the generator (kWh). More... | |
Generator & | FuelkWh (double value) |
double | pctFuel () |
It is a number between 0 and 100 representing the current amount of fuel avaiable in percentage of FuelkWh. More... | |
Generator & | pctFuel (double value) |
double | pctReserve () |
It is a number between 0 and 100 representing the reserve level in percentage of FuelkWh. More... | |
Generator & | pctReserve (double value) |
Generator & | Refuel (bool value) |
It is a boolean value (Yes/True, No/False) that can be used to manually refuel the generator when needed. More... | |
string | spectrum () |
Name of harmonic voltage or current spectrum for this generator. More... | |
Generator & | spectrum (const string &value) |
Generator & | spectrum (dss::obj::Spectrum &value) |
dss::obj::Spectrum | spectrum_obj () |
Name of harmonic voltage or current spectrum for this generator. More... | |
Generator & | spectrum_obj (dss::obj::Spectrum &value) |
double | basefreq () |
Base Frequency for ratings. More... | |
Generator & | basefreq (double value) |
bool | enabled () |
{Yes|No or True|False} Indicates whether this element is enabled. More... | |
Generator & | enabled (bool value) |
Generator & | like (const string &value) |
Make like another object, e.g. More... | |
Generator & | like (const char *value) |
Make like another object, e.g. More... | |
Public Member Functions inherited from dss::obj::DSSObj | |
DSSObj (APIUtil *util=nullptr, void *ptr_=nullptr) | |
Static Public Attributes | |
static const char | dss_cls_name [] = "Generator" |
static const int32_t | dss_cls_idx = 26 |
Additional Inherited Members | |
Public Attributes inherited from dss::obj::DSSObj | |
APIUtil * | api_util |
void * | ptr |
Protected Member Functions inherited from dss::obj::DSSObj | |
void | check_for_error () |
void | set_string (int32_t index, const string &value) |
void | set_string (int32_t index, const char *value) |
string | get_prop_string (int32_t index) |
complex | get_complex (int32_t index) |
void | set_complex (int32_t index, complex value) |
void | set_string_array (int32_t index, strings &value) |
void | set_obj (int32_t index, DSSObj &value) |
template<typename T > | |
T | get_obj (int32_t index) |
template<typename T = VectorXd> | |
T | get_array (int32_t index) |
template<typename T = VectorXd> | |
void | set_array (int32_t index, T value) |
Static Protected Member Functions inherited from dss::obj::DSSObj | |
template<typename T = VectorXd> | |
static void | set_array (void *ptr, int32_t index, T value) |
Protected Attributes inherited from dss::obj::DSSObj | |
friend | DSSBatch |
|
strong |
|
strong |
|
inline |
{Yes | No*} Default is No.
For Model=7, force balanced current only for 3-phase generators. Force zero- and negative-sequence to zero.
DSS property name: Balanced, DSS property index: 36
|
inline |
Base Frequency for ratings.
DSS property name: basefreq, DSS property index: 44
|
inline |
Marks an object for edition.
Until end_edit
is called, some actions are postponed.
|
inline |
Bus to which the Generator is connected.
May include specific node specification.
DSS property name: bus1, DSS property index: 2
|
inline |
|
inline |
={wye|LN|delta|LL}.
Default is wye.
DSS property name: conn, DSS property index: 15
|
inline |
={wye|LN|delta|LL}.
Default is wye.
DSS property name: conn, DSS property index: 15
|
inline |
={wye|LN|delta|LL}.
Default is wye.
DSS property name: conn, DSS property index: 15
|
inline |
Damping constant.
Usual range is 0 to 4. Default is 1.0. Adjust to get damping
DSS property name: D, DSS property index: 29
|
inline |
Dispatch shape to use for daily simulations.
Must be previously defined as a Loadshape object of 24 hrs, typically. If generator is assumed to be ON continuously, specify Status=FIXED, or designate a Loadshape objectthat is 1.0 perunit for all hours. Set to NONE to reset to no loadahape.
DSS property name: daily, DSS property index: 11
|
inline |
Dispatch shape to use for daily simulations.
Must be previously defined as a Loadshape object of 24 hrs, typically. If generator is assumed to be ON continuously, specify Status=FIXED, or designate a Loadshape objectthat is 1.0 perunit for all hours. Set to NONE to reset to no loadahape.
DSS property name: daily, DSS property index: 11
|
inline |
{Yes | No } Default is no.
Turn this on to capture the progress of the generator model for each iteration. Creates a separate file for each generator named "GEN_name.CSV".
DSS property name: debugtrace, DSS property index: 35
|
inline |
{Default* | Loadlevel | Price } Default = Default.
Dispatch mode. In default mode, gen is either always on or follows dispatch curve as specified. Otherwise, the gen comes on when either the global default load level (Loadshape "default") or the price level exceeds the dispatch value.
DSS property name: dispmode, DSS property index: 13
|
inline |
{Default* | Loadlevel | Price } Default = Default.
Dispatch mode. In default mode, gen is either always on or follows dispatch curve as specified. Otherwise, the gen comes on when either the global default load level (Loadshape "default") or the price level exceeds the dispatch value.
DSS property name: dispmode, DSS property index: 13
|
inline |
{Default* | Loadlevel | Price } Default = Default.
Dispatch mode. In default mode, gen is either always on or follows dispatch curve as specified. Otherwise, the gen comes on when either the global default load level (Loadshape "default") or the price level exceeds the dispatch value.
DSS property name: dispmode, DSS property index: 13
|
inline |
Dispatch value.
If = 0.0 (default) then Generator follow dispatch curves, if any. If > 0 then Generator is ON only when either the price signal (in Price dispatch mode) exceeds this value or the active circuit load multiplier * "default" loadshape value * the default yearly growth factor exceeds this value. Then the generator follows dispatch curves (duty, daily, or yearly), if any (see also Status).
DSS property name: dispvalue, DSS property index: 14
|
inline |
Load shape to use for duty cycle dispatch simulations such as for wind generation.
Must be previously defined as a Loadshape object. Typically would have time intervals less than 1 hr – perhaps, in seconds. Set Status=Fixed to ignore Loadshape designation. Set to NONE to reset to no loadahape. Designate the number of points to solve using the Set Number=xxxx command. If there are fewer points in the actual shape, the shape is assumed to repeat.
DSS property name: duty, DSS property index: 12
|
inline |
Load shape to use for duty cycle dispatch simulations such as for wind generation.
Must be previously defined as a Loadshape object. Typically would have time intervals less than 1 hr – perhaps, in seconds. Set Status=Fixed to ignore Loadshape designation. Set to NONE to reset to no loadahape. Designate the number of points to solve using the Set Number=xxxx command. If there are fewer points in the actual shape, the shape is assumed to repeat.
DSS property name: duty, DSS property index: 12
|
inline |
Starting time offset [hours] into the duty cycle shape for this generator, defaults to 0.
DSS property name: DutyStart, DSS property index: 34
|
inline |
{Yes|No or True|False} Indicates whether this element is enabled.
DSS property name: enabled, DSS property index: 45
|
inline |
Finalizes an object edition.
This will result more compelx side-effects like Yprim and other internal data recalculation, for example.
|
inline |
{Yes | No} Forces generator ON despite requirements of other dispatch modes.
Stays ON until this property is set to NO, or an internal algorithm cancels the forced ON state.
DSS property name: forceon, DSS property index: 22
|
inline |
{*0}Is the nominal level of fuel for the generator (kWh).
It only applies if UseFuel = Yes/True
DSS property name: FuelkWh, DSS property index: 39
|
inline |
Per unit mass constant of the machine.
MW-sec/MVA. Default is 1.0.
DSS property name: H, DSS property index: 28
|
inline |
Nominal rated (1.0 per unit) voltage, kV, for Generator.
For 2- and 3-phase Generators, specify phase-phase kV. Otherwise, for phases=1 or phases>3, specify actual kV across each branch of the Generator. If wye (star), specify phase-neutral kV. If delta or phase-phase connected, specify phase-phase kV.
DSS property name: kv, DSS property index: 3
|
inline |
kVA rating of electrical machine.
Defaults to 1.2* kW if not specified. Applied to machine or inverter definition for Dynamics mode solutions.
DSS property name: kVA, DSS property index: 23
|
inline |
Specify the base kvar.
Alternative to specifying the power factor. Side effect: the power factor value is altered to agree based on present value of kW.
DSS property name: kvar, DSS property index: 6
|
inline |
Total base kW for the Generator.
A positive value denotes power coming OUT of the element, which is the opposite of a load. This value is modified depending on the dispatch mode. Unaffected by the global load multiplier and growth curves. If you want there to be more generation, you must add more generators or change this value.
DSS property name: kW, DSS property index: 4
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 46
|
inline |
Make like another object, e.g.
:
New Capacitor.C2 like=c1 ...
DSS property name: like, DSS property index: 46
|
inline |
Maximum kvar limit for Model = 3.
Defaults to twice the specified load kvar. Always reset this if you change PF or kvar properties.
DSS property name: maxkvar, DSS property index: 19
|
inline |
Minimum kvar limit for Model = 3.
Enter a negative number if generator can absorb vars. Defaults to negative of Maxkvar. Always reset this if you change PF or kvar properties.
DSS property name: minkvar, DSS property index: 20
|
inline |
Integer code for the model to use for generation variation with voltage.
Valid values are:
1:Generator injects a constant kW at specified power factor. 2:Generator is modeled as a constant admittance. 3:Const kW, constant kV. Somewhat like a conventional transmission power flow P-V generator. 4:Const kW, Fixed Q (Q never varies) 5:Const kW, Fixed Q(as a constant reactance) 6:Compute load injection from User-written Model.(see usage of Xd, Xdp) 7:Constant kW, kvar, but current-limited below Vminpu. Approximates a simple inverter. See also Balanced.
DSS property name: model, DSS property index: 7
|
inline |
MVA rating of electrical machine.
Alternative to using kVA=.
DSS property name: MVA, DSS property index: 24
|
inline |
It is a number between 0 and 100 representing the current amount of fuel avaiable in percentage of FuelkWh.
It only applies if UseFuel = Yes/True
DSS property name: Fuel, DSS property index: 40
|
inline |
It is a number between 0 and 100 representing the reserve level in percentage of FuelkWh.
It only applies if UseFuel = Yes/True
DSS property name: Reserve, DSS property index: 41
|
inline |
Generator power factor.
Default is 0.80. Enter negative for leading powerfactor (when kW and kvar have opposite signs.) A positive power factor for a generator signifies that the generator produces vars as is typical for a synchronous generator. Induction machines would be specified with a negative power factor.
DSS property name: pf, DSS property index: 5
|
inline |
Number of Phases, this Generator.
Power is evenly divided among phases.
DSS property name: phases, DSS property index: 1
|
inline |
Deceleration factor for P-V generator model (Model=3).
Default is 0.1. If the circuit converges easily, you may want to use a higher number such as 1.0. Use a lower number if solution diverges. Use Debugtrace=yes to create a file that will trace the convergence of a generator model.
DSS property name: pvfactor, DSS property index: 21
|
inline |
It is a boolean value (Yes/True, No/False) that can be used to manually refuel the generator when needed.
It only applies if UseFuel = Yes/True
DSS property name: Refuel, DSS property index: 42
|
inline |
String (in quotes or parentheses) that gets passed to user-written shaft dynamic model for defining the data for that model.
DSS property name: ShaftData, DSS property index: 33
|
inline |
Name of user-written DLL containing a Shaft model, which models the prime mover and determines the power on the shaft for Dynamics studies.
Models additional mass elements other than the single-mass model in the DSS default model. Set to "none" to negate previous setting.
DSS property name: ShaftModel, DSS property index: 32
|
inline |
Name of harmonic voltage or current spectrum for this generator.
Voltage behind Xd" for machine - default. Current injection for inverter. Default value is "default", which is defined when the DSS starts.
DSS property name: spectrum, DSS property index: 43
|
inline |
Name of harmonic voltage or current spectrum for this generator.
Voltage behind Xd" for machine - default. Current injection for inverter. Default value is "default", which is defined when the DSS starts.
DSS property name: spectrum, DSS property index: 43
|
inline |
={Fixed | Variable*}.
If Fixed, then dispatch multipliers do not apply. The generator is alway at full power when it is ON. Default is Variable (follows curves).
DSS property name: status, DSS property index: 16
|
inline |
={Fixed | Variable*}.
If Fixed, then dispatch multipliers do not apply. The generator is alway at full power when it is ON. Default is Variable (follows curves).
DSS property name: status, DSS property index: 16
|
inline |
={Fixed | Variable*}.
If Fixed, then dispatch multipliers do not apply. The generator is alway at full power when it is ON. Default is Variable (follows curves).
DSS property name: status, DSS property index: 16
|
inline |
{Yes | *No}.
Activates the use of fuel for the operation of the generator. When the fuel level reaches the reserve level, the generator stops until it gets refueled. By default, the generator is connected to a continuous fuel supply, Use this mode to mimic dependency on fuel level for different generation technologies.
DSS property name: UseFuel, DSS property index: 38
|
inline |
String (in quotes or parentheses) that gets passed to user-written model for defining the data required for that model.
DSS property name: UserData, DSS property index: 31
|
inline |
Name of DLL containing user-written model, which computes the terminal currents for Dynamics studies, overriding the default model.
Set to "none" to negate previous setting.
DSS property name: UserModel, DSS property index: 30
|
inline |
Default = 1.10.
Maximum per unit voltage for which the Model is assumed to apply. Above this value, the load model reverts to a constant impedance model.
DSS property name: Vmaxpu, DSS property index: 9
|
inline |
Default = 0.90.
Minimum per unit voltage for which the Model is assumed to apply. Below this value, the load model reverts to a constant impedance model. For model 7, the current is limited to the value computed for constant power at Vminpu.
DSS property name: Vminpu, DSS property index: 8
|
inline |
Per Unit voltage set point for Model = 3 (typical power flow model).
Default is 1.0.
DSS property name: Vpu, DSS property index: 18
|
inline |
Per unit synchronous reactance of machine.
Presently used only for Thevinen impedance for power flow calcs of user models (model=6). Typically use a value 0.4 to 1.0. Default is 1.0
DSS property name: Xd, DSS property index: 25
|
inline |
Per unit transient reactance of the machine.
Used for Dynamics mode and Fault studies. Default is 0.27.For user models, this value is used for the Thevinen/Norton impedance for Dynamics Mode.
DSS property name: Xdp, DSS property index: 26
|
inline |
Per unit subtransient reactance of the machine.
Used for Harmonics. Default is 0.20.
DSS property name: Xdpp, DSS property index: 27
|
inline |
Default is 20.
X/R ratio for Xdp property for FaultStudy and Dynamic modes.
DSS property name: XRdp, DSS property index: 37
|
inline |
Dispatch shape to use for yearly simulations.
Must be previously defined as a Loadshape object. If this is not specified, a constant value is assumed (no variation). If the generator is assumed to be ON continuously, specify Status=FIXED, or designate a curve that is 1.0 per unit at all times. Set to NONE to reset to no loadahape. Nominally for 8760 simulations. If there are fewer points in the designated shape than the number of points in the solution, the curve is repeated.
DSS property name: yearly, DSS property index: 10
|
inline |
Dispatch shape to use for yearly simulations.
Must be previously defined as a Loadshape object. If this is not specified, a constant value is assumed (no variation). If the generator is assumed to be ON continuously, specify Status=FIXED, or designate a curve that is 1.0 per unit at all times. Set to NONE to reset to no loadahape. Nominally for 8760 simulations. If there are fewer points in the designated shape than the number of points in the solution, the curve is repeated.
DSS property name: yearly, DSS property index: 10