module Drasil.HGHC.HeatTransfer where --whole file is used

import Language.Drasil
import Language.Drasil.ShortHands
import Theory.Drasil (DataDefinition, ddENoRefs)

import Data.Drasil.Units.Thermodynamics (heatTransferCoef)

{--}

symbols :: [QuantityDict]
symbols :: [QuantityDict]
symbols = [QuantityDict]
htOutputs forall a. [a] -> [a] -> [a]
++ [QuantityDict]
htInputs

dataDefs :: [DataDefinition]
dataDefs :: [DataDefinition]
dataDefs = [DataDefinition
htTransCladFuelDD, DataDefinition
htTransCladCoolDD]

qDefs :: [SimpleQDef]
qDefs :: [SimpleQDef]
qDefs = [SimpleQDef
htTransCladFuel, SimpleQDef
htTransCladCool]

htVars :: [QuantityDict]
htVars :: [QuantityDict]
htVars = [QuantityDict
cladThick, QuantityDict
coolFilmCond, QuantityDict
gapFilmCond, QuantityDict
cladCond]

htInputs, htOutputs :: [QuantityDict]
htInputs :: [QuantityDict]
htInputs = forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [QuantityDict]
htVars
htOutputs :: [QuantityDict]
htOutputs = forall a b. (a -> b) -> [a] -> [b]
map forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [SimpleQDef]
qDefs

cladThick, coolFilmCond, gapFilmCond, cladCond :: QuantityDict
cladThick :: QuantityDict
cladThick    = String -> NP -> Symbol -> Space -> QuantityDict
vc String
"cladThick"    (String -> NP
cn''' String
"clad thickness")
  (Symbol -> Symbol -> Symbol
sub Symbol
lTau Symbol
lClad) Space
Real
coolFilmCond :: QuantityDict
coolFilmCond = String -> NP -> Symbol -> Space -> QuantityDict
vc String
"coolFilmCond" (String -> NP
cn' String
"initial coolant film conductance")
  (Symbol -> Symbol -> Symbol
sub Symbol
lH Symbol
lCoolant) Space
Real
gapFilmCond :: QuantityDict
gapFilmCond  = String -> NP -> Symbol -> Space -> QuantityDict
vc String
"gapFilmCond"  (String -> NP
cn' String
"initial gap film conductance")
  (Symbol -> Symbol -> Symbol
sub Symbol
lH Symbol
lGap) Space
Real
cladCond :: QuantityDict
cladCond     = String -> NP -> Symbol -> Space -> QuantityDict
vc String
"cladCond"     (String -> NP
cnIES String
"clad conductivity") (Symbol -> Symbol -> Symbol
sub Symbol
lK Symbol
lClad) Space
Real

htTransCladCoolEq, htTransCladFuelEq :: Expr
htTransCladCool, htTransCladFuel :: SimpleQDef

---

htTransCladCoolDD :: DataDefinition
htTransCladCoolDD :: DataDefinition
htTransCladCoolDD = SimpleQDef
-> Maybe Derivation -> String -> [Sentence] -> DataDefinition
ddENoRefs SimpleQDef
htTransCladCool forall a. Maybe a
Nothing String
"htTransCladCool"--Label
  []--no additional notes

htTransCladCool :: SimpleQDef
htTransCladCool = forall u e.
IsUnit u =>
String
-> NP -> Sentence -> Symbol -> Space -> u -> e -> QDefinition e
fromEqn String
"htTransCladCool" (String -> NP
nounPhraseSP
  String
"convective heat transfer coefficient between clad and coolant")
  Sentence
EmptyS (Symbol -> Symbol -> Symbol
sub Symbol
lH Symbol
lClad) Space
Real UnitDefn
heatTransferCoef Expr
htTransCladCoolEq

htTransCladCoolEq :: Expr
htTransCladCoolEq =
  forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
coolFilmCond forall r. ExprC r => r -> r -> r
$/ (forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond forall r. ExprC r => r -> r -> r
`addRe` (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladThick 
  forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
coolFilmCond))

---

htTransCladFuelDD :: DataDefinition
htTransCladFuelDD :: DataDefinition
htTransCladFuelDD = SimpleQDef
-> Maybe Derivation -> String -> [Sentence] -> DataDefinition
ddENoRefs SimpleQDef
htTransCladFuel forall a. Maybe a
Nothing String
"htTransCladFuel"--Label
  []--no additional notes

htTransCladFuel :: SimpleQDef
htTransCladFuel = forall u e.
IsUnit u =>
String
-> NP -> Sentence -> Symbol -> Space -> u -> e -> QDefinition e
fromEqn String
"htTransCladFuel" (String -> NP
nounPhraseSP
  String
"effective heat transfer coefficient between clad and fuel surface")
  Sentence
EmptyS (Symbol -> Symbol -> Symbol
sub Symbol
lH Symbol
lEffective) Space
Real UnitDefn
heatTransferCoef Expr
htTransCladFuelEq

htTransCladFuelEq :: Expr
htTransCladFuelEq = (forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
gapFilmCond) forall r. ExprC r => r -> r -> r
$/ (forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond
  forall r. ExprC r => r -> r -> r
`addRe` (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladThick forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
gapFilmCond))

---

hghc :: CI
hghc :: CI
hghc = String -> NP -> String -> [UID] -> CI
commonIdea String
"hghc" (String -> NP
cn String
"HGHC") String
"HGHC" []

nuclearPhys, fp :: IdeaDict
nuclearPhys :: IdeaDict
nuclearPhys = String -> NP -> IdeaDict
nc String
"nuclearPhys" (String -> NP
nounPhraseSP String
"nuclear physics")
fp :: IdeaDict
fp = String -> NP -> IdeaDict
nc String
"fp" (String -> NP
cn String
"FP")

lCoolant, lClad, lEffective, lGap :: Symbol
lCoolant :: Symbol
lCoolant   = String -> Symbol
label String
"b"
lClad :: Symbol
lClad      = String -> Symbol
label String
"c"
lEffective :: Symbol
lEffective = String -> Symbol
label String
"g"
lGap :: Symbol
lGap       = String -> Symbol
label String
"p"