-- | 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 Data.Drasil.Concepts.Documentation (source, theory)
import Data.Drasil.Concepts.Physics (energy)

-- | Collects all thermodynamics-related concepts.
thermocon :: [ConceptChunk]
thermocon :: [ConceptChunk]
thermocon = [ConceptChunk
boilPt, ConceptChunk
boiling, ConceptChunk
degree_', ConceptChunk
enerSrc, ConceptChunk
heat, ConceptChunk
heatCapSpec, ConceptChunk
heatTrans,
  ConceptChunk
htFlux, ConceptChunk
htTransTheo, ConceptChunk
latentHeat, ConceptChunk
lawConsEnergy, ConceptChunk
lawConvCooling, ConceptChunk
meltPt,
  ConceptChunk
melting, ConceptChunk
phaseChange, ConceptChunk
sensHeat, ConceptChunk
temp, 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           = String -> NP -> String -> ConceptChunk
dcc String
"boiling"           (String -> NP
cn String
"boiling")
                      String
"the phase change from liquid to vapour"
boilPt :: ConceptChunk
boilPt            = String -> NP -> String -> ConceptChunk
dcc String
"boilPt"           (String -> NP
cn' String
"boiling point temperature")
                      String
"the temperature at which a substance changes from liquid to vapour"
degree_' :: ConceptChunk
degree_'          = String -> NP -> String -> ConceptChunk
dcc String
"degree"            (String -> NP
cn' String
"degree")
                      String
"a measure of the warmth or coldness of an object or substance"
heat :: ConceptChunk
heat              = String -> NP -> String -> ConceptChunk
dcc String
"heat"              (String -> NP
cn String
"heat")
                      (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         = String -> NP -> String -> ConceptChunk
dcc String
"heatTrans"         (String -> NP
cn' String
"heat transfer")
                      (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       = String -> NP -> String -> ConceptChunk
dcc String
"heatCapSpec"       (String -> NP
cnIES String
"specific heat capacity")
                      (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            = String -> NP -> String -> ConceptChunk
dcc String
"htFlux"            (String -> NP
cn'' String
"heat flux") 
                      (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        = String -> NP -> String -> ConceptChunk
dcc String
"latentHeat"        (String -> NP
cn' String
"latent heat")
                      (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     = String -> NP -> String -> ConceptChunk
dcc String
"lawConsEnergy"     (String -> NP
nounPhraseSP String
"law of conservation of energy")
                      String
"the law that energy is conserved"
lawConvCooling :: ConceptChunk
lawConvCooling    = String -> NP -> String -> ConceptChunk
dcc String
"lawConvCooling"    (String -> NP
nounPhraseSP String
"Newton's law of cooling")
                      String
"Newton's law of convective cooling"
melting :: ConceptChunk
melting           = String -> NP -> String -> ConceptChunk
dcc String
"melting"           (String -> NP
cn String
"melting")
                      String
"the phase change from solid to liquid"
meltPt :: ConceptChunk
meltPt            = String -> NP -> String -> ConceptChunk
dcc String
"meltPt"            (String -> NP
cn' String
"melting point temperature")
                      String
"the temperature at which a substance changes from liquid to vapour"
phaseChange :: ConceptChunk
phaseChange       = String -> NP -> String -> ConceptChunk
dcc String
"phaseChange"       (String -> NP
cn' String
"phase change")
                      String
"a change of state"
sensHeat :: ConceptChunk
sensHeat          = String -> NP -> String -> ConceptChunk
dcc String
"sensHeat"          (String -> NP
cn' String
"sensible heat")
                      (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              = String -> NP -> String -> ConceptChunk
dcc String
"temperature"       (String -> NP
cn' String
"temperature")
                      String
"the degree or intensity of heat present in a substance or object"
thermalAnalysis :: ConceptChunk
thermalAnalysis   = String -> NP -> String -> ConceptChunk
dcc 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
"the study of material properties as they change with temperature"
thermalConduction :: ConceptChunk
thermalConduction = String -> NP -> String -> ConceptChunk
dcc String
"thermalConduction" (String -> NP
nounPhraseSP String
"thermal conduction")
                      String
"the transfer of heat energy through a substance"
thermalConductor :: ConceptChunk
thermalConductor  = String -> NP -> String -> ConceptChunk
dcc String
"thermalConductor"  (String -> NP
cn' String
"thermal conductor")
                      String
"an object through which thermal energy can be transferred easily"
thermalEnergy :: ConceptChunk
thermalEnergy     = String -> NP -> String -> ConceptChunk
dcc String
"thermalEnergy"     (String -> NP
cnIES String
"thermal energy")
                      String
"the energy that comes from heat"

enerSrc :: ConceptChunk
enerSrc           = String -> NP -> String -> ConceptChunk
dcc String
"enerSrc"     (ConceptChunk -> IdeaDict -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI ConceptChunk
energy IdeaDict
source)
                      String
"a source from which useful energy can be extracted"
htTransTheo :: ConceptChunk
htTransTheo       = String -> NP -> String -> ConceptChunk
dcc String
"htTransTheo" (ConceptChunk -> IdeaDict -> NP
forall c d. (NamedIdea c, NamedIdea d) => c -> d -> NP
combineNINI ConceptChunk
heatTrans IdeaDict
theory)
                      (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")