PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
BC_Handlers.h
Go to the documentation of this file.
1#ifndef BC_HANDLERS_H
2#define BC_HANDLERS_H
3
4#include "variables.h"
5#include "logging.h"
6
7//================================================================================
8// VALIDATORS
9//================================================================================
10
11/**
12 * @brief (Private) Validates all consistency rules for a driven flow (channel/pipe) setup.
13 *
14 * This function enforces a strict set of rules to ensure a driven flow simulation is
15 * configured correctly. It is called by the main `BoundarySystem_Validate` dispatcher.
16 *
17 * The validation rules are checked in a specific order:
18 * 1. Detect if any `DRIVEN_` handler is active. If not, the function returns immediately.
19 * 2. Ensure that no `INLET`, `OUTLET`, or `FARFIELD` boundary conditions exist anywhere in the
20 * domain, as they are physically incompatible with a pressure-driven flow model.
21 * 3. Verify that both faces in the driven direction are of `mathematical_type PERIODIC`.
22 * 4. Verify that both faces in the driven direction use the exact same `DRIVEN_` handler type.
23 *
24 * @param user The UserCtx for a single block.
25 * @return PetscErrorCode 0 on success, non-zero PETSc error code on failure.
26 */
27PetscErrorCode Validate_DrivenFlowConfiguration(UserCtx *user);
28
29
30//================================================================================
31//
32// HANDLER "CONSTRUCTOR" FUNCTION DECLARATIONS
33//
34// Each function is responsible for populating a BoundaryCondition struct
35// with the correct function pointers for its specific behavior. They are
36// implemented in BC_Handlers.c and called by the factory in Boundaries.c.
37//
38//================================================================================
39
40/**
41 * @brief Configures a BoundaryCondition object to behave as a no-slip, stationary wall.
42 *
43 * @param bc A
44 * @return PetscErrorCode 0 on success.
45 */
46PetscErrorCode Create_WallNoSlip(BoundaryCondition *bc);
47
48/**
49 * @brief Configures a BoundaryCondition object to behave as a constant velocity inlet.
50 *
51 * @param bc Parameter `bc` passed to `Create_InletConstantVelocity()`.
52 * @return PetscErrorCode 0 on success.
53 */
55
56/**
57 * @brief Configures a BoundaryCondition object for a parabolic inlet profile.
58 *
59 * The constructed handler computes inlet velocity as a profile function of
60 * transverse coordinates, typically used for laminar channel/pipe initialization.
61 *
62 * @param bc A pointer to the generic BoundaryCondition object to be configured.
63 * @return PetscErrorCode 0 on success.
64 */
66
67/**
68 * @brief Configures a BoundaryCondition object for conservative outlet treatment.
69 *
70 * The constructed handler applies outlet updates that preserve the solver's
71 * global mass/flux consistency assumptions.
72 *
73 * @param bc A pointer to the generic BoundaryCondition object to be configured.
74 * @return PetscErrorCode 0 on success.
75 */
77
78/**
79 * @brief Configures a BoundaryCondition object for geometric periodic coupling.
80 *
81 * This constructor wires periodic boundary callbacks that exchange values across
82 * opposite faces according to the configured periodic directions.
83 *
84 * @param bc A pointer to the generic BoundaryCondition object to be configured.
85 * @return PetscErrorCode 0 on success.
86 */
88
89/**
90 * @brief Configures a BoundaryCondition object for periodic driven-flow forcing.
91 *
92 * This constructor wires the periodic callbacks that enforce a prescribed driving
93 * strategy (for example constant target flux) on a periodic direction pair.
94 *
95 * @param bc A pointer to the generic BoundaryCondition object to be configured.
96 * @return PetscErrorCode 0 on success.
97 */
99
100#endif // BC_HANDLERS_H
PetscErrorCode Create_InletConstantVelocity(BoundaryCondition *bc)
Configures a BoundaryCondition object to behave as a constant velocity inlet.
PetscErrorCode Create_PeriodicGeometric(BoundaryCondition *bc)
Configures a BoundaryCondition object for geometric periodic coupling.
PetscErrorCode Validate_DrivenFlowConfiguration(UserCtx *user)
(Private) Validates all consistency rules for a driven flow (channel/pipe) setup.
Definition BC_Handlers.c:15
PetscErrorCode Create_InletParabolicProfile(BoundaryCondition *bc)
Configures a BoundaryCondition object for a parabolic inlet profile.
PetscErrorCode Create_PeriodicDrivenConstant(BoundaryCondition *bc)
Configures a BoundaryCondition object for periodic driven-flow forcing.
PetscErrorCode Create_WallNoSlip(BoundaryCondition *bc)
Configures a BoundaryCondition object to behave as a no-slip, stationary wall.
PetscErrorCode Create_OutletConservation(BoundaryCondition *bc)
Configures a BoundaryCondition object for conservative outlet treatment.
Logging utilities and macros for PETSc-based applications.
The "virtual table" struct for a boundary condition handler object.
Definition variables.h:321
Main header file for a complex fluid dynamics solver.
User-defined context containing data specific to a single computational grid level.
Definition variables.h:811