ORNL/GridKit

Init section for device json input

开放

#405 创建于 2026年5月18日

 (4 条评论) (0 个反应) (0 位负责人)C++ (10 个派生)auto 404
enhancementhelp wanted

仓库指标

星标
 (23 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Summary

The exciter and governor models desperately need a way to initialize their external. We are initializing these models in an unfortunate way because we don't have a way to set the initial values of external states in the case format:

Some of the more advanced models cannot be implemented due to our current approach of intialziation intra-model.

Rationale

Right now, during initialization, the Genrou model writes information to the governor Tgov1 via the mechanical power signal. And then (the sequencing matters, which is unfortunate) the governor initialization reads this data that landed in its own internal state:

  // Initial mechanical = initial electric torque
  if (signals_.template isAssigned<Tgov1InternalVariables::PM>())
  {
    p0 = y_[2]; ///<- generator needs to be initialized first
  }

  // Input Variables (Parameter for now)
  pref_ = R_ * p0;

which is then used to initialize the static values of pref which is an external variable of the governor

But the dependency chain is backward, since we can know a priori from the power flow solution the value of pref. And the case format itself embeds knowledge of the models, so if the machine Genrou isn't wired up to an exciter, then the author of the case format already knows to initialize pmech with the value we would have given pref if it had a governor.

Additionally, this would allow us to fully unit test models without coupling them with other models as we do with the exciter, governor, and machine trio.

Description

a init section which only accepts names of external variables

  {
      "class": "Tgov1",
      "ports": {
          "bus": 26,
          "speed": 28,
          "pmech": 29
      },
      "id": "26_1_tgov1",
      "init":{
            "pref": 10.0,
       },
      "params": {
          "R": 0.05,
          "T1": 0.5,
          "T2": 2.5,
          "T3": 7.5,
          "Pvmin": 0.0,
          "Pvmax": 1.0,
          "Dt": 0.0
      }
  },

Additional information

I had a conversation a while ago about this with @abirchfield, but I hit a wall with the REECA exciter implementation for IBR because of this issue

贡献者指南