|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
#include <petscpf.h>#include <petscdmswarm.h>#include <stdlib.h>#include <time.h>#include <math.h>#include <petsctime.h>#include <petscdmcomposite.h>#include "variables.h"#include "ParticleSwarm.h"#include "walkingsearch.h"#include "grid.h"#include "logging.h"#include "io.h"#include "setup.h"#include "interpolation.h"Go to the source code of this file.
Macros | |
| #define | __FUNCT__ "AnalyticalSolutionEngine" |
Functions | |
| PetscErrorCode | SetAnalyticalGridInfo (UserCtx *user) |
| Sets the grid domain and resolution for analytical solution cases. | |
| PetscErrorCode | AnalyticalSolutionEngine (SimCtx *simCtx) |
| Dispatches to the appropriate analytical solution function based on simulation settings. | |
| PetscErrorCode | SetAnalyticalSolutionForParticles (Vec tempVec, SimCtx *simCtx) |
| Applies the analytical solution to particle velocity vector. | |
| #define __FUNCT__ "AnalyticalSolutionEngine" |
Definition at line 49 of file AnalyticalSolutions.h.
| PetscErrorCode SetAnalyticalGridInfo | ( | UserCtx * | user | ) |
Sets the grid domain and resolution for analytical solution cases.
This function is called when eulerianSource is "analytical". It is responsible for automatically configuring the grid based on the chosen AnalyticalSolutionType.
[0, 2*PI] physical domain among the available blocks.nblk=1):** The single block is assigned the full [0, 2*PI] domain.nblk>1):** It requires that the number of blocks be a perfect square (e.g., 4, 9, 16). It then arranges the blocks in a sqrt(nblk) by sqrt(nblk) grid in the X-Y plane, partitioning the [0, 2*PI] domain in X and Y accordingly. The Z domain for all blocks remains [0, 2*PI]. If nblk is not a perfect square, the simulation is aborted with an error.After setting the domain bounds, it proceeds to read the grid resolution options (-im, -jm, -km) from the command line for the specific block.
| user | Pointer to the UserCtx for a specific block. The function will populate the geometric fields (IM, JM, KM, Min_X, Max_X, etc.) within this struct. |
Definition at line 63 of file AnalyticalSolutions.c.
| PetscErrorCode AnalyticalSolutionEngine | ( | SimCtx * | simCtx | ) |
Dispatches to the appropriate analytical solution function based on simulation settings.
This function acts as a router. It reads the AnalyticalSolutionType from the simulation context and calls the corresponding private implementation function (e.g., for Taylor-Green Vortex, lid-driven cavity, etc.). This design keeps the main simulation code clean and makes it easy to add new analytical test cases.
| simCtx | The main simulation context, containing configuration and state. |
This function acts as a router. It reads the AnalyticalSolutionType string from the simulation context and calls the corresponding private implementation function (e.g., for Taylor-Green Vortex). This design keeps the main simulation code clean and makes it easy to add new analytical test cases.
| [in] | simCtx | The main simulation context, containing all configuration and state. |
Definition at line 184 of file AnalyticalSolutions.c.
| PetscErrorCode SetAnalyticalSolutionForParticles | ( | Vec | tempVec, |
| SimCtx * | simCtx | ||
| ) |
Applies the analytical solution to particle velocity vector.
Dispatcher function that calls the appropriate analytical solution based on simCtx->AnalyticalSolutionType. Supports multiple solution types.
| tempVec | The PETSc Vec containing particle positions which will be used to store velocities. |
| simCtx | The simulation context. |
Definition at line 447 of file AnalyticalSolutions.c.