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 [QuantityDict] -> [QuantityDict] -> [QuantityDict]
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 = (QuantityDict -> QuantityDict) -> [QuantityDict] -> [QuantityDict]
forall a b. (a -> b) -> [a] -> [b]
map QuantityDict -> QuantityDict
forall q. (Quantity q, MayHaveUnit q) => q -> QuantityDict
qw [QuantityDict]
htVars
htOutputs :: [QuantityDict]
htOutputs = (SimpleQDef -> QuantityDict) -> [SimpleQDef] -> [QuantityDict]
forall a b. (a -> b) -> [a] -> [b]
map SimpleQDef -> QuantityDict
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 Maybe Derivation
forall a. Maybe a
Nothing String
"htTransCladCool"--Label
  []--no additional notes

htTransCladCool :: SimpleQDef
htTransCladCool = String
-> NP
-> Sentence
-> Symbol
-> Space
-> UnitDefn
-> Expr
-> SimpleQDef
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 =
  Integer -> Expr
forall r. LiteralC r => Integer -> r
exactDbl Integer
2 Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
coolFilmCond Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$/ (Integer -> Expr
forall r. LiteralC r => Integer -> r
exactDbl Integer
2 Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$+ (QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladThick 
  Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
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 Maybe Derivation
forall a. Maybe a
Nothing String
"htTransCladFuel"--Label
  []--no additional notes

htTransCladFuel :: SimpleQDef
htTransCladFuel = String
-> NP
-> Sentence
-> Symbol
-> Space
-> UnitDefn
-> Expr
-> SimpleQDef
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 = (Integer -> Expr
forall r. LiteralC r => Integer -> r
exactDbl Integer
2 Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
gapFilmCond) Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$/ (Integer -> Expr
forall r. LiteralC r => Integer -> r
exactDbl Integer
2 Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladCond
  Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$+ (QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy QuantityDict
cladThick Expr -> Expr -> Expr
forall r. ExprC r => r -> r -> r
$* QuantityDict -> Expr
forall c. (HasUID c, HasSymbol c) => c -> Expr
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"