Commit 5aed2b71 by David Moxey

 ... ... @@ -1520,22 +1520,25 @@ oscillations if the mesh spacing is not small enough. \section{Imposing a constant flowrate} In some simulations, it may be desirable to impose a constant flowrate condition in order to drive the flow. 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. The incompressible solver supports the use of an alternative forcing whereby the volumetric flux through a user-defined surface $R$ of area $\mu(R)$ 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} Q(\mathbf{u}) = \frac{1}{\mu(R)} \int_R \mathbf{u}\cdot d\mathbf{s},$ % is kept constant. This is supported for both standard two- and three-dimensional examples, as well as three-dimensional homogeneous simulations, where the forcing can either be in the homogeneous direction or perpendicular to it. 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 ... ... @@ -1543,15 +1546,26 @@ $\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. 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 this flowrate correction, the \inltt{Flowrate} parameter must first be defined, which dictates the value of $Q$ that will be imposed through the reference area $R$. If a homogeneous simulation is used and forcing is in the homogeneous direction, then the reference area is taken to be the homogeneous plane. Otherwise, the user should mark the boundary region to be used using the \inltt{Flowrate} user-defined boundary type, for example: 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]
\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] ... ... @@ -1566,12 +1580,11 @@ plane. Otherwise, the user should mark the boundary region to be used using the \end{lstlisting} Finally, a \inltt{FlowrateForce} function must be defined, which specifies the direction in which forcing is 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: \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] ... ... @@ -1579,6 +1592,11 @@ example, to impose a force in the $x$-direction we specify: \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 ... ...