Go to the source code of this file.
Data Structures | |
| struct | InletPrescribedVelocityData |
| Private data of the prescribed-velocity inlet: a compiled source or a PICSLICE file, the values of the source's variables at each face slot this rank owns, and the velocity they last gave. More... | |
| struct | OutletConservationData |
| Per-face state of the backflow clip; see the section comment above. More... | |
| struct | DrivenFluxData |
| Private data structure shared by both periodic driven-flux handlers. More... | |
Macros | |
| #define | INFLOW_LATTICE_PAD 1048576 |
| Face cells the synthetic-inflow draw lattice extends beyond each edge; a filter half-width may not exceed it. | |
Typedefs | |
| typedef Cmpnts(* | FaceBoundaryVelocityRule) (const BoundaryCondition *self, BCFace face_id, PetscInt i, PetscInt j, PetscInt k, Cmpnts metric, PetscReal sign, Cmpnts interior) |
| Cartesian boundary velocity one handler prescribes at one boundary face slot. | |
Enumerations | |
| enum | OutletClipPassMode { OUTLET_CLIP_DECIDE , OUTLET_CLIP_MEASURE , OUTLET_CLIP_WRITE } |
| What one OutletClipPass() over the owned outlet elements does. More... | |
Functions | |
| PetscErrorCode | Validate_DrivenFlowConfiguration (UserCtx *user) |
| Implementation of Validate_DrivenFlowConfiguration(). | |
| static PetscErrorCode | ApplyFaceBoundaryVelocity (BoundaryCondition *self, BCContext *ctx, FaceBoundaryVelocityRule rule) |
| Sets a handler's boundary velocity and the face flux it implies on one face. | |
| static PetscErrorCode | Apply_WallNoSlip (BoundaryCondition *self, BCContext *ctx) |
| Apply no-slip velocity values to wall-adjacent cells for this boundary condition. | |
| PetscErrorCode | Create_WallNoSlip (BoundaryCondition *bc) |
| Implementation of Create_WallNoSlip(). | |
| static Cmpnts | WallNoSlipVelocity (const BoundaryCondition *self, BCFace face_id, PetscInt i, PetscInt j, PetscInt k, Cmpnts metric, PetscReal sign, Cmpnts interior) |
| The no-slip wall's boundary velocity: the wall's own, which is at rest. | |
| static PetscErrorCode | Apply_WallFreeSlip (BoundaryCondition *self, BCContext *ctx) |
| Apply free-slip boundary values to wall-adjacent cells for this boundary condition. | |
| PetscErrorCode | Create_WallFreeSlip (BoundaryCondition *bc) |
| Implementation of Create_WallFreeSlip(). | |
| static Cmpnts | WallFreeSlipVelocity (const BoundaryCondition *self, BCFace face_id, PetscInt i, PetscInt j, PetscInt k, Cmpnts metric, PetscReal sign, Cmpnts interior) |
| The free-slip wall's boundary velocity: the adjacent velocity, less its normal part. | |
| static PetscErrorCode | Initialize_InletPrescribedVelocity (BoundaryCondition *self, BCContext *ctx) |
Compile the source named by the face's source_id parameter, with its bulk velocity or flow rate if any, record the PICSLICE file named by its source_file parameter, and read the synthetic-fluctuation settings -face_source_<id>_fluct*: the Reynolds-stress sources and the integral length and time scales. | |
| static PetscErrorCode | PreStep_InletPrescribedVelocity (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Refresh the inlet velocity once per step: gather the slots on the first call, then re-evaluate and rescale only what depends on t. | |
| static PetscErrorCode | Apply_InletVelocity (BoundaryCondition *self, BCContext *ctx) |
| Applies the prescribed inlet velocity through the common face-layout path. | |
| static PetscErrorCode | PostStep_InletFlux (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Adds the inlet face's applied flux, the sum of its normal Ucont, to the inflow. | |
| static PetscErrorCode | Apply_WallMoving (BoundaryCondition *self, BCContext *ctx) |
| Applies a moving wall's velocity through the path every prescribed face shares. | |
| static PetscErrorCode | Destroy_InletPrescribedVelocity (BoundaryCondition *self) |
| Release the compiled source and the per-slot arrays. | |
| static PetscInt | PrescribedSlot (const InletPrescribedVelocityData *data, PetscInt i, PetscInt j, PetscInt k) |
| Index of the owned slot (i, j, k) in a prescribed-velocity inlet's per-slot arrays. | |
| PetscErrorCode | Create_InletPrescribedVelocity (BoundaryCondition *bc) |
| Implementation of Create_InletPrescribedVelocity(). | |
| PetscErrorCode | Create_WallMoving (BoundaryCondition *bc) |
| Implementation of Create_WallMoving(). | |
| static PetscErrorCode | GetProfileFileExpectedDims (UserCtx *user, BCFace face_id, PetscInt *n1, PetscInt *n2) |
| Computes the expected PICSLICE dimensions for an inlet face. | |
| static PetscErrorCode | OpenPicSlice (InletPrescribedVelocityData *data, PetscInt expected_n1, PetscInt expected_n2) |
| Opens a canonical PICSLICE file and reads its header. | |
| static PetscErrorCode | ReadPicSliceFrame (InletPrescribedVelocityData *data) |
Reads the frame at the file's position into file_values, validating every value: finite, and a normal speed nonnegative. | |
| static Cmpnts | EvaluateInletCartesianVelocity (const BoundaryCondition *self, BCFace face_id, PetscInt i, PetscInt j, PetscInt k, Cmpnts metric, PetscReal sign, Cmpnts interior) |
| Prescribed velocity at one inlet face slot, as a Cartesian vector. | |
| static Cmpnts | EvaluateMovingWallVelocity (const BoundaryCondition *self, BCFace face_id, PetscInt i, PetscInt j, PetscInt k, Cmpnts metric, PetscReal sign, Cmpnts interior) |
| A moving wall's boundary velocity: the source's, with any part along the face removed, since a wall closes its face. | |
| static PetscErrorCode | PrescribedFaceSums (const InletPrescribedVelocityData *data, UserCtx *user, BCFace face_id, PetscReal local[4]) |
| This rank's area-weighted sums over the face, physical: the source's normal speed, the staged data's when expressions add to it, the area, and the synthetic fluctuations' inflow (zero without them). | |
| static PetscErrorCode | PrescribedBulkFactor (InletPrescribedVelocityData *data, UserCtx *user, BCFace face_id, PetscReal physical_time, PetscReal *factor) |
| Factor that makes the face's mean normal speed or flow rate equal the target. | |
| static PetscErrorCode | LoadPrescribedFrame (InletPrescribedVelocityData *data, PetscInt frame, Cmpnts *target) |
| Read one frame of the face's PICSLICE into this rank's slots, moving the file there. | |
| static PetscErrorCode | OpenPrescribedProfile (InletPrescribedVelocityData *data, UserCtx *user, BCFace face_id) |
| Open the face's PICSLICE and read a lone frame, as the velocity itself or, under expressions, as what they add to; several frames are read as time reaches them. | |
| static PetscErrorCode | InterpolatePrescribedFrames (InletPrescribedVelocityData *data, BCFace face_id, PetscReal physical_time) |
| Set the staged data at a time: linear between the two frames around it, the first at t = 0. | |
| PetscErrorCode | LogPrescribedFlowDiagnostics (UserCtx *user) |
| Implementation of LogPrescribedFlowDiagnostics(). | |
| static PetscErrorCode | BuildInletFluctuation (InletPrescribedVelocityData *data, UserCtx *user) |
| Prepare an inlet's synthetic fluctuations once its slots exist: filter widths from the face's mean spacing, and the Reynolds stresses' Cholesky factor at each slot. | |
| static PetscErrorCode | StepInletFluctuation (InletPrescribedVelocityData *data, UserCtx *user, BCFace face_id) |
| This step's synthetic fluctuation at every owned slot of an inlet. | |
| static PetscErrorCode | PreStep_OutletConservation (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Prepare the outlet-conservation correction before advancing the solver. | |
| 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) |
| Update outlet-conservation state after a completed solver step. | |
| static PetscErrorCode | Destroy_OutletConservation (BoundaryCondition *self) |
| Release the outlet-conservation handler's clip state. | |
| PetscErrorCode | Create_OutletConservation (BoundaryCondition *bc) |
| Implementation of Create_OutletConservation(). | |
| static PetscErrorCode | OutletClipPass (UserCtx *user, BCFace face_id, OutletConservationData *data, OutletClipPassMode mode, PetscReal correction, PetscReal psi, PetscReal sums[3]) |
| One pass over this rank's elements of an outlet face for the backflow clip. | |
| static PetscErrorCode | OutletConservationClip (UserCtx *user, BCFace face_id, OutletConservationData *data, PetscReal correction, PetscBool *applied) |
| Run the backflow clip for one Apply call; see the section comment. | |
| PetscErrorCode | Create_PeriodicGeometric (BoundaryCondition *bc) |
| Implementation of Create_PeriodicGeometric(). | |
| static PetscErrorCode | MeasureDrivenFluxes (UserCtx *user, char direction, PetscReal *boundaryFlux, PetscReal *planarAverageFlux) |
| Measure the two volumetric fluxes the driven-flow controller senses. | |
| static PetscErrorCode | Initialize_PeriodicDrivenConstant (BoundaryCondition *self, BCContext *ctx) |
| Initialize constant forcing data for a periodically driven boundary. | |
| static PetscErrorCode | PreStep_PeriodicDrivenConstant (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Prepare constant periodic-driving data before the solver step. | |
| static PetscErrorCode | Apply_PeriodicDrivenConstant (BoundaryCondition *self, BCContext *ctx) |
| Apply the configured constant driving term to the periodic boundary. | |
| static PetscErrorCode | Destroy_PeriodicDrivenConstant (BoundaryCondition *self) |
| Release resources owned by the constant periodic-driving boundary. | |
| PetscErrorCode | Create_PeriodicDrivenConstant (BoundaryCondition *bc) |
| Implementation of Create_PeriodicDrivenConstant(). | |
| static PetscErrorCode | Initialize_PeriodicDrivenInitial (BoundaryCondition *self, BCContext *ctx) |
| Initialize forcing data for a periodic boundary driven to its initial flux. | |
| static PetscErrorCode | PreStep_PeriodicDrivenInitial (BoundaryCondition *self, BCContext *ctx, PetscReal *local_inflow_contribution, PetscReal *local_outflow_contribution) |
| Latch the initial-state flux once, then drive to it like a constant target. | |
| PetscErrorCode | Create_PeriodicDrivenInitial (BoundaryCondition *bc) |
| Implementation of Create_PeriodicDrivenInitial(). | |
| struct InletPrescribedVelocityData |
Private data of the prescribed-velocity inlet: a compiled source or a PICSLICE file, the values of the source's variables at each face slot this rank owns, and the velocity they last gave.
Definition at line 277 of file BC_Handlers.c.
| Data Fields | ||
|---|---|---|
| PicurvVelocitySource | source | |
| char * | source_file | |
| Cmpnts * | profile | |
| FILE * | file | |
| fpos_t | first_frame | |
| PetscInt | frames | |
| PetscInt | components | |
| PetscInt | next_frame | |
| PetscInt | file_n[2] | |
| PetscReal | interval | |
| PetscBool | repeat | |
| PetscReal * | file_values | |
| Cmpnts * | bracket[2] | |
| PetscInt | bracket_frame[2] | |
| PicurvSourceFaceSlots | slots | |
| Cmpnts * | velocity | |
| PetscReal | factor | |
| PetscInt | evaluated_step | |
| PetscBool | built | |
| PetscBool | fluctuate | |
| PicurvVelocitySource | stress[2] | |
| PetscReal | fluct_length[2] | |
| PetscReal | fluct_time | |
| PetscInt | half[2] | |
| PetscReal * | kernel[2] | |
| PetscReal(* | lund)[6] | |
| Cmpnts * | fluct | |
| PetscBool | fluct_started | |
| struct OutletConservationData |
Per-face state of the backflow clip; see the section comment above.
Definition at line 1401 of file BC_Handlers.c.
| Data Fields | ||
|---|---|---|
| PetscInt | decisionStep | |
| PetscBool | clipRule | |
| PetscInt | maskSize | |
| PetscBool * | clipped | |
| struct DrivenFluxData |
Private data structure shared by both periodic driven-flux handlers.
constant_flux fills targetVolumetricFlux from the bcs file at initialization; initial_flux latches it from the starting field at the first PreStep. Everything downstream of the target is identical, so both handlers reuse this struct and the PreStep/Apply/Destroy implementations below.
Definition at line 2263 of file BC_Handlers.c.
| Data Fields | ||
|---|---|---|
| char | direction | |
| PetscReal | targetVolumetricFlux | |
| PetscBool | isMasterController | |
| PetscBool | enforceSeamFlux | |
| PetscInt | lastBulkCorrectionStep | |
| #define INFLOW_LATTICE_PAD 1048576 |
Face cells the synthetic-inflow draw lattice extends beyond each edge; a filter half-width may not exceed it.
Definition at line 1102 of file BC_Handlers.c.
| typedef Cmpnts(* FaceBoundaryVelocityRule) (const BoundaryCondition *self, BCFace face_id, PetscInt i, PetscInt j, PetscInt k, Cmpnts metric, PetscReal sign, Cmpnts interior) |
Cartesian boundary velocity one handler prescribes at one boundary face slot.
Definition at line 97 of file BC_Handlers.c.
| enum OutletClipPassMode |
What one OutletClipPass() over the owned outlet elements does.
| Enumerator | |
|---|---|
| OUTLET_CLIP_DECIDE | |
| OUTLET_CLIP_MEASURE | |
| OUTLET_CLIP_WRITE | |
Definition at line 1578 of file BC_Handlers.c.
| PetscErrorCode Validate_DrivenFlowConfiguration | ( | UserCtx * | user | ) |
Implementation of Validate_DrivenFlowConfiguration().
(Private) Validates all consistency rules for a driven flow (channel/pipe) setup.
Definition at line 15 of file BC_Handlers.c.
|
static |
Sets a handler's boundary velocity and the face flux it implies on one face.
Shared by every handler that prescribes a Cartesian velocity at its face: the inlets, the no-slip wall and the free-slip wall. For each boundary slot this rank owns it asks rule for the velocity, stores it as the boundary value, and sets the face flux to its product with the face metric. A rule whose velocity is tangent to the face therefore closes the face. A slot whose fluid side is blanked (nvert > 0.1) belongs to an immersed body, whose own boundary condition applies there, so it is left untouched.
| self | Handler being applied. |
| ctx | Boundary context naming the face. |
| rule | Velocity the handler prescribes, given the slot, the face metric, the side (sign, positive on a negative face) and the adjacent interior velocity. |
Definition at line 653 of file BC_Handlers.c.
|
static |
Apply no-slip velocity values to wall-adjacent cells for this boundary condition.
A zero boundary velocity also closes the face, since its flux is the velocity's product with the face metric.
Definition at line 166 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 123 of file BC_Handlers.c.
|
static |
The no-slip wall's boundary velocity: the wall's own, which is at rest.
Definition at line 151 of file BC_Handlers.c.
|
static |
Apply free-slip boundary values to wall-adjacent cells for this boundary condition.
Definition at line 237 of file BC_Handlers.c.
| PetscErrorCode Create_WallFreeSlip | ( | BoundaryCondition * | bc | ) |
Implementation of Create_WallFreeSlip().
Configures a BoundaryCondition object to behave as a free-slip wall.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/BC_Handlers.h.
Definition at line 197 of file BC_Handlers.c.
|
inlinestatic |
The free-slip wall's boundary velocity: the adjacent velocity, less its normal part.
Removing the component along the face metric leaves a velocity tangent to the face, so the face flux vanishes; placing it as the boundary value makes the dummy cell the mirror image of the interior one, reversing the normal velocity and keeping the tangential one, which is zero normal gradient. On a curvilinear grid the metric is the face's own normal, so the construction holds there too.
Definition at line 226 of file BC_Handlers.c.
|
static |
Compile the source named by the face's source_id parameter, with its bulk velocity or flow rate if any, record the PICSLICE file named by its source_file parameter, and read the synthetic-fluctuation settings -face_source_<id>_fluct*: the Reynolds-stress sources and the integral length and time scales.
Definition at line 797 of file BC_Handlers.c.
|
static |
Refresh the inlet velocity once per step: gather the slots on the first call, then re-evaluate and rescale only what depends on t.
Definition at line 1266 of file BC_Handlers.c.
|
static |
Applies the prescribed inlet velocity through the common face-layout path.
Ownership clipping, immersed-cell exclusion, metric projection, Ubcs placement, and the normal staggered Ucont write are ApplyFaceBoundaryVelocity()'s, shared with the walls.
Definition at line 782 of file BC_Handlers.c.
|
static |
Adds the inlet face's applied flux, the sum of its normal Ucont, to the inflow.
Definition at line 362 of file BC_Handlers.c.
|
static |
Applies a moving wall's velocity through the path every prescribed face shares.
Definition at line 766 of file BC_Handlers.c.
|
static |
Release the compiled source and the per-slot arrays.
Definition at line 1335 of file BC_Handlers.c.
|
inlinestatic |
Index of the owned slot (i, j, k) in a prescribed-velocity inlet's per-slot arrays.
Definition at line 310 of file BC_Handlers.c.
| PetscErrorCode Create_InletPrescribedVelocity | ( | BoundaryCondition * | bc | ) |
Implementation of Create_InletPrescribedVelocity().
Configures a BoundaryCondition object as an inlet whose velocity is a configured source: expressions over position, time and grid-line fractions, in the Cartesian, curvilinear or face-normal frame, a PICSLICE file, or a file with expressions added to it, optionally rescaled to a bulk velocity or flow rate, with optional synthetic fluctuations.
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.
| PetscErrorCode Create_WallMoving | ( | BoundaryCondition * | bc | ) |
Implementation of Create_WallMoving().
Creates a wall moving along itself at a velocity source, the prescribed inlet's without its flux.
Definition at line 347 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 461 of file BC_Handlers.c.
|
static |
Opens a canonical PICSLICE file and reads its header.
The file holds magic token PICSLICE, a frame count, then a line with the slice dimensions, optionally the components per slot (1, a normal speed, the default, or 3, a Cartesian velocity) and, with several frames, the time between them. Frames follow.
| data | Handler data; file, first_frame, frames, components, interval and file_n are set. |
| expected_n1 | Expected first slice dimension. |
| expected_n2 | Expected second slice dimension. |
Definition at line 508 of file BC_Handlers.c.
|
static |
Reads the frame at the file's position into file_values, validating every value: finite, and a normal speed nonnegative.
After the last frame the file must end.
| data | Handler data with an open file. |
Definition at line 572 of file BC_Handlers.c.
|
inlinestatic |
Prescribed velocity at one inlet face slot, as a Cartesian vector.
A normal-frame source stores its speed in .x; it is lifted onto the signed unit face normal. Other frames store the Cartesian velocity. Both carry the bulk factor.
Definition at line 610 of file BC_Handlers.c.
|
inlinestatic |
A moving wall's boundary velocity: the source's, with any part along the face removed, since a wall closes its face.
PreStep refuses a source with more than a rounding of the surface's facets through it.
Definition at line 759 of file BC_Handlers.c.
|
static |
This rank's area-weighted sums over the face, physical: the source's normal speed, the staged data's when expressions add to it, the area, and the synthetic fluctuations' inflow (zero without them).
Slots blanked by an immersed body are excluded, as in Apply. The first three are what the bulk rescaling reads; the fluctuations are added after it.
Definition at line 878 of file BC_Handlers.c.
|
static |
Factor that makes the face's mean normal speed or flow rate equal the target.
Collective.
Definition at line 931 of file BC_Handlers.c.
|
static |
Read one frame of the face's PICSLICE into this rank's slots, moving the file there.
Every rank reads the file, so a malformed one fails on all of them.
| data | Handler data with an open file. |
| frame | Frame to read. |
| target | Velocity per owned slot; a normal speed goes in x. |
Definition at line 953 of file BC_Handlers.c.
|
static |
Open the face's PICSLICE and read a lone frame, as the velocity itself or, under expressions, as what they add to; several frames are read as time reaches them.
Definition at line 983 of file BC_Handlers.c.
|
static |
Set the staged data at a time: linear between the two frames around it, the first at t = 0.
Definition at line 1017 of file BC_Handlers.c.
| PetscErrorCode LogPrescribedFlowDiagnostics | ( | UserCtx * | user | ) |
Implementation of LogPrescribedFlowDiagnostics().
Appends each prescribed-velocity inlet's flow rate and mean normal speed this step to inlet_flow.csv.
Definition at line 1065 of file BC_Handlers.c.
|
static |
Prepare an inlet's synthetic fluctuations once its slots exist: filter widths from the face's mean spacing, and the Reynolds stresses' Cholesky factor at each slot.
Collective over the block. The integral length L along a tangential axis spans n = L / h cells, h the face's cell width along it: the mean of its widest and narrowest cell there. The filter weights are exp(-pi |k| / n) for |k| <= 2n, scaled to a unit sum of squares (Xie & Castro 2008), so filtered unit-variance noise keeps unit variance. Every rank and every decomposition uses the same h, so the kernel is bitwise the same.
Definition at line 1114 of file BC_Handlers.c.
|
static |
This step's synthetic fluctuation at every owned slot of an inlet.
Keyed unit normals on the owned face cells and a halo of the filter's half-width are filtered along each tangential axis; a draw is a pure function of the seed, block, component, face cell and step, so a rank computes its halo itself and the result does not depend on the decomposition. A periodic tangential axis wraps the halo. The time filter psi <- psi exp(-pi dt / 2T) + filtered sqrt(1 - exp(-pi dt / T)) keeps unit variance; its state lives in the inlet's dummy plane of InflowFluctuation, which a checkpoint carries, and starts from the filtered noise when there is none. A restored state belongs to the restart step already, so the first pass after it only reads it.
Definition at line 1182 of file BC_Handlers.c.
|
static |
Prepare the outlet-conservation correction before advancing the solver.
Definition at line 1446 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 1739 of file BC_Handlers.c.
|
static |
Update outlet-conservation state after a completed solver step.
Definition at line 1958 of file BC_Handlers.c.
|
static |
Release the outlet-conservation handler's clip state.
Definition at line 2094 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 1414 of file BC_Handlers.c.
|
static |
One pass over this rank's elements of an outlet face for the backflow clip.
Every fluid element's zero-gradient flux is F = Ucat(cell) . S, the flux the uniform rule starts from. The pass is local; the caller reduces sums.
data and returns sums[0] = the number of elements where F + correction*A points into the domain and sums[1] = the number clipped. Fluxes are signed along +xi, so outward is +F on a positive face and -F on a negative one.Definition at line 1593 of file BC_Handlers.c.
|
static |
Run the backflow clip for one Apply call; see the section comment.
Collective: every rank calls it, whether or not it serves the face. Sets applied when the clip rule wrote this face's fluxes; otherwise the caller applies the uniform rule unchanged.
Definition at line 1685 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 2115 of file BC_Handlers.c.
|
static |
Measure the two volumetric fluxes the driven-flow controller senses.
Both periodic driven handlers steer on the same pair of measurements, so they are taken here in a single sweep of lUcont:
*boundaryFlux is the flux through the single periodic boundary plane. It is fast and responsive but noisy, and drives the boundary trim.*planarAverageFlux is the flux averaged over every cross-sectional plane in the driven direction. It is stable and inertial, and drives the momentum source. It is also the quantity initial_flux latches at t=0.| [in] | user | Block context supplying lUcont, lNvert and info. |
| [in] | direction | Driven direction, 'X', 'Y' or 'Z'. |
| [out] | boundaryFlux | Globally reduced flux through the boundary plane. |
| [out] | planarAverageFlux | Globally reduced plane-averaged flux. |
Definition at line 2155 of file BC_Handlers.c.
|
static |
Initialize constant forcing data for a periodically driven boundary.
Definition at line 2321 of file BC_Handlers.c.
|
static |
Prepare constant periodic-driving data before the solver step.
Definition at line 2393 of file BC_Handlers.c.
|
static |
Apply the configured constant driving term to the periodic boundary.
Definition at line 2478 of file BC_Handlers.c.
|
static |
Release resources owned by the constant periodic-driving boundary.
Definition at line 2580 of file BC_Handlers.c.
| PetscErrorCode Create_PeriodicDrivenConstant | ( | BoundaryCondition * | bc | ) |
Implementation of Create_PeriodicDrivenConstant().
Configures a BoundaryCondition object for periodic driven-flow forcing.
Definition at line 2278 of file BC_Handlers.c.
|
static |
Initialize forcing data for a periodic boundary driven to its initial flux.
InitializeEulerianState() runs, so at this point Ucont still holds zeros. The measurement is deferred to the first PreStep, by which time either the initial condition has been applied or the restart target has been restored from the checkpoint manifest. Definition at line 2673 of file BC_Handlers.c.
|
static |
Latch the initial-state flux once, then drive to it like a constant target.
The latch is one-shot and guarded by simCtx->drivenFluxTargetLatched:
Ucont now holds the initial condition, so the plane-averaged flux is measured and stored.ReadSimulationFields() restored both the target and the flag from the checkpoint manifest, so the original target survives instead of being re-measured from a drifted field. Definition at line 2747 of file BC_Handlers.c.
| PetscErrorCode Create_PeriodicDrivenInitial | ( | BoundaryCondition * | bc | ) |
Implementation of Create_PeriodicDrivenInitial().
Configures a BoundaryCondition object for initial-flux periodic driving.
Definition at line 2626 of file BC_Handlers.c.