Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Implement resilience analysis use case (#485)
Browse files Browse the repository at this point in the history
* Create README.md

* Update README.md

* Create Resilience.md

* IEEE 13 model with poles

* Adding model IEEE 13 with poles

* Create test_IEEE13_pole_output.csv

* Adding wind pressure output

* Update .gitignore

* Update pole.cpp

* Add documentation on resilience impacts of vegetation

* Add support for parent class definition in loader

* Add support for more general tariff design specification

* Revert "Add support for parent class definition in loader"

This reverts commit 1914581.

* Revert "Add support for more general tariff design specification"

This reverts commit f5a7512.

* Added Santa Cruz county example data

* Update Powerline vegetation impact example.ipynb

* Update Powerline vegetation impact example.ipynb

* Update Powerline vegetation impact example.ipynb

* Add example of RoW canopy cover analysis

* Create requirements.txt

* Update requirements.txt

* Update requirements.txt

* Fix vegetation path analysis

* Convert example to command-like usage

* Update vegetation.py

* Update vegetation.py

* Update vegetation.py

* Create agl.py

* Update agl.py

* Add elevation data acquisition

* Delete 230kV_example.tif

* Update elevation.py

* Update requirements.txt

* Update elevation.py

* vegetation analysis file (#889)

Co-authored-by: XinyuanCheng <51723951+XinyuanCheng@users.noreply.github.com>

* Fixing it

* Moving vegetation analysis docs

* Update pole.cpp

* Update pole.h

* Update test_IEEE_13_pole.glm

* Update test_IEEE13_pole_output.csv

* Update main.cpp

* Update main.cpp

* Update load.cpp

* Delete 230kV_example.tif

* Update pole_mount.cpp

* Update test_pole.glm

* Update pole_mount.cpp

* Fix resilience autotest error

* Fix for ABOVE_NORMAL and NORMAL Rfloor value

* Update pole.cpp

* Update pole.cpp

* Update pole.cpp

* Update pole.cpp

* Update pole.cpp

* Update load.cpp

* Update test_IEEE_13_pole_output.csv

* Update test_pole.csv

* Update test_IEEE_13_pole_output.csv

* Update test_IEEE_13_pole_wind.player

* Update test_IEEE_13_pole_output.csv

* Update Pole.md

* (#985) Update so "status" field for links will now allow them to disconnect, much like if switches were on both end.
Various changes to fault conditions to support this
Autotest added for the specific field under powerflow

* Create test_IEEE123_link_outages.py

* Create test_IEEE123_link_outages.glm

* Create .gitignore

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.py

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.py

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.py

* Update test_IEEE123_link_outages.py

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.py

* Update test_IEEE123_link_outages.glm

* Update test_IEEE123_link_outages.py

* Update test_IEEE123_link_outages.glm

* Update pole.cpp

* (#985) Added multiple independent island capability
Fixed constant-current rotation issue in powerflow
Generic autotest updates/bugfixes associated with the current fix

Python powerflow learning code is limited to a single island at the moment

* Update pole_mount.cpp

* (#985) Small fix so the MacOS compiler stops complaining about C++11 structures

* Fix resilience IEEE123 autotest of NR solver

Co-authored-by: Alyona Ivanova <Ivanova.alyona5@gmail.com>
Co-authored-by: XinyuanCheng <51723951+XinyuanCheng@users.noreply.github.com>
Co-authored-by: Fuhong Xie <fxie2@slac.stanford.edu>
Co-authored-by: ftuffner <francis.tuffner@pnnl.gov>
  • Loading branch information
5 people authored Nov 4, 2021
1 parent 4c49a84 commit 2e97b1b
Show file tree
Hide file tree
Showing 98 changed files with 27,721 additions and 15,001 deletions.
2 changes: 1 addition & 1 deletion docs/Module/Powerflow/Pole.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
~~~
object pole
{
pole_status "OK";
status "OK";
tilt_angle "0 deg";
tilt_direction 0 deg";
weather "<climate-object>";
Expand Down
41 changes: 21 additions & 20 deletions module/generators/autotest/fqm_group_lf_batt633_power.player
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
2014-01-01 00:01:30 PST,+312175+000000i
2014-01-01 01:01:30 PST,+181920+000000i
2014-01-01 02:01:30 PST,+061563+000000i
2014-01-01 03:01:30 PST,+000000+000000i
2014-01-01 04:01:30 PST,+000000+900000i
2014-01-01 05:01:30 PST,-176150+881896i
2014-01-01 06:01:30 PST,-356255-826488i
2014-01-01 07:01:30 PST,-613021-658942i
2014-01-01 08:01:30 PST,-774889-457763i
2014-01-01 09:01:30 PST,+000000-900000i
2014-01-01 10:01:30 PST,+152205-887036i
2014-01-01 11:01:30 PST,+506831-743722i
2014-01-01 12:01:30 PST,+064691-762707i
2014-01-01 13:01:30 PST,-152656-762707i
2014-01-01 14:01:30 PST,-683220-585841i
2014-01-01 15:01:30 PST,-000000-762707i
2014-01-01 16:01:30 PST,+000000-762707i
2014-01-01 18:01:30 PST,+294085+079313i
2014-01-01 19:01:30 PST,+054743+079313i
2014-01-01 20:01:30 PST,+000000+898334i
2014-01-01 00:01:30 PST,+325935+0.0j
2014-01-01 01:01:30 PST,+194925+0.0j
2014-01-01 02:01:30 PST,+78102.5+0.0j
2014-01-01 03:01:30 PST,+0+0.0j
2014-01-01 04:01:30 PST,0.0+900000j
2014-01-01 05:01:30 PST,-160331+884948j
2014-01-01 06:01:30 PST,-340311-833180j
2014-01-01 07:01:30 PST,-591762-678099j
2014-01-01 08:01:30 PST,-773662-459834j
2014-01-01 09:01:30 PST,0.0-900000j
2014-01-01 10:01:30 PST,+163413-885040j
2014-01-01 11:01:30 PST,+518316-735764j
2014-01-01 12:01:30 PST,+80063.1-735764j
2014-01-01 13:01:30 PST,-135288-735764j
2014-01-01 14:01:30 PST,-654367-617902j
2014-01-01 15:01:30 PST,0.0-735764j
2014-01-01 16:01:30 PST,0.0-735764j
2014-01-01 17:01:30 PST,0.0-735764j
2014-01-01 18:01:30 PST,+308929+35065j
2014-01-01 19:01:30 PST,+68380.1+35065j
2014-01-01 20:01:30 PST,+0.0+897399j
41 changes: 21 additions & 20 deletions module/generators/autotest/fqm_group_lf_batt684_power.player
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
2014-01-01 00:01:30 PST,+104058+000000i
2014-01-01 01:01:30 PST,+060640+000000i
2014-01-01 02:01:30 PST,+020521+000000i
2014-01-01 03:01:30 PST,+000000+000000i
2014-01-01 04:01:30 PST,+000000+300000i
2014-01-01 05:01:30 PST,-058717+293965i
2014-01-01 06:01:30 PST,-118752-275496i
2014-01-01 07:01:30 PST,-204340-219647i
2014-01-01 08:01:30 PST,-258296-152588i
2014-01-01 09:01:30 PST,-148051-260923i
2014-01-01 10:01:30 PST,+050735-295679i
2014-01-01 11:01:30 PST,+168944-247907i
2014-01-01 12:01:30 PST,+021564-254236i
2014-01-01 13:01:30 PST,-050878-254236i
2014-01-01 14:01:30 PST,-227740-195280i
2014-01-01 15:01:30 PST,-228869-193956i
2014-01-01 16:01:30 PST,+000000-254236i
2014-01-01 18:01:30 PST,+098028+026438i
2014-01-01 19:01:30 PST,+018248+026438i
2014-01-01 20:01:30 PST,+000000+299445i
2014-01-01 00:01:30 PST,+108645+0.0j
2014-01-01 01:01:30 PST,+64974.9+0.0j
2014-01-01 02:01:30 PST,+26034.2,+0j
2014-01-01 03:01:30 PST,+0+0j
2014-01-01 04:01:30 PST,0.0+300000j
2014-01-01 05:01:30 PST,-53443.8+294983j
2014-01-01 06:01:30 PST,-113437-277727j
2014-01-01 07:01:30 PST,-197254-226033j
2014-01-01 08:01:30 PST,-257887-153278j
2014-01-01 09:01:30 PST,-137733-266514j
2014-01-01 10:01:30 PST,+54470.6-295013j
2014-01-01 11:01:30 PST,+172772-245255j
2014-01-01 12:01:30 PST,+26687.7-245255j
2014-01-01 13:01:30 PST,-45095.9-245255j
2014-01-01 14:01:30 PST,-218122-205967j
2014-01-01 15:01:30 PST,-232263-189879j
2014-01-01 16:01:30 PST,+0.0-245255j
2014-01-01 17:01:30 PST,+0.0-245255j
2014-01-01 18:01:30 PST,+102976+11688.3j
2014-01-01 19:01:30 PST,+22793.4+11688.3j
2014-01-01 20:01:30 PST,0.0+299133j
105 changes: 70 additions & 35 deletions module/generators/windturb_dg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ int windturb_dg::init(OBJECT *parent)

double ZB, SB = 0.0, EB = 0.0;
complex tst, tst2, tst3, tst4;
gld_property *temp_property_pointer;
enumeration temp_enum;
bool NR_detect;

switch (Turbine_Model) {
case GENERIC_IND_LARGE:
Expand Down Expand Up @@ -452,17 +455,6 @@ int windturb_dg::init(OBJECT *parent)
*/
}

// construct circuit variable map to meter -- copied from 'House' module
struct {
complex **var;
const char *varname;
} map[] = {
// local object name, meter object name
{&pCircuit_V, "voltage_A"}, // assumes 2 and 3 follow immediately in memory
{&pLine_I, "current_A"}, // assumes 2 and 3(N) follow immediately in memory
/// @todo use triplex property mapping instead of assuming memory order for meter variables (residential, low priority) (ticket #139)
};

static complex default_line123_voltage[3], default_line1_current[3];
size_t i;

Expand Down Expand Up @@ -554,18 +546,58 @@ int windturb_dg::init(OBJECT *parent)
voltages of the parent meter be within ~10% of the rated voltage.
*/

// attach meter variables to each circuit
for (i=0; i<sizeof(map)/sizeof(map[0]); i++)
//Map the solver method and see if we're NR-oriented
temp_property_pointer = new gld_property("powerflow::solver_method");

//Make sure it worked
if ((temp_property_pointer->is_valid() != true) || (temp_property_pointer->is_enumeration() != true))
{
*(map[i].var) = get_complex(parent,map[i].varname);
GL_THROW("windturb_dg:%d %s failed to map the nominal_frequency property", obj->id, (obj->name ? obj->name : "Unnamed"));
/* TROUBLESHOOT
While attempting to map the powerflow:solver_method property, an error occurred. Please try again.
If the error persists, please submit your GLM and a bug report to the ticketing system.
*/
}

if (*(map[i].var) == NULL)
{
GL_THROW("Unable to map variable %s",map[i].varname);
/* TROUBLESHOOT
The variable name was not found when mapping it
*/
}
//Must be valid, read it
temp_enum = temp_property_pointer->get_enumeration();

//Remove the link
delete temp_property_pointer;

//Check which method we are - NR=2
if (temp_enum == 2)
{
//Map the current property - pre-rotated for NR
pLine_I = get_complex(parent,"prerotated_current_A");
}
else //Other methods - should already be set, but be explicit
{
//Map the normal current property for FBS for now
pLine_I = get_complex(parent,"current_A");
}

//Check it
if (pLine_I == NULL)
{
GL_THROW("windturb_dg:%d %s failed to map the current property", obj->id, (obj->name ? obj->name : "Unnamed"));
/* TROUBLESHOOT
While attempting to map the current property from the parent meter, an error occurred. Please try again.
If the error persists, please submit your GLM and a bug report to the ticketing system.
*/
}

//Map the voltage - it's the same regardless
pCircuit_V = get_complex(parent,"voltage_A");

//Check it
if (pCircuit_V == NULL)
{
GL_THROW("windturb_dg:%d %s failed to map the voltage property", obj->id, (obj->name ? obj->name : "Unnamed"));
/* TROUBLESHOOT
While attempting to map the voltage property from the parent meter, an error occurred. Please try again.
If the error persists, please submit your GLM and a bug report to the ticketing system.
*/
}
}
else if (gl_object_isa(parent,"triplex_meter","powerflow"))
Expand Down Expand Up @@ -620,22 +652,25 @@ int windturb_dg::init(OBJECT *parent)
voltages of the parent meter be within ~10% of the rated voltage.
*/

//Map the normal current property
pLine_I = get_complex(parent,"current_A");

//Check it
if (pLine_I == NULL)
{
GL_THROW("windturb_dg:%d %s failed to map the current property", obj->id, (obj->name ? obj->name : "Unnamed"));
//Defined above
}

//Map the voltage - it's the same regardless
pCircuit_V = get_complex(parent,"voltage_A");

// attach meter variables to each circuit
for (i=0; i<sizeof(map)/sizeof(map[0]); i++)
//Check it
if (pCircuit_V == NULL)
{
if ((*(map[i].var) = get_complex(parent,map[i].varname))==NULL)
{
GL_THROW("%s (%s:%d) does not implement rectifier variable %s for %s (windturb_dg:%d)",
/* TROUBLESHOOT
The rectifier requires that the inverter contains certain published properties in order to properly connect. If you encounter this error, please report it to the developers, along with
the version of GridLAB-D that raised this error.
*/
parent->name?parent->name:"unnamed object", parent->oclass->name, parent->id, map[i].varname, obj->name?obj->name:"unnamed", obj->id);
}
GL_THROW("windturb_dg:%d %s failed to map the voltage property", obj->id, (obj->name ? obj->name : "Unnamed"));
//Defined above
}

}
else
{
Expand All @@ -650,8 +685,8 @@ int windturb_dg::init(OBJECT *parent)
warning("windturb_dg:%d %s", obj->id, parent==NULL?"has no parent meter defined":"parent is not a meter");

// attach meter variables to each circuit in the default_meter
*(map[0].var) = &default_line123_voltage[0];
*(map[1].var) = &default_line1_current[0];
// *(map[0].var) = &default_line123_voltage[0];
// *(map[1].var) = &default_line1_current[0];

// provide initial values for voltages
default_line123_voltage[0] = complex(Rated_V/sqrt(3.0),0);
Expand Down
Loading

0 comments on commit 2e97b1b

Please sign in to comment.