research: reuse quadrature and clarify snapshot and VIV coordinates

This commit is contained in:
Astra (AI agent)
2026-10-31 12:04:56 +08:00
parent 4f17c3c586
commit d0968e6e91
6 changed files with 62 additions and 8 deletions
+8 -1
View File
@@ -8,6 +8,7 @@ s/T in [0.25 + (k-1), 0.25 + k); cycle 0 is the startup quarter.
from __future__ import annotations
import math
from functools import lru_cache
import numpy as np
@@ -53,10 +54,16 @@ def bin_phase(s, T):
return None
@lru_cache(maxsize=8)
def _quadrature_rule(points):
"""Reuse the nodes and weights, which depend only on quadrature order."""
return np.polynomial.legendre.leggauss(points)
def interval_bases(n, T, points=16):
"""Single-step interval averages over [n, n + 1] of cos phi |cos phi| and sin phi
(phi in radians = 2 pi s / T - pi / 2), Gauss-Legendre quadrature."""
x, w = np.polynomial.legendre.leggauss(points)
x, w = _quadrature_rule(points)
s = int(n) % T + 0.5 * (x + 1.0) # periodic: identical bases in every cycle
phi = 2.0 * np.pi * s / T - 0.5 * np.pi
c = np.cos(phi)
+4 -3
View File
@@ -1,8 +1,9 @@
"""One-shot predeclared VIV run (docs/validation/viv_re150_predeclare.md).
Re 150, U* = 5, m/(rho D^2) = 2, zeta = 0, D = 40 on a 75 D x 60 D native
channel (uniform inlet, NEQ outlet, free-slip y walls), cylinder at
(30 D, 30 D). Structural RHS = CME + Wen (diagnostics: raw CME, node terms).
Re 150, U* = 5, m/(rho D^2) = 2, zeta = 0, D = 40 on a nominal 75 D x 60 D
lattice (uniform inlet, NEQ outlet, free-slip y walls). The cylinder is at
(30 D, (ny - 1)/2); y-wall planes are .5 and ny - 1.5 in lattice coordinates.
Structural RHS = CME + Wen (diagnostics: raw CME, node terms).
Research driver only: Simulation API, no production change.
PYTHONPATH=src python research/viv_re150/run.py --out /path/outside/checkout