-- | Defines concepts used in the field of thermodynamics.
module Data.Drasil.Concepts.Thermodynamics where

import Language.Drasil
--import Utils.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators
import Drasil.Database (mkUid)

import Data.Drasil.Concepts.Documentation (source, theory)
import Data.Drasil.Concepts.Physics (energy)

-- | Collects all thermodynamics-related concepts.
thermocon :: [ConceptChunk]
thermocon :: [ConceptChunk]
thermocon = [ConceptChunk
boiling, ConceptChunk
degree_', ConceptChunk
enerSrc, ConceptChunk
heat, ConceptChunk
heatTrans, ConceptChunk
htTransTheo,
  ConceptChunk
lawConsEnergy, ConceptChunk
lawConvCooling, ConceptChunk
melting, ConceptChunk
phaseChange, ConceptChunk
thermalAnalysis,
  ConceptChunk
thermalConduction, ConceptChunk
thermalConductor, ConceptChunk
thermalEnergy]

boilPt, boiling, degree_', enerSrc, heat, heatCapSpec, heatTrans, htFlux,
  htTransTheo, latentHeat, lawConsEnergy, lawConvCooling, meltPt, melting,
  phaseChange, sensHeat, temp, thermalAnalysis, thermalConduction,
  thermalConductor, thermalEnergy :: ConceptChunk

-- FIXME: "Boiling" is not a noun. How should we deal with it?
--    Same for "Melting"
boiling :: ConceptChunk
boiling           = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"boiling")           (String -> NP
cn String
"boiling")
                      (String -> Sentence
S String
"the phase change from liquid to vapour")
boilPt :: ConceptChunk
boilPt            = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"boilPt")            (String -> NP
cn' String
"boiling point temperature")
                      (String -> Sentence
S String
"the temperature at which a substance changes from liquid to vapour")
degree_' :: ConceptChunk
degree_'          = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"thermo_degree")     (String -> NP
cn' String
"degree")
                      (String -> Sentence
S String
"a measure of the warmth or coldness of an object or substance")
heat :: ConceptChunk
heat              = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"heat")              (String -> NP
cn String
"heat")
                      (String -> Sentence
S (String
"Noun: The amount of heat energy inside a body. " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"Verb: To transfer thermal energy to a body")) -- FIXME: there shouldn't be two definitions in one
heatTrans :: ConceptChunk
heatTrans         = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"heatTrans")         (String -> NP
cn' String
"heat transfer")
                      (String -> Sentence
S (String
"the generation, use, conversion, and exchange of thermal " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"energy and heat between physical systems"))
heatCapSpec :: ConceptChunk
heatCapSpec       = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"heatCapSpec")       (String -> NP
cnIES String
"specific heat capacity")
                      (String -> Sentence
S (String
"the amount of energy required to raise the temperature " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"of the unit mass of a given substance by a given amount"))
htFlux :: ConceptChunk
htFlux            = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"htFlux")            (String -> NP
cn'' String
"heat flux")
                      (String -> Sentence
S (String
"the rate of thermal energy transfer through a given " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"surface per unit time"))
latentHeat :: ConceptChunk
latentHeat        = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"latentHeat")        (String -> NP
cn' String
"latent heat")
                      (String -> Sentence
S (String
"the heat required to convert a solid into a liquid or " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"vapor, or a liquid into a vapor, without change of temperature"))
lawConsEnergy :: ConceptChunk
lawConsEnergy     = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"lawConsEnergy")     (String -> NP
nounPhraseSP String
"law of conservation of energy")
                      (String -> Sentence
S String
"the law that energy is conserved")
lawConvCooling :: ConceptChunk
lawConvCooling    = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"lawConvCooling")    (String -> NP
nounPhraseSP String
"Newton's law of cooling")
                      (String -> Sentence
S String
"Newton's law of convective cooling")
melting :: ConceptChunk
melting           = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"melting")           (String -> NP
cn String
"melting")
                      (String -> Sentence
S String
"the phase change from solid to liquid")
meltPt :: ConceptChunk
meltPt            = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"meltPt")            (String -> NP
cn' String
"melting point temperature")
                      (String -> Sentence
S String
"the temperature at which a substance changes from solid to liquid")
phaseChange :: ConceptChunk
phaseChange       = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"phaseChange")       (String -> NP
cn' String
"phase change")
                      (String -> Sentence
S String
"a change of state")
sensHeat :: ConceptChunk
sensHeat          = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"sensHeat")          (String -> NP
cn' String
"sensible heat")
                      (String -> Sentence
S (String
"heat exchanged by a body in which the exchange of heat " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"changes the temperature and some macroscopic variables of " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"the body or system, but leaves others unchanged"))
temp :: ConceptChunk
temp              = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"temperature")       (String -> NP
cn' String
"temperature")
                      (String -> Sentence
S String
"the degree or intensity of heat present in a substance or object")
thermalAnalysis :: ConceptChunk
thermalAnalysis   = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"thermalAnalysis")
                      (String -> PluralRule -> NP
cnIP String
"thermal analysis" ((String -> String) -> PluralRule
IrregPlur (\String
x -> String -> String
forall a. HasCallStack => [a] -> [a]
init (String -> String
forall a. HasCallStack => [a] -> [a]
init String
x) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
"es")))
                      (String -> Sentence
S String
"the study of material properties as they change with temperature")
thermalConduction :: ConceptChunk
thermalConduction = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"thermalConduction") (String -> NP
nounPhraseSP String
"thermal conduction")
                      (String -> Sentence
S String
"the transfer of heat energy through a substance")
thermalConductor :: ConceptChunk
thermalConductor  = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"thermalConductor")  (String -> NP
cn' String
"thermal conductor")
                      (String -> Sentence
S String
"an object through which thermal energy can be transferred easily")
thermalEnergy :: ConceptChunk
thermalEnergy     = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"thermalEnergy")     (String -> NP
cnIES String
"thermal energy")
                      (String -> Sentence
S String
"the energy that comes from heat")

enerSrc :: ConceptChunk
enerSrc           = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"enerSrc")     (ConceptChunk -> IdeaDict -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI ConceptChunk
energy IdeaDict
source)
                      (String -> Sentence
S String
"a source from which useful energy can be extracted")
htTransTheo :: ConceptChunk
htTransTheo       = UID -> NP -> Sentence -> ConceptChunk
cncpt''' (String -> UID
mkUid String
"htTransTheo") (ConceptChunk -> IdeaDict -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI ConceptChunk
heatTrans IdeaDict
theory)
                      (String -> Sentence
S (String
"the theory predicting the energy transfer that may take " String -> String -> String
forall a. [a] -> [a] -> [a]
++
                      String
"place between material bodies as a result of temperature difference"))