|
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 physics model. | |
| 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 physics model.
Implements the IEM (Interaction by Exchange with the Mean) model for scalar mixing. Physics: dPsi/dt = -Omega * (Psi - Psi_mean) Solution: Psi_new = Psi_mean + (Psi_old - Psi_mean) * exp(-Omega * dt)
| fieldName | Name |
| dt | Time |
| psi_io | Pointer |
| diffusivity | Particle |
| mean_val | Local |
| cell_vol | Volume |
| C_model | Model |
Updates a single particle's field based on its state and physics model.
Local to this translation unit.
Definition at line 14 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"). |
Loops over all local particles and updates a specified field.
Local to this translation unit.
Definition at line 44 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. |
Orchestrates the update of all physical properties for particles.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/ParticlePhysics.h.
Definition at line 132 of file ParticlePhysics.c.