-- | 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 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 (String -> NP -> Sentence -> ConceptChunk
dccWDS 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 (String -> NP -> Sentence -> ConceptChunk
dccWDS 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 (String -> NP -> String -> ConceptChunk
dcc String
"volHtGenU" (String -> NP
cn String
"volumetric heat generation")
  String
"the rate of heat energy generation per unit volume") (UnitDefn
watt UnitDefn -> UnitDefn -> UnitEquation
/: UnitDefn
m_3)