Commit 5f3c9547 authored by Spencer Sherwin's avatar Spencer Sherwin

Merge branch 'master' into feature/new-precons

parents 401ac32f ce5ecd42
......@@ -22,7 +22,7 @@ v5.0.0
- Simplify RawType typedefs (!840)
- Remove unused files from BasicUtils (!841)
- Remove checks for old boost versions which are no longer supported (!841)
- Refactor ParseUtils to be more consistent (!843, !896)
- Refactor ParseUtils to be more consistent (!843, !896, !908)
- Added support for using the distance to a specific region (e.g. outlet) in the
function definitions for the Absorption Forcing (!769)
- Improve performance of DisContField2D::v_ExtractTracePhys (!824)
......@@ -38,6 +38,13 @@ v5.0.0
- Switch MeshGraph to use factory pattern and add HDF5 geometry support (!900,
!904)
- Restructure the low energy preconditioner to handle pyramidic and variable p expansions (!920)
- Remove requirement for modmetis, switch to SCOTCH by default (!899)
- Switch MeshGraph to use factory pattern and add HDF5 geometry support
(!900, !904)
- Fix bug in MeshPartition.cpp which caused incorrect array access when
WeightPartitions was used in parallel (!923)
- Removed instance count from beginning of Array storage to improve memory
alignment (!921)
**NekMesh**:
- Add feature to read basic 2D geo files as CAD (!731)
......@@ -64,12 +71,17 @@ v5.0.0
- Add ability to space out 2D BL nodes to better fit local target Delta (!890)
- Fix automatic peralign call in 2D periodic meshing (!888)
- Fix BL splitting call from MCF (!910)
- Support CFI combined lines (!917)
- Order nodes in Gmsh output (!912)
- Fix manifold face curvature nodes (!913)
**FieldConvert**:
- Add input module for Semtex field files (!777)
- Fixed interppoints module (!760)
- Fix OutputTecplot in 2DH1D (!818)
- Move StreamFunction utility to a FieldConvert module (!809)
- Allow using expansion from session file with new `--useSessionExpansion`
command line option (!842)
- Extend wss module to compressible flows (!810)
- Allow explicitly setting bool options of FieldConvert modules as false (!811)
- Enable output to multiple files (!844)
......@@ -82,11 +94,12 @@ v5.0.0
- Replace steady-state check based on difference of norms by check based on
norm of the difference, to be consistent with the compressible solver (!832)
- Updated SVV to allow for the DGKernel extension (!851)
- Pre-calculate Time invariant portion of Womersley Solution (!814)
**CompressibleFlowSolver**
- Add 3D regression tests (!567)
- Introduce forcing for quasi-1D Euler simulations (!771)
- Allow performing axi-symmetric Euler simulations (!771)
- Allow performing axi-symmetric Euler and NS simulations (!771, !866)
- Add ability to use an exponential filtering for stabilization with
seg, quad and hex elements (!771, !862)
- Introduce equations of state to account for real gas effects (!880)
......@@ -111,6 +124,7 @@ v4.4.2
- Fix deadlock in DiffusionLDG (!885)
- Fix uninitialised coefficients in DirectFull solver (!898)
- Updated PETSc to 3.7.7 (!916)
- Fix typcase to an integer which set Lz < 1 to zero when postprocess hdf5 output (!9922)
**NekMesh**
- Fix missing periodic boundary meshing and boundary layer mesh adjustment
......
......@@ -56,8 +56,6 @@ ENABLE_TESTING()
# Use the CMake 2.4 policy for CMake 2.6
IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 OLD)
# Silence warnings when using generator expressions in
# TARGET_LINK_LIBRARIES.
IF(POLICY CMP0022)
......@@ -356,17 +354,21 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/Nektar++Config.cmake
COMPONENT dev)
# Install ThirdParty headers to subdirectory of ${NEKTAR_INCLUDE_DIR}
INSTALL(DIRECTORY ${TPDIST}/include/
DESTINATION ${NEKTAR_INCLUDE_DIR}/ThirdParty
COMPONENT dev
)
IF (EXISTS ${TPDIST}/include)
INSTALL(DIRECTORY ${TPDIST}/include/
DESTINATION ${NEKTAR_INCLUDE_DIR}/ThirdParty
COMPONENT dev
)
ENDIF()
# Install ThirdParty libraries into ${NEKTAR_LIB_DIR}. These are shipped with
# the LibUtilities library.
INSTALL(DIRECTORY ${TPDIST}/lib/
DESTINATION ${NEKTAR_LIB_DIR}
COMPONENT libutilities
)
IF (EXISTS ${TPDIST}/lib)
INSTALL(DIRECTORY ${TPDIST}/lib/
DESTINATION ${NEKTAR_LIB_DIR}
COMPONENT libutilities
)
ENDIF()
ADD_SUBDIRECTORY(docs)
......
......@@ -77,6 +77,13 @@ IF( NEKTAR_USE_SCOTCH )
${NEKTAR++_TP_INCLUDE_DIRS} ${SCOTCH_INCLUDE_DIRS})
ENDIF( NEKTAR_USE_SCOTCH )
SET(NEKTAR_USE_METIS "@NEKTAR_USE_METIS@")
IF( NEKTAR_USE_METIS )
SET(METIS_INCLUDE_DIRS "@METIS_CONFIG_INCLUDE_DIR@")
SET(NEKTAR++_TP_INCLUDE_DIRS
${NEKTAR++_TP_INCLUDE_DIRS} ${METIS_INCLUDE_DIRS})
ENDIF( NEKTAR_USE_METIS )
SET(NEKTAR_USE_FFTW "@NEKTAR_USE_FFTW@")
IF( NEKTAR_USE_FFTW )
SET(FFTW_INCLUDE_DIR "@FFTW_INCLUDE_DIR@")
......
......@@ -68,18 +68,14 @@ IF( NEKTAR_USE_MPI )
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
${TPSRC}/gsmpi-1.2.1
)
SET(GSMPI_LIBRARY gsmpi CACHE FILEPATH
"GSMPI path" FORCE)
THIRDPARTY_LIBRARY(GSMPI_LIBRARY STATIC gsmpi DESCRIPTION "GSMPI Library")
THIRDPARTY_LIBRARY(XXT_LIBRARY STATIC xxt DESCRIPTION "XXT Library")
MARK_AS_ADVANCED(GSMPI_LIBRARY)
SET(XXT_LIBRARY xxt CACHE FILEPATH
"XXT path" FORCE)
MARK_AS_ADVANCED(XXT_LIBRARY)
MESSAGE(STATUS "Build GSMPI: ${TPDIST}/lib/lib${GSMPI_LIBRARY}.a")
MESSAGE(STATUS "Build XXT: ${TPDIST}/lib/lib${XXT_LIBRARY}.a")
MESSAGE(STATUS "Build GSMPI: ${GSMPI_LIBRARY}")
MESSAGE(STATUS "Build XXT: ${XXT_LIBRARY}")
ELSE (THIRDPARTY_BUILD_GSMPI)
ADD_CUSTOM_TARGET(gsmpi-1.2.1 ALL)
INCLUDE (FindGSMPI)
INCLUDE (FindXXT)
MESSAGE(FATAL_ERROR "Must build GSMPI and XXT")
ENDIF (THIRDPARTY_BUILD_GSMPI)
ENDIF( NEKTAR_USE_MPI )
......@@ -8,40 +8,65 @@
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
modmetis-5.1.0
PREFIX ${TPSRC}
URL ${TPURL}/modmetis-5.1.0_2.tar.bz2
URL_MD5 "8a1f1afd39b46a4477c1ea15464cdf89"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/modmetis-5.1.0
BINARY_DIR ${TPBUILD}/modmetis-5.1.0
TMP_DIR ${TPBUILD}/modmetis-5.1.0-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_C_FLAGS:STRING=-fPIC\ -w
-DGKLIB_PATH:PATH=${TPSRC}/modmetis-5.1.0/GKlib
${TPSRC}/modmetis-5.1.0
)
IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang 7.3 has a lovely bug that needs to be patched in order for it to
# compile.
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.3")
EXTERNALPROJECT_ADD_STEP(modmetis-5.1.0 patch-install-path
COMMAND sed -i ".bak" "s|#define MAX_JBUFS 128|#define MAX_JBUFS 24|" ${TPSRC}/modmetis-5.1.0/GKlib/error.c
DEPENDERS build
DEPENDEES download)
ENDIF()
ENDIF()
OPTION(NEKTAR_USE_METIS
"Use Metis library for performing mesh partitioning." OFF)
IF (NEKTAR_USE_METIS)
FIND_LIBRARY(METIS_LIBRARY NAMES metis PATHS ${MACPORTS_PREFIX}/lib)
FIND_PATH (METIS_INCLUDE_DIR metis.h PATHS ${MACPORTS_PREFIX}/include)
IF (METIS_LIBRARY AND METIS_INCLUDE_DIR)
SET(BUILD_METIS OFF)
ELSE()
SET(BUILD_METIS ON)
ENDIF ()
CMAKE_DEPENDENT_OPTION(THIRDPARTY_BUILD_METIS
"Build Metis library from ThirdParty" ${BUILD_METIS}
"NEKTAR_USE_METIS" OFF)
THIRDPARTY_LIBRARY(METIS_LIB STATIC metis DESCRIPTION "Metis library")
MARK_AS_ADVANCED(METIS_LIB)
MESSAGE(STATUS "Build Metis: ${METIS_LIB}")
IF (THIRDPARTY_BUILD_METIS)
EXTERNALPROJECT_ADD(
metis-5.1.0
PREFIX ${TPSRC}
URL ${TPURL}/metis-5.1.0.tar.gz
URL_MD5 "5465e67079419a69e0116de24fce58fe"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/metis-5.1.0
BINARY_DIR ${TPBUILD}/metis-5.1.0
TMP_DIR ${TPBUILD}/metis-5.1.0-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
-DCMAKE_C_FLAGS:STRING=-fPIC\ -w
-DGKLIB_PATH:PATH=${TPSRC}/metis-5.1.0/GKlib
${TPSRC}/metis-5.1.0
)
INCLUDE_DIRECTORIES(${TPDIST}/include)
\ No newline at end of file
IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang 7.3 has a lovely bug that needs to be patched in order for it to
# compile.
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.3")
EXTERNALPROJECT_ADD_STEP(metis-5.1.0 patch-install-path
COMMAND sed -i ".bak" "s|#define MAX_JBUFS 128|#define MAX_JBUFS 24|" ${TPSRC}/metis-5.1.0/GKlib/error.c
DEPENDERS build
DEPENDEES download)
ENDIF()
ENDIF()
THIRDPARTY_LIBRARY(METIS_LIB STATIC metis DESCRIPTION "Metis library")
MARK_AS_ADVANCED(METIS_LIB)
MESSAGE(STATUS "Build Metis: ${METIS_LIB}")
SET(METIS_CONFIG_INCLUDE_DIR ${TPINC})
INCLUDE_DIRECTORIES(${TPDIST}/include)
ELSE ()
ADD_CUSTOM_TARGET(metis-5.1.0 ALL)
MESSAGE(STATUS "Found Metis: ${METIS_LIBRARY}")
SET(METIS_CONFIG_INCLUDE_DIR ${METIS_INCLUDE_DIR})
ENDIF()
ENDIF()
......@@ -8,14 +8,14 @@
IF (NOT WIN32)
OPTION(NEKTAR_USE_SCOTCH
"Use Scotch library for performing mesh partitioning." OFF)
"Use Scotch library for performing mesh partitioning." ON)
ENDIF(NOT WIN32)
IF (NEKTAR_USE_SCOTCH)
# First search for system TinyXML installs. Hint /opt/local for MacPorts.
FIND_LIBRARY(SCOTCH_LIBRARY NAMES scotch PATHS /opt/local/lib)
FIND_LIBRARY(SCOTCHERR_LIBRARY NAMES scotcherr PATHS /opt/local/lib)
FIND_PATH (SCOTCH_INCLUDE_DIR scotch.h PATHS /opt/local/include)
FIND_LIBRARY(SCOTCH_LIBRARY NAMES scotch PATHS ${MACPORTS_PREFIX}/lib)
FIND_LIBRARY(SCOTCHERR_LIBRARY NAMES scotcherr PATHS ${MACPORTS_PREFIX}/lib)
FIND_PATH (SCOTCH_INCLUDE_DIR scotch.h PATHS ${MACPORTS_PREFIX}/include)
IF (SCOTCH_LIBRARY AND SCOTCHERR_LIBRARY AND SCOTCH_INCLUDE_DIR)
SET(BUILD_SCOTCH OFF)
......@@ -27,6 +27,8 @@ IF (NEKTAR_USE_SCOTCH)
"Build Scotch library from ThirdParty" ${BUILD_SCOTCH}
"NEKTAR_USE_SCOTCH" OFF)
ADD_DEFINITIONS(-DNEKTAR_USE_SCOTCH)
IF (THIRDPARTY_BUILD_SCOTCH)
UNSET(FLEX CACHE)
FIND_PROGRAM(FLEX flex)
......@@ -38,7 +40,7 @@ IF (NEKTAR_USE_SCOTCH)
# Note that scotch is compiled in the source-tree, so we unpack the
# source code in the ThirdParty builds directory.
SET(SCOTCH_SRC ${TPBUILD}/scotch-6.0.0/src)
SET(SCOTCH_SRC ${TPBUILD}/scotch-6.0.4/src)
IF (APPLE)
SET(SCOTCH_MAKE Makefile.inc.i686_mac_darwin8)
......@@ -57,15 +59,15 @@ IF (NEKTAR_USE_SCOTCH)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
scotch-6.0.0
scotch-6.0.4
PREFIX ${TPSRC}
URL ${TPURL}/scotch_6.0.0.tar.gz
URL_MD5 "ba117428c0a6cd97d0c93e8b872bb3fe"
URL ${TPURL}/scotch_6.0.4.tar.gz
URL_MD5 "d58b825eb95e1db77efe8c6ff42d329f"
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPBUILD}/scotch-6.0.0
BINARY_DIR ${TPBUILD}/scotch-6.0.0
TMP_DIR ${TPBUILD}/scotch-6.0.0-tmp
SOURCE_DIR ${TPBUILD}/scotch-6.0.4
BINARY_DIR ${TPBUILD}/scotch-6.0.4
TMP_DIR ${TPBUILD}/scotch-6.0.4-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND rm -f ${SCOTCH_SRC}/Makefile.inc
COMMAND ln -s
......@@ -88,7 +90,7 @@ IF (NEKTAR_USE_SCOTCH)
MESSAGE(STATUS "Build Scotch: ${SCOTCH_LIBRARY}")
SET(SCOTCH_CONFIG_INCLUDE_DIR ${TPINC})
ELSE (THIRDPARTY_BUILD_SCOTCH)
ADD_CUSTOM_TARGET(scotch-6.0.0 ALL)
ADD_CUSTOM_TARGET(scotch-6.0.4 ALL)
MESSAGE(STATUS "Found Scotch: ${SCOTCH_LIBRARY}")
SET(SCOTCH_CONFIG_INCLUDE_DIR ${SCOTCH_INCLUDE_DIR})
ENDIF (THIRDPARTY_BUILD_SCOTCH)
......
......@@ -57,9 +57,10 @@ high-memory node, prior to being executed on a multi-node cluster.
\lstinline[style=BashInputStyle]{--use-metis}\\
\hangindent=1.5cm
Forces the use of METIS for mesh partitioning. If \nekpp{} is compiled with
Scotch support, the default is to use Scotch.
Forces the use of METIS for mesh partitioning. Requires the
\inltt{NEKTAR\_USE\_METIS} option to be set.
\lstinline[style=BashInputStyle]{--use-scotch}\\
\hangindent=1.5cm
Forces the use of Scotch for mesh partitioning.
Forces the use of Scotch for mesh partitioning. If \nekpp{} is compiled with
METIS support, the default is to use METIS.
......@@ -49,7 +49,7 @@ be downloaded and compiled for use with Nektar++ \emph{automatically} (but not
installed system-wide).
\begin{center}
\begin{tabular}{lccccl}
\begin{tabularx}{\linewidth}{lccccX}
\toprule
& & \multicolumn{3}{c}{Installation} & \\ \cmidrule(r){3-5}
Package & Req. & Sys. & User & Auto. & Note \\
......@@ -65,7 +65,10 @@ LAPACK & \cmark & \cmark & \cmark & & \\
Boost $>=1.52$ & \cmark & \cmark & \cmark & \cmark & Compile
with iostreams
\\
ModMETIS & \cmark & & & \cmark & \\
Scotch & & \cmark & \cmark & \cmark & Required
for multi-level static condensation, highly recommended\\
METIS & & \cmark & \cmark & \cmark &
Alternative mesh partitioning\\
FFTW $>3.0$ & & \cmark & \cmark & \cmark & For
high-performance FFTs\\
ARPACK $>2.0$ & & \cmark & \cmark & & For
......@@ -78,12 +81,10 @@ HDF5 & & \cmark & \cmark & \cmark & For
large-scale parallel I/O (requires CMake >3.1)\\
PETSc & & & \cmark & \cmark &
Alternative linear solvers\\
Scotch & & \cmark & \cmark & \cmark &
Alternative mesh partitioning\\
VTK $>5.8$ & & \cmark & \cmark & & Visualisation
utilities\\
\bottomrule
\end{tabular}
\end{tabularx}
\end{center}
\begin{warningbox}
......@@ -208,7 +209,7 @@ system-wide).
\end{notebox}
\begin{center}
\begin{tabular}{lccccl}
\begin{tabularx}{\linewidth}{lccccX}
\toprule
& & \multicolumn{3}{c}{Installation} & \\ \cmidrule(r){3-5}
Package & Req. & MacPorts & User & Auto. & Note \\
......@@ -223,7 +224,10 @@ Xcode \\
Boost $>=1.52$ & \cmark & \texttt{boost} & \cmark & \cmark & Compile
with iostreams \\
TinyXML & \cmark & \texttt{tinyxml} & \cmark & \cmark & \\
ModMETIS & \cmark & & & \cmark & \\
Scotch & & \texttt{scotch} & \cmark & \cmark & Required
for multi-level static condensation, highly recommended\\
METIS & & \texttt{metis} & \cmark & \cmark &
Alternative mesh partitioning\\
FFTW $>3.0$ & & \texttt{fftw-3} & \cmark & \cmark & For
high-performance FFTs\\
ARPACK $>2.0$ & & \texttt{arpack} & \cmark & & For
......@@ -236,12 +240,10 @@ HDF5 & & \cmark & \cmark & \cmark & For
large-scale parallel I/O (requires CMake >3.1)\\
PETSc & & \texttt{petsc} & \cmark & \cmark &
Alternative linear solvers\\
Scotch & & \texttt{scotch} & \cmark & \cmark &
Alternative mesh partitioning\\
VTK $>5.8$ & & \texttt{vtk} & \cmark & &
Visualisation utilities\\
\bottomrule
\end{tabular}
\end{tabularx}
\end{center}
\newsavebox\installationOSXMacPortsTip
......@@ -364,7 +366,7 @@ additional build packages. These can either be installed by the user, or
automatically in the build process.
\begin{center}
\begin{tabular}{lcccl}
\begin{tabularx}{\linewidth}{lcccX}
\toprule
& & \multicolumn{2}{c}{Installation} & \\ \cmidrule(r){3-4}
Package & Req. & User & Auto. & Note \\
......@@ -374,9 +376,8 @@ CMake $\geq 3.0$ & \cmark & \cmark & & \\
BLAS & \cmark & \cmark & \cmark & \\
LAPACK & \cmark & \cmark & \cmark & \\
Boost $\geq 1.55$ & \cmark & \cmark & \cmark & Compile with iostreams\\
ModMETIS & \cmark & \cmark & \cmark & \\
\bottomrule
\end{tabular}
\end{tabularx}
\end{center}
\subsubsection{Detailed instructions}
......@@ -583,6 +584,12 @@ can be selected using the following options:
that \nekpp be built with MPI support with \inlsh{NEKTAR\_USE\_MPI} enabled
and that HDF5 is compiled with MPI support.
\item \inlsh{NEKTAR\_USE\_METIS}
Build \nekpp with support for the METIS graph partitioning library. This
provides both an alternative mesh partitioning algorithm to SCOTCH for
parallel simulations.
\item \inlsh{NEKTAR\_USE\_MKL}
Use the Intel MKL library. This is typically available on cluster
......@@ -604,12 +611,13 @@ can be selected using the following options:
Build \nekpp with support for the PETSc package for solving linear systems.
\item \inlsh{NEKTAR\_USE\_SCOTCH}
\item \inlsh{NEKTAR\_USE\_SCOTCH} (Recommended)
Build \nekpp with support for the SCOTCH graph partitioning library. This
provides an alternative mesh partitioning algorithm to METIS. However, METIS
is still required as it is used by the multi-level static condensation
algorithm.
provides both a mesh partitioning algorithm for parallel simulations and
enabled support for multi-level static condensation, so is highly
recommended and enabled by default. However for systems that do not support
SCOTCH build requirements (e.g. Windows), this can be disabled.
\item \inlsh{NEKTAR\_USE\_SMV}
......@@ -642,8 +650,8 @@ automatically built during the \nekpp build process. Below are the choices of X:
\item \inlsh{METIS}
A graph partitioning library used for substructuring of matrices and mesh
partitioning when \nekpp is run in parallel.
A graph partitioning library used for mesh partitioning when \nekpp is run
in parallel.
\item \inlsh{PETSC}
......@@ -651,8 +659,9 @@ automatically built during the \nekpp build process. Below are the choices of X:
\item \inlsh{SCOTCH}
An alternative graph partitioning library used for mesh partitioning when
\nekpp is run in parallel.
A graph partitioning library used for mesh partitioning when \nekpp is run
in parallel, and reordering routines that are used in multi-level static
condensation.
\item \inlsh{TINYXML}
......
......@@ -1518,6 +1518,91 @@ This leads to small grid spacing required to resolve all physical scales associa
Schmidt number = kinematic viscosity/diffusion coefficient). Hence, small diffusion coefficient might lead to spurious
oscillations if the mesh spacing is not small enough.
\section{Imposing a constant flowrate}
In some simulations, it may be desirable to drive the flow by fixing a value of
the volumetric flux through a boundary surface. A common use case for this is a
channel flow, where the inflow and outflow are treated using periodic boundary
conditions, requiring a use of either a body force or a flowrate condition to
drive the flow. Often, the use of a body force is sufficient, but in some cases
(e.g. transitional or turbulent simulations), it may be difficult to determine
the correct body force to use in order to attain a specific Reynolds number. The
incompressible solver supports the use of an alternative forcing whereby the
volumetric flux,
%
\[
Q(\mathbf{u}) = \frac{1}{\mu(R)} \int_R \mathbf{u}\cdot d\mathbf{s},
\]
%
through a user-defined surface $R$ of area $\mu(R)$ is kept constant. This is
supported for standard two- and three-dimensional simulations, where $R$ is a
boundary region, as well as three-dimensional homogeneous simulations. In the
latter case, the forcing can be imposed either in the homogeneous direction (in
the $x-y$ plane) or perpendicular to it (in the $z$ direction).
The flowrate correction works by taking each timestep's velocity field
$\mathbf{u}^{n}$, and computing a scalar $\alpha$ so that the corrected flow
%
\[
\tilde{\mathbf{u}}^n = \mathbf{u}^n + \alpha\mathbf{u}_s
\]
has the desired flowrate. Here, $\mathbf{u}_s$ is a linear Stokes solution that
is calculated once at the start of the simulation, so that the condition is not
expensive to implement.
To enable flowrate corrections, three things must be defined in the session
file:
\begin{itemize}
\item The \inltt{Flowrate} parameter in the parameters section, which defines
the desired value of the volumetric flux $Q(\mathbf{u})$ through the reference
region. To set $Q = 1$ we would therefore define:
\begin{lstlisting}[style=XMLStyle]
<PARAMETERS>
<P> Flowrate = 1.0 </P>
</PARAMETERS>
\end{lstlisting}
\item A boundary condition must be tagged with the \inltt{Flowrate}
user-defined type to define the reference region $R$. For example, a 2D
channel flow with periodic boundary conditions might use the following
arrangement:
\begin{lstlisting}[style=XMLStyle]
<BOUNDARYCONDITIONS>
<REGION REF="0">
<P VAR="u" VALUE="[1]" USERDEFINEDTYPE="Flowrate" />
<P VAR="v" VALUE="[1]" USERDEFINEDTYPE="Flowrate" />
<P VAR="p" VALUE="[1]" USERDEFINEDTYPE="Flowrate" />
</REGION>
<REGION REF="1">
<P VAR="u" VALUE="[0]" />
<P VAR="v" VALUE="[0]" />
<P VAR="p" VALUE="[0]" />
</REGION>
</BOUNDARYCONDITIONS>
\end{lstlisting}
\item a \inltt{FlowrateForce} function with components \inltt{ForceX},
\inltt{ForceY} and \inltt{ForceZ} that defines the direction in which the
forcing will be applied. This should be a unit vector (i.e. of magnitude 1)
and constant (i.e. not dependent on $x$, $y$, $z$ or $t$). As an example, to
impose a force in the $x$-direction we specify:
\begin{lstlisting}[style=XMLStyle]
<FUNCTION NAME="FlowrateForce">
<E VAR="ForceX" VALUE="1.0" />
<E VAR="ForceY" VALUE="0.0" />
<E VAR="ForceZ" VALUE="0.0" />
</FUNCTION>
\end{lstlisting}
\end{itemize}
Note that in homogeneous simulations where the forcing is in the $z$-direction,
only the \inltt{Flowrate} parameter is required and the reference area $R$ is
taken to be the homogeneous plane.
Optionally, the \inltt{IO\_FlowSteps} parameter can be defined. If set to a
non-zero integer, this produces a file \inltt{session.prs} which records the
value of $\alpha$ used in the flowrate correction, every \inltt{IO\_FlowSteps}
steps.
\section{Examples}
\subsection{Kovasznay Flow 2D}
......
......@@ -318,7 +318,7 @@ class IProductWRTDerivBase_IterPerExp : public Operator
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_dim = PtsKey.size();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
int nqtot = m_stdExp->GetTotPoints();
......@@ -605,7 +605,7 @@ class IProductWRTDerivBase_SumFac_Quad : public Operator
{
Vmath::Vmul (ntot,m_derivFac[i],1, in[0],1,
tmp[i],1);
for(int j = 1; j < m_coordim; ++j)
for(int j = 1; j < 2; ++j)
{
Vmath::Vvtvp (ntot,m_derivFac[i +j*2],1,
in[j],1, tmp[i], 1, tmp[i],1);
......@@ -670,7 +670,7 @@ class IProductWRTDerivBase_SumFac_Quad : public Operator
m_derbase1(m_stdExp->GetBasis(1)->GetDbdata())
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
......@@ -756,7 +756,7 @@ class IProductWRTDerivBase_SumFac_Tri : public Operator
{
Vmath::Vmul (ntot,m_derivFac[i],1, in[0],1, tmp[i],1);
for(int j = 1; j < m_coordim; ++j)
for(int j = 1; j < 2; ++j)
{
Vmath::Vvtvp (ntot,m_derivFac[i +j*2],1,
in[j],1, tmp[i], 1, tmp[i],1);
......@@ -832,7 +832,7 @@ class IProductWRTDerivBase_SumFac_Tri : public Operator
m_derbase1(m_stdExp->GetBasis(1)->GetDbdata())
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
......
......@@ -156,7 +156,7 @@ class PhysDeriv_StdMat : public Operator
int nqtot = 1;
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_dim = PtsKey.size();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
for(int i = 0; i < m_dim; ++i)
{
......@@ -326,7 +326,7 @@ class PhysDeriv_IterPerExp : public Operator
int nqtot = 1;
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_dim = PtsKey.size();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
for(int i = 0; i < m_dim; ++i)
{
......@@ -582,7 +582,7 @@ class PhysDeriv_SumFac_Seg : public Operator
m_nquad0 (m_stdExp->GetNumPoints(0))
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
......@@ -712,7 +712,7 @@ class PhysDeriv_SumFac_Quad : public Operator
m_nquad1 (m_stdExp->GetNumPoints(1))
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
......@@ -864,7 +864,7 @@ class PhysDeriv_SumFac_Tri : public Operator
m_nquad1 (m_stdExp->GetNumPoints(1))
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
......@@ -1046,7 +1046,7 @@ class PhysDeriv_SumFac_Hex : public Operator
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
......@@ -1274,7 +1274,7 @@ class PhysDeriv_SumFac_Tet : public Operator
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();
m_derivFac = pGeomData->GetDerivFactors(pCollExp);
......@@ -1488,7 +1488,7 @@ class PhysDeriv_SumFac_Prism : public Operator
{
LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
m_coordim = m_stdExp->GetCoordim();
m_coordim = pCollExp[0]->GetCoordim();