Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ jobs:
images: pnnl/gridpack
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=ref,event=tag
type=raw,value=latest,enable=${{ github.event_name == 'release' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=${{ inputs.tag || 'dev' }},enable=${{ github.event_name == 'workflow_dispatch' }}

- name: Extract primary tag
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/docker-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Sync Docker Hub README

on:
push:
branches: [ develop ]

jobs:
sync-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Update Docker Hub repo description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: pnnl/gridpack
readme-filepath: ./README.md
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# GridPACK<sup>TM</sup>-->
# GridPACK: High-Performance Electric Grid Simulation
* Repo: https://github.com/gridoptics/gridpack
* Issues: https://github.com/GridOPTICS/GridPACK/issues
* Releases: https://github.com/GridOPTICS/GridPACK/releases

## About
GridPACK is an open-source high-performance (HPC) package for simulation of large-scale electrical grids. Powered by distributed (parallel) computing and high-performance numerical solvers, GridPACK offers several applications forfast simulation of electrical transmission systems. GridPACK includes a number of prebuilt applications that can be directly used. The most commonly used and well-developed are:
- AC Power Flow
- Dynamics Simulation
Expand All @@ -28,6 +32,9 @@ docker pull pnnl/gridpack:latest

# Run with your files (container starts in /app/workspace)
docker run -it --rm -v $(pwd):/app/workspace pnnl/gridpack:latest bash

# Run a specific semantic version
docker run -it --rm -v $(pwd):/app/workspace pnnl/gridpack:v3.6 bash
```

The Docker image supports both AMD64 and ARM64 architectures. See the [Docker usage guide](https://gridpack.readthedocs.io/en/latest/Section2-Docker.html) for more examples.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,12 @@ bool gridpack::dynamic_simulation::DSFullBus::matrixDiagValues(ComplexType *valu
if (p_ngen > 0) {
for (int i = 0; i < p_ngen; i++) {
if(!p_gstatus[i]) continue;

if (p_pg[i] < 0) {

// Only convert PG<0 generators to impedance load if they
// do NOT have a dynamic model. Generators with dynamic models
// (including motoring generators with PG<0) contribute via
// Norton current injection, not as impedance loads.
if (p_pg[i] < 0 && p_gen_nodynmodel[i]) {
p_ybusr = p_ybusr+(-p_pg[i])/(p_voltage*p_voltage);
p_ybusi = p_ybusi+p_qg[i]/(p_voltage*p_voltage);
gridpack::ComplexType ret(p_ybusr, p_ybusi);
Expand All @@ -241,14 +245,6 @@ bool gridpack::dynamic_simulation::DSFullBus::matrixDiagValues(ComplexType *valu
gridpack::ComplexType u(p_ybusr, p_ybusi);
values[0] = u;
}
if (p_negngen > 0) {
for (int i = 0; i < p_negngen; i++) {
p_ybusr = p_ybusr+(-p_negpg[i])/(p_voltage*p_voltage);
p_ybusi = p_ybusi+p_negqg[i]/(p_voltage*p_voltage);
gridpack::ComplexType ret(p_ybusr, p_ybusi);
values[0] = ret;
}
}
for (int i = 0; i < p_ngen; i++) {
if(p_gen_nodynmodel[i]) {
p_ybusr = p_ybusr+(-p_genpg_nodynmodel[i])/(p_voltage*p_voltage);
Expand Down Expand Up @@ -978,7 +974,7 @@ void gridpack::dynamic_simulation::DSFullBus::load(
p_gpmax.push_back(pmax);

std::string model;
if (data->getValue(GENERATOR_MODEL, &model, i) && pg >= 0.0) {
if (data->getValue(GENERATOR_MODEL, &model, i)) {

BaseGeneratorModel *generator
= genFactory.createGeneratorModel(model);
Expand Down Expand Up @@ -1127,7 +1123,7 @@ void gridpack::dynamic_simulation::DSFullBus::load(
model.c_str(), idx);
}

} else if (!data->getValue(GENERATOR_MODEL, &model, i) && pg >= 0.0){
} else if (!data->getValue(GENERATOR_MODEL, &model, i)){
// handle the generators having no dynamic model, need to convert to negative load
BaseGeneratorModel *generator = new gridpack::dynamic_simulation::BaseGeneratorModel;
boost::shared_ptr<BaseGeneratorModel> basegen;
Expand All @@ -1138,10 +1134,6 @@ void gridpack::dynamic_simulation::DSFullBus::load(
p_genpg_nodynmodel[i] = pg;
p_genqg_nodynmodel[i] = qg;
p_ngen_nodynmodel++;
} else if (pg < 0.0) {
p_negpg.push_back(pg);
p_negqg.push_back(qg);
p_negngen++;
}
icnt++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void gridpack::dynamic_simulation::ClassicalGenerator::init(double mag,
p_eqprime = gridpack::ComplexType(abs(p_eprime_s0),0.0);
//printf("eqprime = %f\n", p_eqprime);
// pmech
p_pmech = gridpack::ComplexType(abs(p_pelect),0.0);
p_pmech = gridpack::ComplexType(real(p_pelect),0.0);
//printf("mech = %f\n", p_pmech);
//printf("mva = %f\n", p_mva);
//printf("d0 = %f\n", p_d0);
Expand Down