EnergyPlus C API
0.1
This is the EnergyPlus C API, which allows linking to EnergyPlus and reading and manipluating data during a simulation.
|
Links |
This "functional" API category provides access to things which do not require a simulation to be running. More...
Go to the source code of this file.
Typedefs | |
typedef void * | Glycol |
This typedef is a convenient pointer to an internal glycol property class inside EnergyPlus. More... | |
typedef void * | Refrigerant |
This typedef is a convenient pointer to an internal refrigerant property class inside EnergyPlus. More... | |
Functions | |
void | initializeFunctionalAPI () |
An initialization routine that sets up all functional API structures. More... | |
const char * | apiVersionFromEPlus () |
Returns the version of this API, in Major.Minor form. More... | |
void | registerErrorCallback (void(*f)(const char *errorMessage)) |
Allows a user to register an error callback function. More... | |
Glycol | glycolNew (const char *glycolName) |
Returns a new reference to a Glycol class. More... | |
void | glycolDelete (Glycol glycol) |
Deletes an instance of a Glycol class. More... | |
Real64 | glycolSpecificHeat (Glycol glycol, Real64 temperature) |
Returns the fluid specific heat for the given Glycol instance at the specified temperature. More... | |
Real64 | glycolDensity (Glycol glycol, Real64 temperature) |
Returns the fluid density for the given Glycol instance at the specified temperature. More... | |
Real64 | glycolConductivity (Glycol glycol, Real64 temperature) |
Returns the fluid thermal conductivity for the given Glycol instance at the specified temperature. More... | |
Real64 | glycolViscosity (Glycol glycol, Real64 temperature) |
Returns the fluid dynamic viscosity for the given Glycol instance at the specified temperature. More... | |
Refrigerant | refrigerantNew (const char *refrigerantName) |
Returns a new reference to a Refrigerant class. More... | |
void | refrigerantDelete (Refrigerant refrigerant) |
Deletes an instance of a Refrigerant class. More... | |
Real64 | refrigerantSaturationPressure (Refrigerant refrigerant, Real64 temperature) |
Returns the refrigerant saturation pressure for the given Refrigerant instance at the specified temperature. More... | |
Real64 | refrigerantSaturationTemperature (Refrigerant refrigerant, Real64 pressure) |
Returns the refrigerant saturation temperature for the given Refrigerant instance at the specified pressure. More... | |
Real64 | refrigerantSaturatedEnthalpy (Refrigerant refrigerant, Real64 temperature, Real64 quality) |
Returns the refrigerant saturated enthalpy for the given Refrigerant instance at the specified temperature and quality. More... | |
Real64 | refrigerantSaturatedDensity (Refrigerant refrigerant, Real64 temperature, Real64 quality) |
Returns the refrigerant saturated density for the given Refrigerant instance at the specified temperature and quality. More... | |
Real64 | refrigerantSaturatedSpecificHeat (Refrigerant refrigerant, Real64 temperature, Real64 quality) |
Returns the refrigerant saturated specific heat for the given Refrigerant instance at the specified temperature and quality. More... | |
Real64 | psyRhoFnPbTdbW (Real64 pb, Real64 tdb, Real64 dw) |
Returns the psychrometric density at given conditions. More... | |
Real64 | psyHfgAirFnWTdb (Real64 T) |
Returns the psychrometric latent energy of air at given conditions. More... | |
Real64 | psyHgAirFnWTdb (Real64 T) |
Returns the psychrometric latent energy of the moisture as a gas in the air at given conditions. More... | |
Real64 | psyHFnTdbW (Real64 TDB, Real64 W) |
Returns the psychrometric enthalpy at given conditions. More... | |
Real64 | psyCpAirFnW (Real64 W) |
Returns the psychrometric specific heat at given conditions. More... | |
Real64 | psyTdbFnHW (Real64 H, Real64 W) |
Returns the psychrometric dry bulb temperature at given conditions. More... | |
Real64 | psyRhovFnTdbWPb (Real64 Tdb, Real64 W, Real64 PB) |
Returns the psychrometric vapor density at given conditions. More... | |
Real64 | psyTwbFnTdbWPb (Real64 Tdb, Real64 W, Real64 PB) |
Returns the psychrometric wet bulb temperature at given conditions. More... | |
Real64 | psyVFnTdbWPb (Real64 TDB, Real64 W, Real64 PB) |
Returns the psychrometric specific volume at given conditions. More... | |
Real64 | psyWFnTdbH (Real64 TDB, Real64 H) |
Returns the psychrometric humidity ratio at given conditions. More... | |
Real64 | psyPsatFnTemp (Real64 T) |
Returns the psychrometric saturation pressure at given conditions. More... | |
Real64 | psyTsatFnHPb (Real64 H, Real64 PB) |
Returns the psychrometric saturation temperature at given conditions. More... | |
Real64 | psyRhovFnTdbRh (Real64 Tdb, Real64 RH) |
Returns the psychrometric vapor density at given conditions. More... | |
Real64 | psyRhFnTdbRhov (Real64 Tdb, Real64 Rhovapor) |
Returns the psychrometric relative humidity at given conditions. More... | |
Real64 | psyRhFnTdbWPb (Real64 TDB, Real64 W, Real64 PB) |
Returns the psychrometric relative humidity at given conditions. More... | |
Real64 | psyWFnTdpPb (Real64 TDP, Real64 PB) |
Returns the psychrometric humidity ratio at given conditions. More... | |
Real64 | psyWFnTdbRhPb (Real64 TDB, Real64 RH, Real64 PB) |
Returns the psychrometric humidity ratio at given conditions. More... | |
Real64 | psyWFnTdbTwbPb (Real64 TDB, Real64 TWB, Real64 PB) |
Returns the psychrometric humidity ratio at given conditions. More... | |
Real64 | psyHFnTdbRhPb (Real64 TDB, Real64 RH, Real64 PB) |
Returns the psychrometric enthalpy at given conditions. More... | |
Real64 | psyTdpFnWPb (Real64 W, Real64 PB) |
Returns the psychrometric dew point temperature at given conditions. More... | |
Real64 | psyTdpFnTdbTwbPb (Real64 TDB, Real64 TWB, Real64 PB) |
Returns the psychrometric dew point temperature at given conditions. More... | |
This "functional" API category provides access to things which do not require a simulation to be running.
Currently this includes accessing API version information, and looking up glycol, refrigerant, and psychrometric properties. Each category has some limitations as this is the first version of the API, but more functionality will be introduced throughout development cycles.
initializeFunctionalAPI
prior to calling any functional API methods to ensure the internal structures are in place in the code. typedef void* Glycol |
This typedef is a convenient pointer to an internal glycol property class inside EnergyPlus.
In a default EnergyPlus simulation, pure water properties are available directly. To access properties of ethylene glycol or propylene glycol, user-input is required. For the current time, the only glycol available through the API is pure water. Accessing the glycol API is initiated using the glycolNew
function.
typedef void* Refrigerant |
This typedef is a convenient pointer to an internal refrigerant property class inside EnergyPlus.
In a default EnergyPlus simulation, refrigerant properties for steam are available directly. To access properties of other refrigerants, user-input is required. For the current time, the only refrigerant available through the API is pure steam. Accessing the refrigerant API is initiated using the refrigerantNew
function.
const char* apiVersionFromEPlus | ( | ) |
Returns the version of this API, in Major.Minor form.
Over time, the API will evolve. In most cases, there won't be breaking changes, just additional functionality. When improvements are made, but they don't break functionality, the minor number will be incremented. If a breaking change ever occurs, the major number will be incremented. This function can be used by users as a way to target a specific major version of the API and avoid problems if the API ever changes.
Returns the fluid thermal conductivity for the given Glycol instance at the specified temperature.
[in] | glycol | An instance of a Glycol class, which can be created by calling glycolNew . |
[in] | temperature | The fluid temperature for property evaluation, in degrees Celsius. |
void glycolDelete | ( | Glycol | glycol | ) |
Deletes an instance of a Glycol class.
When an instance of a Glycol class is created using glycolNew
, it should be cleaned up when totally done with it.
[in] | glycol | An instance of a Glycol class to be deleted. The Glycol class is initially created by calling glycolNew . |
Returns the fluid density for the given Glycol instance at the specified temperature.
[in] | glycol | An instance of a Glycol class, which can be created by calling glycolNew . |
[in] | temperature | The fluid temperature for property evaluation, in degrees Celsius. |
Glycol glycolNew | ( | const char * | glycolName | ) |
Returns a new reference to a Glycol class.
The glycol class allows access to fluid properties. Eventually ethylene and propylene glycol properties will be made available but for now the only fluid is pure water.
[in] | glycolName | The name of the glycol. Currently the only valid option is "water". In future versions of the API, the function will accept other fluid types and glycol mixtures. |
glycolDelete
to clean up the instance. Returns the fluid specific heat for the given Glycol instance at the specified temperature.
[in] | glycol | An instance of a Glycol class, which can be created by calling glycolNew . |
[in] | temperature | The fluid temperature for property evaluation, in degrees Celsius. |
Returns the fluid dynamic viscosity for the given Glycol instance at the specified temperature.
[in] | glycol | An instance of a Glycol class, which can be created by calling glycolNew . |
[in] | temperature | The fluid temperature for property evaluation, in degrees Celsius. |
void initializeFunctionalAPI | ( | ) |
An initialization routine that sets up all functional API structures.
The functional API exposes classes and methods that can be used for outside calculations. Some of these calculations rely on internal structures being allocated and set up. Whenever any script is going to use a method from this functional API, this method must be called.
Returns the psychrometric specific heat at given conditions.
[in] | W | Humidity ratio, in kgWater/kgDryAir |
Returns the psychrometric latent energy of air at given conditions.
[in] | T | Dry bulb temperature, in Celsius |
Returns the psychrometric enthalpy at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | RH | Relative humidity ratio, as a fraction from 0.0 to 1.0 |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric enthalpy at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | W | Humidity ratio, in kgWater/kgDryAir |
Returns the psychrometric latent energy of the moisture as a gas in the air at given conditions.
[in] | T | Dry bulb temperature, in Celsius |
Returns the psychrometric saturation pressure at given conditions.
[in] | T | Dry bulb temperature, in Celsius |
Returns the psychrometric relative humidity at given conditions.
[in] | Tdb | Dry bulb temperature, in Celsius |
[in] | Rhovapor | Vapor density, in kg/m3 |
Returns the psychrometric relative humidity at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | W | Humidity ratio, in kgWater/kgDryAir |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric density at given conditions.
[in] | pb | Barometric pressure, in Pa |
[in] | tdb | Dry bulb temperature, in Celsius |
[in] | dw | Humidity ratio, in kgWater/kgDryAir |
Returns the psychrometric vapor density at given conditions.
[in] | Tdb | Dry bulb temperature, in Celsius |
[in] | RH | Relative humidity, as a fraction from 0.0 to 1.0 |
Returns the psychrometric vapor density at given conditions.
[in] | Tdb | Dry bulb temperature, in Celsius |
[in] | W | Humidity ratio, in kgWater/kgDryAir |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric dry bulb temperature at given conditions.
[in] | H | Enthalpy, in J/kg |
[in] | W | Humidity ratio, in kgWater/kgDryAir |
Returns the psychrometric dew point temperature at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | TWB | Wet bulb temperature, in Celsius |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric dew point temperature at given conditions.
[in] | W | Humidity ratio, in kgWater/kgDryAir |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric saturation temperature at given conditions.
[in] | H | Enthalpy, in J/kg |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric wet bulb temperature at given conditions.
[in] | Tdb | Dry bulb temperature, in Celsius |
[in] | W | Humidity ratio, in kgWater/kgDryAir |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric specific volume at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | W | Humidity ratio, in kgWater/kgDryAir |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric humidity ratio at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | H | Enthalpy, in J/kg |
Returns the psychrometric humidity ratio at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | RH | Relative humidity ratio, as a fraction from 0.0 to 1.0 |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric humidity ratio at given conditions.
[in] | TDB | Dry bulb temperature, in Celsius |
[in] | TWB | Wet bulb temperature, in Celsius |
[in] | PB | Barometric pressure, in Pascals |
Returns the psychrometric humidity ratio at given conditions.
[in] | TDP | Dew point temperature, in Celsius |
[in] | PB | Barometric pressure, in Pascals |
void refrigerantDelete | ( | Refrigerant | refrigerant | ) |
Deletes an instance of a Refrigerant class.
When an instance of a Refrigerant class is created using refrigerantNew
, it should be cleaned up when totally done with it.
[in] | refrigerant | An instance of a Refrigerant class to be deleted. The Refrigerant class is initially created by calling refrigerantNew . |
Refrigerant refrigerantNew | ( | const char * | refrigerantName | ) |
Returns a new reference to a Refrigerant class.
The refrigerant class allows access to refrigerant properties. Eventually more refrigerant properties will be made available but for now the only refrigerant is pure steam.
[in] | refrigerantName | The name of the refrigerant. Currently the only valid option is "steam". In future versions of the API, the function will accept other refrigerant types. |
refrigerantDelete
to clean up the instance. Real64 refrigerantSaturatedDensity | ( | Refrigerant | refrigerant, |
Real64 | temperature, | ||
Real64 | quality | ||
) |
Returns the refrigerant saturated density for the given Refrigerant instance at the specified temperature and quality.
[in] | refrigerant | An instance of a Refrigerant class, which can be created by calling refrigerantNew . |
[in] | temperature | The refrigerant temperature for property evaluation, in C. |
[in] | quality | The refrigerant quality for property evaluation, in fractional form from 0.0 to 1.0. |
Real64 refrigerantSaturatedEnthalpy | ( | Refrigerant | refrigerant, |
Real64 | temperature, | ||
Real64 | quality | ||
) |
Returns the refrigerant saturated enthalpy for the given Refrigerant instance at the specified temperature and quality.
[in] | refrigerant | An instance of a Refrigerant class, which can be created by calling refrigerantNew . |
[in] | temperature | The refrigerant temperature for property evaluation, in C. |
[in] | quality | The refrigerant quality for property evaluation, in fractional form from 0.0 to 1.0. |
Real64 refrigerantSaturatedSpecificHeat | ( | Refrigerant | refrigerant, |
Real64 | temperature, | ||
Real64 | quality | ||
) |
Returns the refrigerant saturated specific heat for the given Refrigerant instance at the specified temperature and quality.
[in] | refrigerant | An instance of a Refrigerant class, which can be created by calling refrigerantNew . |
[in] | temperature | The refrigerant temperature for property evaluation, in C. |
[in] | quality | The refrigerant quality for property evaluation, in fractional form from 0.0 to 1.0. |
Real64 refrigerantSaturationPressure | ( | Refrigerant | refrigerant, |
Real64 | temperature | ||
) |
Returns the refrigerant saturation pressure for the given Refrigerant instance at the specified temperature.
[in] | refrigerant | An instance of a Refrigerant class, which can be created by calling refrigerantNew . |
[in] | temperature | The refrigerant temperature for property evaluation, in degrees Celsius. |
Real64 refrigerantSaturationTemperature | ( | Refrigerant | refrigerant, |
Real64 | pressure | ||
) |
Returns the refrigerant saturation temperature for the given Refrigerant instance at the specified pressure.
[in] | refrigerant | An instance of a Refrigerant class, which can be created by calling refrigerantNew . |
[in] | pressure | The refrigerant pressure for property evaluation, in Pa. |
void registerErrorCallback | ( | void(*)(const char *errorMessage) | f | ) |
Allows a user to register an error callback function.
If a user script registers a callback function here, then when EnergyPlus is sending an error message to the error file, it will also send it here. The user function will then have the ability to act on the error message if needed.