Skip to content

Commit

Permalink
Cleanup some formatting of math in derivationofstream.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 2, 2020
1 parent 12e5f46 commit adb0972
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions chapters/derivationofstream.tex
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ \section{Rationale for the formulation of \lstinline!inStream!}\doublelabel{rati
it is therefore the mixing enthalpy under the assumption of fluid
flowing into said model.

We establish this quantity using a dedicated operator $inStream(h_{outflow,i})=h_{mix}$ assuming that $\dot{m}_{i} >= 0$. This leads to
We establish this quantity using a dedicated operator $\text{\lstinline!inStream!}(h_{outflow,i})=h_{mix}$ assuming that $\dot{m}_{i} >= 0$. This leads to
three different incarnations of (n in the general case). This is
illustrated in the figure below. For the present example of three
components in a connection set, this means the following.
\begin{eqnarray*}
inStream(h_{outflow,1})&=&\frac{\text{max}(-\dot{m}_2,0)h_{outflow,2}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_2,0)+\text{max}(-\dot{m}_3,0)}\\
inStream(h_{outflow,2})&=&\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_3,0)}\\
inStream(h_{outflow,3})&=&\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)}
\end{eqnarray*}
\begin{align*}
\text{\lstinline!inStream!}(h_{outflow,1}) &= \frac{\text{max}(-\dot{m}_2,0)h_{outflow,2}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_2,0)+\text{max}(-\dot{m}_3,0)}\\
\text{\lstinline!inStream!}(h_{outflow,2}) &= \frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_3,0)}\\
\text{\lstinline!inStream!}(h_{outflow,3}) &= \frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)}
\end{align*}
\begin{figure}[H]
\caption{Exemplary connection set with three connected components}
\begin{center}
Expand All @@ -146,20 +146,20 @@ \section{Rationale for the formulation of \lstinline!inStream!}\doublelabel{rati
In the general case of a connection set with \emph{n} components,
similar considerations lead to the following.
\begin{equation*}
inStream(h_{outflow,i})=\frac{\sum_{j=1,...,n;j\neq i}\text{max}(-\dot{m}_j,0)h_{outflow,j}}{\sum_{j=1,...,n;j\neq i}\text{max}(-\dot{m}_j,0)}
\text{\lstinline!inStream!}(h_{outflow,i})=\frac{\sum_{j=1,...,n;j\neq i}\text{max}(-\dot{m}_j,0)h_{outflow,j}}{\sum_{j=1,...,n;j\neq i}\text{max}(-\dot{m}_j,0)}
\end{equation*}

\section{Special cases covered by \lstinline!inStream! definition}\doublelabel{special-cases-covered-by-the-instream-operator-definition}
\subsection{Stream connector is not connected ($N = 1$):}\doublelabel{stream-connector-is-not-connected-n-1}
For this case, the return value of \lstinline!inStream! is arbitrary.
Therefore, it is set to the outflow value.

\subsection{Connection of 2 stream connectors, one to one connections (N=2):}\doublelabel{connection-of-2-stream-connectors-one-to-one-connections-n-2}
\subsection{Connection of 2 stream connectors, one to one connections ($N = 2$):}\doublelabel{connection-of-2-stream-connectors-one-to-one-connections-n-2}

\begin{eqnarray*}
inStream(h_{outflow,1})&=&\frac{\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_2,0)}=h_{outflow,2}\\
inStream(h_{outflow,2})&=&\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}}{\text{max}(-\dot{m}_1,0)}=h_{outflow,1}
\end{eqnarray*}
\begin{align*}
\text{\lstinline!inStream!}(h_{outflow,1}) &= \frac{\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_2,0)}=h_{outflow,2}\\
\text{\lstinline!inStream!}(h_{outflow,2}) &= \frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}}{\text{max}(-\dot{m}_1,0)}=h_{outflow,1}
\end{align*}

In this case, \lstinline!inStream! is continuous (contrary to $h_{mix}$) and does not
depend on flow rates. The latter result means that this transformation
Expand All @@ -177,15 +177,16 @@ \subsection{Connection of 3 stream connectors where one mass flow rate is identi
The suggested implementation results in
the following equations, and as indicated the last formula can be
simplified further by using $\dot{m}_3=0$:
\begin{eqnarray*}
inStream(h_{outflow,1})&=&h_{outflow,2}\\
inStream(h_{outflow,2})&=&h_{outflow,1}\\
inStream(h_{outflow,3})&=&\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)}\\
&=&\begin{cases}
\begin{align*}
\text{\lstinline!inStream!}(h_{outflow,1}) &= h_{outflow,2}\\
\text{\lstinline!inStream!}(h_{outflow,2}) &= h_{outflow,1}\\
\text{\lstinline!inStream!}(h_{outflow,3}) &= \frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)}\\
&=
\begin{cases}
h_{outflow,2}&\text{if $\dot{m}_1>=0$}\\
h_{outflow,1}&\text{if $\dot{m}_1<0$ and $\dot{m}_3=0$}
\end{cases}
\end{eqnarray*}
\end{align*}
\begin{figure}[H]
\caption{Example series connection of multiple models with stream connectors }
\begin{center}
Expand All @@ -197,7 +198,7 @@ \subsection{Connection of 3 stream connectors where one mass flow rate is identi
properties discussed for two connected components still hold. The
connection set equations reflect that the sensor does not any influence
by discarding the flow rate of the latter. In several cases a non-linear
equation system is removed by this transformation. However, \lstinline!inStream(..)!
equation system is removed by this transformation. However, \lstinline!inStream!
results in a discontinuous equation for the sensor, which is consistent
with modeling the convective phenomena only. The discontinuous equation
is uncritical, if the sensor variable is not used in a feedback loop
Expand Down Expand Up @@ -228,20 +229,22 @@ \subsection{Connection of 3 stream connectors where two mass flow rates are posi
\end{lstlisting}
results in the following equation:
\begin{equation*}
inStream(h_{outflow,1})=\frac{\text{max}(-\dot{m}_2,0)h_{outflow,2}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_2,0)+\text{max}(-\dot{m}_3,0)}=\frac{0}{0}
\text{\lstinline!inStream!}(h_{outflow,1})=\frac{\text{max}(-\dot{m}_2,0)h_{outflow,2}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_2,0)+\text{max}(-\dot{m}_3,0)}=\frac{0}{0}
\end{equation*}

\lstinline!inStream! cannot be evaluated for a connector, on which
the mass flow rate has to be negative by definition. The reason is that
the value is arbitrary, which is why it is defined as follows.
\begin{equation*}
inStream(h_{outflow,1}):=h_{outflow,1}
\text{\lstinline!inStream!}(h_{outflow,1}):=h_{outflow,1}
\end{equation*}
For the remaining connectors, \lstinline!inStream! reduces to a simple result.
\begin{eqnarray*}
inStream(h_{outflow,2})&=\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_3,0)}=h_{outflow,1}\\
inStream(h_{outflow,3})&=\frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)}=h_{outflow,1}
\end{eqnarray*}
\begin{align*}
\text{\lstinline!inStream!}(h_{outflow,2}) &= \frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_3,0)h_{outflow,3}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_3,0)}
= h_{outflow,1}\\
\text{\lstinline!inStream!}(h_{outflow,3}) &= \frac{\text{max}(-\dot{m}_1,0)h_{outflow,1}+\text{max}(-\dot{m}_2,0)h_{outflow,2}}{\text{max}(-\dot{m}_1,0)+\text{max}(-\dot{m}_2,0)}
= h_{outflow,1}
\end{align*}
Again, the previous non-linear algebraic system of equations is removed.
This means that utilizing the information about uni-directional flow is
very important.
Expand Down

0 comments on commit adb0972

Please sign in to comment.