Skip to content

Commit

Permalink
Added Notes of new GDs; closes #1479
Browse files Browse the repository at this point in the history
  • Loading branch information
samm82 committed Aug 12, 2019
1 parent 8c16b32 commit e4bb4f5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 28 deletions.
20 changes: 14 additions & 6 deletions code/drasil-example/Drasil/SWHS/GenDefs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ import Utils.Drasil
import Control.Lens ((^.))

import Data.Drasil.Concepts.Math (rOfChng, unit_)
import Data.Drasil.Concepts.Thermodynamics (lawConvCooling)

import Data.Drasil.Quantities.Math (uNormalVect, surface, gradient)
import Data.Drasil.Quantities.PhysicalProperties as QPP (vol, mass, density)
import Data.Drasil.Quantities.Physics as QP (time)
import Data.Drasil.Quantities.Thermodynamics as QT (heatCapSpec, temp)

import Drasil.SWHS.Assumptions (assumpCWTAT, assumpLCCCW, assumpTPCAV,
assumpDWPCoV, assumpSHECoV, assumpTHCCoT)
import Drasil.SWHS.Concepts (gaussDiv)
import Drasil.SWHS.Assumptions (assumpCWTAT, assumpLCCCW, assumpLCCWP,
assumpTPCAV, assumpDWPCoV, assumpSHECoV, assumpTHCCoT)
import Drasil.SWHS.Concepts (coil, gaussDiv, phaseChangeMaterial)
import Drasil.SWHS.References (koothoor2013)
import Drasil.SWHS.TMods (consThermE)
import Drasil.SWHS.TMods (consThermE, nwtnCooling)
import Drasil.SWHS.Unitals (coilHTC, htFluxC, htFluxIn, htFluxOut, htFluxP,
inSA, outSA, pcmHTC, tempC, tempPCM, tempW, thFluxVect, volHtGen)

Expand Down Expand Up @@ -53,7 +54,7 @@ rocTempSimpRel = sy QPP.mass * sy QT.heatCapSpec *
htFluxWaterFromCoil :: GenDefn
htFluxWaterFromCoil = gd htFluxWaterFromCoilRC (getUnit htFluxC) Nothing
[makeCite koothoor2013] "htFluxWaterFromCoil"
[makeRef2S assumpLCCCW, makeRef2S assumpTHCCoT]
[newtonLawNote htFluxC assumpLCCCW coil, makeRef2S assumpTHCCoT]

htFluxWaterFromCoilRC :: RelationConcept
htFluxWaterFromCoilRC = makeRC "htFluxWaterFromCoilRC" (htFluxC ^. term)
Expand All @@ -67,7 +68,8 @@ htFluxWaterFromCoilRel = sy htFluxC $= sy coilHTC * (sy tempC - apply1 tempW tim

htFluxPCMFromWater :: GenDefn
htFluxPCMFromWater = gd htFluxPCMFromWaterRC (getUnit htFluxP) Nothing
[makeCite koothoor2013] "htFluxPCMFromWater" [makeRef2S assumpLCCCW]
[makeCite koothoor2013] "htFluxPCMFromWater"
[newtonLawNote htFluxP assumpLCCWP phaseChangeMaterial]

htFluxPCMFromWaterRC :: RelationConcept
htFluxPCMFromWaterRC = makeRC "htFluxPCMFromWaterRC" (htFluxP ^. term)
Expand All @@ -76,6 +78,12 @@ htFluxPCMFromWaterRC = makeRC "htFluxPCMFromWaterRC" (htFluxP ^. term)
htFluxPCMFromWaterRel :: Relation
htFluxPCMFromWaterRel = sy htFluxP $= sy pcmHTC * (apply1 tempW time - apply1 tempPCM time)

newtonLawNote :: UnitalChunk -> ConceptInstance -> ConceptChunk -> Sentence
newtonLawNote u a c = foldlSent [ch u `sIs` S "found by assuming that",
phrase lawConvCooling, S "applies" +:+. sParen (makeRef2S a), S "This law",
sParen (S "defined" `sIn` makeRef2S nwtnCooling) `sIs` S "used on",
phrase surface `ofThe` phrase c]

--------------------------------------
-- General Definitions Derivation --
--------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions code/stable/nopcm/SRS/NoPCM_SRS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ \subsubsection{Theoretical Models}
Source & \cite[(pg. 8)]{incroperaEtAl2007}

\\ \midrule \\
RefBy &
RefBy & \hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil}

\\ \bottomrule
\end{tabular}
\end{minipage}
Expand Down Expand Up @@ -523,7 +524,7 @@ \subsubsection{General Definitions}
\item{$t$ is the time (s)}
\end{symbDescription}
\\ \midrule \\
Notes & \hyperref[assumpLCCCW]{A: Newton-Law-Convective-Cooling-Coil-Water}
Notes & ${q_{\text{C}}}$ is found by assuming that Newton's law of cooling applies (\hyperref[assumpLCCCW]{A: Newton-Law-Convective-Cooling-Coil-Water}). This law (defined in \hyperref[TM:nwtnCooling]{TM: nwtnCooling}) is used on the surface of the heating coil.

\hyperref[assumpTHCCoT]{A: Temp-Heating-Coil-Constant-over-Time}

Expand Down Expand Up @@ -919,7 +920,7 @@ \section{Traceability Matrices and Graphs}
\\
\hyperref[GD:rocTempSimp]{GD: rocTempSimp} & & X & & & X & & &
\\
\hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} & & & & & & & &
\hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} & & & & X & & & &
\\
\hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} & X & & & & X & X & &
\\
Expand Down
10 changes: 7 additions & 3 deletions code/stable/nopcm/Website/NoPCM_SRS.html
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,11 @@ <h3>Theoretical Models</h3>
</tr>
<tr>
<th>RefBy</th>
<td><p class="paragraph"></p></td>
<td>
<p class="paragraph">
<a href=#GD:htFluxWaterFromCoil>GD: htFluxWaterFromCoil</a>
</p>
</td>
</tr>
</table>
</div>
Expand Down Expand Up @@ -1008,7 +1012,7 @@ <h4>
<th>Notes</th>
<td>
<p class="paragraph">
<a href=#assumpLCCCW>A: Newton-Law-Convective-Cooling-Coil-Water</a>
<em>q<sub>C</sub></em> is found by assuming that Newton's law of cooling applies (<a href=#assumpLCCCW>A: Newton-Law-Convective-Cooling-Coil-Water</a>). This law (defined in <a href=#TM:nwtnCooling>TM: nwtnCooling</a>) is used on the surface of the heating coil.
</p>
<p class="paragraph">
<a href=#assumpTHCCoT>A: Temp-Heating-Coil-Constant-over-Time</a>
Expand Down Expand Up @@ -2267,7 +2271,7 @@ <h1>Traceability Matrices and Graphs</h1>
<td></td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
Expand Down
17 changes: 9 additions & 8 deletions code/stable/swhs/SRS/SWHS_SRS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ \subsubsection{Assumptions}
\item[Temp-PCM-Constant-Across-Volume:\phantomsection\label{assumpTPCAV}]{The temperature of the phase change material is the same throughout the volume of PCM. (RefBy: \hyperref[GD:rocTempSimp]{GD: rocTempSimp}, \hyperref[likeChgUTP]{LC: Uniform-Temperature-PCM}, \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}, and \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM}.)}
\item[Density-Water-PCM-Constant-over-Volume:\phantomsection\label{assumpDWPCoV}]{The density of water and density of PCM have no spatial variation; that is, they are each constant over their entire volume. (RefBy: \hyperref[GD:rocTempSimp]{GD: rocTempSimp}.)}
\item[Specific-Heat-Energy-Constant-over-Volume:\phantomsection\label{assumpSHECov}]{The specific heat capacity of water, specific heat capacity of PCM as a solid, and specific heat capacity of PCM as a liquid have no spatial variation; that is, they are each constant over their entire volume. (RefBy: \hyperref[GD:rocTempSimp]{GD: rocTempSimp}.)}
\item[Newton-Law-Convective-Cooling-Coil-Water:\phantomsection\label{assumpLCCCW}]{Newton's law of convective cooling applies between the heating coil and the water. (RefBy: \hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} and \hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater}.)}
\item[Newton-Law-Convective-Cooling-Coil-Water:\phantomsection\label{assumpLCCCW}]{Newton's law of convective cooling applies between the heating coil and the water. (RefBy: \hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil}.)}
\item[Temp-Heating-Coil-Constant-over-Time:\phantomsection\label{assumpTHCCoT}]{The temperature of the heating coil is constant over time. (RefBy: \hyperref[likeChgTCVOD]{LC: Temperature-Coil-Variable-Over-Day} and \hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil}.)}
\item[Temp-Heating-Coil-Constant-over-Length:\phantomsection\label{assumpTHCCoL}]{The temperature of the heating coil does not vary along its length. (RefBy: \hyperref[likeChgTCVOL]{LC: Temperature-Coil-Variable-Over-Length} and \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.}
\item[Law-Convective-Cooling-Water-PCM:\phantomsection\label{assumpLCCWP}]{Newton's law of convective cooling applies between the water and the PCM. (RefBy: \hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater}.)}
\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. (RefBy: \hyperref[likeChgDT]{LC: Discharging-Tank} and \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. (RefBy: \hyperref[likeChgDITPW]{LC: Different-Initial-Temps-PCM-Water}, \hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr}, \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM}, and \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. (RefBy: \hyperref[IM:heatEInPCM]{IM: heatEInPCM} and \hyperref[IM:eBalanceOnPCM]{IM: eBalanceOnPCM}.)}
Expand Down Expand Up @@ -546,7 +546,8 @@ \subsubsection{Theoretical Models}
Source & \cite[(pg. 8)]{incroperaEtAl2007}

\\ \midrule \\
RefBy &
RefBy & \hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} and \hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater}

\\ \bottomrule
\end{tabular}
\end{minipage}
Expand Down Expand Up @@ -643,7 +644,7 @@ \subsubsection{General Definitions}
\item{$t$ is the time (s)}
\end{symbDescription}
\\ \midrule \\
Notes & \hyperref[assumpLCCCW]{A: Newton-Law-Convective-Cooling-Coil-Water}
Notes & ${q_{\text{C}}}$ is found by assuming that Newton's law of cooling applies (\hyperref[assumpLCCCW]{A: Newton-Law-Convective-Cooling-Coil-Water}). This law (defined in \hyperref[TM:nwtnCooling]{TM: nwtnCooling}) is used on the surface of the heating coil.

\hyperref[assumpTHCCoT]{A: Temp-Heating-Coil-Constant-over-Time}

Expand Down Expand Up @@ -683,7 +684,7 @@ \subsubsection{General Definitions}
\item{${T_{\text{P}}}$ is the temperature of the phase change material (${}^{\circ}$C)}
\end{symbDescription}
\\ \midrule \\
Notes & \hyperref[assumpLCCCW]{A: Newton-Law-Convective-Cooling-Coil-Water}
Notes & ${q_{\text{P}}}$ is found by assuming that Newton's law of cooling applies (\hyperref[assumpLCCWP]{A: Law-Convective-Cooling-Water-PCM}). This law (defined in \hyperref[TM:nwtnCooling]{TM: nwtnCooling}) is used on the surface of the phase change material.

\\ \midrule \\
Source & \cite{koothoor2013}
Expand Down Expand Up @@ -1508,7 +1509,7 @@ \section{Traceability Matrices and Graphs}
\\
\hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} & & & & & & & X & X & & & & & & & & & & & &
\\
\hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater} & & & & & & & X & & & & & & & & & & & & &
\hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater} & & & & & & & & & & X & & & & & & & & & &
\\
\hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} & & & X & X & & & & & X & & X & X & & X & X & X & & & X &
\\
Expand Down Expand Up @@ -1602,9 +1603,9 @@ \section{Traceability Matrices and Graphs}
\\
\hyperref[GD:rocTempSimp]{GD: rocTempSimp} & & & & & & & & X & & & & X & & & & & &
\\
\hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} & & & & & & & & & & & & & & & & & &
\hyperref[GD:htFluxWaterFromCoil]{GD: htFluxWaterFromCoil} & & & & & & & & & & & X & & & & & & &
\\
\hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater} & & & & & & & & & & & & & & & & & &
\hyperref[GD:htFluxPCMFromWater]{GD: htFluxPCMFromWater} & & & & & & & & & & & X & & & & & & &
\\
\hyperref[IM:eBalanceOnWtr]{IM: eBalanceOnWtr} & X & X & & & & & & & & & & X & X & X & X & X & &
\\
Expand Down
20 changes: 12 additions & 8 deletions code/stable/swhs/Website/SWHS_SRS.html
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ <h3>Assumptions</h3>
</p>
<p>
<div id="assumpLCCCW">
Newton-Law-Convective-Cooling-Coil-Water: Newton's law of convective cooling applies between the heating coil and the water. (RefBy: <a href=#GD:htFluxWaterFromCoil>GD: htFluxWaterFromCoil</a> and <a href=#GD:htFluxPCMFromWater>GD: htFluxPCMFromWater</a>.)
Newton-Law-Convective-Cooling-Coil-Water: Newton's law of convective cooling applies between the heating coil and the water. (RefBy: <a href=#GD:htFluxWaterFromCoil>GD: htFluxWaterFromCoil</a>.)
</div>
</p>
<p>
Expand All @@ -779,7 +779,7 @@ <h3>Assumptions</h3>
</p>
<p>
<div id="assumpLCCWP">
Law-Convective-Cooling-Water-PCM: Newton's law of convective cooling applies between the water and the PCM.
Law-Convective-Cooling-Water-PCM: Newton's law of convective cooling applies between the water and the PCM. (RefBy: <a href=#GD:htFluxPCMFromWater>GD: htFluxPCMFromWater</a>.)
</div>
</p>
<p>
Expand Down Expand Up @@ -1135,7 +1135,11 @@ <h3>Theoretical Models</h3>
</tr>
<tr>
<th>RefBy</th>
<td><p class="paragraph"></p></td>
<td>
<p class="paragraph">
<a href=#GD:htFluxWaterFromCoil>GD: htFluxWaterFromCoil</a> and <a href=#GD:htFluxPCMFromWater>GD: htFluxPCMFromWater</a>
</p>
</td>
</tr>
</table>
</div>
Expand Down Expand Up @@ -1325,7 +1329,7 @@ <h4>
<th>Notes</th>
<td>
<p class="paragraph">
<a href=#assumpLCCCW>A: Newton-Law-Convective-Cooling-Coil-Water</a>
<em>q<sub>C</sub></em> is found by assuming that Newton's law of cooling applies (<a href=#assumpLCCCW>A: Newton-Law-Convective-Cooling-Coil-Water</a>). This law (defined in <a href=#TM:nwtnCooling>TM: nwtnCooling</a>) is used on the surface of the heating coil.
</p>
<p class="paragraph">
<a href=#assumpTHCCoT>A: Temp-Heating-Coil-Constant-over-Time</a>
Expand Down Expand Up @@ -1395,7 +1399,7 @@ <h4>
<th>Notes</th>
<td>
<p class="paragraph">
<a href=#assumpLCCCW>A: Newton-Law-Convective-Cooling-Coil-Water</a>
<em>q<sub>P</sub></em> is found by assuming that Newton's law of cooling applies (<a href=#assumpLCCWP>A: Law-Convective-Cooling-Water-PCM</a>). This law (defined in <a href=#TM:nwtnCooling>TM: nwtnCooling</a>) is used on the surface of the phase change material.
</p>
</td>
</tr>
Expand Down Expand Up @@ -3527,10 +3531,10 @@ <h1>Traceability Matrices and Graphs</h1>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
Expand Down Expand Up @@ -4529,7 +4533,7 @@ <h1>Traceability Matrices and Graphs</h1>
<td></td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
Expand All @@ -4550,7 +4554,7 @@ <h1>Traceability Matrices and Graphs</h1>
<td></td>
<td></td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
Expand Down

0 comments on commit e4bb4f5

Please sign in to comment.