flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
probe_budget Namespace Reference

Functions

 fields (s)
 face_rho (C, c)
 face_avg (F, c)
 main ()

Variables

list SHIFT

Detailed Description

Case A G5 diagnosis, step 1: the discrete momentum budget behind the closure acceleration.

set_superficial_velocity applies, at the end of every step, one uniform shift s of u_x on every
face, i.e. a uniform ACCELERATION a = s/dt, which in the velocity form is the force density
rho_f * a. In the continuum the steady (translating) state has a = 0: the total momentum
P = sum_f rho_f u_f is constant and every other force sums to zero. Discretely

  P^{n+1} - P^n = sum rho^n_f (u* - u^n)            [predictor; the projection sums to zero]
                + sum (rho^{n+1}_f - rho^n_f) u^{n+1,pre}   [the density change, VoF]
                + sum rho^{n+1}_f s                 [the closure]

and the predictor part is dt * sum(-rho_f A(u) + f_csf + T_fullstress + f_grav). Per term, as a
mean force density in units of <rho> g (so that, at steady state, the terms sum to +a/g... with
the sign below: closure = -(sum of the others)):

  ADV   -sum rho_f A(u)        from a twin solver stepped once with advection toggled
                               (the solver default and the case-A runs: advection OFF; the twin
                               then measures what the missing term would contribute)
  VISC  sum T (transpose part)  from a twin stepped once with set_viscous_stress('laplacian')
  CSF   sum f_csf               diagnostics.vof_block_force (the field the RHS adds)
  GRAV  sum -(rho - <rho>) g    from C^n (zero by construction)
  DRHO  sum (rho^{n+1}-rho^n) u^{n+1,pre} / dt
  PRED  sum rho^n_f (u^{n+1,pre} - u^n) / dt   (= ADV + VISC + CSF + GRAV + solver residual)

The twins are bitwise copies of the main solver up to the probe step (checked). After the probe
the main solver alone runs on over --avg-crossings box crossings, recording PRED, CSF, DRHO,
GRAV and the closure every step; with --advection, ADV over the window = PRED - CSF - VISC - GRAV.

Also: the projection of each recorded force field on the buoyancy pattern (C - alpha), relative
to the buoyancy's own, i.e. the fraction by which the term adds to the effective buoyancy.

Usage (host, <= 4 threads):
  OMP_NUM_THREADS=4 OMP_PROC_BIND=false PYTHONPATH=$PWD/build_host \\
      python tests/study/case_a/probe_budget.py --d-over-h 20 --t-probe 10 --out DIR
Prints one summary line; DIR/budget.csv per step, DIR/summary.txt.

Function Documentation

◆ fields()

probe_budget.fields ( s)

Definition at line 49 of file probe_budget.py.

Referenced by main().

◆ face_rho()

probe_budget.face_rho ( C,
c )

Definition at line 58 of file probe_budget.py.

Referenced by main().

◆ face_avg()

probe_budget.face_avg ( F,
c )

Definition at line 63 of file probe_budget.py.

Referenced by main().

◆ main()

probe_budget.main ( )

Definition at line 67 of file probe_budget.py.

References face_avg(), face_rho(), fields(), and main().

Referenced by main().

Variable Documentation

◆ SHIFT

list probe_budget.SHIFT
Initial value:
1= [
2 1
3]

Definition at line 53 of file probe_budget.py.