@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
148 lines (146 loc) • 4.81 kB
JavaScript
import {
ParameterLookupTable
} from "../../../../engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js";
/**
* Complex refractive index of soot (black carbon): n + i k, wavelength in nm.
* Assumptions: aggregation/morphology not modeled; bulk effective optical constants representative of fresh black carbon.
* Temperature: ~300 K; ambient pressure; dry.
*
* Composite sources and notes:
* - Chang & Charalampopoulos (1990), Proc. R. Soc. A 430, 577–591 — 0.25–25 µm soot optical constants (canonical in combustion/atmospheric).
* - Dalzell & Sarofim (1969), J. Heat Transfer 91, 100–104 — visible anchors near 0.55–0.65 µm.
* - Querry (1985/1991), Optical constants of minerals and other materials (amorphous carbon) — trend guidance in MIR/FIR.
* - Bond & Bergstrom (2006), Aerosol Science and Technology 40, 27–67 — review with recommended visible values.
*
* Table design:
* - 200–20,000 nm coverage for radiometric work beyond graphics; linear interpolation by ParameterLookupTable.
* - Denser around UV/visible and 3–12 µm where carbon shows stronger spectral structure.
* - Values are a smoothed composite to avoid sharp source-to-source discontinuities; suitable for Mie with linear interpolation.
*/
const SOOT_REFRACTION_INDEX_LUT = ParameterLookupTable.from(
2, // number of columns in the table [n, k]
// Lookup data (n, k) pairs; positions in nm below must match length/2.
[
// UV (short-wave): stronger absorption, slightly higher n
1.90, 1.10, // 200 nm
1.92, 1.05, // 220 nm
1.94, 1.00, // 240 nm
1.96, 0.96, // 260 nm
1.96, 0.92, // 280 nm
1.95, 0.88, // 300 nm
1.94, 0.85, // 320 nm
1.93, 0.82, // 340 nm
1.92, 0.80, // 360 nm
1.91, 0.79, // 380 nm
// Visible (anchors around 405/532/633 nm; composite from C&C90, Dalzell & Sarofim, Bond & Bergstrom)
1.88, 0.90, // 400 nm
1.86, 0.84, // 450 nm
1.82, 0.74, // 500 nm
1.79, 0.68, // 550 nm
1.77, 0.65, // 600 nm
1.76, 0.63, // 650 nm (≈633 nm HeNe close anchor)
1.75, 0.62, // 700 nm
// NIR (0.7–1.1 µm): gradual reduction in k; n ~1.70–1.78
1.75, 0.60, // 750 nm
1.74, 0.58, // 800 nm
1.73, 0.54, // 900 nm
1.72, 0.50, // 1000 nm (1 µm)
1.71, 0.46, // 1100 nm
// SWIR (1.1–2.5 µm)
1.70, 0.42, // 1200 nm
1.70, 0.40, // 1300 nm
1.69, 0.38, // 1450 nm
1.69, 0.36, // 1550 nm
1.68, 0.34, // 1650 nm
1.68, 0.32, // 1750 nm
1.67, 0.30, // 1940 nm
1.67, 0.30, // 2000 nm
1.66, 0.29, // 2200 nm
1.66, 0.28, // 2400 nm
1.66, 0.28, // 2500 nm
// Mid-IR (2.5–5 µm): carbonaceous materials tend to maintain moderate k; slight n increase
1.67, 0.30, // 2700 nm
1.68, 0.33, // 2900 nm
1.70, 0.36, // 3000 nm
1.72, 0.40, // 3100 nm
1.74, 0.44, // 3200 nm
1.76, 0.48, // 3300 nm
1.78, 0.50, // 3500 nm
1.80, 0.52, // 3700 nm
1.82, 0.55, // 4000 nm
1.85, 0.58, // 4500 nm
1.88, 0.60, // 5000 nm (5 µm)
// Long-wave IR (5–20 µm): k remains significant; n slowly rises then flattens
1.90, 0.62, // 6000 nm
1.92, 0.65, // 7000 nm
1.95, 0.70, // 8000 nm
1.98, 0.75, // 9000 nm
2.00, 0.80, // 10000 nm (10 µm)
2.02, 0.85, // 12000 nm
2.05, 0.92, // 15000 nm
2.08, 1.00, // 20000 nm (20 µm)
],
// Wavelength positions in nm corresponding to the (n,k) pairs above
[
200,
220,
240,
260,
280,
300,
320,
340,
360,
380,
400,
450,
500,
550,
600,
650,
700,
750,
800,
900,
1000,
1100,
1200,
1300,
1450,
1550,
1650,
1750,
1940,
2000,
2200,
2400,
2500,
2700,
2900,
3000,
3100,
3200,
3300,
3500,
3700,
4000,
4500,
5000,
6000,
7000,
8000,
9000,
10000,
12000,
15000,
20000
]
);
/**
* 🔥 SOOT (Black Carbon)
* @param {number[]} result complex number, refraction index
* @param {number} wavelength_nm in nanometers
*/
export function ri_soot(result, wavelength_nm) {
SOOT_REFRACTION_INDEX_LUT.sample(wavelength_nm, result);
}