|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
#include "BC_Handlers.h"Go to the source code of this file.
Data Structures | |
| struct | InletConstantData |
| Private data structure for the Constant Velocity Inlet handler. More... | |
| struct | InletParabolicData |
| Private data structure for the Parabolic Velocity Inlet handler. More... | |
| struct | InletProfileFileData |
| struct | DrivenConstantData |
| Private data structure for the handler. More... | |
Macros | |
| #define | __FUNCT__ "Validate_DrivenFlowConfiguration" |
| #define | __FUNCT__ "Create_WallNoSlip" |
| #define | __FUNCT__ "Apply_WallNoSlip" |
| #define | __FUNCT__ "Create_InletConstantVelocity" |
| #define | __FUNCT__ "Initialize_InletConstantVelocity" |
| #define | __FUNCT__ "PreStep_InletConstantVelocity" |
| #define | __FUNCT__ "Apply_InletConstantVelocity" |
| #define | __FUNCT__ "PostStep_InletConstantVelocity" |
| #define | __FUNCT__ "Destroy_InletConstantVelocity" |
| #define | __FUNCT__ "Create_InletParabolicProfile" |
| #define | __FUNCT__ "Initialize_InletParabolicProfile" |
| #define | __FUNCT__ "PreStep_InletParabolicProfile" |
| #define | __FUNCT__ "Apply_InletParabolicProfile" |
| #define | __FUNCT__ "PostStep_InletParabolicProfile" |
| #define | __FUNCT__ "Destroy_InletParabolicProfile" |
| #define | __FUNCT__ "Create_InletProfileFromFile" |
| #define | __FUNCT__ "Initialize_InletProfileFromFile" |
| #define | __FUNCT__ "PreStep_InletProfileFromFile" |
| #define | __FUNCT__ "Apply_InletProfileFromFile" |
| #define | __FUNCT__ "PostStep_InletProfileFromFile" |
| #define | __FUNCT__ "Destroy_InletProfileFromFile" |
| #define | __FUNCT__ "Create_OutletConservation" |
| #define | __FUNCT__ "PreStep_OutletConservation" |
| #define | __FUNCT__ "Apply_OutletConservation" |
| #define | __FUNCT__ "PostStep_OutletConservation" |
| #define | __FUNCT__ "Create_PeriodicDrivenConstant" |
| #define | __FUNCT__ "Initialize_PeriodicDrivenConstant" |
| #define | __FUNCT__ "PreStep_PeriodicDrivenConstant" |
| #define | __FUNCT__ "Apply_PeriodicDrivenConstant" |
| #define | __FUNCT__ "Destroy_PeriodicDrivenConstant" |
Functions | |
| PetscErrorCode | Validate_DrivenFlowConfiguration (UserCtx *user) |
Internal helper implementation: Validate_DrivenFlowConfiguration(). | |
| static PetscErrorCode | Apply_WallNoSlip (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Apply_WallNoSlip(). | |
| PetscErrorCode | Create_WallNoSlip (BoundaryCondition *bc) |
| Implementation of Create_WallNoSlip(). | |
| static PetscErrorCode | Initialize_InletConstantVelocity (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Initialize_InletConstantVelocity(). | |
| static PetscErrorCode | PreStep_InletConstantVelocity (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PreStep_InletConstantVelocity(). | |
| static PetscErrorCode | Apply_InletConstantVelocity (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Apply_InletConstantVelocity(). | |
| static PetscErrorCode | PostStep_InletConstantVelocity (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PostStep_InletConstantVelocity(). | |
| static PetscErrorCode | Destroy_InletConstantVelocity (BoundaryCondition *self) |
Internal helper implementation: Destroy_InletConstantVelocity(). | |
| PetscErrorCode | Create_InletConstantVelocity (BoundaryCondition *bc) |
| Implementation of Create_InletConstantVelocity(). | |
| static PetscErrorCode | Initialize_InletParabolicProfile (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Initialize_InletParabolicProfile(). | |
| static PetscErrorCode | PreStep_InletParabolicProfile (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PreStep_InletParabolicProfile(). | |
| static PetscErrorCode | Apply_InletParabolicProfile (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Apply_InletParabolicProfile(). | |
| static PetscErrorCode | PostStep_InletParabolicProfile (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PostStep_InletParabolicProfile(). | |
| static PetscErrorCode | Destroy_InletParabolicProfile (BoundaryCondition *self) |
Internal helper implementation: Destroy_InletParabolicProfile(). | |
| PetscErrorCode | Create_InletParabolicProfile (BoundaryCondition *bc) |
| Implementation of Create_InletParabolicProfile(). | |
| static PetscErrorCode | Initialize_InletProfileFromFile (BoundaryCondition *self, BCContext *ctx) |
| Initializes a file-prescribed inlet profile handler for one boundary face. | |
| static PetscErrorCode | PreStep_InletProfileFromFile (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Pre-step hook for the static file-prescribed inlet profile handler. | |
| static PetscErrorCode | Apply_InletProfileFromFile (BoundaryCondition *self, BCContext *ctx) |
| Applies the loaded PICSLICE scalar profile to Ucont and Ubcs on an inlet face. | |
| static PetscErrorCode | PostStep_InletProfileFromFile (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Accumulates the applied inlet flux for a file-prescribed profile. | |
| static PetscErrorCode | Destroy_InletProfileFromFile (BoundaryCondition *self) |
| Releases private storage owned by a file-prescribed inlet profile handler. | |
| static PetscErrorCode | GetBCParamStringLocal (BC_Param *params, const char *key, const char **value_out, PetscBool *found) |
| Looks up a string-valued boundary-condition parameter in a BC_Param list. | |
| static PetscErrorCode | GetProfileFileExpectedDims (UserCtx *user, BCFace face_id, PetscInt *n1, PetscInt *n2) |
| Computes the expected PICSLICE dimensions for an inlet face. | |
| static PetscErrorCode | ReadPicSliceProfile (const char *source_file, PetscInt expected_n1, PetscInt expected_n2, InletProfileFileData *data) |
| Reads and validates a static scalar inlet profile from a canonical PICSLICE file. | |
| static PetscReal | ProfileSpeedAt (const InletProfileFileData *data, PetscInt a, PetscInt b) |
| Returns one scalar speed from the flattened PICSLICE profile. | |
| PetscErrorCode | Create_InletProfileFromFile (BoundaryCondition *bc) |
| Implementation of Create_InletProfileFromFile(). | |
| static PetscErrorCode | PreStep_OutletConservation (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PreStep_OutletConservation(). | |
| static PetscErrorCode | Apply_OutletConservation (BoundaryCondition *self, BCContext *ctx) |
| (Handler Action) Applies mass conservation correction to the outlet face. | |
| static PetscErrorCode | PostStep_OutletConservation (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PostStep_OutletConservation(). | |
| PetscErrorCode | Create_OutletConservation (BoundaryCondition *bc) |
| Implementation of Create_OutletConservation(). | |
| PetscErrorCode | Create_PeriodicGeometric (BoundaryCondition *bc) |
| Implementation of Create_PeriodicGeometric(). | |
| static PetscErrorCode | Initialize_PeriodicDrivenConstant (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Initialize_PeriodicDrivenConstant(). | |
| static PetscErrorCode | PreStep_PeriodicDrivenConstant (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
Internal helper implementation: PreStep_PeriodicDrivenConstant(). | |
| static PetscErrorCode | Apply_PeriodicDrivenConstant (BoundaryCondition *self, BCContext *ctx) |
Internal helper implementation: Apply_PeriodicDrivenConstant(). | |
| static PetscErrorCode | Destroy_PeriodicDrivenConstant (BoundaryCondition *self) |
Internal helper implementation: Destroy_PeriodicDrivenConstant(). | |
| PetscErrorCode | Create_PeriodicDrivenConstant (BoundaryCondition *bc) |
Internal helper implementation: Create_PeriodicDrivenConstant(). | |
| struct InletConstantData |
Private data structure for the Constant Velocity Inlet handler.
Definition at line 311 of file BC_Handlers.c.
| Data Fields | ||
|---|---|---|
| PetscReal | normal_velocity | |
| struct InletParabolicData |
Private data structure for the Parabolic Velocity Inlet handler.
Stores the peak velocity and pre-computed cross-stream geometry needed to evaluate the parabolic profile at each boundary node.
Definition at line 705 of file BC_Handlers.c.
| struct InletProfileFileData |
Definition at line 1117 of file BC_Handlers.c.
| Data Fields | ||
|---|---|---|
| PetscInt | n1 | |
| PetscInt | n2 | |
| PetscReal * | profile | |
| PetscReal | min_speed | |
| PetscReal | max_speed | |
| char * | source_file | |
| struct DrivenConstantData |
Private data structure for the handler.
Definition at line 2208 of file BC_Handlers.c.
| Data Fields | ||
|---|---|---|
| char | direction | |
| PetscReal | targetVolumetricFlux | |
| PetscReal | boundaryVelocityCorrection | |
| PetscBool | isMasterController | |
| PetscBool | applyBoundaryTrim | |
| #define __FUNCT__ "Validate_DrivenFlowConfiguration" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Create_WallNoSlip" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Apply_WallNoSlip" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Create_InletConstantVelocity" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Initialize_InletConstantVelocity" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PreStep_InletConstantVelocity" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Apply_InletConstantVelocity" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PostStep_InletConstantVelocity" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Destroy_InletConstantVelocity" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Create_InletParabolicProfile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Initialize_InletParabolicProfile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PreStep_InletParabolicProfile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Apply_InletParabolicProfile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PostStep_InletParabolicProfile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Destroy_InletParabolicProfile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Create_InletProfileFromFile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Initialize_InletProfileFromFile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PreStep_InletProfileFromFile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Apply_InletProfileFromFile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PostStep_InletProfileFromFile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Destroy_InletProfileFromFile" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Create_OutletConservation" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PreStep_OutletConservation" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Apply_OutletConservation" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PostStep_OutletConservation" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Create_PeriodicDrivenConstant" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Initialize_PeriodicDrivenConstant" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "PreStep_PeriodicDrivenConstant" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Apply_PeriodicDrivenConstant" |
Definition at line 10 of file BC_Handlers.c.
| #define __FUNCT__ "Destroy_PeriodicDrivenConstant" |
Definition at line 10 of file BC_Handlers.c.
| PetscErrorCode Validate_DrivenFlowConfiguration | ( | UserCtx * | user | ) |
Internal helper implementation: Validate_DrivenFlowConfiguration().
(Private) Validates all consistency rules for a driven flow (channel/pipe) setup.
Local to this translation unit.
Definition at line 15 of file BC_Handlers.c.
|
static |
Internal helper implementation: Apply_WallNoSlip().
Local to this translation unit.
Definition at line 144 of file BC_Handlers.c.
| PetscErrorCode Create_WallNoSlip | ( | BoundaryCondition * | bc | ) |
Implementation of Create_WallNoSlip().
Configures a BoundaryCondition object to behave as a no-slip, stationary wall.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 114 of file BC_Handlers.c.
|
static |
Internal helper implementation: Initialize_InletConstantVelocity().
Local to this translation unit.
Definition at line 352 of file BC_Handlers.c.
|
static |
Internal helper implementation: PreStep_InletConstantVelocity().
Local to this translation unit.
Definition at line 402 of file BC_Handlers.c.
|
static |
Internal helper implementation: Apply_InletConstantVelocity().
Local to this translation unit.
Definition at line 425 of file BC_Handlers.c.
|
static |
Internal helper implementation: PostStep_InletConstantVelocity().
Local to this translation unit.
Definition at line 561 of file BC_Handlers.c.
|
static |
Internal helper implementation: Destroy_InletConstantVelocity().
Local to this translation unit.
Definition at line 656 of file BC_Handlers.c.
| PetscErrorCode Create_InletConstantVelocity | ( | BoundaryCondition * | bc | ) |
Implementation of Create_InletConstantVelocity().
Configures a BoundaryCondition object to behave as a constant velocity inlet.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 323 of file BC_Handlers.c.
|
static |
Internal helper implementation: Initialize_InletParabolicProfile().
Local to this translation unit.
Definition at line 750 of file BC_Handlers.c.
|
static |
Internal helper implementation: PreStep_InletParabolicProfile().
Local to this translation unit.
Definition at line 816 of file BC_Handlers.c.
|
static |
Internal helper implementation: Apply_InletParabolicProfile().
Local to this translation unit.
Definition at line 836 of file BC_Handlers.c.
|
static |
Internal helper implementation: PostStep_InletParabolicProfile().
Local to this translation unit.
Definition at line 994 of file BC_Handlers.c.
|
static |
Internal helper implementation: Destroy_InletParabolicProfile().
Local to this translation unit.
Definition at line 1088 of file BC_Handlers.c.
| PetscErrorCode Create_InletParabolicProfile | ( | BoundaryCondition * | bc | ) |
Implementation of Create_InletParabolicProfile().
Configures a BoundaryCondition object for a parabolic inlet profile.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 721 of file BC_Handlers.c.
|
static |
Initializes a file-prescribed inlet profile handler for one boundary face.
Reads the source_file BC parameter, validates the target face dimensions, loads the PICSLICE scalar speed profile, records summary statistics for logging, and applies the profile once to initialize boundary state.
| self | BoundaryCondition object configured by Create_InletProfileFromFile(). |
| ctx | Runtime boundary context containing the UserCtx and face id. |
Definition at line 1344 of file BC_Handlers.c.
|
static |
Pre-step hook for the static file-prescribed inlet profile handler.
Static profiles require no per-step preparation. The hook is implemented so future time-varying profile support can reuse the same handler lifecycle.
| self | BoundaryCondition object for this inlet handler. |
| ctx | Runtime boundary context. |
| local_inflow_contribution | Inflow accumulator, intentionally unchanged. |
| local_outflow_contribution | Outflow accumulator, intentionally unchanged. |
Definition at line 1389 of file BC_Handlers.c.
|
static |
Applies the loaded PICSLICE scalar profile to Ucont and Ubcs on an inlet face.
Each stored scalar is treated as a positive normal speed magnitude. The routine uses the same negative/positive face sign convention, immersed-boundary skip checks, metric vectors, and CellArea conversion used by the constant and parabolic inlet handlers.
| self | BoundaryCondition object with InletProfileFileData storage. |
| ctx | Runtime boundary context containing arrays and face id. |
Definition at line 1415 of file BC_Handlers.c.
|
static |
Accumulates the applied inlet flux for a file-prescribed profile.
Sums the face-normal Ucont component over the same interior face slots populated by Apply_InletProfileFromFile().
| self | BoundaryCondition object for this inlet handler. |
| ctx | Runtime boundary context containing the UserCtx and face id. |
| local_inflow_contribution | Accumulator incremented by the measured inlet flux. |
| local_outflow_contribution | Outflow accumulator, intentionally unchanged. |
Definition at line 1535 of file BC_Handlers.c.
|
static |
Releases private storage owned by a file-prescribed inlet profile handler.
| self | BoundaryCondition object whose data field stores InletProfileFileData. |
Definition at line 1611 of file BC_Handlers.c.
|
static |
Looks up a string-valued boundary-condition parameter in a BC_Param list.
| params | Head of the boundary-condition parameter linked list. | |
| key | Case-insensitive key to search for. | |
| [out] | value_out | Borrowed pointer to the matching value string, or NULL if absent. |
| [out] | found | PETSC_TRUE when the key is present, PETSC_FALSE otherwise. |
Definition at line 1135 of file BC_Handlers.c.
|
static |
Computes the expected PICSLICE dimensions for an inlet face.
| user | User context containing global grid node counts. | |
| face_id | Boundary face whose tangential profile dimensions are requested. | |
| [out] | n1 | First PICSLICE dimension in handler storage order. |
| [out] | n2 | Second PICSLICE dimension in handler storage order. |
Definition at line 1160 of file BC_Handlers.c.
|
static |
Reads and validates a static scalar inlet profile from a canonical PICSLICE file.
The file must contain magic token PICSLICE, frame count 1, the expected two-dimensional face shape, and exactly one finite nonnegative scalar speed value per interior face slot. Values are stored row-major in data->profile.
| source_file | Path to the PICSLICE profile file. | |
| expected_n1 | Expected first slice dimension. | |
| expected_n2 | Expected second slice dimension. | |
| [in,out] | data | Handler-private storage that receives dimensions, profile values, and min/max speeds. |
Definition at line 1205 of file BC_Handlers.c.
|
inlinestatic |
Returns one scalar speed from the flattened PICSLICE profile.
| data | Handler-private profile storage. |
| a | First profile index in face-specific storage order. |
| b | Second profile index in face-specific storage order. |
(a, b). Definition at line 1290 of file BC_Handlers.c.
| PetscErrorCode Create_InletProfileFromFile | ( | BoundaryCondition * | bc | ) |
Implementation of Create_InletProfileFromFile().
Configures a BoundaryCondition object for a file-prescribed inlet profile.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 1303 of file BC_Handlers.c.
|
static |
Internal helper implementation: PreStep_OutletConservation().
Local to this translation unit.
Definition at line 1684 of file BC_Handlers.c.
|
static |
(Handler Action) Applies mass conservation correction to the outlet face.
This function calculates a global correction factor based on the total inflow and outflow fluxes and applies it to the contravariant velocity (ucont) on the outlet face to ensure mass conservation.
Definition at line 1820 of file BC_Handlers.c.
|
static |
Internal helper implementation: PostStep_OutletConservation().
Local to this translation unit.
Definition at line 2033 of file BC_Handlers.c.
| PetscErrorCode Create_OutletConservation | ( | BoundaryCondition * | bc | ) |
Implementation of Create_OutletConservation().
Configures a BoundaryCondition object for conservative outlet treatment.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 1655 of file BC_Handlers.c.
| PetscErrorCode Create_PeriodicGeometric | ( | BoundaryCondition * | bc | ) |
Implementation of Create_PeriodicGeometric().
Configures a BoundaryCondition object for geometric periodic coupling.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 2172 of file BC_Handlers.c.
|
static |
Internal helper implementation: Initialize_PeriodicDrivenConstant().
Local to this translation unit.
Definition at line 2269 of file BC_Handlers.c.
|
static |
Internal helper implementation: PreStep_PeriodicDrivenConstant().
Local to this translation unit.
Definition at line 2337 of file BC_Handlers.c.
|
static |
Internal helper implementation: Apply_PeriodicDrivenConstant().
Local to this translation unit.
Definition at line 2519 of file BC_Handlers.c.
|
static |
Internal helper implementation: Destroy_PeriodicDrivenConstant().
Local to this translation unit.
Definition at line 2623 of file BC_Handlers.c.
| PetscErrorCode Create_PeriodicDrivenConstant | ( | BoundaryCondition * | bc | ) |
Internal helper implementation: Create_PeriodicDrivenConstant().
Configures a BoundaryCondition object for periodic driven-flow forcing.
Local to this translation unit.
Definition at line 2225 of file BC_Handlers.c.