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

import Drasil.Database (mkUid)
import Language.Drasil (cnIES, cn, cn', cn'', Sentence(S),
  UnitDefn, (/:), (*:), (/$), newUnit, makeDerU, cncpt''')

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

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

heatCapSpec :: UnitDefn --Specific heat capacity
heatCapSpec :: UnitDefn
heatCapSpec = ConceptChunk -> UnitEquation -> UnitDefn
makeDerU (UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"heatCapSpec") (String -> NP
cn' String
"specific heat")
  (String -> Sentence
S String
"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 (UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"thermalFlux") (String -> NP
cn'' String
"heat flux")
  (String -> Sentence
S String
"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 String
"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 (UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"volHtGenU") (String -> NP
cn String
"volumetric heat generation")
  (String -> Sentence
S String
"the rate of heat energy generation per unit volume")) (UnitDefn
watt UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
m_3)