#include "variables.h"#include "logging.h"#include "Metric.h"#include "BodyForces.h"#include "poisson.h"Go to the source code of this file.
Macros | |
| #define | RHS_INNER_BLANK 7.0 |
Cells whose nvert exceeds this are blanked inner-body cells, which convect as fluid. | |
Functions | |
| static PetscBool | RHSConvectsAsFluid (PetscReal nvert) |
| Whether a cell takes part in convection: fluid, or a blanked inner-body cell. | |
| static PetscBool | RHSIsBlankedSolid (PetscReal nvert) |
| Whether a cell is a blanked solid cell, which ComputeViscous()'s transverse differences avoid with a one-sided stencil. | |
| PetscErrorCode | ComputeViscous (UserCtx *user, Vec Ucat, Vec Visc) |
| Computes the viscous contribution to the contravariant momentum RHS. | |
| PetscErrorCode | ComputeConvection (UserCtx *user, Vec Ucont, Vec Ucat, Vec Conv) |
| Computes the convective contribution to the contravariant momentum RHS. | |
| PetscErrorCode | ComputeBodyForces (UserCtx *user, Vec Rct) |
| General dispatcher for applying all active body forces (momentum sources). | |
| PetscErrorCode | ComputeRHS (UserCtx *user, Vec Rhs) |
| Computes the Right-Hand Side (RHS) of the momentum equations. | |
| #define RHS_INNER_BLANK 7.0 |
|
inlinestatic |
Whether a cell takes part in convection: fluid, or a blanked inner-body cell.
A face next to any other cell takes ComputeConvection()'s one-sided QUICK stencil.
| [in] | nvert | The cell's solid field. |
nvert < POISSON_SOLID_THRESHOLD or nvert > RHS_INNER_BLANK. Definition at line 19 of file rhs.h.
|
inlinestatic |
Whether a cell is a blanked solid cell, which ComputeViscous()'s transverse differences avoid with a one-sided stencil.
| [in] | nvert | The cell's solid field. |
0.5 < nvert < RHS_INNER_BLANK. Definition at line 30 of file rhs.h.
| PetscErrorCode ComputeViscous | ( | UserCtx * | user, |
| Vec | Ucat, | ||
| Vec | Visc | ||
| ) |
Computes the viscous contribution to the contravariant momentum RHS.
This routine evaluates diffusive fluxes on the curvilinear grid and writes the resulting term into Visc, which it zeroes first. The caller is responsible for providing compatible vectors and for assembling any additional source terms afterwards.
| [in] | user | Block-level solver context containing metrics and model parameters. |
| [in] | Ucat | Ghosted Cartesian velocity field used for derivative evaluation. |
| [out] | Visc | Output vector receiving the viscous RHS contribution. |
Computes the viscous contribution to the contravariant momentum RHS.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/rhs.h.
Definition at line 346 of file rhs.c.
| PetscErrorCode ComputeConvection | ( | UserCtx * | user, |
| Vec | Ucont, | ||
| Vec | Ucat, | ||
| Vec | Conv | ||
| ) |
Computes the convective contribution to the contravariant momentum RHS.
This routine evaluates the advection operator on the current velocity state and stores the contribution in Conv, which it zeroes first, for subsequent combination with viscous and body-force terms.
| [in] | user | Block-level solver context containing metrics and numerics settings. |
| [in] | Ucont | Contravariant velocity field used in face-normal flux construction. |
| [in] | Ucat | Cartesian velocity field used by the convective stencil. |
| [out] | Conv | Output vector receiving the convection RHS contribution. |
Computes the convective contribution to the contravariant momentum RHS.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/rhs.h.
Definition at line 96 of file rhs.c.
| PetscErrorCode ComputeBodyForces | ( | UserCtx * | user, |
| Vec | Rct | ||
| ) |
General dispatcher for applying all active body forces (momentum sources).
This function serves as a central hub for adding momentum source terms to the contravariant right-hand-side (Rct) of the momentum equations. It is called once per RHS evaluation (e.g., once per Runge-Kutta stage).
It introspects the simulation configuration to determine which, if any, body forces are active and calls their specific implementation functions.
| user | The UserCtx containing the simulation state for a single block. |
| Rct | The PETSc Vec for the contravariant RHS, modified in place. |
General dispatcher for applying all active body forces (momentum sources).
A body force added here follows the contract in include/BodyForces.h: this runs once per residual evaluation, not once per step, so a force that carries state across calls (a filter, ramp, moving average, or integral term) gates its update on simCtx->step.
Definition at line 426 of file rhs.c.
|
extern |
Computes the Right-Hand Side (RHS) of the momentum equations.
This function calculates the contribution of the convective and diffusive terms. It is called by the momentum solvers (e.g., RungeKutta).
| user | The UserCtx for a single block. |
| Rhs | The PETSc Vec where the RHS result will be stored. |
Computes the Right-Hand Side (RHS) of the momentum equations.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/rhs.h.
Definition at line 616 of file rhs.c.