PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
initialcondition.h
Go to the documentation of this file.
1#ifndef INITIALCONDITION_H
2#define INITIALCONDITION_H
3
4#include <petscpf.h>
5#include <petscdmswarm.h>
6#include <stdlib.h>
7#include <time.h>
8#include <math.h>
9#include <petsctime.h>
10#include <petscsys.h>
11#include <petscdmcomposite.h>
12#include <petscsystypes.h>
13// Include additional headers
14#include "variables.h" // Shared type definitions
15#include "ParticleSwarm.h" // Particle swarm functions
16#include "walkingsearch.h" // Particle location functions
17#include "grid.h" // Grid functions
18#include "logging.h" // Logging macros
19#include "io.h" // Data Input and Output functions
20#include "interpolation.h" // Interpolation routines
21#include "AnalyticalSolutions.h" // Analytical Solution for testing
22#include "ParticleMotion.h" // Functions related to motion of particles
23#include "Boundaries.h" // Functions related to Boundary condition
24#include "runloop.h"
25
26/**
27 * @brief Populate Ucont for one fresh-start block from the initial source (`-ic_source_*`).
28 * @details A staged field, when there is one, is read first: Ucat, or Ucont. The source's
29 * expressions then add their flux at every owned face. With `-ic_source_field_weight w`
30 * the staged field is scaled by w, and with a bulk velocity the expressions are scaled
31 * by PicurvSourceCellBulkFactor(). Collective.
32 * @param[in,out] user Block context whose velocity field is populated.
33 * @return PETSc error code.
34 */
35PetscErrorCode PopulateInitialUcont(UserCtx *user);
36
37/**
38 * @brief High-level orchestrator to set the complete initial state of the Eulerian solver.
39 *
40 * This function is called once from main() before the time loop begins. It inspects
41 * the simulation context to determine whether to perform a fresh start (t=0) or
42 * restart from saved files. It then delegates to the appropriate helper function.
43 * Finally, it initializes the solver's history vectors (Ucont_o, P_o, etc.)
44 * to ensure the first time step has the necessary data.
45 *
46 * @param simCtx Simulation context controlling the operation.
47 * @return PetscErrorCode 0 on success.
48 */
49PetscErrorCode InitializeEulerianState(SimCtx *simCtx);
50
51#endif // INITIALCONDITION_H
Header file for Particle Motion and migration related functions.
Header file for Particle Swarm management functions.
Public interface for grid, solver, and metric setup routines.
PetscErrorCode InitializeEulerianState(SimCtx *simCtx)
High-level orchestrator to set the complete initial state of the Eulerian solver.
PetscErrorCode PopulateInitialUcont(UserCtx *user)
Populate Ucont for one fresh-start block from the initial source (-ic_source_*).
Public interface for data input/output routines.
Logging utilities and macros for PETSc-based applications.
Main header file for a complex fluid dynamics solver.
The master context for the entire simulation.
Definition variables.h:916
User-defined context containing data specific to a single computational grid level.
Definition variables.h:1157
Header file for particle location functions using the walking search algorithm.