PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
#include "postprocessing_kernels.h"
Go to the source code of this file.
Functions | |
PetscErrorCode | ComputeNodalAverage (UserCtx *user, const char *in_field_name, const char *out_field_name) |
Computes node-centered data by averaging 8 surrounding cell-centered values, exactly replicating the legacy code's indexing and boundary handling. | |
PetscErrorCode | ComputeQCriterion (UserCtx *user) |
Computes the Q-Criterion, a scalar value identifying vortex cores. | |
PetscErrorCode | NormalizeRelativeField (UserCtx *user, const char *relative_field_name) |
Normalizes a relative field by subtracting a reference value. | |
PetscErrorCode | ComputeSpecificKE (UserCtx *user, const char *velocity_field, const char *ske_field) |
Computes the specific kinetic energy (KE per unit mass) for each particle. | |
PetscErrorCode ComputeNodalAverage | ( | UserCtx * | user, |
const char * | in_field_name, | ||
const char * | out_field_name | ||
) |
Computes node-centered data by averaging 8 surrounding cell-centered values, exactly replicating the legacy code's indexing and boundary handling.
This kernel uses a stencil that averages the 8 cells from the corner (i,j,k) to (i+1, j+1, k+1) and stores the result at the output node (i,j,k). This matches the legacy code's behavior. It operates on the full range of output nodes necessary for the subsampled grid, preventing zero-padding at the boundaries.
user | The UserCtx, providing access to DMs and Vecs. |
in_field_name | The string name of the source Vec (e.g., "P", "Ucat"). |
out_field_name | The string name of the destination Vec (e.g., "P_nodal"). |
Definition at line 17 of file postprocessing_kernels.c.
PetscErrorCode ComputeQCriterion | ( | UserCtx * | user | ) |
Computes the Q-Criterion, a scalar value identifying vortex cores.
This function is self-contained. It ensures all its required input data (Ucat and grid metrics) have up-to-date ghost values before proceeding with the calculation. The result is stored in the global vector user->Qcrit.
user | The UserCtx, providing access to all necessary data. |
Definition at line 108 of file postprocessing_kernels.c.
PetscErrorCode NormalizeRelativeField | ( | UserCtx * | user, |
const char * | relative_field_name | ||
) |
Normalizes a relative field by subtracting a reference value.
This kernel finds the relative field at a specific grid point (i,j,k) and subtracts this value from the entire field. The reference point is configurable via command-line options (-ip, -jp, -kp). The operation is performed in-place on the provided relative field vector.
user | The UserCtx, providing access to DMs and Vecs. |
relative_field_name | The string name of the relative field Vec to normalize (e.g., "P"). |
Definition at line 240 of file postprocessing_kernels.c.
PetscErrorCode ComputeSpecificKE | ( | UserCtx * | user, |
const char * | velocity_field, | ||
const char * | ske_field | ||
) |
Computes the specific kinetic energy (KE per unit mass) for each particle.
This kernel calculates SKE = 0.5 * |velocity|^2. It requires that the velocity field exists and will populate the specific kinetic energy field. The output field must be registered before this kernel is called.
user | The UserCtx containing the DMSwarm. |
velocity_field | The name of the input vector field for particle velocity. |
ske_field | The name of the output scalar field to store specific KE. |
Definition at line 327 of file postprocessing_kernels.c.