PICurv
0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
include
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 Sets the initial values for the INTERIOR of a specified Eulerian field.
28
*
29
* This function initializes the interior nodes of `Ucont` based on the mode selected
30
* by `simCtx->initialConditionMode`.
31
*
32
* Supported profiles for "Ucont":
33
* - IC_MODE_ZERO: All interior contravariant components are set to zero.
34
* - IC_MODE_CONSTANT_CARTESIAN: `UniformCart2Contra` dots the Cartesian
35
* vector `(InitialConstantContra.x/y/z)` with the local metric vectors to fill
36
* all three contravariant components correctly across the entire interior.
37
* - IC_MODE_CONSTANT_STREAMWISE: Sets only the
38
* contravariant component along the streamwise axis (from `flowDirection` or the
39
* identified INLET face) proportional to `icVelocityPhysical * |A_n|`.
40
* - IC_MODE_POISEUILLE: Separable parabolic profile in the two cross-stream index directions;
41
* centerline speed is `icVelocityPhysical`; streamwise axis from `flowDirection`
42
* or the identified INLET face.
43
*
44
* @param user The main UserCtx struct, containing all simulation data and configuration.
45
* @param field_id Typed identity of the field to initialize.
46
* @return PetscErrorCode 0 on success.
47
*/
48
PetscErrorCode
SetInitialInteriorField
(
UserCtx
*user,
FieldId
field_id);
49
50
/**
51
* @brief Populate Ucont for one fresh-start block from the configured IC mode.
52
*
53
* Built-in modes generate Ucont directly. File mode loads either Ucat or Ucont
54
* from the staged IC directory and converts Ucat when necessary.
55
* @param[in,out] user Block context whose velocity field is populated.
56
* @return PETSc error code.
57
*/
58
PetscErrorCode
PopulateInitialUcont
(
UserCtx
*user);
59
60
/**
61
* @brief High-level orchestrator to set the complete initial state of the Eulerian solver.
62
*
63
* This function is called once from main() before the time loop begins. It inspects
64
* the simulation context to determine whether to perform a fresh start (t=0) or
65
* restart from saved files. It then delegates to the appropriate helper function.
66
* Finally, it initializes the solver's history vectors (Ucont_o, P_o, etc.)
67
* to ensure the first time step has the necessary data.
68
*
69
* @param simCtx Simulation context controlling the operation.
70
* @return PetscErrorCode 0 on success.
71
*/
72
PetscErrorCode
InitializeEulerianState
(
SimCtx
*simCtx);
73
74
#endif
// INITIALCONDITION_H
AnalyticalSolutions.h
Boundaries.h
ParticleMotion.h
Header file for Particle Motion and migration related functions.
ParticleSwarm.h
Header file for Particle Swarm management functions.
FieldId
FieldId
Compile-time identity for a catalogued Eulerian field.
Definition
field_catalog.h:23
grid.h
Public interface for grid, solver, and metric setup routines.
SetInitialInteriorField
PetscErrorCode SetInitialInteriorField(UserCtx *user, FieldId field_id)
Sets the initial values for the INTERIOR of a specified Eulerian field.
Definition
initialcondition.c:14
InitializeEulerianState
PetscErrorCode InitializeEulerianState(SimCtx *simCtx)
High-level orchestrator to set the complete initial state of the Eulerian solver.
Definition
initialcondition.c:358
PopulateInitialUcont
PetscErrorCode PopulateInitialUcont(UserCtx *user)
Populate Ucont for one fresh-start block from the configured IC mode.
Definition
initialcondition.c:220
interpolation.h
io.h
Public interface for data input/output routines.
logging.h
Logging utilities and macros for PETSc-based applications.
runloop.h
variables.h
Main header file for a complex fluid dynamics solver.
SimCtx
The master context for the entire simulation.
Definition
variables.h:695
UserCtx
User-defined context containing data specific to a single computational grid level.
Definition
variables.h:906
walkingsearch.h
Header file for particle location functions using the walking search algorithm.
Generated by
1.9.8