nx_emulsion.nx
buildroot/runtime/nx_emulsion.nx
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
imports: nx_syscalls.nx
imported by: nx_emulsion_test.nx
structs
| none |
consts
| 20 | const EM_MAGIC_1000000: i64 = 1000000 |
| 22 | const EM_TYPE_SPLIT_HLB: i64 = 70 // HLB 7.0: below -> W/O, at/above -> O/W |
| 26 | const EM_WO: i64 = 0 // water-in-oil |
| 27 | const EM_OW: i64 = 1 // oil-in-water |
| 29 | const EM_SPAN80: i64 = 0 // HLB 4.3 |
| 30 | const EM_TWEEN80: i64 = 1 // HLB 15.0 |
| 31 | const EM_LECITHIN: i64 = 2 // HLB ~4.0 |
| 32 | const EM_MONOGLYCERIDE: i64 = 3 // HLB ~3.7 |
| 33 | const EM_SSL: i64 = 4 // sodium stearoyl lactylate, HLB ~8.3 |
| 35 | const EM_OIL_OLIVE: i64 = 0 // required HLB ~7.0 |
| 36 | const EM_OIL_MINERAL: i64 = 1 // required HLB ~10.5 |
functions
| 40 | func em_emulsifier_hlb(id: i64) -> i64 called by 1: main |
| 50 | func em_required_hlb(oil_id: i64) -> i64 called by 1: main |
| 57 | func em_blend_hlb(hlb_a: i64, w_a: i64, hlb_b: i64, w_b: i64) -> i64 called by 1: main |
| 64 | func em_emulsion_type(hlb: i64) -> i64 called by 1: main |
| 70 | func em_match(required_hlb: i64, actual_hlb: i64, tol: i64) -> i64 called by 1: main |
| 81 | func em_creaming_index(density_diff_gpl: i64, diam_um: i64, visc_mpas: i64) -> i64 called by 1: main |
| 87 | func em_more_stable(index_a: i64, index_b: i64) -> i64 called by 1: main |