Documentation
¶
Overview ¶
Package units contains float64 wrappers with unit semantics relevant to the CX34 heat pump (flow rate, temperature, etc).
Index ¶
Constants ¶
const ( CubicMeter = underlying.CubicMeter Liter = underlying.Liter )
Volume values.
const Ampere = underlying.Ampere
const (
Kilogram = underlying.Kilogram
)
Mass values.
const Volt = underlying.Volt
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoefficientOfPerformance ¶
type CoefficientOfPerformance float64
CoefficientOfPerformance is the ratio of useful heat supplied or removed from the water stream divided by the amount of electrical energy energy being used by the heat pump.
func (CoefficientOfPerformance) Float64 ¶
func (s CoefficientOfPerformance) Float64() float64
Float64 returns the COP as a floating point number.
type Density ¶
type Density float64
Density is a the density of a material (mass/volume).
The materialized value is kg/m^3.
func DensityFromRatio ¶
DensityFromRatio returns a density value that is the ratio of a given mass and volume.
func (Density) TimesVolume ¶
TimesVolume returns the mass taken up by a given volume of material with density p.
type FlowRate ¶
type FlowRate float64
FlowRate is measured in units of volume over duration, such as liters per minute. The materialized value is liters/minute.
func (FlowRate) LitersPerMinute ¶
LitersPerMinute returns the flow rate in liters per minute as a float64.
func (FlowRate) LitersPerSecond ¶
LitersPerSecond returns the flow rate in liters per minute as a float64.
type Power ¶
type Power = underlying.Power
Power represents energy over time.
const ( Watt Power = underlying.Watt Kilowatt Power = underlying.Kilowatt )
Power constants.
func PowerFromIV ¶
PowerFromIV multiples current and voltage to get power.
type PumpSpeed ¶
type PumpSpeed uint8
PumpSpeed is the speed of the pump. The value should be between 0 (for off) and 10 (for 100% on).
type SpecificHeat ¶
type SpecificHeat float64
SpecificHeat is measured in kJ/(kg * K).
const KilojoulePerKilogramKelvin SpecificHeat = 1
KilojoulePerKilogramKelvin is the standard unit used for recording specific heat in tables.
func (SpecificHeat) KilojoulesPerKilogramKelvin ¶
func (sh SpecificHeat) KilojoulesPerKilogramKelvin() float64
KilojoulesPerKilogramKelvin returns the specific heat in kJ/(kg * Kelvin).
func (SpecificHeat) Scale ¶
func (sh SpecificHeat) Scale(f float64) SpecificHeat
Scale scales the specific heat value by a multiplier.
func (SpecificHeat) TimesMassDeltaTemp ¶
func (sh SpecificHeat) TimesMassDeltaTemp(m Mass, t Temperature) Energy
TimesMassDeltaTemp multiplies the specific heat value by mass and delta T to arrive at an energy value.
type Temperature ¶
type Temperature = underlying.Temperature
Temperature contains a temperature value in kelvin.
func FromCelsius ¶
func FromCelsius(t float64) Temperature
FromCelsius returns a temperature from a value in degrees celcius.