diff --git a/code/drasil-example/Drasil/SWHS/IMods.hs b/code/drasil-example/Drasil/SWHS/IMods.hs index 112270013a..85eef7d6c4 100644 --- a/code/drasil-example/Drasil/SWHS/IMods.hs +++ b/code/drasil-example/Drasil/SWHS/IMods.hs @@ -8,7 +8,7 @@ import Utils.Drasil import Data.Drasil.SentenceStructures (follows) import Data.Drasil.Utils (unwrap, weave) import Data.Drasil.Concepts.Documentation (assumption, condition, constraint, - goal, solution, term_) + goal, input_, solution, term_) import Data.Drasil.Concepts.Math (area, change, equation, ode, rOfChng, surface) import Data.Drasil.Concepts.PhysicalProperties (liquid, mass, solid, vol) import Data.Drasil.Concepts.Thermodynamics (boilPt, boiling, heat, heatCapSpec, @@ -56,11 +56,12 @@ balWtr_Rel = (deriv (sy temp_W) time) $= 1 / (sy tau_W) * balWtrDesc :: [Sentence] balWtrDesc = map foldlSent [[E (sy temp_PCM) `sIs` S "defined by", makeRef2S eBalanceOnPCM], - [S "The input", phrase constraint, E $ sy temp_init $<= sy temp_C, S "comes from", makeRef2S assumpCTNOD], - [E (sy tau_W) `sIs` S "calculated from" +:+ S "FIXME: Missing DD Issue 1484"], - [E (sy eta) `sIs` S "calculated from" +:+ S "FIXME: Missing DD Issue 1484"], - [S "The initial", plural condition, S "for the" +:+ (getAcc ode `sAre` - E ((apply1Int temp_W 0) $= (apply1Int temp_PCM 0) $= sy temp_init) `follows` assumpSITWP)], + [S "The", phrase input_, phrase constraint, E $ sy temp_init $<= sy temp_C, + S "comes from", makeRef2S assumpCTNOD], + [E (sy tau_W) `sIs` S "calculated from", S "FIXME: Missing DD Issue 1484"], + [E (sy eta) `sIs` S "calculated from", S "FIXME: Missing DD Issue 1484"], + [S "The initial", plural condition, S "for the", getAcc ode `sAre` + E ((apply1Int temp_W 0) $= (apply1Int temp_PCM 0) $= sy temp_init) `follows` assumpSITWP], [S "The", getAcc ode, S "applies as long as the", phrase water `sIs` EmptyS `sIn` phrase liquid, S "form" `sC` (E $ real_interval temp_W (Bounded (Exc,0) (Exc,100))), sParen (unwrap $ getUnit temp_W), S "where", E 0, sParen (unwrap $ getUnit temp_W) `sAnd` @@ -204,7 +205,7 @@ eBalanceOnPCM = im eBalanceOnPCM_rc [qw temp_melt_P, qw time_final, qw temp_init qw pcm_HTC, qw pcm_mass, qw htCap_S_P, qw htCap_L_P] [sy temp_init $< sy temp_melt_P] (qw temp_PCM) [0 $<= sy time $<= sy time_final] [makeCite koothoor2013] eBalanceOnPCMDeriv - "eBalanceOnPCM" [balPCMDesc_note] + "eBalanceOnPCM" balPCMDescNotes eBalanceOnPCM_rc :: RelationConcept eBalanceOnPCM_rc = makeRC "eBalanceOnPCM_rc" (nounPhraseSP @@ -234,36 +235,20 @@ balPCMDesc = foldlSent [(E $ sy temp_W) `isThe` phrase temp_W +:+. sParen (unwrap $ getUnit tau_S_P), sParen (makeRef2S ddBalanceLiquidPCM)] -balPCMDesc_note :: Sentence -balPCMDesc_note = foldlSent [ - (E (sy temp_melt_P)) `sC` (E (sy time_final)) `sC` (E (sy temp_init)) `sC` - (E (sy pcm_HTC)) `sC` (E (sy pcm_mass)) `sC` (E (sy htCap_S_P)) `sC` - (E (sy htCap_S_P)), S "form" +:+. sParen (makeRef2S eBalanceOnWtr), - S "The input is constrained so that", (E (sy temp_init $< sy temp_melt_P)), - sParen (makeRef2S assumpPIS), - (E (sy temp_PCM)) `sC` (E (0 $< sy time $< sy time_final)) `sC` - (S "with initial conditions") - `sC` (E (sy temp_W $= sy temp_PCM $= sy temp_init)) `sC` - (S "FIXME t_w(0) = t_p(0)") `sC` - makeRef2S assumpSITWP `sC` (S "and"), (E (sy temp_W)), - S "from", (makeRef2S eBalanceOnWtr) `sC` - S "such that the following governing" +:+. getAcc ode `sIs` S "satisfied", - S "The temperature remains constant at", - (E (sy temp_melt_P)) `sC` - (S "even with the heating (or cool-ing), until the phase change has occurred for all of the material; that is as long as"), - (E (0 $< sy melt_frac $< 1)), S "(from", makeRef2S dd4MeltFrac, - S ") is determined as part of the heat energy in the PCM, as given in" +:+. - sParen (makeRef2S heatEInPCM), - -- Addition based on smiths manual version. - (E $ (sy tau_S_P) $= ((sy pcm_mass) * (sy htCap_S_P)) / - ((sy pcm_HTC) * (sy pcm_SA))), S "is a constant", - sParen (unwrap $ getUnit tau_S_P) +:+. - sParen (makeRef2S ddBalanceSolidPCM), - - (E $ (sy tau_L_P) $= ((sy pcm_mass) * (sy htCap_L_P)) / - ((sy pcm_HTC) * (sy pcm_SA))), S "is a constant", - sParen (unwrap $ getUnit tau_L_P), - sParen (makeRef2S ddBalanceLiquidPCM)] +balPCMDescNotes :: [Sentence] +balPCMDescNotes = map foldlSent [ + [E (sy temp_W) `sIs` S "defined by", makeRef2S eBalanceOnWtr], + [S "The", phrase input_, phrase constraint, E $ sy temp_init $<= sy temp_melt_P, + S "comes from", makeRef2S assumpPIS], + [S "The", phrase temp, S "remains constant at", (E $ sy temp_melt_P) `sC` + S "even with the heating", sParen (S "or cooling") `sC` S "until the", + phrase phaseChange, S "has occurred for all" `sOf` S "the material; that" `sIs` + S "as long as" +:+. E (0 $< sy melt_frac $< 1), E $ sy melt_frac, + sParen (S "from" +:+ makeRef2S dd4MeltFrac) `sIs` + S "determined as part" `sOf` S "the", phrase heat, phrase energy `sIn` + S "the", getAcc phsChgMtrl `sC` S "as given" `sIn` sParen (makeRef2S heatEInPCM)], + [E (sy tau_S_P) `sIs` S "calculated" `sIn` makeRef2S ddBalanceSolidPCM], + [E (sy tau_L_P) `sIs` S "calculated" `sIn` makeRef2S ddBalanceLiquidPCM]] ---------------------------------------------- -- Derivation of eBalanceOnPCM -- diff --git a/code/stable/swhs/SRS/SWHS_SRS.tex b/code/stable/swhs/SRS/SWHS_SRS.tex index 5b0f6c39af..cdc058fb61 100644 --- a/code/stable/swhs/SRS/SWHS_SRS.tex +++ b/code/stable/swhs/SRS/SWHS_SRS.tex @@ -353,7 +353,7 @@ \subsubsection{Assumptions} \item[Temp-Heating-Coil-Constant-over-Length:\phantomsection\label{assumpTHCCoL}]The temperature of the heating coil does not vary along its length. \hyperref[likeChgTCVOL]{LC: Temperature-Coil-Variable-Over-Length} \hyperref[DD:ht.flux.C]{DD: ht\_flux\_C} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}. \item[Law-Convective-Cooling-Water-PCM:\phantomsection\label{assumpLCCWP}]Newton's law of convective cooling applies between the water and the PCM. \hyperref[DD:ht.flux.P]{DD: ht\_flux\_P}. \item[Charging-Tank-No-Temp-Discharge:\phantomsection\label{assumpCTNOD}]The model only accounts for charging of the tank, not discharging. The temperature of the water and temperature of the phase change material can only increase, or remain constant; they do not decrease. This implies that the initial temperature \hyperref[assumpSITWP]{A: Same-Initial-Temp-Water-PCM} is less than (or equal) to the temperature of the heating coil. \hyperref[likeChgDT]{LC: Discharging-Tank} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}. -\item[Same-Initial-Temp-Water-PCM:\phantomsection\label{assumpSITWP}]The initial temperature of the water and the PCM is the same. \hyperref[likeChgDITPW]{LC: Different-Initial-Temps-PCM-Water} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM} \hyperref[assumpCTNOD]{A: Charging-Tank-No-Temp-Discharge}. +\item[Same-Initial-Temp-Water-PCM:\phantomsection\label{assumpSITWP}]The initial temperature of the water and the PCM is the same. \hyperref[likeChgDITPW]{LC: Different-Initial-Temps-PCM-Water} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} \hyperref[assumpCTNOD]{A: Charging-Tank-No-Temp-Discharge}. \item[PCM-Initially-Solid:\phantomsection\label{assumpPIS}]The simulation will start with the PCM in a solid state. \hyperref[IM:heatEInPCM]{IM: heatEInPCM} \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM}. \item[Water-Always-Liquid:\phantomsection\label{assumpWAL}]The operating temperature range of the system is such that the water is always in liquid state. That is, the temperature will not drop below the melting point temperature of water, or rise above its boiling point temperature. \hyperref[unlikeChgWPFS]{UC: Water-PCM-Fixed-States} \hyperref[IM:heatEInWtr]{IM: heatEInWtr} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}. \item[Perfect-Insulation-Tank:\phantomsection\label{assumpPIT}]The tank is perfectly insulated so that there is no heat loss from the tank. \hyperref[likeChgTLH]{LC: Tank-Lose-Heat} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}. @@ -793,7 +793,7 @@ \subsubsection{Instance Models} \\ \midrule \\ Source & \cite{koothoor2013} \\ \midrule \\ -RefBy & \hyperref[unlikeChgNIHG]{UC: No-Internal-Heat-Generation} \hyperref[outputInputDerivQuants]{FR: Output-Input-Derived-Quantities} \hyperref[outputInputDerivQuants]{FR: Output-Input-Derived-Quantities} \hyperref[findMass]{FR: Find-Mass} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM} \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM} \hyperref[calcTempWtrOverTime]{FR: Calculate-Temperature-Water-Over-Time}. +RefBy & \hyperref[unlikeChgNIHG]{UC: No-Internal-Heat-Generation} \hyperref[outputInputDerivQuants]{FR: Output-Input-Derived-Quantities} \hyperref[outputInputDerivQuants]{FR: Output-Input-Derived-Quantities} \hyperref[findMass]{FR: Find-Mass} \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM} \hyperref[calcTempWtrOverTime]{FR: Calculate-Temperature-Water-Over-Time}. \\ \bottomrule \end{tabular} \end{minipage} Derivation of the energy balance on water: @@ -865,7 +865,11 @@ \subsubsection{Instance Models} \item{$ϕ$ is the melt fraction (Unitless)} \end{symbDescription} \\ \midrule \\ -Notes & ${{T_{melt}}^{P}}$, ${t_{final}}$, ${T_{init}}$, ${h_{P}}$, ${m_{P}}$, ${{C_{P}}^{S}}$, ${{C_{P}}^{S}}$ form (\hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}). The input is constrained so that ${T_{init}}<{{T_{melt}}^{P}}$ (\hyperref[assumpPIS]{A: PCM-Initially-Solid}) ${T_{P}}$, $0Assumptions

-Same-Initial-Temp-Water-PCM: The initial temperature of the water and the PCM is the same. LC: Different-Initial-Temps-PCM-Water IM: eBalanceOnWtr IM: eBalanceOnPCM A: Charging-Tank-No-Temp-Discharge. +Same-Initial-Temp-Water-PCM: The initial temperature of the water and the PCM is the same. LC: Different-Initial-Temps-PCM-Water IM: eBalanceOnWtr A: Charging-Tank-No-Temp-Discharge.

@@ -1741,7 +1741,7 @@

Instance Models

RefBy

-UC: No-Internal-Heat-Generation FR: Output-Input-Derived-Quantities FR: Output-Input-Derived-Quantities FR: Find-Mass IM: eBalanceOnWtr IM: eBalanceOnPCM IM: eBalanceOnPCM FR: Calculate-Temperature-Water-Over-Time. +UC: No-Internal-Heat-Generation FR: Output-Input-Derived-Quantities FR: Output-Input-Derived-Quantities FR: Find-Mass IM: eBalanceOnWtr IM: eBalanceOnPCM FR: Calculate-Temperature-Water-Over-Time.

@@ -1977,21 +1977,19 @@

Instance Models

Notes

-TmeltP, tfinal, Tinit, hP, mP, CPS, CPS form (IM: eBalanceOnWtr). The input is constrained so that Tinit < TmeltP (A: PCM-Initially-Solid) TP, 0 < t < tfinal, with initial conditions, TW = TP = Tinit, FIXME t_w(0) = t_p(0), A: Same-Initial-Temp-Water-PCM, and TW from IM: eBalanceOnWtr, such that the following governing ODE. is satisfied The temperature remains constant at TmeltP, even with the heating (or cool-ing), until the phase change has occurred for all of the material; that is as long as 0 < ϕ < 1 (from DD: melt_frac ) is determined as part of the heat energy in the PCM, as given in (IM: heatEInPCM). τPS =

- - mP CPS - - - hP AP - -
is a constant (s) (DD: balanceSolidPCM). τPL =
- - mP CPL - - - hP AP - -
is a constant (s) (DD: balanceLiquidPCM). +TW is defined by IM: eBalanceOnWtr. +

+

+The input constraint Tinit ≤ TmeltP comes from A: PCM-Initially-Solid. +

+

+The temperature remains constant at TmeltP, even with the heating (or cooling), until the phase change has occurred for all of the material; that is as long as 0 < ϕ < 1. ϕ (from DD: melt_frac) is determined as part of the heat energy in the PCM, as given in (IM: heatEInPCM). +

+

+τPS is calculated in DD: balanceSolidPCM. +

+

+τPL is calculated in DD: balanceLiquidPCM.

@@ -3410,7 +3408,7 @@

Traceability Matrices and Graphs

-X + X