PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
Filter.h
Go to the documentation of this file.
1#ifndef FILTER_H
2#define FILTER_H
3
4#include "variables.h"
5#include "logging.h"
6
7/**
8 * @brief Applies a numerical "test filter" to a 3x3x3 stencil of data points.
9 *
10 * EXPLANATION of "Test Filter":
11 * In the dynamic Smagorinsky LES model the model coefficient is not prescribed. It
12 * is calculated dynamically by sampling the turbulent energy cascade at two
13 * different scales. The first scale is the grid filter itself, implicit in the
14 * discretization. The second, larger scale is this explicit "test filter". By
15 * comparing how the resolved flow behaves at the two scales, the model determines
16 * how much dissipation the unresolved motions require.
17 *
18 * The kernel is selected by the caller rather than read from the simulation
19 * context, so a filter can be exercised on 27 numbers without a live run.
20 *
21 * @param[in] kernel Discrete stencil to apply.
22 * @param[in] values The 3x3x3 array of scalar values at the stencil points,
23 * indexed `[k][j][i]` in the DMDA convention.
24 * @param[in] weights The 3x3x3 array of cell volume weights. Ignored by
25 * ::LES_TEST_FILTER_SIMPSON_IK, which assumes uniform spacing
26 * in its homogeneous plane.
27 * @return The filtered value, or zero when every weight vanishes because the
28 * stencil lies entirely inside a solid body.
29 */
30double ApplyLESTestFilter(LESTestFilterKernel kernel, double values[3][3][3], double weights[3][3][3]);
31
32/**
33 * @brief Applies the test filter to all six components of a symmetric tensor.
34 *
35 * Filtering is linear, so applying it componentwise is exact; this wrapper exists
36 * so callers state the intent once instead of repeating six near-identical calls
37 * whose only difference is easy to mistype.
38 *
39 * @param[in] kernel Discrete stencil to apply.
40 * @param[in] values Per-stencil-point tensors, indexed `[k][j][i]`.
41 * @param[in] weights Cell volume weights over the same stencil.
42 * @param[out] filtered Componentwise filtered tensor.
43 * @return PetscErrorCode 0 on success.
44 */
45PetscErrorCode ApplyLESTestFilterSymTensor(LESTestFilterKernel kernel, SymTensor values[3][3][3],
46 double weights[3][3][3], SymTensor *filtered);
47
48#endif // FILTER_H
double ApplyLESTestFilter(LESTestFilterKernel kernel, double values[3][3][3], double weights[3][3][3])
Applies a numerical "test filter" to a 3x3x3 stencil of data points.
Definition Filter.c:123
PetscErrorCode ApplyLESTestFilterSymTensor(LESTestFilterKernel kernel, SymTensor values[3][3][3], double weights[3][3][3], SymTensor *filtered)
Applies the test filter to all six components of a symmetric tensor.
Definition Filter.c:147
Logging utilities and macros for PETSc-based applications.
Main header file for a complex fluid dynamics solver.
LESTestFilterKernel
Selects the discrete test-filter kernel used by the dynamic procedure.
Definition variables.h:591
A symmetric second-order tensor stored by its six independent components.
Definition variables.h:138