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

Functions

 make (dt, u_init)
 
 run (mode, dt=5.0, steps=STEPS, stop_after=None)
 
 bits_equal (a, b)
 
 time_call (kind, reps=20, dt=5.0)
 
 run_stop (refresh, dt=5.0, steps=STEPS)
 
 run_never (dt=5.0, steps=STEPS)
 

Variables

 N
 
 RF
 
 R = RF * N
 
 RHO
 
 MU
 
 U0
 
 KN_R
 
 KI_I
 
 KI_R
 
 STEPS = int(os.environ.get("STEPS", "60"))
 
float OM = 0.01
 
 rb = run("rebuild")
 
 rf = run("refresh")
 
list names = ["u", "v", "w", "P"]
 
bool ok_a = True
 
 eq = bits_equal(rb[k], rf[k])
 
 d = float(np.abs(rb[k] - rf[k]).max())
 
 dF = float(np.abs(rb[4] - rf[4]).max()) / max(float(np.abs(rb[4]).max()), 1e-300)
 
 t_rb = time_call("rebuild_geometry")
 
 t_rf = time_call("refresh_wall_velocity")
 
tuple t_step = (1000 * rb[5] / STEPS) - t_rb
 
 ok_b = t_rf < t_rb
 
 ref = run_never()
 
 fixed = run_stop(refresh=True)
 
 stale = run_stop(refresh=False)
 
bool ok_c = True
 
int exhibits = float(np.abs(stale[0] - ref[0]).max()) > 1e-6
 

Detailed Description

Gate for flow's refresh_wall_velocity() (the cheap moving-BC entry point).

The claim is exactness, not approximation: for a driver that changes an instance's VELOCITY every
step while its TRANSFORM stays put, refresh_wall_velocity() must reproduce rebuild_geometry()
BITWISE -- same velocity field, same pressure, same reaction force, after many steps of a
time-varying wall velocity. Anything less and it is a different solver, not a faster path to the
same one.

Three claims:
  A. BITWISE over a 60-step oscillating-wall run (u, v, w, P, and the per-instance reaction force).
  B. The cost actually falls (that is the whole point).
  C. Stopping the motion clears the wall-velocity fields. wallVelView() keys off the field's
     EXTENT, not hasMotion_, so a previously-built uBc_ used to keep being folded into the momentum
     operator after the caller set the velocity back to zero -- a real bug on the rebuild path too.
     The check: run with a wall velocity, then set it to zero and step; the result must equal a run
     that never moved at all.

Function Documentation

◆ make()

refresh_wall_gate.make (   dt,
  u_init 
)

Definition at line 30 of file refresh_wall_gate.py.

Referenced by run(), run_never(), run_stop(), and time_call().

◆ run()

refresh_wall_gate.run (   mode,
  dt = 5.0,
  steps = STEPS,
  stop_after = None 
)

Definition at line 45 of file refresh_wall_gate.py.

References make().

◆ bits_equal()

refresh_wall_gate.bits_equal (   a,
  b 
)

Definition at line 63 of file refresh_wall_gate.py.

◆ time_call()

refresh_wall_gate.time_call (   kind,
  reps = 20,
  dt = 5.0 
)

Definition at line 92 of file refresh_wall_gate.py.

References make().

◆ run_stop()

refresh_wall_gate.run_stop (   refresh,
  dt = 5.0,
  steps = STEPS 
)
Build the scene WITH a wall velocity (so uBc_ is really built), then stop it.

Definition at line 118 of file refresh_wall_gate.py.

References make().

◆ run_never()

refresh_wall_gate.run_never (   dt = 5.0,
  steps = STEPS 
)

Definition at line 130 of file refresh_wall_gate.py.

References make().

Variable Documentation

◆ N

refresh_wall_gate.N

Definition at line 22 of file refresh_wall_gate.py.

◆ RF

refresh_wall_gate.RF

Definition at line 22 of file refresh_wall_gate.py.

◆ R

refresh_wall_gate.R = RF * N

Definition at line 23 of file refresh_wall_gate.py.

◆ RHO

refresh_wall_gate.RHO

Definition at line 24 of file refresh_wall_gate.py.

◆ MU

refresh_wall_gate.MU

Definition at line 24 of file refresh_wall_gate.py.

◆ U0

refresh_wall_gate.U0

Definition at line 24 of file refresh_wall_gate.py.

◆ KN_R

refresh_wall_gate.KN_R

Definition at line 25 of file refresh_wall_gate.py.

◆ KI_I

refresh_wall_gate.KI_I

Definition at line 25 of file refresh_wall_gate.py.

◆ KI_R

refresh_wall_gate.KI_R

Definition at line 25 of file refresh_wall_gate.py.

◆ STEPS

refresh_wall_gate.STEPS = int(os.environ.get("STEPS", "60"))

Definition at line 26 of file refresh_wall_gate.py.

◆ OM

float refresh_wall_gate.OM = 0.01

Definition at line 27 of file refresh_wall_gate.py.

◆ rb

refresh_wall_gate.rb = run("rebuild")

Definition at line 69 of file refresh_wall_gate.py.

◆ rf

refresh_wall_gate.rf = run("refresh")

Definition at line 70 of file refresh_wall_gate.py.

◆ names

list refresh_wall_gate.names = ["u", "v", "w", "P"]

Definition at line 71 of file refresh_wall_gate.py.

◆ ok_a

bool refresh_wall_gate.ok_a = True

Definition at line 72 of file refresh_wall_gate.py.

◆ eq

refresh_wall_gate.eq = bits_equal(rb[k], rf[k])

Definition at line 74 of file refresh_wall_gate.py.

◆ d

refresh_wall_gate.d = float(np.abs(rb[k] - rf[k]).max())

Definition at line 75 of file refresh_wall_gate.py.

◆ dF

refresh_wall_gate.dF = float(np.abs(rb[4] - rf[4]).max()) / max(float(np.abs(rb[4]).max()), 1e-300)

Definition at line 80 of file refresh_wall_gate.py.

◆ t_rb

refresh_wall_gate.t_rb = time_call("rebuild_geometry")

Definition at line 105 of file refresh_wall_gate.py.

◆ t_rf

refresh_wall_gate.t_rf = time_call("refresh_wall_velocity")

Definition at line 106 of file refresh_wall_gate.py.

◆ t_step

tuple refresh_wall_gate.t_step = (1000 * rb[5] / STEPS) - t_rb

Definition at line 107 of file refresh_wall_gate.py.

◆ ok_b

refresh_wall_gate.ok_b = t_rf < t_rb

Definition at line 115 of file refresh_wall_gate.py.

◆ ref

refresh_wall_gate.ref = run_never()

Definition at line 139 of file refresh_wall_gate.py.

◆ fixed

refresh_wall_gate.fixed = run_stop(refresh=True)

Definition at line 140 of file refresh_wall_gate.py.

◆ stale

refresh_wall_gate.stale = run_stop(refresh=False)

Definition at line 141 of file refresh_wall_gate.py.

◆ ok_c

bool refresh_wall_gate.ok_c = True

Definition at line 142 of file refresh_wall_gate.py.

◆ exhibits

int refresh_wall_gate.exhibits = float(np.abs(stale[0] - ref[0]).max()) > 1e-6

Definition at line 150 of file refresh_wall_gate.py.