|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
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 | DimensionalizeField (UserCtx *user, const char *field_name) |
| Scales a specified field from non-dimensional to dimensional units in-place. | |
| PetscErrorCode | DimensionalizeAllLoadedFields (UserCtx *user) |
| Orchestrates the dimensionalization of all relevant fields loaded from a file. | |
| 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 166 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 264 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 400 of file postprocessing_kernels.c.
| PetscErrorCode DimensionalizeField | ( | UserCtx * | user, |
| const char * | field_name | ||
| ) |
Scales a specified field from non-dimensional to dimensional units in-place.
This function acts as a dispatcher. It takes the string name of a field, identifies the corresponding PETSc Vec object and the correct physical scaling factor (e.g., U_ref for velocity, P_ref for pressure), and then performs an in-place VecScale operation. It correctly handles the different physical dimensions of Cartesian velocity vs. contravariant volume flux.
| [in,out] | user | The UserCtx containing the PETSc Vecs to be modified. |
| [in] | field_name | The case-insensitive string name of the field to dimensionalize (e.g., "Ucat", "P", "Ucont", "Coordinates", "ParticlePosition", "ParticleVelocity"). |
Definition at line 20 of file postprocessing_kernels.c.
| PetscErrorCode DimensionalizeAllLoadedFields | ( | UserCtx * | user | ) |
Orchestrates the dimensionalization of all relevant fields loaded from a file.
This function is intended to be called in the post-processor immediately after all solver output has been read into memory. It calls DimensionalizeField() for each of the core physical quantities to convert the entire loaded state from non-dimensional to dimensional units, preparing it for analysis and visualization.
| [in,out] | user | The UserCtx containing all the fields to be dimensionalized. |
Definition at line 118 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 493 of file postprocessing_kernels.c.