PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
// Setup the Initial conditions for different cases. More...
#include "initialcondition.h"
Go to the source code of this file.
Functions | |
PetscErrorCode | SetInitialInteriorField (UserCtx *user, const char *fieldName) |
Sets the initial values for the INTERIOR of a specified Eulerian field. | |
static PetscErrorCode | FinalizeBlockState (UserCtx *user) |
(HELPER) Finalizes a block's state by applying BCs, converting to Cartesian, and synchronizing ghost regions. | |
static PetscErrorCode | SetInitialFluidState_FreshStart (SimCtx *simCtx) |
(HELPER) Sets the t=0 fluid state for all blocks. | |
static PetscErrorCode | SetInitialFluidState_Restart (SimCtx *simCtx) |
(HELPER) Reads fluid state for all blocks from restart files. | |
PetscErrorCode | InitializeEulerianState (SimCtx *simCtx) |
High-level orchestrator to set the complete initial state of the Eulerian solver. | |
// Setup the Initial conditions for different cases.
Test program for DMSwarm interpolation using the fdf-curvIB method.
Definition in file initialcondition.c.
PetscErrorCode SetInitialInteriorField | ( | UserCtx * | user, |
const char * | fieldName | ||
) |
Sets the initial values for the INTERIOR of a specified Eulerian field.
This function initializes the interior nodes of Ucont
based on a profile selected by user->FieldInitialization
. It explicitly skips any node that lies on a global boundary, as those values are set by the Boundary System's Initialize
methods.
The initialization is directional, aligned with the primary INLET face that was identified by the parser. This ensures the initial flow is physically meaningful.
Supported user->FieldInitialization
profiles for "Ucont":
uin
. Other contravariant components are zero.user | The main UserCtx struct, containing all simulation data and configuration. |
fieldName | A string ("Ucont" or "P") identifying which field to initialize. |
Definition at line 30 of file initialcondition.c.
|
static |
(HELPER) Finalizes a block's state by applying BCs, converting to Cartesian, and synchronizing ghost regions.
Definition at line 242 of file initialcondition.c.
|
static |
(HELPER) Sets the t=0 fluid state for all blocks.
This function replicates the initialization sequence for a fresh start from the legacy code. It sets an initial guess for the interior, establishes the boundary conditions, and ensures the final state is consistent across MPI ranks.
Definition at line 274 of file initialcondition.c.
|
static |
(HELPER) Reads fluid state for all blocks from restart files.
Definition at line 319 of file initialcondition.c.
PetscErrorCode InitializeEulerianState | ( | SimCtx * | simCtx | ) |
High-level orchestrator to set the complete initial state of the Eulerian solver.
This function is called once from main() before the time loop begins. It inspects the simulation context to determine whether to perform a fresh start (t=0) or restart from saved files. It then delegates to the appropriate helper function. Finally, it initializes the solver's history vectors (Ucont_o, P_o, etc.) to ensure the first time step has the necessary data.
Definition at line 352 of file initialcondition.c.