Go to the source code of this file.
Functions | |
| static PICURV_ALWAYS_INLINE Cmpnts | RHSVelocityAtBN (const Cmpnts ***ucat, const PetscInt c[3], PetscInt b, PetscInt p, PetscInt n, PetscInt q) |
Velocity at c + p e_b + q e_n, the Cartesian counterpart of PoissonOperator_AtBN(). | |
| static Cmpnts | RHSVelocityAt (const Cmpnts ***ucat, const PetscInt c[3], PetscInt n, PetscInt d) |
Cartesian velocity at cell c displaced by d along axis n. | |
| static Cmpnts | RHSQuickFlux (const Cmpnts ***ucat, const PetscInt c[3], PetscInt n, PetscReal ucon, PetscInt m1, PetscInt p2) |
QUICK flux through the face between cell c and c + e_n, upwinded by the sign of ucon. | |
| static Cmpnts | RHSCentralFlux (const Cmpnts ***ucat, const PetscInt c[3], PetscInt n, PetscReal ucon) |
Central flux through the face between cell c and c + e_n. | |
| static Cmpnts | RHSConvectiveFaceFlux (const Cmpnts ***ucat, const PetscReal ***nvert, const PetscInt c[3], PetscInt n, PetscReal ucon, PetscInt m, PetscBool periodic, PetscBool central) |
Convective flux of Cartesian momentum through the face between cell c and c + e_n, carried by half the contravariant flux on that face. | |
| PetscErrorCode | ComputeConvection (UserCtx *user, Vec Ucont, Vec Ucat, Vec Conv) |
| Implementation of ComputeConvection(). | |
| static PICURV_ALWAYS_INLINE Cmpnts | RHSTransverseVelocityDifference (const Cmpnts ***ucat, const PetscInt c[3], PetscInt n, PetscInt b, PoissonTransverseDifference diff) |
(u(c+hi e_b+e_n) + u(c+hi e_b) - u(c+lo e_b+e_n) - u(c+lo e_b)) * weight, for diff's rows and weight. | |
| static PICURV_ALWAYS_INLINE Cmpnts | RHSTransverseFaceDifference (const Cmpnts ***ucat, const PetscReal ***nvert, const PetscInt c[3], PetscInt n, PetscInt b) |
Velocity difference along transverse axis b on the face between cell c and c + e_n: the average over the two cells beside the face, one-sided away from a blanked solid cell. | |
| static PICURV_ALWAYS_INLINE void | RHSFaceVelocityDifferences (const Cmpnts ***ucat, const PetscReal ***nvert, const PetscInt c[3], PetscInt n, Cmpnts d[3]) |
Velocity differences on the face between cell c and c + e_n, one per computational direction: across the face along n, and along each transverse axis. | |
| static PICURV_ALWAYS_INLINE Cmpnts | RHSViscousFaceFlux (const PoissonFaceMetrics *metrics, const Cmpnts d[3], const PetscInt c[3], PetscInt n, PetscReal nu, PetscReal nu_t, PetscBool les, PetscBool clark) |
Viscous stress through the face between cell c and c + e_n, in Cartesian components, from the face differences d and the face metrics. | |
| static PICURV_ALWAYS_INLINE void | RHSViscousFluxesAlong (const UserCtx *user, const PoissonFaceMetrics *metrics, const Cmpnts ***ucat, const PetscReal ***nvert, const PetscReal ***lnu_t, const Cmpnts ***lwall_stress, const PetscInt lo[3], const PetscInt hi[3], const PetscInt m[3], PetscInt n, PetscBool les, PetscBool clark, Cmpnts ***fp) |
Viscous stresses on every face of orientation n of the owned cells, from the face below the first cell; n is a constant at each call, so each expands to its own loop. | |
| PetscErrorCode | ComputeViscous (UserCtx *user, Vec Ucat, Vec Visc) |
| Implementation of ComputeViscous(). | |
| PetscErrorCode | ComputeBodyForces (UserCtx *user, Vec Rct) |
| Implementation of ComputeBodyForces(). | |
| static PetscErrorCode | RHSContravariantSpatialTerms (UserCtx *user, Vec Conv, Vec Visc, Vec Rct) |
| Contravariant cell-centre components of the spatial terms, Rct = aj F_n . | |
| static PICURV_ALWAYS_INLINE PetscReal | RHSFaceTerm (const PoissonFaceMetrics *metrics, const PetscReal ***nvert, const PetscReal ***p, const Cmpnts ***rct, const PetscInt c[3], PetscInt n, const PetscInt m[3], const PetscBool periodic[3]) |
Face residual of component n at cell c: the two-cell average of rct less the pressure-gradient flux through the face. | |
| static PetscErrorCode | RHSFaceTermsWithPressureGradient (UserCtx *user, Vec Rct, Vec Rhs) |
Face residual from the ghosted cell-centre terms: the average of Rct over the two cells beside each face, less the pressure-gradient flux through it. | |
| static PetscErrorCode | RHSZeroInactiveRows (UserCtx *user, Vec Rhs) |
| Zeroes the residual rows that carry no unknown: the component a 2D run disables, every component of a solid cell, and each face component whose far cell is solid. | |
| PetscErrorCode | ComputeRHS (UserCtx *user, Vec Rhs) |
| Implementation of ComputeRHS(). | |
|
static |
Velocity at c + p e_b + q e_n, the Cartesian counterpart of PoissonOperator_AtBN().
Definition at line 5 of file rhs.c.
|
inlinestatic |
Cartesian velocity at cell c displaced by d along axis n.
Definition at line 12 of file rhs.c.
|
inlinestatic |
QUICK flux through the face between cell c and c + e_n, upwinded by the sign of ucon.
m1 and p2 are the offsets used for the far upwind cells, -1 and +2 in the interior; a one-sided face substitutes 0 or +1 for the side it cannot reach.
Definition at line 22 of file rhs.c.
|
inlinestatic |
|
inlinestatic |
Convective flux of Cartesian momentum through the face between cell c and c + e_n, carried by half the contravariant flux on that face.
Interior faces use the central flux when central (central differencing or LES) and QUICK otherwise; with central differencing the two end faces of an axis are central as well. A face at the low end of an axis or behind a solid cell is QUICK one-sided toward +n, and one at the high end or ahead of a solid cell one-sided toward -n, except across a periodic seam, which keeps the full stencil. A face meeting none of these carries no flux.
Definition at line 62 of file rhs.c.
| PetscErrorCode ComputeConvection | ( | UserCtx * | user, |
| Vec | Ucont, | ||
| Vec | Ucat, | ||
| Vec | Conv | ||
| ) |
Implementation of ComputeConvection().
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.
|
static |
(u(c+hi e_b+e_n) + u(c+hi e_b) - u(c+lo e_b+e_n) - u(c+lo e_b)) * weight, for diff's rows and weight.
Definition at line 180 of file rhs.c.
|
static |
Velocity difference along transverse axis b on the face between cell c and c + e_n: the average over the two cells beside the face, one-sided away from a blanked solid cell.
Each branch has constant offsets once n and b are constants.
Definition at line 199 of file rhs.c.
|
static |
Velocity differences on the face between cell c and c + e_n, one per computational direction: across the face along n, and along each transverse axis.
Definition at line 215 of file rhs.c.
|
static |
Viscous stress through the face between cell c and c + e_n, in Cartesian components, from the face differences d and the face metrics.
With F_b the contravariant base vectors on the face and N = F_n its normal, the flux of each velocity component U is (sum_b (F_b . N) dU/dxi_b + sum_c (sum_b dU_c/dxi_b F_b) . e_U N_c) aj: the full stress, gradient plus transpose. The eddy viscosity nu_t carries it when LES is on, and the molecular viscosity nu is added; with the gradient (Clark) model the tensor sum_b d_b d_b^T contracted with N, over 12, is subtracted.
Definition at line 235 of file rhs.c.
|
static |
Viscous stresses on every face of orientation n of the owned cells, from the face below the first cell; n is a constant at each call, so each expands to its own loop.
Definition at line 291 of file rhs.c.
| PetscErrorCode ComputeViscous | ( | UserCtx * | user, |
| Vec | Ucat, | ||
| Vec | Visc | ||
| ) |
Implementation of ComputeViscous().
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 ComputeBodyForces | ( | UserCtx * | user, |
| Vec | Rct | ||
| ) |
Implementation of ComputeBodyForces().
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.
|
static |
Contravariant cell-centre components of the spatial terms, Rct = aj F_n .
(Visc - Conv), with each base vector F_n averaged from its two faces to the cell centre.
Definition at line 440 of file rhs.c.
|
static |
Face residual of component n at cell c: the two-cell average of rct less the pressure-gradient flux through the face.
Definition at line 491 of file rhs.c.
|
static |
Face residual from the ghosted cell-centre terms: the average of Rct over the two cells beside each face, less the pressure-gradient flux through it.
The flux is the projection's face gradient (PoissonOperator_FaceGradientFlux()) applied to P. Every interior face is set, and on a periodic axis also the seam face at index 0.
Definition at line 508 of file rhs.c.
|
static |
Zeroes the residual rows that carry no unknown: the component a 2D run disables, every component of a solid cell, and each face component whose far cell is solid.
Definition at line 577 of file rhs.c.
| PetscErrorCode ComputeRHS | ( | UserCtx * | user, |
| Vec | Rhs | ||
| ) |
Implementation of ComputeRHS().
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.