flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
collocated_varrho.hpp File Reference

flow — collocated (ABC approximate-projection) variable-density kernels: the mass-adjoint pair of rung V8 (doc/collocated_varrho_forces.md). More...

#include <Kokkos_Core.hpp>
#include "collocated_varrho_point.hpp"
#include "mac_cutcell.hpp"
#include "policy.hpp"
#include "vof/surface_tension.hpp"

Go to the source code of this file.

Namespaces

namespace  peclet
 
namespace  peclet::flow
 

Functions

void peclet::flow::buildFaceAccelVar (CCField af, CCConst P, CCConst rho, CCConst fb, bool haveFb, bool haveRho, double rhoC, double fc, bool incr, double scale, long s, C3 e, int g, double wa=1.0)
 
void peclet::flow::addFaceAccelCsf (CCField af, CCConst cv, CCConst kp, CCConst kb, CCConst rho, bool haveRho, double rhoC, double sigma, double hGrad, double scale, long s, C3 e, int g)
 
void peclet::flow::centerToFaceMassWeighted (CCField uf, CCField vf, CCField wf, CCConst U, CCConst V, CCConst W, CCConst rho, C3 e, int g)
 
void peclet::flow::correctCellFaceAverageVar (CCField u, CCConst phi, CCConst rho, CCConst o, bool haveRho, double rho0, long s, C3 e, int g, double wa=1.0)
 

Detailed Description

flow — collocated (ABC approximate-projection) variable-density kernels: the mass-adjoint pair of rung V8 (doc/collocated_varrho_forces.md).

The collocated solver stores u at the cell centre and couples it to the pressure through an APPROXIMATE projection: map the cell velocities onto a MAC face field, make THAT field discretely divergence-free, then correct the cell field. With a variable density (or the CSF of surface tension, rung V8 = Grid::collocated && (varRho_ || csfActive())) the step is the incremental-rotational predictor of the constant-density scheme with the weights changed so that the pressure force and the constraint stay an ADJOINT pair in the kinetic-energy inner product (§4.3):

  • the pressure, the CSF and the uniform drive set_body_force enter the implicit momentum predictor at the cell as the finite-volume face integral with the acceleration-continuous face pressure, rho_c * ½ sum_faces o_f (F_f - w (P(j) - P(j-s))) / rho_f (buildFaceAccelVar + addFaceAccelCsf build the bracket / rho_f per face; the cell RHS Solver::buildRhsColoVar reconstructs it with varrho::cellFromFaces);
  • a per-cell volumetric force enters at the CELL VALUE times the weight sum W = ½ (o_lo + o_hi) of that reconstruction (varrho::weightSum), which is what balances f = rho g against the wall's Neumann pressure (§4.5);
  • the projection's face field is MOMENTUM-weighted, (rho_L u_L + rho_R u_R)/(rho_L + rho_R) (centerToFaceMassWeighted), so the pressure force is exactly -M^{-1} C^T for the constraint C = D O Pi_rho, for any openness;
  • the Poisson operator keeps the face coefficient c_f = o_f rho0/rho_f with the ARITHMETIC face mean (the staggered buildRhoCoeff), the face correction is projectCorrectVar, and the cell correction is the SAME face-to-cell reconstruction applied to the face corrections k(j) = w (rho0/rho_f) (phi(j) - phi(j-s)) (correctCellFaceAverageVar).

At uniform density every one of these reduces to the validated constant-density collocated scheme (to round-off). The rotational (Timmermans) pressure update is unchanged. Openness is a multiplicative weight applied ONCE, in the face-to-cell reconstruction and in the divergence (§4.9 L1); the per-face arrays built here carry no openness.

HISTORY — do not reintroduce. WO-T (2026-09-02) made every force and the lagged pressure a MAC face acceleration added after the viscous solve (Basilisk centered.h; Popinet JCP 2009 §3). It was balanced but non-incremental and unstable above mu dt/(rho h^2) = 1/12, and it was retired 2026-09-25. See doc/collocated_varrho_forces.md §2 and the suite-wide register.

Every kernel here is reached only under Grid::collocated && (varRho_ || csfActive()): nothing on the staggered path and nothing on the constant-density collocated path calls them.

Definition in file collocated_varrho.hpp.