/ proof-of-concept / plate-mechanics-sim
Sign in
proof-of-concept / plate-mechanics-sim
plate-mechanics-sim / packages / core / src / methods / fd.ts
61 lines · 2.7 KBBlameHistoryRaw
1import type { MethodDefinition } from "./types";
2import { GOVERNING_EQUATIONS, RADIATION_EQUATIONS, STRESS_EQUATIONS } from "./common";
4export const FD_METHOD: MethodDefinition = {
5 id: "fd",
6 name: "Explicit finite differences",
7 shortName: "Explicit FD",
8 summary: "Explicit second-order time stepping of the 13-point biharmonic stencil.",
9 solverFunction: "plate_fd",
10 planFunction: "plate_fd_plan",
11 supports: {
12 bc: ["simply-supported", "clamped"],
13 excitation: ["impulse", "harmonic"],
14 audio: "clip",
15 },
16 readingOrder: [
17 "plate_fd.m",
18 "plate_fd_plan.m",
19 "plate_setup.m",
20 "plate_pad.m",
21 "plate_laplacian.m",
22 "plate_curvature.m",
23 "plate_force_time.m",
24 "plate_force_footprint.m",
25 "plate_stress.m",
26 "plate_listener.m",
27 "plate_spectrum.m",
28 "plate_result_schema.m",
29 ],
30 equations: [
31 ...GOVERNING_EQUATIONS,
32 {
33 tex: String.raw`(1+\sigma_0\Delta t)\,w^{n+1} = 2w^n - (1-\sigma_0\Delta t)\,w^{n-1} - \kappa^2\Delta t^2\, \mathsf L\mathsf L\, w^n + 2\sigma_1\Delta t\,\mathsf L\!\left(w^n - w^{n-1}\right) + \frac{\Delta t^2}{\mu} F^n s`,
34 caption:
35 "Explicit scheme, second order in space and time; L is the five-point Laplacian and LL the resulting 13-point biharmonic stencil.",
36 },
37 {
38 tex: String.raw`\mathsf L w_{ij} = \frac{w_{i,j+1} - 2w_{ij} + w_{i,j-1}}{\Delta x^2} + \frac{w_{i+1,j} - 2w_{ij} + w_{i-1,j}}{\Delta y^2}`,
39 caption:
40 "Edge conditions enter through one ghost layer: odd reflection for simply supported (w = w_nn = 0), even reflection for clamped (w = w_n = 0).",
41 },
42 {
43 tex: String.raw`\Delta t \le \frac{2}{\lambda_{\max}\left(\sigma_1 + \sqrt{\kappa^2 + \sigma_1^2}\right)}, \qquad \lambda_{\max} = \frac{4}{\Delta x^2} + \frac{4}{\Delta y^2}`,
44 caption:
45 "Stability bound from von Neumann analysis; for a square grid without sigma1 it reads dt <= dx^2 / (4 kappa). Because dt scales with dx^2, halving the spacing costs eight times more work.",
46 },
47 ...STRESS_EQUATIONS,
48 ...RADIATION_EQUATIONS,
49 ],
50 validity: [
51 "Second-order truncation error in dx, dy and dt; the top modes on the grid are dispersive and their frequencies are too low.",
52 "The probe is snapped to the nearest interior grid node.",
53 "Stress fields are evaluated only at the saved frames, so the envelope samples the true peak.",
54 "The time-step limit makes long simulated times expensive: cost grows as (1/dx)^4 for a fixed duration.",
55 "Audio is a short clip covering only the simulated window, box-averaged onto audio samples.",
56 ],
57 durationOf: (spec) => spec.fd.duration,
58 gridOf: (spec) => [spec.fd.nx, spec.fd.ny],
59 settingsKey: "fd",
60 usPerCellStep: 0.35,
61};
↑↓ move↵openescclose