Functional API¶
-
class
func.
EnergyPlusVersion
[source]¶ Bases:
object
This is the EnergyPlus version. Could also call into the DLL but it’s the same effect.
-
class
func.
Functional
(api: <ctypes.LibraryLoader object at 0x7fdff3d3bb70>, running_as_python_plugin: bool = False)[source]¶ Bases:
object
This API class enables accessing structures and functionality inside EnergyPlus from an outside client. This functional API will be extended over time, but initial targeted functionality includes fluid and refrigerant property methods, and surface and geometry classes and methods.
The Functional API class itself is really just an organizational class that provides access to nested functional classes through member functions. The functional API class is instantiated by the higher level EnergyPlusAPI class, and clients should never attempt to create an instance manually. Instead, create an EnergyPlusAPI instance, and call the functional() member function to create a Functional class instance. For Python Plugin workflows, the EnergyPlusPlugin base class also provides an instance of the Functional base class through the self.functional member variable. Clients should use that directly when needing to make functional calls into the library.
-
callback_error
(f: function) → None[source]¶ This function allows a client to register a function to be called back by EnergyPlus when an error message is added to the error file. The user can then detect specific error messages or whatever.
- Parameters
f – A python function which takes a string (bytes) argument and returns nothing
- Returns
Nothing
-
static
clear_callbacks
() → None[source]¶ This function is only used if you are running this script continually making many calls into the E+ library in one thread, each with many new and different error handler callbacks, and you need to clean up.
Note this will affect all current instances in this thread, so use carefully!
- Returns
Nothing
-
glycol
(glycol_name: str) → func.Glycol[source]¶ Returns a Glycol instance, which allows calculation of glycol properties.
- Parameters
glycol_name – Name of the Glycol, for now only water is allowed
- Returns
An instantiated Glycol structure
-
-
class
func.
Glycol
(api: <ctypes.LibraryLoader object at 0x7fdff3d3bb70>, glycol_name: bytes)[source]¶ Bases:
object
This class provides access to the glycol property calculations inside EnergyPlus. For now, the only glycol name allowed is plain water. This is because other fluids are only initialized when they are declared in the input file. When calling through the API, there is no input file, so no other fluids are declared. This is ripe for a refactor to enable additional fluids, but water will suffice for now.
-
conductivity
(temperature: float) → float[source]¶ Returns the conductivity of the fluid at the specified temperature.
- Parameters
temperature – Fluid temperature, in degrees Celsius
- Returns
The conductivity of the fluid, in W/m-K
-
density
(temperature: float) → float[source]¶ Returns the density of the fluid at the specified temperature.
- Parameters
temperature – Fluid temperature, in degrees Celsius
- Returns
The density of the fluid, in kg/m3
-
-
class
func.
Psychrometrics
(api: <ctypes.LibraryLoader object at 0x7fdff3d3bb70>)[source]¶ Bases:
object
This class provides access to the psychrometric functions within EnergyPlus. Some property calculations are available as functions of different independent variables, and so there are functions with suffixes like vapor_density_b and relative_humidity_c.
-
density
(barometric_pressure: float, dry_bulb_temp: float, humidity_ratio: float) → float[source]¶ Returns the psychrometric density at the specified conditions.
- Parameters
barometric_pressure – Barometric pressure, in Pa
dry_bulb_temp – Psychrometric dry bulb temperature, in C
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
- Returns
-
dew_point
(humidity_ratio: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric dew point temperature at the specified conditions.
- Parameters
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
barometric_pressure – Barometric pressure, in Pa
- Returns
-
dew_point_b
(dry_bulb_temp: float, wet_bulb_temp: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric dew point temperature at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
wet_bulb_temp – Psychrometric wet bulb temperature, in C
barometric_pressure – Barometric pressure, in Pa
- Returns
-
dry_bulb
(enthalpy: float, humidity_ratio: float) → float[source]¶ Returns the psychrometric dry bulb temperature at the specified conditions.
- Parameters
enthalpy – Psychrometric enthalpy, in J/kg
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
- Returns
-
enthalpy
(dry_bulb_temp: float, humidity_ratio: float) → float[source]¶ Returns the psychrometric enthalpy at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
- Returns
-
enthalpy_b
(dry_bulb_temp: float, relative_humidity_fraction: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric enthalpy at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
relative_humidity_fraction – Psychrometric relative humidity, as a fraction from 0.0 to 1.0.
barometric_pressure – Barometric pressure, in Pa
- Returns
-
humidity_ratio
(dry_bulb_temp: float, enthalpy: float) → float[source]¶ Returns the psychrometric humidity ratio at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
enthalpy – Psychrometric enthalpy, in J/kg
- Returns
-
humidity_ratio_b
(dew_point_temp: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric humidity ratio at the specified conditions.
- Parameters
dew_point_temp – Psychrometric dew point temperature, in Celsius
barometric_pressure – Barometric pressure, in Pa
- Returns
-
humidity_ratio_c
(dry_bulb_temp: float, relative_humidity_fraction: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric humidity ratio at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
relative_humidity_fraction – Psychrometric relative humidity, as a fraction from 0.0 to 1.0.
barometric_pressure – Barometric pressure, in Pa
- Returns
-
humidity_ratio_d
(dry_bulb_temp: float, wet_bulb_temp: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric humidity ratio at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
wet_bulb_temp – Psychrometric wet bulb temperature, in C
barometric_pressure – Barometric pressure, in Pa
- Returns
-
latent_energy_of_air
(dry_bulb_temp: float) → float[source]¶ Returns the psychrometric latent energy of air at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
- Returns
-
latent_energy_of_moisture_in_air
(dry_bulb_temp: float) → float[source]¶ Returns the psychrometric latent energy of the moisture in air at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
- Returns
-
relative_humidity
(dry_bulb_temp: float, vapor_density: float) → float[source]¶ Returns the psychrometric relative humidity at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
vapor_density – Psychrometric vapor density, in kg/m3
- Returns
-
relative_humidity_b
(dry_bulb_temp: float, humidity_ratio: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric relative humidity at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
barometric_pressure – Barometric pressure, in Pa
- Returns
-
saturation_pressure
(dry_bulb_temp: float) → float[source]¶ Returns the psychrometric saturation pressure at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
- Returns
-
saturation_temperature
(enthalpy: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric saturation temperature at the specified conditions.
- Parameters
enthalpy – Psychrometric enthalpy, in J/kg
barometric_pressure – Barometric pressure, in Pa
- Returns
-
specific_heat
(humidity_ratio: float) → float[source]¶ Returns the psychrometric specific heat at the specified conditions.
- Parameters
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
- Returns
-
specific_volume
(dry_bulb_temp: float, humidity_ratio: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric specific volume at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
barometric_pressure – Barometric pressure, in Pa
- Returns
-
vapor_density
(dry_bulb_temp: float, humidity_ratio: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric vapor density at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
barometric_pressure – Barometric pressure, in Pa
- Returns
-
vapor_density_b
(dry_bulb_temp: float, relative_humidity_fraction: float) → float[source]¶ Returns the psychrometric vapor density at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
relative_humidity_fraction – Psychrometric relative humidity, as a fraction from 0.0 to 1.0.
- Returns
-
wet_bulb
(dry_bulb_temp: float, humidity_ratio: float, barometric_pressure: float) → float[source]¶ Returns the psychrometric wet bulb temperature at the specified conditions.
- Parameters
dry_bulb_temp – Psychrometric dry bulb temperature, in C
humidity_ratio – Humidity ratio, in kgWater/kgDryAir
barometric_pressure – Barometric pressure, in Pa
- Returns
-
-
class
func.
Refrigerant
(api: <ctypes.LibraryLoader object at 0x7fdff3d3bb70>, refrigerant_name: bytes)[source]¶ Bases:
object
This class provides access to the refrigerant property calculations inside EnergyPlus. For now, the only refrigerant name allowed is steam. This is because other refrigerants are only initialized when they are declared in the input file. When calling through the API, there is no input file, so no other refrigerants are declared. This should be improved through later enhancements, but steam will provide a suitable use case for now.
-
saturated_density
(temperature: float, quality: float) → float[source]¶ Returns the refrigerant density at the specified temperature and quality.
- Parameters
temperature – Refrigerant temperature, in Celsius
quality – Refrigerant quality, in fractional form from 0.0 to 1.0
- Returns
Refrigerant saturated density, in kg/m3
-
saturated_enthalpy
(temperature: float, quality: float) → float[source]¶ Returns the refrigerant saturated enthalpy at the specified temperature and quality.
- Parameters
temperature – Refrigerant temperature, in Celsius
quality – Refrigerant quality, in fractional form from 0.0 to 1.0
- Returns
Refrigerant saturated enthalpy, in J/kg
-
saturated_specific_heat
(temperature: float, quality: float) → float[source]¶ Returns the refrigerant specific heat at the specified temperature and quality.
- Parameters
temperature – Refrigerant temperature, in Celsius
quality – Refrigerant quality, in fractional form from 0.0 to 1.0
- Returns
Refrigerant saturated specific heat, in J/kg-K
-