new Enthalpy( [units])
Creates a new enthalpy converter.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
units |
number |
<optional> |
The units type identifier, defaults to |
Members
-
:number
units
-
The numeric identifier defining the type of stored units.
The value of this property should equate to
PD.Units.JOULES_PER_KILOGRAM,PD.Units.KILO_JOULES_PER_KILOGRAMandPD.Units.BTU_PER_POUND. Any other value is assumed to be Joules per kilogram.Type
- number
Methods
-
fromBtuPerPound(btu_lb)
-
Converts from Btu per pound to the current units.
Parameters:
Name Type Description btu_lbnumber The value to convert in Btu per pound (Btu/lb).
Returns:
Returns the value converted to the current units.
- Type
- number
-
fromJoulesPerKilogram(J_kg)
-
Converts from Joules per kilogram to the current units.
Parameters:
Name Type Description J_kgnumber The value to convert in Joules per kilogram (J/kg).
Returns:
Returns the value converted to the current units.
- Type
- number
-
fromKiloJoulesPerKilogram(kJ_kg)
-
Converts from kilo-Joules per kilogram to the current units.
Parameters:
Name Type Description kJ_kgnumber The value to convert in kilo-Joules per kilogram (kJ/kg).
Returns:
Returns the value converted to the current units.
- Type
- number
-
getAbbrev()
-
Retrieve the abbreviation of the stored units.
Depending on the current units, this method returns one of the following string values: 'J/kg', 'kJ/kg' or 'Btu/lb'.
Returns:
Returns the abbreviation of the current units.
- Type
- string
-
getName()
-
Retrieve the full name of the stored units.
Depending on the current units, this method returns one of the following string values: 'Joules per Kilogram', 'kilo-Joules per Kilogram' or 'Btu per Pound'.
Returns:
Returns the full name of the current units.
- Type
- string
-
getUnitsId()
-
Retrieves the currently units identifier as a numeric value.
Returns:
Returns the current units identifier.
- Type
- number
-
set(units)
-
Sets the current enthalpy unit and updates conversions.
Parameters:
Name Type Description unitsnumber The new units identifier (
PD.Units.JOULES_PER_KILOGRAM | KILO_JOULES_PER_KILOGRAM | BTU_PER_POUND).Returns:
Returns this Enthalpy object to support method chaining.
- Type
- object
-
toBtuPerPound(value)
-
Converts the given value to Btu per pound (Btu/lb).
Parameters:
Name Type Description valuenumber The value to convert, must be in stored units.
Returns:
Returns the value converted to Btu per pound (Btu/lb).
- Type
- number
-
toJoulesPerKilogram(value)
-
Converts the given value to Joules per kilogram (J/kg).
Parameters:
Name Type Description valuenumber The value to convert, must be in stored units.
Returns:
Returns the value converted to Joules per kilogram (J/kg).
- Type
- number
-
toKiloJoulesPerKilogram(value)
-
Converts the given value to kilo-Joules per kilogram (kJ/kg).
Parameters:
Name Type Description valuenumber The value to convert, must be in stored units.
Returns:
Returns the value converted to kilo-Joules per kilogram (kJ/kg).
- Type
- number
-
convertBtuPerPoundToJoulesPerKilogram(btu_lb) <static>
-
Converts a value in British thermal units per pound (Btu/lb) to Joules per kilogram (J/kg).
Parameters:
Name Type Description btu_lbnumber The value to convert, in British thermal units per pound (Btu/lb).
Returns:
Returns the value converted to Joules per kilogram (J/kg).
- Type
- number
-
convertBtuPerPoundToKiloJoulesPerKilogram(btu_lb) <static>
-
Converts a value in British thermal units per pound (Btu/lb) to kilo-Joules per kilogram (kJ/kg).
Parameters:
Name Type Description btu_lbnumber The value to convert, in British thermal units per pound (Btu/lb).
Returns:
Returns the value converted to kilo-Joules per kilogram (kJ/kg).
- Type
- number
-
convertJoulesPerKilogramToBtuPerPound(j_kg) <static>
-
Converts a value in Joules per kilogram (J/kg) to British thermal units per pound (Btu/lb).
Parameters:
Name Type Description j_kgnumber The value to convert, in Joules per kilogram (J/kg).
Returns:
Returns the value converted to British thermal units per pound (Btu/lb).
- Type
- number
-
convertJoulesPerKilogramToKiloJoulesPerKilogram(J_kg) <static>
-
Converts a value in Joules per kilogram (J/kg) to kilo-Joules per kilogram (kJ/kg).
Parameters:
Name Type Description J_kgnumber The value to convert, in Joules per kilogram (J/kg).
Returns:
Returns the value converted to kilo-Joules per kilogram (kJ/kg).
- Type
- number
-
convertKiloJoulesPerKilogramToBtuPerPound(kj_kg) <static>
-
Converts a value in kilo-Joules per kilogram (kJ/kg) to British thermal units per pound (Btu/lb).
Parameters:
Name Type Description kj_kgnumber The value to convert, in kilo-Joules per kilogram (kJ/kg).
Returns:
Returns the value converted to British thermal units per pound (Btu/lb).
- Type
- number
-
convertKiloJoulesPerKilogramToJoulesPerKilogram(kJ_kg) <static>
-
Converts a value in kilo-Joules per kilogram (kJ/kg) to Joules per kilogram (J/kg).
Parameters:
Name Type Description kJ_kgnumber The value to convert, in kilo-Joules per kilogram (kJ/kg).
Returns:
Returns the value converted to Joules per kilogram (J/kg).
- Type
- number
-
getAbbrev(units) <static>
-
Retrieves the abbreviation of the given enthalpy units.
Based on the given units, this method returns one of the following string values: 'J/kg', 'kJ/kg' or 'Btu/lb'.
Parameters:
Name Type Description unitsnumber The numeric units identifier (
PD.Units.JOULES_PER_KILOGRAM | KILO_JOULES_PER_KILOGRAM | BTU_PER_POUND).Returns:
Returns the abbreviation of the given enthalpy units.
- Type
- string
-
getName(units) <static>
-
Retrieves the name of the given enthalpy units.
Based on the given units, this method returns one of the following string values: 'Joules per Kilogram', 'kilo-Joules per Kilogram' or 'Btu per Pound'.
Parameters:
Name Type Description unitsnumber The numeric units identifier (
PD.Units.JOULES_PER_KILOGRAM | KILO_JOULES_PER_KILOGRAM | BTU_PER_POUND).Returns:
Returns the name of the given enthalpy units.
- Type
- string
-
getUnitsFromAbbrev(abbrev) <static>
-
Retrieves the enthalpy units identifier from the given abbreviation.
Interprets the abbreviations 'J/kg', 'kJ/kg' or 'Btu/lb' into the identifiers
PD.Units.JOULES_PER_KILOGRAM | KILO_JOULES_PER_KILOGRAM | BTU_PER_POUND.Parameters:
Name Type Description abbrevstring The abbreviation of the given enthalpy units.
Returns:
Returns the The numeric units identifier.
- Type
- number