PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
BodyForces.h
Go to the documentation of this file.
1#ifndef BODYFORCES_H
2#define BODYFORCES_H
3
4#include "variables.h" // Provides definitions for UserCtx, SimCtx, IBMNodes, etc.
5#include "logging.h"
6#include "Metric.h"
7
8/**
9 * @brief Applies a momentum source term to drive flow in a periodic channel or pipe.
10 *
11 * This function is the "engine" of the driven flow control system. It operates by:
12 * 1. Introspecting the boundary condition handlers to see if a `DRIVEN_` flow
13 * handler is active on any face. This determines if a driven flow is enabled
14 * and in which direction ('X', 'Y', or 'Z').
15 * 2. If a driven flow is active, it reads the `bulkVelocityCorrection` value that
16 * was computed by the handler's `PreStep` method and stored in the `SimCtx`.
17 * 3. It translates this velocity correction into a momentum source term.
18 * 4. It adds this source term to the appropriate component of the contravariant
19 * RHS vector (`Rct`) for all fluid cells in the domain.
20 *
21 * If no driven flow handler is found, this function does nothing.
22 *
23 * @param user The UserCtx containing the simulation state for a single block.
24 * @param Rct The PETSc Vec for the contravariant RHS, which will be modified in-place.
25 * @return PetscErrorCode 0 on success.
26 */
27PetscErrorCode ComputeDrivenChannelFlowSource(UserCtx *user, Vec Rct);
28
29#endif // BODYFORCES_H
PetscErrorCode ComputeDrivenChannelFlowSource(UserCtx *user, Vec Rct)
Applies a momentum source term to drive flow in a periodic channel or pipe.
Definition BodyForces.c:29
Logging utilities and macros for PETSc-based applications.
Main header file for a complex fluid dynamics solver.
User-defined context containing data specific to a single computational grid level.
Definition variables.h:728