|
Neko 1.99.3
A portable framework for high-order spectral element flow simulations
|
filter_t is a base type for filters on field_t by calling subroutine filter_tapply(F_out, F_in), where F_out and F_in are the output and the input fields, respectively.
The derived type of filter_t includes PDE_filter_t, elementwise_filter_t, ...
The PDE filter is defined in the derived type PDE_filter_t. The filter is `based on the work of B. S. Lazarov, O. Sigmund that solves a Helmholtz-type differential equation to provide smoothing. The equation has the form
\[ -r^2 \nabla^2 X_\text{out} + X_\text{out} = X_\text{in}, \]
subject to Neumann boundary conditions. The filter has the following input parameters:
| Name | Description | Admissible values | Default value |
|---|---|---|---|
r | \(r\) is the above equation. | Real | - |
tol | The desired tolerance used when solving the system. | Real | 0.0000000001 |
max_iter | Maximum number of iterations when solving the system. | Integer | 200 |
solver | Numerical solver used to solve the system. | cg,gmres, gmres | cg |
preconditioner | Pre-conditioner used to solve the system. | ident, hsmg, jacobi | jacobi |
The elementwise filter is defined in the derived type elementwise_filter_t. Basing on the spectral element discretization, it is performed by mapping the field into hierarchical polynomials element by element (currently only Legendre-like polynomials are supported) and then attenuating the kernel for different orders. One could directly set it up through the json file if the filter is needed in any section.
The user can also modify elementwise_filter_type and transfer_function according to their need.
elementwise_filter_type is an optional string to specify the type of usage of the polynomial for the filter.
| Name | Polynomials |
|---|---|
nonBoyd | i-th order polynomials L_i(x) |
Boyd | L_i(x) for i<2, L_i(x) - L_{i-2}(x) for i>=2 |
The kernel is defined through an optional array transfer_function whose size is the number of polynomials. The indices of transfer_function corresponds to the polynomial order in ascending order. transfer_function is initialized to be all 1 such that the filter has no effect by default unless further defined.
One could set up the elementwise_filter in the following way for polynomial order 7.
One could also refer to dynamic_smagorinsky.f90 for an example of using elementwise_filter_t in the neko code.
The high-pass filter relaxation source term uses the elementwise filter as a low-pass filter and adds the high-pass residual to the right hand side. It can be used as a source term for the fluid momentum equation or for a scalar transport equation. See Source terms for the case-file setup.
Let \( q \) denote one velocity component or a scalar field. The source term added to the equation is
\[ f_\text{hpfrt}(q) = -\chi (I - F) q, \]
where \( F \) is the tensor-product elementwise low-pass filter and \( \chi \) is the filter weight. The negative sign makes the term dissipative for the high-pass part of the field.
The one-dimensional low-pass filter is defined by a modal transfer function. For filter_modes \( = k_f \) and \( n = lx \), let
\[ k_0 = n - k_f. \]
The transfer function used by the implementation is
\[ \sigma_k = \begin{cases} 1, & k \leq k_0,\\ 1 - \left(\frac{k-k_0}{k_f}\right)^2, & k_0 < k \leq n. \end{cases} \]
Thus the highest filter_modes modes are damped with a quadratic ramp, and the highest mode is removed from the low-pass-filtered signal. The tensor-product filter \( F \) is then applied element by element in each coordinate direction.
For the momentum equation, the source term is applied componentwise to \( u \), \( v \), and \( w \). For a scalar equation, it is applied to the scalar field owned by that scalar scheme.