powerStorageBase#

Executive Summary#

The PowerStorageBase is a base class that is used generate a standard interface and list of features for modules that store electrical power. This class is used by other modules as a parent class and cannot be instantiated by itself. All Xmera power storage modules based on this PowerStorageBase inherit the following common properties:

  1. Writes out a PowerStorageStatusMsgPayload containing the current stored power (in Watt-Seconds or Joules), the current net power (in Watts), and the battery storage capacity (in Watt-Seconds or Joules).

  2. Allows for multiple PowerNodeUsageMsgPayload corresponding to individual powerNodeBase instances to be subscribed to using the addPowerNodeToModel method.

  3. Iterates through attached PowerNodeUsageMsgPayload instances and computes the net power over all messages using sumAllInputs()

  4. Computes the conversion between net power in and storage using the evaluateBatteryModel method, which must be overridden in child classes and is therefore module-specific.

Core functionality is wrapped in the evaluateBatteryModel protected virtual void method, which is assumed to compute power storage on a module specific mathematical model.

Protected methods prepended with custom are intended for module developers to override with additional, module-specific functionality.

For more information on how to set up and use classes derived from this module, see the simple power system example: scenarioPowerDemo

Module Assumptions and Limitations#

The base class makes no specific energy storage device related assumptions.

Message Connection Descriptions#

The following table lists all the module input and output messages. The module msg connection is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

Module I/O Messages#

Msg Variable Name

Msg Type

Description

batPowerOutMsg

PowerStorageStatusMsgPayload

power storage status output message

nodePowerUseInMsgs

PowerNodeUsageMsgPayload

vector of power node input messages (these are linked through the addPowerNodeToModel(msg) method

User Guide#

  • The base class behavior requires the initial energy storage to be specified through storedCharge_Init.

  • The integration time step is evaluated as the time between module calls.

  • The user must set the output message name variable batPowerOutMsg

  • The input message names are provided by calling the method addPowerNodeToModel(msg)

class PowerStorageBase : public SysModel#

power storage base class

Subclassed by SimpleBattery, SimplePowerMonitor

Public Functions

PowerStorageBase()#

This method initializes some basic parameters for the module.

Returns:

void

~PowerStorageBase()#

Destructor.

Returns:

void

void reset(uint64_t currentSimNanos)#

This method is used to reset the module.

Returns:

void

void addPowerNodeToModel(Message<PowerNodeUsageMsgPayload> *tmpNodeMsg)#

Adds a PowerNodeUsageMsgPayload input message to iterate over

Parameters:

tmpNodeMsg – Message name corresponding to a PowerNodeUsageMsgPayload.

Returns:

void

void updateState(uint64_t currentSimNanos)#

Implements readMessages, integratePowerStatus, and writeMessages for the rest of the sim.

Parameters:

currentSimNanos – The current simulation time in nanoseconds

Returns:

void

Public Members

std::vector<ReadFunctor<PowerNodeUsageMsgPayload>> nodePowerUseInMsgs#

Vector of power node input message names.

Message<PowerStorageStatusMsgPayload> batPowerOutMsg#

power storage status output message

double storedCharge_Init#

[W-s] Initial stored charge set by the user. Defaults to 0.

BSKLogger bskLogger#

— BSK Logging