|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Header file for Particle related physics modules. More...
#include <petsc.h>#include <petscdmswarm.h>#include <stdbool.h>#include <petscsys.h>#include <math.h>#include "variables.h"#include "logging.h"#include "walkingsearch.h"Go to the source code of this file.
Functions | |
| PetscErrorCode | UpdateParticleField (const char *fieldName, PetscReal dt, PetscReal *psi_io, PetscReal diffusivity, PetscReal mean_val, PetscReal cell_vol, PetscReal C_model) |
| Updates a single particle's field based on its state and the specified field name. | |
| PetscErrorCode | UpdateFieldForAllParticles (UserCtx *user, const char *fieldName) |
| Loops over all local particles and updates a specified field. | |
| PetscErrorCode | UpdateAllParticleFields (UserCtx *user) |
| Orchestrates the update of all physical properties for particles. | |
Header file for Particle related physics modules.
This file contains declarations of functions responsible for solving for fields in the particle swarms within a simulation using PETSc's DMSwarm.
Definition in file ParticlePhysics.h.
| PetscErrorCode UpdateParticleField | ( | const char * | fieldName, |
| PetscReal | dt, | ||
| PetscReal * | psi_io, | ||
| PetscReal | diffusivity, | ||
| PetscReal | mean_val, | ||
| PetscReal | cell_vol, | ||
| PetscReal | C_model | ||
| ) |
Updates a single particle's field based on its state and the specified field name.
This function serves as a switchboard for various particle property calculations. Given a particle's data, it computes a new value for the specified field.
Currently supported fields:
| [in] | fieldName | The name of the field to update (e.g., "Psi"). |
| [in] | t | The current simulation time. |
| [in] | pos | The particle's physical position. |
| [in] | vel | The particle's velocity. |
| [in,out] | psi_io | A pointer to the particle's current Psi value (used for accumulation if needed). |
Updates a single particle's field based on its state and physics model.
Implements the IEM (Interaction by Exchange with the Mean) model for scalar mixing.
Physics: dPsi/dt = -Omega * (Psi - <Psi>) Solution: Psi_new = <Psi> + (Psi_old - <Psi>) * exp(-Omega * dt)
| [in] | fieldName | Name of the field (e.g., "Psi"). |
| [in] | dt | Time step size. |
| [in,out] | psi_io | Pointer to the particle's scalar value (Psi). |
| [in] | diffusivity | Particle diffusivity (Gamma + Gamma_t). |
| [in] | mean_val | Local Eulerian mean value (<Psi>). |
| [in] | cell_vol | Volume of the host cell (1/Jacobian). |
| [in] | C_model | Model constant (C_IEM). |
Updates a single particle's field based on its state and the specified field name.
Implements the IEM (Interaction by Exchange with the Mean) model for scalar mixing.
Physics: dPsi/dt = -Omega * (Psi - <Psi>) Solution: Psi_new = <Psi> + (Psi_old - <Psi>) * exp(-Omega * dt)
| [in] | fieldName | Name of the field (e.g., "Psi"). |
| [in] | dt | Time step size. |
| [in,out] | psi_io | Pointer to the particle's scalar value (Psi). |
| [in] | diffusivity | Particle diffusivity (Gamma + Gamma_t). |
| [in] | mean_val | Local Eulerian mean value (<Psi>). |
| [in] | cell_vol | Volume of the host cell (1/Jacobian). |
| [in] | C_model | Model constant (C_IEM). |
Definition at line 25 of file ParticlePhysics.c.
| PetscErrorCode UpdateFieldForAllParticles | ( | UserCtx * | user, |
| const char * | fieldName | ||
| ) |
Loops over all local particles and updates a specified field.
This function orchestrates the update of a single particle field across the entire local swarm. It gets access to the necessary particle data arrays and calls the UpdateParticleField kernel for each particle.
| [in,out] | user | Pointer to the UserCtx containing the swarm and simulation context. |
| [in] | fieldName | The name of the field to update (e.g., "Psi"). |
Prepares necessary Eulerian and Lagrangian data structures before looping.
| [in,out] | user | Pointer to the UserCtx. |
| [in] | fieldName | The name of the field to update (e.g., "Psi"). |
Definition at line 76 of file ParticlePhysics.c.
| PetscErrorCode UpdateAllParticleFields | ( | UserCtx * | user | ) |
Orchestrates the update of all physical properties for particles.
This function serves as the top-level entry point for updating particle-specific physical quantities after their position and the surrounding fluid velocity are known. It calls a sequence of more specific update routines for each property.
For example, it can be configured to update:
| [in,out] | user | Pointer to the UserCtx containing the swarm and simulation context. |
Definition at line 178 of file ParticlePhysics.c.