Home / Docs-Technical WhitePaper / 02-EFT.WP.Core.Equations v1.1
Chapter 9 — Numerical Realization and Consistency
I. Aims and Principles
- Establish the minimal closed loop from equations to implementation: discretize → assemble → constrain → solve → evaluate metrics → regress.
- Use the I20-* interfaces as the sole landing path; all formulas and symbols follow Core.Terms and the conventions defined earlier in this volume.
- Define consistency through three classes of metrics: L2, L_inf, T_arr (see Chapters 2 and 8).
II. Grid and Discrete Operators (S90-1)
- Discrete inner products and norms
inner_h[u,v] def= ( ∑_{i ∈ cells} u_i * v_i * |V_i| );
L2_h[u] def= sqrt( inner_h[u,u] );L_inf_h[u] def= max_i |u_i|。 - Discrete gradient/divergence consistency
div_h and grad_h must satisfy the discrete Gauss theorem:
∑_{i} ( div_h F )_i * |V_i| = ∑_{faces} ( F_f • nu_f ) * A_f。
Treat this as the acceptance criterion for assemble_operator("div", ...) and assemble_operator("grad", ...). - S90-1 (discrete conservation constraint)
For any closed control volume V, if Chapter 6 prescribes zero flux on the boundary, then
∑_{i∈V} ( div_h F )_i * |V_i| = 0。
III. Path Discretization and Arrival-Time Consistency (S90-2)
- Line elements and samples
Given a piecewise approximation of gamma(ell) with ds = { ds_i } and samples n_eff_i:
T_arr_h def= ( ∑_i ( n_eff_i / c_ref ) * ds_i )。 - Interface consistency
T_arr_h = propagate_time( n_eff_path={ n_eff_i }, ds={ ds_i }, c_ref ) (binding to I20-4)。
Must agree with the continuous form: T_arr = ( ∫_{gamma(ell)} ( n_eff / c_ref ) d ell ) (see Chapter 2). - S90-2 (segment additivity)
If gamma = ⋃_k gamma_k, then T_arr_h = ( ∑_k T_arr_h^{(k)} )。
IV. Strong → Weak → Algebraic (S90-3)
- Strong template (example): ∂_t q + div( J_q ) = S_q on Ω。
- Weak template (see Chapter 7):
weak= inner_Ω[w, ∂_t q] + ( ∫_{Ω} grad[w] • J_q d V ) = inner_Ω[w, S_q] + B[w]。 - Algebraic assembly
Build matrices/operators M (mass), K (diffusion/advection) via assemble_operator; inject boundary terms with bc_dirichlet, bc_neumann:
M * dq_dt + K(q) = f + b。 - S90-3 (linearization consistency)
For one Newton step, linearize K(q) ≈ K(q^n) + J(q^n) * ( q^{n+1} - q^n ). The Jacobian J(•) must match the Gâteaux variation of the weak form (see Chapter 7).
V. Time Marching and Stability (S90-4)
- Explicit advance (example)
q^{n+1} = q^n + Δt * M^{-1} * ( f^n + b^n - K(q^n) )。
Convective CFL bound: Δt ≤ CFL * min_i( Δx_i / |u|_{max,i} ), with CFL ∈ (0,1]。
Diffusive bound: Δt ≤ σ * min_i( Δx_i^2 / ( 2 * d * κ_{max,i} ) ), σ ∈ (0,1], d is spatial dimension. - Implicit advance (example)
Solve q^{n+1} from M * ( q^{n+1} - q^n ) / Δt + K( q^{n+1} ) = f^{n+1} + b^{n+1} using solve_nonlinear。 - S90-4 (energy bound)
For steady diffusion-type K positive definite, implicit Euler satisfies discrete energy decay:
inner_h[ q^{n+1}, q^{n+1} ] ≤ inner_h[ q^n, q^n ]。
VI. Consistent Injection of Boundary and Initial Data (S90-5)
- Initial condition injection
Map q^0 = IC(x) to grid nodes/cell centers; if the weak form has a mass matrix, set M * q^0 = inner_Ω[φ_i, IC]。 - Dirichlet boundary
Use bc_dirichlet(mask, value) for hard replacement or penalty weak enforcement; annotate the chosen method in the equation notes. - Neumann boundary
Use bc_neumann(mask, flux) to inject ∫_{∂Ω_N} w * flux d A into the right-hand side b。 - S90-5 (boundary priority)
Where both value and flux are provided at the same location, prefer Dirichlet as in Chapter 6; Neumann becomes a diagnostic and is not assembled.
VII. Error Metrics and Conservation Diagnostics (S90-6)
- Difference metrics
E_L2 def= L2_h[ x - y ];E_Linf def= L_inf_h[ x - y ]。
Path metric: E_T def= | T_arr(x) - T_arr(y) |, where T_arr(•) is computed by propagate_time。 - Conservation residual
For a closed system:
C_err^n def= ( ∑_i q_i^{n+1} * |V_i| - ∑_i q_i^n * |V_i| ) - Δt * ( ∑_i S_{q,i}^n * |V_i| ),expect C_err^n approx 0。 - S90-6 (consistency thresholds)
Pass if E_L2 ≤ τ_L2 and E_Linf ≤ τ_Linf and E_T ≤ τ_T; thresholds must be stated explicitly in the test plan.
VIII. Grid and Time-Step Convergence (S90-7)
- Order estimate
With grid sequence h_k = h_0 / 2^k and error E_k = L2_h[ q_{h_k} - q_{h_{k+1}} ], define
p_est def= log2( E_k / E_{k+1} )。 - S90-7 (order acceptance)
If theoretical order is p_th, accept when | p_est - p_th | ≤ ε_p, with recommended ε_p ∈ [0.1, 0.3]。
IX. Realizing Statistics and Coarse-Graining in Computation (S90-8)
- Time-average discretization
avg_t[q; Δt] ≈ ( 1 / N_t ) * ( ∑_{k=0}^{N_t-1} q^{n-k} ),N_t = round( Δt / Δt_num )。 - Volume-average discretization
avg_V[q; V] ≈ ( 1 / |V| ) * ( ∑_{c ∈ V} q_c * |V_c| )。 - Flux-closure injection
If using J_sgs^q approx - K_sgs^q * grad[ bar_q ] (see Chapter 8), include K_sgs^q in the diffusion coefficient table coeffs during assembly.
X. Minimal Working Sequence (I20-aligned)*
- Use register_equation(code, eqn, kind, anchors, depends) to register the target equation (see each chapter’s Sxx-*).
- Prepare the grid and path; call discretize_path(gamma, scheme, h) to obtain ds and nodes.
- Build operators M, K, etc., with assemble_operator; inject boundaries with bc_dirichlet and bc_neumann.
- Set IC to obtain q^0; choose a time integrator: solve_linear or solve_nonlinear.
- If arrival time is involved, call propagate_time(n_eff_path, ds, c_ref) to compute T_arr。
- Use compare_solutions(x, y, metrics=["L2","L_inf","T_arr"]) to evaluate differences versus the baseline.
- Record E_L2, E_Linf, E_T, C_err; issue pass/fail per S90-6/7。
- Archive all run metadata (grid, step sizes, thresholds) via export_equations("yaml") and external logs.
XI. Regression and Baselines (S90-9)
- Reference solution
y_ref comes from analytics, grid extrapolation, or a high-accuracy computation; for path quantities, also store T_arr_ref。 - S90-9 (regression rule)
pass if ( L2 ≤ τ_L2 and L_inf ≤ τ_Linf ) and | T_arr - T_arr_ref | ≤ τ_T;
on failure, output the minimal counterexample: grid level, time step, boundary combination, and the corresponding residuals.
XII. Typical Anomalies and Diagnostic Card
- Dimensional check failure: check_dim_equation(eqn) not [target] → roll back to the equation definition and verify coefficients/units (see Core.Terms §6).
- Path not explicit: missing gamma(ell) or d ell → reject (see Chapter 2 and Chapter 8 Lint).
- Conserved quantity drift: nonzero C_err^n accumulates → inspect bc_* injections, div_h/grad_h pairing, and the time integrator.
- Order collapse: p_est far below p_th → examine grid quality, boundary-layer treatment, and subgrid-flux parameters.
XIII. Lint and Forbidden List
- Do not write ∫ n d ell / c or ∫ n_eff / c_ref d ell (missing parentheses or path); the canonical form is ( ∫_{gamma(ell)} ( n_eff / c_ref ) d ell )。
- Do not mix n with n_eff or T_fil with T_trans; do not use bare c, T, n。
- Do not omit window/volume parameters: avg_t[•; Δt], avg_V[•; V] must be explicit.
XIV. Registrable Items and Examples
- register_equation("S90-1","discrete inner products and Gauss consistency","definition",anchors=["§II"],depends=["S50-*","S60-*"])
- register_equation("S90-2","discrete arrival time T_arr_h = sum_i (n_eff_i / c_ref) * ds_i","identity",anchors=["§III"],depends=["S20-*","I20-4"])
- register_equation("S90-3","assembly M dq/dt + K(q) = f + b with weak consistency","procedure",anchors=["§IV"],depends=["S70-*"])
- register_equation("S90-4","time stepping stability bounds (CFL/diffusion)","guideline",anchors=["§V"],depends=["S50-*"])
- register_equation("S90-6","error metrics and conservation residuals","metric",anchors=["§VII"],depends=["I20-5"])
- register_equation("S90-7","order-of-accuracy estimation p_est = log2(E_k/E_{k+1})","metric",anchors=["§VIII"],depends=[])
- register_equation("S90-9","regression rule with thresholds on L2, L_inf, T_arr","criterion",anchors=["§XI"],depends=["I20-5","S20-*"])
Copyright & License (CC BY 4.0)
Copyright: Unless otherwise noted, the copyright of “Energy Filament Theory” (text, charts, illustrations, symbols, and formulas) belongs to the author “Guanglin Tu”.
License: This work is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0). You may copy, redistribute, excerpt, adapt, and share for commercial or non‑commercial purposes with proper attribution.
Suggested attribution: Author: “Guanglin Tu”; Work: “Energy Filament Theory”; Source: energyfilament.org; License: CC BY 4.0.
First published: 2025-11-11|Current version:v5.1
License link:https://creativecommons.org/licenses/by/4.0/