Commit c040b4dc authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

update mat{q} description

parent da3e2fa7
......@@ -16,7 +16,10 @@ The `engine' park (chapter \ref{introduction}, phase 2) of \mlfem{} consists of
\end{itemize}
These scripts do the actually \textsl{work}, we do not call them the `engine' without reason.\\
\noindent The following matrices are needed for that work and may be mentioned in the upcoming sections:
\subsection*{Matrices}
The following matrices are needed for that work and may be mentioned in the upcoming sections:
\begin{enumerate}
\item[$\mat{M}$] the (global) `mass' matrix for the final linear set of equations, for time-dependent problems
\item[$\mat{C}$] the (global) `damping' or `convective' matrix for the final linear set of equations, for first derivative terms in the PDE
......@@ -26,33 +29,30 @@ These scripts do the actually \textsl{work}, we do not call them the `engine' w
\end{enumerate}
These global matrices are assembled from the corresponding element matrices (i.e.\ $\mat{K}$ is assembled from $\mat{K}_\mathrm{e}$, etc.) and are available for linear engines after the solution \kwo{sol} has been calculated (table \ref{enginevar}, see the element documentation in appendix \ref{elmlib} for the specifics of the element matrices for each element).
\begin{table}[h]
\center
\caption{Variables filled (overwritten) by the engines. \label{enginevar}}
\begin{tabular}{l c c c c c l l }
\begin{tabular}{l c c c c c l l l }
\hline\noalign{\smallskip}
engine & $\mat{M}$ & $\mat{K}$ & $\mat{C}$ & $\col{f}$ & $\col{u}$ & $\sigma$ & and\dots\\
engine & $\mat{M}$ & $\mat{K}$ & $\mat{C}$ & $\mat{q}$ & $\col{f}$ & $\col{u}$ & derivatives & and\dots\\
\noalign{\smallskip}\hline\noalign{\bigskip}
\kwc{fem1d} & & \kwo{K} & & \kwo{rhs} & \kwo{sol} & \texttt{sigma} &\kwo{pos}, \kwo{dest}\\
\kwc{fem1dcd} & \kwo{M} & \kwo{K} & \kwo{C} & \kwo{rhs} & \kwo{sol}, \kwo{soln} & & \kwo{pos}, \kwo{dest}, \kwo{q}\\
\kwc{femlin\_cd} & \kwo{M} & \kwo{K} & \kwo{C} & \kwo{rhs} & \kwo{sol}, \kwo{soln} && \kwo{pos}, \kwo{dest}, \kwo{q}\\
\kwc{femlin\_e} & & \kwo{K} & & \kwo{rhs} & \kwo{sol} & \texttt{sigma\_elm} & \kwo{pos}, \kwo{dest}\\
\kwc{femnl} & & & & \kwo{rhs} & \kwo{sol}, \kwo{solinc} && \kwo{pos}, \kwo{dest}\\
\kwc{femnlt} & & & & \kwo{rhs} & \kwo{sol}, \kwo{soln} && \kwo{pos}, \kwo{dest}\\
\kwc{fem1d} & & \kwo{K} & & &\kwo{rhs} & \kwo{sol} & \texttt{sigma} &\kwo{pos}, \kwo{dest}\\
\kwc{fem1dcd} & \kwo{M} & \kwo{K} & \kwo{C} & \kwo{q} & \kwo{rhs} & \kwo{sol}, \kwo{soln} & & \kwo{pos}, \kwo{dest}\\
\kwc{femlin\_cd} & \kwo{M} & \kwo{K} & \kwo{C} & \kwo{q} & \kwo{rhs} & \kwo{sol}, \kwo{soln} && \kwo{pos}, \kwo{dest}\\
\kwc{femlin\_e} & & \kwo{K} & && \kwo{rhs} & \kwo{sol} & \texttt{sigma\_elm} & \kwo{pos}, \kwo{dest}\\
\kwc{femnl} & & & & & \kwo{rhs} & \kwo{sol}, \kwo{solinc} && \kwo{pos}, \kwo{dest}\\
\kwc{femnlt} & & & && \kwo{rhs} & \kwo{sol}, \kwo{soln} && \kwo{pos}, \kwo{dest}\\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}
The matrix \kwo{q} equals
\begin{lstlisting}[language=mlfem,numbers=none]
q = K + C;
\end{lstlisting}
for stationary convection-diffusion problems, and
\begin{lstlisting}[language=mlfem,numbers=none]
q = M/dt + theta*C + theta*K;
\end{lstlisting}
for time-dependent convection-diffusion problems.
The matrix $\mat{q}$ is the final (global) `stiffness' matrix that is assembled from $\mat{M}, \mat{C}$, and $\mat{K}$:
\begin{equation}
\mat{q} = \begin{cases} \mat{C} + \mat{K} & \text{for \kwo{istat}} = 1\\[1em]
\frac{\mat{M}}{\Deltaup t}+\theta\left(\mat{C}+ \mat{K}\right) & \text{for \kwo{istat}} = 2\end{cases}
\end{equation}
\section{1D diffusion problems: \kwc{fem1d}}\label{enginefem1d}
......@@ -83,9 +83,10 @@ The script \kwc{fem1dcd} uses the element \kwc{elm1dcd} to solve the 1D (instati
\pderiv{u}{t} + v \pderiv{u}{x} = \pderiv{}{x}\left(c\pderiv{u}{x}\right) + f \tag{\ref{elcdeq}}
\end{equation}
with the final linear set of equations \cite[equation 15.27]{Oomens2018}:
\begin{equation}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} = \col{f}
\end{equation}
\begin{align}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} & = \col{f}\\
\mat{q}\cdot\col{u} & = \col{f}\\
\end{align}
Where the $\pderiv{\col{u}}{t}$ terms only apply for the instationary case, of course.\\
\noindent At least the parameters $c$ , $v$ and $f$, and the order of the element for \kwc{elm1dcd} have to be provided in \kwo{mat.mat} (section \ref{elm1dcd}):
......@@ -109,9 +110,10 @@ The script \kwc{femlin\_cd} uses the element \kwc{elcd} to solve the (instationa
\pderiv{u}{t} + v \cdot\grad u = \grad\cdot\left(c\grad u\right) \tag{\ref{elcdeq}}
\end{equation}
with the final linear set of equations \cite[equation 16.39]{Oomens2018}:
\begin{equation}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} = \col{f}
\end{equation}
\begin{align}
\mat{M}\pderiv{\col{u}}{t}+\left(\mat{C}+\mat{K}\right)\cdot\col{u} & = \col{f}\\
\mat{q}\cdot\col{u} & = \col{f}\\
\end{align}
Where the $\pderiv{\col{u}}{t}$ terms only apply for the instationary case, of course.\\
\noindent The engine uses the function \kwc{sysbuild} (section \ref{sysbuildextra}) for calculations and sets \kwo{options} $=\begin{bmatrix} 1& 1& 1 &1 & 1\end{bmatrix}$ (which should not be changed).\\
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment