code wiki / (root) / nx_emulsion.nx

nx_emulsion.nx

buildroot/runtime/nx_emulsion.nx

3455 B90 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_emulsion.nx -- FOOD-SCIENCE SUITE / COLLOID & EMULSION rung. Designs emulsions with the HLB (hydrophilic-lipophilic balance) system: match an emulsifier (or a blend) to the REQUIRED HLB of an oil, predict the emulsion TYPE (oil-in-water vs water-in-oil, Griffin/Bancroft), and rank creaming STABILITY by Stokes' law -- versus trial-and-error. All INTEGER: HLB values x10 (one decimal, HLB 15.0 = 150); weights in parts; creaming index in relative units. Stokes: creaming rate rises with density difference and droplet-diameter squared, falls with continuous-phase viscosity (smaller droplets + thicker phase = stabler). THE exceed: emulsifier selection becomes a MATCH against the oil's required HLB (with a blend to hit any target), the type is PREDICTED, and stability is RANKED from physics -- not guessed from a recipe. grounded: griffin_hlb_system + bancroft_rule + stokes_law_creaming genealogy_id: emulsion_colloid_science + nishi_food_science_suite

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_emulsion.nx nx_emulsion_test.nx

imports: nx_syscalls.nx

imported by: nx_emulsion_test.nx

structs

none

consts

20const EM_MAGIC_1000000: i64 = 1000000
22const EM_TYPE_SPLIT_HLB: i64 = 70 // HLB 7.0: below -> W/O, at/above -> O/W
26const EM_WO: i64 = 0 // water-in-oil
27const EM_OW: i64 = 1 // oil-in-water
29const EM_SPAN80: i64 = 0 // HLB 4.3
30const EM_TWEEN80: i64 = 1 // HLB 15.0
31const EM_LECITHIN: i64 = 2 // HLB ~4.0
32const EM_MONOGLYCERIDE: i64 = 3 // HLB ~3.7
33const EM_SSL: i64 = 4 // sodium stearoyl lactylate, HLB ~8.3
35const EM_OIL_OLIVE: i64 = 0 // required HLB ~7.0
36const EM_OIL_MINERAL: i64 = 1 // required HLB ~10.5

functions

40func em_emulsifier_hlb(id: i64) -> i64
called by 1: main
50func em_required_hlb(oil_id: i64) -> i64
called by 1: main
57func em_blend_hlb(hlb_a: i64, w_a: i64, hlb_b: i64, w_b: i64) -> i64
called by 1: main
64func em_emulsion_type(hlb: i64) -> i64
called by 1: main
70func em_match(required_hlb: i64, actual_hlb: i64, tol: i64) -> i64
called by 1: main
81func em_creaming_index(density_diff_gpl: i64, diam_um: i64, visc_mpas: i64) -> i64
called by 1: main
87func em_more_stable(index_a: i64, index_b: i64) -> i64
called by 1: main