|
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) |
| Interpolates a cell-centered field to nodal locations using local stencil averaging. | |
| PetscErrorCode | ComputeQCriterion (UserCtx *user) |
| Computes the Q-criterion diagnostic from the local velocity-gradient tensor. | |
| PetscErrorCode | NormalizeRelativeField (UserCtx *user, const char *relative_field_name) |
| Normalizes a relative scalar field using the configured reference pressure scale. | |
| 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 | ComputeDisplacement (UserCtx *user, const char *disp_field) |
| Computes the displacement magnitude |r_i - r_0| for each particle (per-particle VTK kernel). | |
| PetscErrorCode ComputeNodalAverage | ( | UserCtx * | user, |
| const char * | in_field_name, | ||
| const char * | out_field_name | ||
| ) |
Interpolates a cell-centered field to nodal locations using local stencil averaging.
The kernel reads the input field by name, computes nodal values, and stores the output in the named destination field. Both fields must already exist in the current UserCtx.
| [in,out] | user | Block-level context that owns the source and destination vectors. |
| [in] | in_field_name | Name of the input field to sample. |
| [in] | out_field_name | Name of the output field to populate. |
Interpolates a cell-centered field to nodal locations using local stencil averaging.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessing_kernels.h.
Definition at line 143 of file postprocessing_kernels.c.
| PetscErrorCode ComputeQCriterion | ( | UserCtx * | user | ) |
Computes the Q-criterion diagnostic from the local velocity-gradient tensor.
This kernel evaluates rotational versus strain-rate dominance and writes the result into the configured Q-criterion output vector for visualization and flow feature identification.
| [in,out] | user | Block-level context containing velocity fields and target output storage. |
Computes the Q-criterion diagnostic from the local velocity-gradient tensor.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessing_kernels.h.
Definition at line 237 of file postprocessing_kernels.c.
| PetscErrorCode NormalizeRelativeField | ( | UserCtx * | user, |
| const char * | relative_field_name | ||
| ) |
Normalizes a relative scalar field using the configured reference pressure scale.
This is primarily used for pressure-normalized outputs in post-processing. The operation is in-place on the selected field.
| [in,out] | user | Block-level context containing scaling information. |
| [in] | relative_field_name | Name of the field to normalize. |
Normalizes a relative scalar field using the configured reference pressure scale.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessing_kernels.h.
Definition at line 367 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"). |
Scales a specified field from non-dimensional to dimensional units in-place.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessing_kernels.h.
Definition at line 12 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. |
Orchestrates the dimensionalization of all relevant fields loaded from a file.
Local to this translation unit.
Definition at line 103 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. |
Computes the specific kinetic energy (KE per unit mass) for each particle.
Local to this translation unit.
Definition at line 452 of file postprocessing_kernels.c.
| PetscErrorCode ComputeDisplacement | ( | UserCtx * | user, |
| const char * | disp_field | ||
| ) |
Computes the displacement magnitude |r_i - r_0| for each particle (per-particle VTK kernel).
Reference point r_0 = (simCtx->psrc_x, psrc_y, psrc_z). Writes the scalar displacement to post_swarm[disp_field]. This is a visualisation kernel only — use ComputeParticleMSD from particle_statistics.h for quantitative global statistics.
| user | The UserCtx containing the DMSwarms. |
| disp_field | Name of the output scalar field in post_swarm. |
Computes the displacement magnitude |r_i - r_0| for each particle (per-particle VTK kernel).
Local to this translation unit.
Definition at line 494 of file postprocessing_kernels.c.