Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
Power System Simulation and Optimization
DPsim
DPsim
Commits
c43478ba
Commit
c43478ba
authored
Sep 09, 2020
by
Jan Dinkelbach
Browse files
add small capacitance and load step to DP_Slack_PiLine_PQLoad
parent
e24e25bd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Examples/Cxx/CIM/DP_CIGRE_MV_withDG_withLoadStep.cpp
View file @
c43478ba
...
...
@@ -89,10 +89,10 @@ int main(int argc, char** argv){
Scenarios
::
CIGREMV
::
logPVAttributes
(
logger
,
pv
);
// // load step sized relative to nominal load at N11
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::
CIGREMV::
createEventAddPowerConsumption("N11", 2-timeStep, 5*systemPF.component<CPS::SP::Ph1::Load>("LOAD-H-11")->attribute<CPS::Real>("P")->get(), systemDP, Domain::DP);
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("N11", 2-timeStep, 5*systemPF.component<CPS::SP::Ph1::Load>("LOAD-H-11")->attribute<CPS::Real>("P")->get(), systemDP, Domain::DP);
// load step sized in absolute terms
std
::
shared_ptr
<
SwitchEvent
>
loadStepEvent
=
Scenarios
::
CIGREMV
::
createEventAddPowerConsumption
(
"N11"
,
2
-
timeStep
,
1500.0e3
,
systemDP
,
Domain
::
DP
);
std
::
shared_ptr
<
SwitchEvent
>
loadStepEvent
=
Scenarios
::
createEventAddPowerConsumption
(
"N11"
,
2
-
timeStep
,
1500.0e3
,
systemDP
,
Domain
::
DP
);
Simulation
sim
(
simName
,
systemDP
,
timeStep
,
finalTime
,
Domain
::
DP
,
Solver
::
Type
::
MNA
,
Logger
::
Level
::
debug
,
true
);
...
...
Examples/Cxx/CIM/EMT_CIGRE_MV_withDG_withLoadStep.cpp
View file @
c43478ba
...
...
@@ -85,7 +85,7 @@ int main(int argc, char** argv){
auto
pv
=
systemEMT
.
component
<
CPS
::
SimPowerComp
<
Real
>>
(
"pv_N11"
);
Scenarios
::
CIGREMV
::
logPVAttributes
(
logger
,
pv
);
std
::
shared_ptr
<
SwitchEvent3Ph
>
loadStepEvent
=
Scenarios
::
CIGREMV
::
createEventAddPowerConsumption3Ph
(
"N11"
,
2
-
timeStep
,
1500.0e3
,
systemEMT
,
Domain
::
EMT
);
std
::
shared_ptr
<
SwitchEvent3Ph
>
loadStepEvent
=
Scenarios
::
createEventAddPowerConsumption3Ph
(
"N11"
,
2
-
timeStep
,
1500.0e3
,
systemEMT
,
Domain
::
EMT
);
Simulation
sim
(
simName
,
systemEMT
,
timeStep
,
finalTime
,
Domain
::
EMT
,
Solver
::
Type
::
MNA
,
Logger
::
Level
::
debug
,
true
);
sim
.
addEvent
(
loadStepEvent
);
...
...
Examples/Cxx/Circuits/DP_Slack_PiLine_PQLoad_with_PF_Init.cpp
View file @
c43478ba
...
...
@@ -18,6 +18,7 @@
using
namespace
DPsim
;
using
namespace
CPS
;
using
namespace
CPS
::
CIM
;
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -27,6 +28,7 @@ int main(int argc, char* argv[]) {
Real
qLoadNom
=
50e3
;
Real
lineResistance
=
0.05
;
Real
lineInductance
=
0.1
;
Real
lineCapacitance
=
0.1e-6
;
Real
finalTime
=
2.0
;
// ----- POWERFLOW FOR INITIALIZATION -----
...
...
@@ -45,7 +47,7 @@ int main(int argc, char* argv[]) {
extnetPF
->
modifyPowerFlowBusType
(
PowerflowBusType
::
VD
);
auto
linePF
=
SP
::
Ph1
::
PiLine
::
make
(
"PiLine"
,
Logger
::
Level
::
debug
);
linePF
->
setParameters
(
lineResistance
,
lineInductance
,
0
);
linePF
->
setParameters
(
lineResistance
,
lineInductance
,
lineCapacitance
);
linePF
->
setBaseVoltage
(
Vnom
);
auto
loadPF
=
SP
::
Ph1
::
Shunt
::
make
(
"Load"
,
Logger
::
Level
::
debug
);
...
...
@@ -90,7 +92,7 @@ int main(int argc, char* argv[]) {
extnetDP
->
setParameters
(
Complex
(
Vnom
,
0
));
auto
lineDP
=
DP
::
Ph1
::
PiLine
::
make
(
"PiLine"
,
Logger
::
Level
::
debug
);
lineDP
->
setParameters
(
lineResistance
,
lineInductance
);
lineDP
->
setParameters
(
lineResistance
,
lineInductance
,
lineCapacitance
);
auto
loadDP
=
DP
::
Ph1
::
RXLoad
::
make
(
"Load"
,
Logger
::
Level
::
debug
);
loadDP
->
setParameters
(
pLoadNom
,
qLoadNom
,
Vnom
);
...
...
@@ -113,6 +115,9 @@ int main(int argc, char* argv[]) {
loggerDP
->
addAttribute
(
"v1"
,
n1DP
->
attribute
(
"v"
));
loggerDP
->
addAttribute
(
"v2"
,
n2DP
->
attribute
(
"v"
));
// load step sized in absolute terms
std
::
shared_ptr
<
SwitchEvent
>
loadStepEvent
=
Scenarios
::
createEventAddPowerConsumption
(
"n2"
,
1
-
timeStepDP
,
100e3
,
systemDP
,
Domain
::
DP
);
// Simulation
Simulation
sim
(
simNameDP
,
Logger
::
Level
::
debug
);
sim
.
setSystem
(
systemDP
);
...
...
@@ -121,6 +126,7 @@ int main(int argc, char* argv[]) {
sim
.
setDomain
(
Domain
::
DP
);
sim
.
doPowerFlowInit
(
false
);
sim
.
addLogger
(
loggerDP
);
sim
.
addEvent
(
loadStepEvent
);
sim
.
run
();
}
Examples/Cxx/Circuits/DP_Slack_PiLine_VSI_with_PF_Init.cpp
View file @
c43478ba
...
...
@@ -116,7 +116,7 @@ int main(int argc, char* argv[]) {
Scenarios
::
CIGREMV
::
logPVAttributes
(
loggerDP
,
pv
);
// load step sized in absolute terms
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::
CIGREMV::
createEventAddPowerConsumption("n2", 1-timeStepDP, 1000.0e3, systemDP, Domain::DP);
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("n2", 1-timeStepDP, 1000.0e3, systemDP, Domain::DP);
// Simulation
Simulation
sim
(
simNameDP
,
Logger
::
Level
::
debug
);
...
...
models/Include/cps/CIM/Scenarios.h
View file @
c43478ba
...
...
@@ -147,7 +147,31 @@ namespace CIGREMV {
}
}
std
::
shared_ptr
<
DPsim
::
SwitchEvent
>
createEventAddPowerConsumption
(
String
nodeName
,
Real
eventTime
,
Real
additionalActivePower
,
SystemTopology
&
system
,
Domain
domain
)
{
void
logPVAttributes
(
DPsim
::
DataLogger
::
Ptr
logger
,
CPS
::
TopologicalPowerComp
::
Ptr
pv
)
{
// state variables
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"theta"
,
pv
->
attribute
(
"theta"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"phipll"
,
pv
->
attribute
(
"phipll"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"p"
,
pv
->
attribute
(
"p"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"q"
,
pv
->
attribute
(
"q"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"phid"
,
pv
->
attribute
(
"phid"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"phiq"
,
pv
->
attribute
(
"phiq"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"gammad"
,
pv
->
attribute
(
"gammad"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"gammaq"
,
pv
->
attribute
(
"gammaq"
));
// input variables
logger
->
addAttribute
(
pv
->
name
()
+
"_input_"
+
"Vcdq"
,
pv
->
attribute
(
"Vcdq"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_input_"
+
"Ircdq"
,
pv
->
attribute
(
"Ircdq"
));
// output variables
logger
->
addAttribute
(
pv
->
name
()
+
"_output_"
+
"Vsdq"
,
pv
->
attribute
(
"Vsdq"
));
// interface variables
logger
->
addAttribute
(
pv
->
name
()
+
"_v_intf"
,
pv
->
attribute
(
"v_intf"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_i_intf"
,
pv
->
attribute
(
"i_intf"
));
}
}
std
::
shared_ptr
<
DPsim
::
SwitchEvent
>
createEventAddPowerConsumption
(
String
nodeName
,
Real
eventTime
,
Real
additionalActivePower
,
SystemTopology
&
system
,
Domain
domain
)
{
// TODO: use base classes ph1
if
(
domain
==
CPS
::
Domain
::
DP
)
{
...
...
@@ -180,32 +204,7 @@ namespace CIGREMV {
return
nullptr
;
}
}
void
logPVAttributes
(
DPsim
::
DataLogger
::
Ptr
logger
,
CPS
::
TopologicalPowerComp
::
Ptr
pv
)
{
// state variables
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"theta"
,
pv
->
attribute
(
"theta"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"phipll"
,
pv
->
attribute
(
"phipll"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"p"
,
pv
->
attribute
(
"p"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"q"
,
pv
->
attribute
(
"q"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"phid"
,
pv
->
attribute
(
"phid"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"phiq"
,
pv
->
attribute
(
"phiq"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"gammad"
,
pv
->
attribute
(
"gammad"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_state_"
+
"gammaq"
,
pv
->
attribute
(
"gammaq"
));
// input variables
logger
->
addAttribute
(
pv
->
name
()
+
"_input_"
+
"Vcdq"
,
pv
->
attribute
(
"Vcdq"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_input_"
+
"Ircdq"
,
pv
->
attribute
(
"Ircdq"
));
// output variables
logger
->
addAttribute
(
pv
->
name
()
+
"_output_"
+
"Vsdq"
,
pv
->
attribute
(
"Vsdq"
));
// interface variables
logger
->
addAttribute
(
pv
->
name
()
+
"_v_intf"
,
pv
->
attribute
(
"v_intf"
));
logger
->
addAttribute
(
pv
->
name
()
+
"_i_intf"
,
pv
->
attribute
(
"i_intf"
));
}
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment