-- | Units related to the field of thermodynamics.
module Data.Drasil.Units.Thermodynamics where

import Language.Drasil (cnIES, cn, cn', cn'',
  UnitDefn, (/:), (*:), (/$), compoundUnit)

import Data.Drasil.SI_Units (centigrade, joule, kilogram, watt, m_2, m_3)

heatCapacity :: UnitDefn
heatCapacity :: UnitDefn
heatCapacity = String -> NP -> String -> UnitEquation -> UnitDefn
compoundUnit String
"heatCapacity" (String -> NP
forall a. String -> NPG a
cnIES String
"heat capacity")
  String
"heat capacity (constant pressure)" (UnitDefn
joule UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
centigrade)

heatCapSpec :: UnitDefn --Specific heat capacity
heatCapSpec :: UnitDefn
heatCapSpec = String -> NP -> String -> UnitEquation -> UnitDefn
compoundUnit String
"heatCapSpec" (String -> NP
forall a. String -> NPG a
cn' String
"specific heat")
  String
"heat capacity per unit mass" (UnitDefn
joule UnitDefn -> UnitEquation -> UnitEquation
/$ (UnitDefn
kilogram UnitDefn -> UnitDefn -> UnitEquation
*: UnitDefn
centigrade))

thermalFlux :: UnitDefn
thermalFlux :: UnitDefn
thermalFlux = String -> NP -> String -> UnitEquation -> UnitDefn
compoundUnit String
"thermalFlux" (String -> NP
forall a. String -> NPG a
cn'' String
"heat flux")
  String
"the rate of heat energy transfer per unit area" (UnitDefn
watt UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
m_2)

heatTransferCoef :: UnitDefn
heatTransferCoef :: UnitDefn
heatTransferCoef = String -> NP -> String -> UnitEquation -> UnitDefn
compoundUnit String
"heat transfer coefficient" (String -> NP
forall a. String -> NPG a
cn' String
"heat transfer coefficient")
  String
"heat transfer coefficient" (UnitDefn
watt UnitDefn -> UnitEquation -> UnitEquation
/$ (UnitDefn
m_2 UnitDefn -> UnitDefn -> UnitEquation
*: UnitDefn
centigrade))

volHtGenU :: UnitDefn
volHtGenU :: UnitDefn
volHtGenU = String -> NP -> String -> UnitEquation -> UnitDefn
compoundUnit String
"volHtGenU" (String -> NP
forall a. String -> NPG a
cn String
"volumetric heat generation")
  String
"the rate of heat energy generation per unit volume" (UnitDefn
watt UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
m_3)