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

import Language.Drasil (dccWDS, cnIES, cn, cn', cn'', dcc, Sentence(S),
  UnitDefn, (/:), (*:), (/$), newUnit, makeDerU)

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

heatCapacity :: UnitDefn
heatCapacity :: UnitDefn
heatCapacity = ConceptChunk -> UnitEquation -> UnitDefn
makeDerU (String -> NP -> Sentence -> ConceptChunk
dccWDS "heatCapacity" (String -> NP
cnIES "heat capacity")
  (String -> Sentence
S "heat capacity (constant pressure)")) (UnitDefn
joule UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
centigrade)

heatCapSpec :: UnitDefn --Specific heat capacity
heatCapSpec :: UnitDefn
heatCapSpec = ConceptChunk -> UnitEquation -> UnitDefn
makeDerU (String -> NP -> Sentence -> ConceptChunk
dccWDS "heatCapSpec" (String -> NP
cn' "specific heat")
  (String -> Sentence
S "heat capacity per unit mass")) (UnitDefn
joule UnitDefn -> UnitEquation -> UnitEquation
/$ (UnitDefn
kilogram UnitDefn -> UnitDefn -> UnitEquation
*: UnitDefn
centigrade))

thermalFlux :: UnitDefn
thermalFlux :: UnitDefn
thermalFlux = ConceptChunk -> UnitEquation -> UnitDefn
makeDerU (String -> NP -> Sentence -> ConceptChunk
dccWDS "thermalFlux" (String -> NP
cn'' "heat flux")
  (String -> Sentence
S "the rate of heat energy transfer per unit area")) (UnitDefn
watt UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
m_2)

heatTransferCoef :: UnitDefn
heatTransferCoef :: UnitDefn
heatTransferCoef = String -> UnitEquation -> UnitDefn
newUnit "heat transfer coefficient" (UnitDefn
watt UnitDefn -> UnitEquation -> UnitEquation
/$ (UnitDefn
m_2 UnitDefn -> UnitDefn -> UnitEquation
*: UnitDefn
centigrade))

volHtGenU :: UnitDefn
volHtGenU :: UnitDefn
volHtGenU = ConceptChunk -> UnitEquation -> UnitDefn
makeDerU (String -> NP -> String -> ConceptChunk
dcc "volHtGenU" (String -> NP
cn "volumetric heat generation")
  "the rate of heat energy generation per unit volume") (UnitDefn
watt UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
m_3)