Commit 9310c953 by Chris Cantwell

### Tidy up parts of solver and utilities docs

parent 3eaf7e96
 ... ... @@ -21,27 +21,38 @@ see the table below. \renewcommand\arraystretch{2.2} \begin{tabular}{|l|l|l|l|} \hline \textbf{Equation to solve} & \textbf{EquationType} & \textbf{Dimensions supported} & \textbf{Projection supported} \\ \textbf{Equation to solve} & \textbf{EquationType} & \textbf{Dimensions supported} & \textbf{Projection supported} \\ \hline $\nabla^2 u = 0$ & Laplace & All & Continuous/Discontinuous \\ $\nabla^2 u = 0$ & \inltt{Laplace} & All & Continuous/Discontinuous \\ \hline $\nabla^2 u = f$ & Poisson & All & Continuous/Discontinuous \\ $\nabla^2 u = f$ & \inltt{Poisson} & All & Continuous/Discontinuous \\ \hline $\nabla^2 u + \lambda u = f$ & Helmholtz & All & Continuous/Discontinuous \\ $\nabla^2 u + \lambda u = f$ & \inltt{Helmholtz} & All & Continuous/Discontinuous \\ \hline $\epsilon \nabla^2 u + \mathbf{V}\nabla u = f$ & SteadyAdvectionDiffusion & 2D only & Continuous/Discontinuous \\ $\epsilon \nabla^2 u + \mathbf{V}\nabla u = f$ & \inltt{SteadyAdvectionDiffusion} & 2D only & Continuous/Discontinuous \\ \hline $\epsilon \nabla^2 u + \lambda u = f$ & SteadyDiffusionReaction & 2D only & Continuous/Discontinuous \\ $\epsilon \nabla^2 u + \lambda u = f$ & \inltt{SteadyDiffusionReaction} & 2D only & Continuous/Discontinuous \\ \hline $\epsilon \nabla^2 u \mathbf{V}\nabla u + \lambda u = f$ & SteadyAdvectionDiffusionReaction & 2D only & Continuous/Discontinuous \\ $\epsilon \nabla^2 u \mathbf{V}\nabla u + \lambda u = f$ & \inltt{SteadyAdvectionDiffusionReaction} & 2D only & Continuous/Discontinuous \\ \hline $\dfrac{\partial u}{\partial t} + \mathbf{V}\nabla u = f$ & UnsteadyAdvection & All & Continuous/Discontinuous \\ $\dfrac{\partial u}{\partial t} + \mathbf{V}\nabla u = f$ & \inltt{UnsteadyAdvection} & All & Continuous/Discontinuous \\ \hline $\dfrac{\partial u}{\partial t} = \epsilon \nabla^2 u$ & UnsteadyDiffusion & All & Continuous/Discontinuous \\ $\dfrac{\partial u}{\partial t} = \epsilon \nabla^2 u$ & \inltt{UnsteadyDiffusion} & All & Continuous/Discontinuous \\ \hline $\dfrac{\partial u}{\partial t} + \mathbf{V}\nabla u = \epsilon \nabla^2 u$ & UnsteadyAdvectionDiffusion & All & Continuous/Discontinuous \\ $\dfrac{\partial u}{\partial t} + \mathbf{V}\nabla u = \epsilon \nabla^2 u$ & \inltt{UnsteadyAdvectionDiffusion} & All & Continuous/Discontinuous \\ \hline $\dfrac{\partial u}{\partial t} + u\nabla u = 0$ & UnsteadyInviscidBurger & 1D only & Continuous/Discontinuous \\ $\dfrac{\partial u}{\partial t} + u\nabla u = 0$ & \inltt{UnsteadyInviscidBurger} & 1D only & Continuous/Discontinuous \\ \hline \end{tabular} \end{center} ... ... @@ -51,7 +62,9 @@ $\dfrac{\partial u}{\partial t} + u\nabla u = 0$ \section{Usage} \begin{lstlisting}[style=BashInputStyle] ADRSolver session.xml \end{lstlisting} \section{Session file configuration} ... ... @@ -69,17 +82,18 @@ The solver info are listed below: \begin{center} \footnotesize \renewcommand\arraystretch{1.2} \begin{tabular}{|c|c|c|c|c|} \begin{tabular}{|l|c|c|c|c|} \hline & \textbf{Explicit} & \textbf{Diagonally Implicit} & \textbf{ IMEX} & \textbf{Implicit} \\ \textbf{EqType} & \textbf{Explicit} & \textbf{Diagonally Implicit} & \textbf{ IMEX} & \textbf{Implicit} \\ \hline UnstedayAdvection & \checkmark & & &\\ \inltt{UnstedayAdvection} & \checkmark & & &\\ \hline UnstedayDifusion & \checkmark & \checkmark & &\\ \inltt{UnstedayDifusion} & \checkmark & \checkmark & &\\ \hline UnstedayAdvectionDiffusion & & & \checkmark &\\ \inltt{UnstedayAdvectionDiffusion} & & & \checkmark &\\ \hline UnstedayInviscidBurger & \checkmark & & &\\ \inltt{UnstedayInviscidBurger} & \checkmark & & &\\ \hline \end{tabular} ... ... @@ -89,57 +103,63 @@ UnstedayInviscidBurger & \checkmark & & &\\ \vspace{-1 cm} \item \textbf{Projection}: The Galerkin projection used may be either: \begin{itemize} \item Continuous for a C0-continuous Galerkin (CG) projection. \item Discontinuous for a discontinous Galerkin (DG) projection. \item \inltt{Continuous} for a C0-continuous Galerkin (CG) projection. \item \inltt{Discontinuous} for a discontinous Galerkin (DG) projection. \end{itemize} \item \textbf{DiffusionAdvancement}: This specifies how to treat the diffusion term. This will be restricted by the choice of time integration scheme: \begin{itemize} \item Explicit: Requires the use of an explicit time integration scheme. \item Implcit: Requires the use of a diagonally implicit, IMEX or Implicit scheme. \item \inltt{Explicit} Requires the use of an explicit time integration scheme. \item \inltt{Implcit} Requires the use of a diagonally implicit, IMEX or Implicit scheme. \end{itemize} \item \textbf{AdvectionAdvancement}: This specifies how to treat the advection term. This will be restricted by the choice of time integration scheme: \begin{itemize} \item Explicit: Requires the use of an explicit or IMEX time integration scheme. \item Implicit: Not supported at present. \item \inltt{Explicit} Requires the use of an explicit or IMEX time integration scheme. \item \inltt{Implicit} Not supported at present. \end{itemize} \item \textbf{AdvectionType}: Specifies the type of advection: \begin{itemize} \item NonConservative (for CG only). \item WeakDG (for DG only). \item \inltt{NonConservative} (for CG only). \item \inltt{WeakDG} (for DG only). \end{itemize} \item \textbf{DiffusionType}: \begin{itemize} \item LDG. \item \inltt{LDG}. \end{itemize} \item \textbf{UpwindType}: \begin{itemize} \item Upwind. \item \inltt{Upwind}. \end{itemize} \end{itemize} \subsection{Parameters} The following parameters can be specified in the PARAMETERS section of the session file: The following parameters can be specified in the \inltt{PARAMETERS} section of the session file: \begin{itemize} \item \textbf{epsilon}: sets the diffusion coefficient $\epsilon$.\\ \item \inltt{epsilon}: sets the diffusion coefficient $\epsilon$.\\ \textit{Can be used} in: SteadyDiffusionReaction, SteadyAdvectionDiffusionReaction, UnsteadyDiffusion, UnsteadyAdvectionDiffusion. \\ \textit{Default value}: 0. \item \textbf{d00, d11, d22}: sets the diagonal entries of the diffusion tensor $D$. \\ \item \inltt{d00}, \inltt{d11}, \inltt{d22}: sets the diagonal entries of the diffusion tensor $D$. \\ \textit{Can be used in}: UnsteadyDiffusion \\ \textit{Default value}: All set to 1 (i.e. identity matrix). \item \textbf{lambda}: sets the reaction coefficient $\lambda$. \\ \item \inltt{lambda}: sets the reaction coefficient $\lambda$. \\ \textit{Can be used in}: SteadyDiffusionReaction, Helmholtz, SteadyAdvectionDiffusionReaction\\ \textit{Default value}: 0. \end{itemize} \subsection{Functions} The following functions can be specified inside the CONDITIONS section of the session file: The following functions can be specified inside the \inltt{CONDITIONS} section of the session file: \begin{itemize} \item \textbf{AdvectionVelocity}: specifies the advection velocity $\mathbf{V}$. \item \textbf{InitialConditions}: specifies the initial condition for unsteady problems. \item \textbf{Forcing}: specifies the forcing function f. \item \inltt{AdvectionVelocity}: specifies the advection velocity $\mathbf{V}$. \item \inltt{InitialConditions}: specifies the initial condition for unsteady problems. \item \inltt{Forcing}: specifies the forcing function f. \end{itemize} \section{Examples} ... ...
 ... ... @@ -177,7 +177,9 @@ For a more detailed description of the above the interested reader can refer to \cite{DeGMen14} and \cite{MenDeG14}. \section{Usage} \inltt{CompressibleFlowSolver session.xml} \begin{lstlisting}[style=BashInputStyle] CompressibleFlowSolver session.xml \end{lstlisting} \section{Session file configuration} ... ...
 \chapter{Incompressible Navier-Stokes Solver} \label{IncNSsolver} \newpage 3.4/UserGuide/Tutorial/IncNavierStokesSolver/Stability 3.4/UserGuide/Examples/IncNavierStokesSolver/Adjoint 3.4/UserGuide/Examples/IncNavierStokesSolver/Aorta 3.4/UserGuide/Examples/IncNavierStokesSolver/Biglobal 3.4/UserGuide/Examples/IncNavierStokesSolver/Direct 3.4/UserGuide/Examples/IncNavierStokesSolver/KovasznayFlow2D \section{Synopsis} \subsection{Velocity Correction Scheme} ... ... @@ -229,7 +223,9 @@ where $\sigma=\left\| \mathbf{u'}(\tau)\right\|$. This is no other that the sing \section{Usage} \texttt{./IncNavierStokesSolver session.xml} \begin{lstlisting}[style=BashInputStyle] IncNavierStokesSolver session.xml} \end{lstlisting} \section{Session file configuration} ... ...
 ... ... @@ -6,45 +6,52 @@ In this section, the capabilities of the field convert utility are explained. Th \item Extract a boundary region \item Specify a sub-range of the domain \end{itemize} The executable FieldConvert can be found in the PostProcessing directory located in builds:\\ \\ \inltt{nektar++/builds/utilities/PostProcessing/FieldConvert/FieldConvert}\\ \\ In the remaining of this section all the command lines will be called from the FieldConvert directory located in builds. Converting an output file that has been obtained using \nekpp into a .dat file goes then as follows:\\ \\ \inltt{FieldConvert test.xml test.fld test.dat } Converting an output file that has been obtained using \nekpp into a .dat file goes then as follows: \begin{lstlisting}[style=BashInputStyle] FieldConvert test.xml test.fld test.dat \end{lstlisting} \subsection{Calculating vorticity} To perform the vorticity calculation and obtain an output data containing the vorticity solution, the executable FieldConvert has to be run. This executable can be found in:\\ \\ \inltt{FieldConvert -m vorticity test.xml test.fld test-vort.fld}\\ \\ \begin{lstlisting}[style=BashInputStyle] FieldConvert -m vorticity test.xml test.fld test-vort.fld \end{lstlisting} where the file test-vort.fld can be processed in a similar way as described above to visualise the solution. \subsection{Sub-range of the domain} One can also select a region in the computational domain and process only the data for that part of the domain. For example for processing the data of a 2D plane defined by $-2\leq x \leq 3$, $-1\leq y \leq 2$, the following command can be run:\\ \\ \inltt{FieldConvert -r -2,3,-1,2 test.xml test.fld test.dat}\\ \\ \begin{lstlisting}[style=BashInputStyle] FieldConvert -r -2,3,-1,2 test.xml test.fld test.dat \end{lstlisting} where -r defines the range option of the field convert utility, the two first numbers define the range in $x$ direction and the the third and forth number specify the $y$ range. The a 3D part of the domain, a third set of numbers has to be provided to define the $z$ range. For calculating the vorticity in a specified part of the computational domain, the following command line can be run:\\ \\ \inltt{FieldConvert -r -2,3,-1,2 -m vorticity test.xml test.fld test-vort.fld} \begin{lstlisting}[style=BashInputStyle] FieldConvert -r -2,3,-1,2 -m vorticity test.xml test.fld test-vort.fld \end{lstlisting} \subsection{Extracting a boundary region} The boundary region of a domain be extracted from the output data using the following command line\\ \\ \inltt{FieldConvert -m extract:bnd=2:fldtoboundary=1 test.xml test.fld test-boundary.fld}\\ \\ The boundary region of a domain be extracted from the output data using the following command line \begin{lstlisting}[style=BashInputStyle] FieldConvert -m extract:bnd=2:fldtoboundary=1 test.xml test.fld test-boundary.fld \end{lstlisting} The option \inltt{bnd} specifies which boundary region to extract. Note this is different to MeshConvert where the parameter \inltt{surf} is specified and corresponds to composites rather boundaries. If bnd is to provided all boundaries are extracted to different field. The fldtoboundary is an optional command argument which copies the expansion of test.fld into the boundary region before outputting the .fld file. This option is on by default. If it turned off using \inltt{fldtoboundary=0} the extraction will only evaluate the boundary condition from the xml file. The output will be placed in test-boundary-b2.fld. If more than one boundary region is specified the extension -b0.fld, -b1.fld etc will be outputted. To process this file you will need an xml file of the same region. This can be generated using the command: \\ \inltt{MeshConvert -m extract:surf=5 test.xml test-b0.xml}\\ \\ \begin{lstlisting}[style=BashInputStyle] MeshConvert -m extract:surf=5 test.xml test-b0.xml \end{lstlisting} The surface to be extracted in this command is the composite number and so needs to correspond to the boundary region of interest. Finally to process the surface file one can use \\ \inltt{MeshConvert -m extract:surf=5 test.xml test-b0.xml}\\ \\ This will obviously generate a tecplot output using a .dat file is specified in the last argument. A .vtu extension will produce a vtk output.\\ \\ To run the utility, if you have compiled \nekpp with MPI support, you may run in parallel\\ \\ \inltt{mpirun -np FieldConvert test.xml test.fld test.dat }\\ \\ replacing with the number of processors. This will produce multiple .dat files of the form test-P0.dat, test-P1.dat, test-P2.dat etc. Similarly the VTK files can be processed in this manner as can the vorticity option. In the case of the vorticity option a directory called test-vort.fld (or the specified output name) will be produced with the standard parallel field files placed within the directory. \begin{lstlisting}[style=BashInputStyle] MeshConvert -m extract:surf=5 test.xml test-b0.xml \end{lstlisting} This will obviously generate a tecplot output using a .dat file is specified in the last argument. A .vtu extension will produce a vtk output. To run the utility, if you have compiled \nekpp with MPI support, you may run in parallel \begin{lstlisting}[style=BashInputStyle] mpirun -np FieldConvert test.xml test.fld test.dat \end{lstlisting} replacing with the number of processors. This will produce multiple .dat files of the form test-P0.dat, test-P1.dat, test-P2.dat etc. Similarly the VTK files can be processed in this manner as can the vorticity option. In the case of the vorticity option a directory called test-vort.fld (or the specified output name) will be produced with the standard parallel field files placed within the directory.
 \section{MeshConvert} \label{s:utilities:meshconvert} %3.4/Reference/Utilities/MeshConvert %3.4/UserGuide/Tutorial/MeshConvert MeshConvert is a utility bundled with Nektar++ which primarily allows foreign mesh file formats to be converted into the XML file format used by the solvers and other utilities. However, there is also some limited support for other output formats - consult the MeshConvert reference page for more information on which formats are supported. On this page, we will run through a basic example to show how a mesh can be converted from the widely-used mesh-generator ?Gmsh to the XML file format. ... ... @@ -43,23 +42,23 @@ Physical Surface(2) = {16}; Physical Surface(3) = {24}; \end{lstlisting} Either choose the option File -> Save Mesh or, assuming this is saved in a file named test.geo', run the command \begin{lstlisting}[style=XmlStyle] \begin{lstlisting}[style=BashInputStyle] gmsh -3 test.geo \end{lstlisting} which will produce the resulting MSH file test.msh'. One can generate a high-order mesh by specifying the order on the command line, for example \begin{lstlisting}[style=XmlStyle] \begin{lstlisting}[style=BashInputStyle] gmsh -3 -order 6 test.geo \end{lstlisting} will generate a sixth-order mesh. Note that you will need to use a current version of Gmsh in order to do this, most likely from subversion. %------------------------------------------------------------------------------------------ \subsection{Converting the MSH to Nektar++ format} Assuming that you have compiled Nektar++ according to the compilation instructions, run the command \begin{lstlisting}[style=XmlStyle] nektar++/builds/utilities/PreProcessing/MeshConvert/MeshConvert test.msh test.xml \begin{lstlisting}[style=BashInputStyle] MeshConvert test.msh test.xml \end{lstlisting} to generate the XML file. To validate the mesh visually, we can use a utility such as Paraview or ?VisIt. To do this, run the command \begin{lstlisting}[style=XmlStyle] nektar++/builds/utilities/PostProcessing/XmlToVtk test.xml \begin{lstlisting}[style=BashInputStyle] XmlToVtk test.xml \end{lstlisting} which generates an unstructured VTK file test.vtu %------------------------------------------------------------------------------------------ ... ... @@ -144,34 +143,37 @@ This sets up an incompressible Navier-Stokes simulation using a first-order spli %------------------------------------------------------------ \subsubsection{Detecting elements with negative Jocabians} To detect elements with negative Jacobians use : \begin{lstlisting}[style=XmlStyle] \begin{lstlisting}[style=BashInputStyle] MeshConvert -m jac Mesh.xml \end{lstlisting} and to extract the elements (in order to visualize them for example) use : \begin{lstlisting}[style=XmlStyle] \begin{lstlisting}[style=BashInputStyle] MeshConvert -m jac:extract Mesh.xml MeshWithNegativeElements.xml \end{lstlisting} %------------------------------------------------------------ \subsubsection{Periodic boundary conditions} Gmsh and Nektar++ use different edge ordering and surface orientation. To use periodic boundary conditions the faces must be aligned properly. To make sure faces (or edges for a 2D mesh) are aligned correctly use the following command : \begin{lstlisting}[style=XmlStyle] MeshConvert -m peralign:surf1=11:surf2=12:dir=y -m peralign:surf1=13:surf2=14:dir=z Mesh.xml Mesh_aligned.xml \begin{lstlisting}[style=BashInputStyle] MeshConvert -m peralign:surf1=11:surf2=12:dir=y \ -m peralign:surf1=13:surf2=14:dir=z Mesh.xml Mesh_aligned.xml \end{lstlisting} where the surfaces "11" and "12" will be aligned normal to "y" and the surfaces "13" and "14" will be aligned normal to "z". Mind the double use of the "-m"! Mesh.xml is the initial mesh by Gmsh and \verb+Mesh_aligned.xml+ is the new mesh output by this command with aligned surfaces (or edges). %------------------------------------------------------------ \subsubsection{Spherigon Patches} To use spherigon patches on two contiguous surfaces "11" and "12" use the following command : \begin{lstlisting}[style=XmlStyle] MeshConvert -m spherigon:surf=11,12 MeshWithStraighEdges.xml MeshWithSpherigons.xml \begin{lstlisting}[style=BashInputStyle] MeshConvert -m spherigon:surf=11,12 \ MeshWithStraighEdges.xml MeshWithSpherigons.xml \end{lstlisting} If the two surfaces "11" and "12" are not contiguous use : \begin{lstlisting}[style=XmlStyle] MeshConvert -m spherigon:surf=11 -m spherigon:surf=12 MeshWithStraighEdges.xml MeshWithSpherigons.xml \begin{lstlisting}[style=BashInputStyle] MeshConvert -m spherigon:surf=11 -m spherigon:surf=12 \ MeshWithStraighEdges.xml MeshWithSpherigons.xml \end{lstlisting} If you have a high-resolution mesh of the surfaces "11" and "12" in ".ply " format it can be used to improve the normal definition of the spherigons. Run : \begin{lstlisting}[style=XmlStyle] MeshConvert -m spherigon:surf=11,12:usenormalfile=Surf_11-12_Mesh.ply MeshWithStraighEdges.xml MeshWithSpherigons.xml \begin{lstlisting}[style=BashInputStyle] MeshConvert -m spherigon:surf=11,12:usenormalfile=Surf_11-12_Mesh.ply \ MeshWithStraighEdges.xml MeshWithSpherigons.xml \end{lstlisting} This can be useful, for example, when meshing the Leading edge of an airfoil. Starting from a "linear" mesh (Fig.1) the spherigon patches curve the surface elements producing leading edge closer to the underlying geometry : \begin{figure}[!htbp] ... ... @@ -185,7 +187,7 @@ This can be useful, for example, when meshing the Leading edge of an airfoil. St %------------------------------------------------------------ \subsubsection{Prism splitting} To split a prism boundary layer on surface "11" into 3 layers with a growth rate of 2 and 7 integration points per element use the following command : \begin{lstlisting}[style=XmlStyle] \begin{lstlisting}[style=BashInputStyle] MeshConvert -m bl:surf=11:layers=3:r=2:nq=7 MeshWithOnePrismLayer.xml MeshWith3PrismsLayers.xml \end{lstlisting} ... ... @@ -201,13 +203,12 @@ MeshWith3PrismsLayers.xml %------------------------------------------------------------ \subsubsection{Running the simulation} The 3D problem defined here is relatively expensive, and will require significant amounts of memory and CPU time at high-order. To run the simulation, execute the command \begin{lstlisting}[style=XmlStyle] nektar++/builds/solvers/IncNavierStokesSolver/IncNavierStokesSolver test.xml \begin{lstlisting}[style=BashInputStyle] IncNavierStokesSolver test.xml \end{lstlisting} Alternatively, if you have compiled Nektar++ with MPI support, you may run in parallel \begin{lstlisting}[style=XmlStyle] mpirun -np nektar++/builds/solvers/IncNavierStokesSolver/IncNavierStokesSolver test.xml \begin{lstlisting}[style=BashInputStyle] mpirun -np IncNavierStokesSolver test.xml \end{lstlisting} replacing with the number of processors.
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