Commit ff4ffb9f authored by Yu Pan's avatar Yu Pan

Add compressibleflowsolver theoretical part

parent 0724faa5
...@@ -3,6 +3,80 @@ ...@@ -3,6 +3,80 @@
In this chapter, we walk the reader through our 2D and 3D compressible Navier-Stokes Solver (CompressibleFlowSolver). In this chapter, we walk the reader through our 2D and 3D compressible Navier-Stokes Solver (CompressibleFlowSolver).
\section{Fundamental Theories of CompressibleFlowSolver} \section{Fundamental Theories of CompressibleFlowSolver}
The governing equation systems include continuity equation, momentum equations and energy equation. Write in conservative form
\begin{equation}\label{eq1}
\frac{\partial U}{\partial t}+
\frac{\partial F_{i}(U)}{\partial x_{i}}
=\frac{\partial G_{i}(U,\nabla U)}{\partial x_{i}}
\end{equation}
where $U=[\rho,\rho u_{1} \hdots \rho u_{d},E]^{T}$
Inviscid flux F in i direction is
\begin{equation}
F_{i}=
\begin{bmatrix}
\rho u_{i}\\
\rho u_{1}u_{i}+\delta_{1,i}P\\
\vdots\\
\rho u_{d}u_{i}+\delta_{d,i}P\\
u_{i}(E+P)
\end{bmatrix}
\end{equation}
where total energy $E=\rho (c_{v}T+u_{i}u_{i}/2)$, pressure $P=(\gamma-1)(E-\rho u_{i}u_{i}/2)$
Viscous flux G in i direction is
\begin{equation}
G_{i}=
\begin{bmatrix}
0\\
\tau_{i1}\\
\vdots\\
\tau_{id}\\
\sum\limits_{j=1}^{d}{u_{j}\tau_{ij}}-q_{i}
\end{bmatrix}
\end{equation}
where viscous term $\tau_{ij}=\mu(\frac{\partial u_{i}}{\partial x_{j}}+\frac{\partial u_{j}}{\partial x_{i}}-\frac{2}{3}\nabla \cdot\textbf{u}\delta_{ij})$ and heat flux $\textbf{q}=-\kappa \nabla T$
In Nektar++ current compressible flow solver, DG spatial discretization is in default. Multiply a test function $\phi$, integrate inside an element $K\in \Omega_{h}$ and sum over all the elements.
\begin{equation}
\sum\limits_{K\in \Omega_{h}}{\int_{K}{\frac{\partial U}{\partial t}\phi dx}}+I_{inv}=I_{vis}
\end{equation}
where
\begin{equation}\label{eq2}
I_{inv}= \sum\limits_{K\in \Omega_{h}}{\int_{\partial K}{\sum\limits_{i=1}^{d}{\widetilde{F}_{i}(U)n_{i}\phi}}dS}-
\sum\limits_{K\in \Omega_{h}}{\int_{K}{\sum\limits_{i=1}^{d}{F_{i}(U)\frac{\partial \phi}{\partial x_{i}}dx}}}
\end{equation}
\begin{equation}\label{eq3}
I_{inv}= \sum\limits_{K\in \Omega_{h}}{\int_{\partial K}{\sum\limits_{i=1}^{d}{\widetilde{G}_{i}(U,\nabla U)n_{i}\phi}}dS}-
\sum\limits_{K\in \Omega_{h}}{\int_{K}{\sum\limits_{i=1}^{d}{G_{i}(U,\nabla U)\frac{\partial \phi}{\partial x_{i}}dx}}}
\end{equation}
Different flux terms such as Equation \eqref{eq2} and \eqref{eq3} and source terms are treated separated and transferred through member variables as the sketch \ref{fig1} shows.
Various advection flux $\widetilde{F}$ and diffsion flux $\widetilde{G}(U,\nabla U)$ are supported in Nektar++ CompressibleSolver. And each specific flux such as LDG diffusion flux (LDGNS) inherits from its general flux type (Diffison).
Usually inside one specific flux type, the codes includes the following simliar process to caculate the flux. Take AdvectionWeakDG.cpp as an example.
\begin {table}[!h]
\caption {AdvectionWeakDG.cpp} \label{table1}
\begin{center}
\scalebox{0.9}[1.]{
\begin{tabular}{ | c | c|}
\hline
Variable/Function name & Physical meaning \\
\hline
m$\_$fluxVector & Advection volume flux: $F_{i}$\\
\hline
numflux & Advection numerical flux at trace: $\widetilde{F}_{i}$\\
\hline
IProductWRTDerivBase & Volume flux integration: $\sum\limits_{K\in \Omega_{h}}{\int_{K}{\sum\limits_{i=1}^{d}{F_{i}(U)\frac{\partial \phi}{\partial x_{i}}dx}}}$ \\
\hline
AddTraceIntegral & Add Surface flux into volume flux interation: $+\sum\limits_{K\in \Omega_{h}}{\int_{\partial K}{\sum\limits_{i=1}^{d}{\widetilde{F}_{i}(U)n_{i}\phi}}dS}$\\
\hline
MultiplyByElmImvMass& Multiply the inverse of mass matrix to get the flux coefficients\\
\hline
\end{tabular}
}
\end{center}
\end{table}
\clearpage \clearpage
\section{Data Structure of CompressibleFlowSolver} \section{Data Structure of CompressibleFlowSolver}
\begin{figure} \begin{figure}
......
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