1#ifndef COOLPROP_DETAIL_CONFIGURATION_KEYS_H
2#define COOLPROP_DETAIL_CONFIGURATION_KEYS_H
10#define CONFIGURATION_KEYS_ENUM \
11 X(NORMALIZE_GAS_CONSTANTS, "NORMALIZE_GAS_CONSTANTS", true, "If true, for mixtures, the molar gas constant (R) will be set to the CODATA value") \
12 X(CRITICAL_WITHIN_1UK, "CRITICAL_WITHIN_1UK", true, \
13 "If true, any temperature within 1 uK of the critical temperature will be considered to be AT the critical point") \
14 X(CRITICAL_SPLINES_ENABLED, "CRITICAL_SPLINES_ENABLED", true, \
15 "If true, the critical splines will be used in the near-vicinity of the critical point") \
16 X(SAVE_RAW_TABLES, "SAVE_RAW_TABLES", false, "If true, the raw, uncompressed tables will also be written to file") \
17 X(ALTERNATIVE_TABLES_DIRECTORY, "ALTERNATIVE_TABLES_DIRECTORY", "", \
18 "If provided, this path will be the root directory for the tabular data. Otherwise, ${HOME}/.CoolProp/Tables is used") \
19 X(ALTERNATIVE_SVDTABLES_DIRECTORY, "ALTERNATIVE_SVDTABLES_DIRECTORY", "", \
20 "If provided, this path will be the root directory for the SVDSBTL on-disk cache (both .svd.bin.z surfaces and .critpatch.bin sidecars). " \
21 "Otherwise, ${HOME}/.CoolProp/SVDTables is used. Useful when ${HOME} is read-only (CI containers), on shared workstations, or for " \
22 "centrally-managed cache directories.") \
23 X(ALTERNATIVE_REFPROP_PATH, "ALTERNATIVE_REFPROP_PATH", "", \
24 "An alternative path to be provided to the directory that contains REFPROP's fluids and mixtures directories. If provided, the SETPATH " \
25 "function will be called with this directory prior to calling any REFPROP functions.") \
26 X(ALTERNATIVE_REFPROP_HMX_BNC_PATH, "ALTERNATIVE_REFPROP_HMX_BNC_PATH", "", \
27 "An alternative path to the HMX.BNC file. If provided, it will be passed into REFPROP's SETUP or SETMIX routines") \
28 X(ALTERNATIVE_REFPROP_LIBRARY_PATH, "ALTERNATIVE_REFPROP_LIBRARY_PATH", "", \
29 "An alternative path to the shared library file. If provided, it will be used to load REFPROP") \
30 X(REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS, "REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS", false, \
31 "If true, if the binary interaction parameters in REFPROP are estimated, throw an error rather than silently continuing") \
32 X(REFPROP_IGNORE_ERROR_ESTIMATED_INTERACTION_PARAMETERS, "REFPROP_IGNORE_ERROR_ESTIMATED_INTERACTION_PARAMETERS", false, \
33 "If true, if the binary interaction parameters in REFPROP are unable to be estimated, silently continue rather than failing") \
34 X(REFPROP_USE_GERG, "REFPROP_USE_GERG", false, \
35 "If true, rather than using the highly-accurate pure fluid equations of state, use the pure-fluid EOS from GERG-2008") \
36 X(REFPROP_ERROR_THRESHOLD, "REFPROP_ERROR_THRESHOLD", static_cast<int>(0), "The highest acceptable error code without throwing an exception") \
37 X(REFPROP_USE_PENGROBINSON, "REFPROP_USE_PENGROBINSON", false, \
38 "If true, rather than using the highly-accurate pure fluid equations of state, use the Peng-Robinson EOS") \
39 X(REFPROP_RESOLVE_COOLPROP_ALIASES, "REFPROP_RESOLVE_COOLPROP_ALIASES", true, \
40 "If true (default), fluid names passed to the REFPROP backend are resolved through the CoolProp alias table before building the .FLD path. " \
41 "Set to false to disable alias resolution and pass names directly to REFPROP, which may be needed for corner cases.") \
42 X(MAXIMUM_TABLE_DIRECTORY_SIZE_IN_GB, "MAXIMUM_TABLE_DIRECTORY_SIZE_IN_GB", 1.0, \
43 "The maximum allowed size of the directory that is used to store tabular data") \
44 X(DONT_CHECK_PROPERTY_LIMITS, "DONT_CHECK_PROPERTY_LIMITS", false, \
45 "If true, when possible, CoolProp will skip checking whether values are inside the property limits") \
46 X(HENRYS_LAW_TO_GENERATE_VLE_GUESSES, "HENRYS_LAW_TO_GENERATE_VLE_GUESSES", false, \
47 "If true, when doing water-based mixture dewpoint calculations, use Henry's Law to generate guesses for liquid-phase composition") \
48 X(PHASE_ENVELOPE_STARTING_PRESSURE_PA, "PHASE_ENVELOPE_STARTING_PRESSURE_PA", 100.0, "Starting pressure [Pa] for phase envelope construction") \
49 X(R_U_CODATA, "R_U_CODATA", 8.31446261815324, \
50 "The value for the ideal gas constant in J/mol/K according to CODATA 2022. This value is used to harmonize all the ideal gas constants. " \
51 "This is especially important in the critical region.") \
52 X(VTPR_UNIFAC_PATH, "VTPR_UNIFAC_PATH", "", "The path to the directory containing the UNIFAC JSON files. Should be slash terminated") \
53 X(SPINODAL_MINIMUM_DELTA, "SPINODAL_MINIMUM_DELTA", 0.5, \
54 "The minimal delta to be used in tracing out the spinodal; make sure that the EOS has a spinodal at this value of delta=rho/rho_r") \
55 X(OVERWRITE_FLUIDS, "OVERWRITE_FLUIDS", false, \
56 "If true, and a fluid is added to the fluids library that is already there, rather than not adding the fluid (and probably throwing an " \
57 "exception), overwrite it") \
58 X(OVERWRITE_DEPARTURE_FUNCTION, "OVERWRITE_DEPARTURE_FUNCTION", false, \
59 "If true, and a departure function to be added is already there, rather than not adding the departure function (and probably throwing an " \
60 "exception), overwrite it") \
61 X(OVERWRITE_BINARY_INTERACTION, "OVERWRITE_BINARY_INTERACTION", false, \
62 "If true, and a pair of binary interaction pairs to be added is already there, rather than not adding the binary interaction pair (and " \
63 "probably throwing an exception), overwrite it") \
64 X(USE_GUESSES_IN_PROPSSI, "USE_GUESSES_IN_PROPSSI", false, \
65 "If true, calls to the vectorized versions of PropsSI use the previous state as guess value while looping over the input vectors, only makes " \
66 "sense when working with a single fluid and with points that are not too far from each other.") \
67 X(ASSUME_CRITICAL_POINT_STABLE, "ASSUME_CRITICAL_POINT_STABLE", false, \
68 "If true, evaluation of the stability of critical point will be skipped and point will be assumed to be stable") \
69 X(VTPR_ALWAYS_RELOAD_LIBRARY, "VTPR_ALWAYS_RELOAD_LIBRARY", false, \
70 "If true, the library will always be reloaded, no matter what is currently loaded") \
71 X(FLOAT_PUNCTUATION, "FLOAT_PUNCTUATION", ".", "The first character of this string will be used as the separator between the number fraction.") \
72 X(ENABLE_SUPERANCILLARIES, "ENABLE_SUPERANCILLARIES", true, "If true, the superancillary functions will be used for VLE of pure fluids") \
73 X(ENABLE_MELTING_CALORIC_HS, "ENABLE_MELTING_CALORIC_HS", true, \
74 "If true, HS_flash may seed the cold-compressed-liquid corner from the melting-line caloric Chebyshev (cascade leg 4). " \
75 "Set false to force the legacy fallback for that region. Default: true") \
76 X(HSU_D_TWOPHASE_EOS_POLISH, "HSU_D_TWOPHASE_EOS_POLISH", true, \
77 "If true (default), the superancillary D+{H,S,U} two-phase flash refines its fast superancillary-based saturation temperature with a short " \
78 "full-EOS secant polish, giving an EOS-exact result. If false, the (slightly faster) superancillary solution is returned directly with a " \
79 "~1e-8 deviation; still far inside typical tolerances. No effect on single-phase states.") \
80 X(LIST_STRING_DELIMITER, "LIST_STRING_DELIMITER", ",", "The delimiter to be used when converting a list of strings to a string") \
81 X(ALLOW_SVDSBTL_IN_PROPSSI, "ALLOW_SVDSBTL_IN_PROPSSI", false, \
82 "If true, the SVDSBTL backend is usable through the high-level PropsSI interface. By default it is rejected (mirroring the BICUBIC/TTSE " \
83 "tabular backends) because PropsSI rebuilds the AbstractState on every call, and loading an SVDSurface from cache costs ~80 ms -- over four " \
84 "orders of magnitude slower per call than the actual SVD eval. For batched workloads use AbstractState directly and call update() in a " \
85 "loop, or use fast_evaluate for a vectorized batch.") \
86 X(SVDSBTL_SAMPLING_THREADS, "SVDSBTL_SAMPLING_THREADS", static_cast<int>(1), \
87 "Number of worker threads for SVDSBTL table-build sampling. 1 (default) = serial (no extra threads). N > 1 = use N worker threads, each " \
88 "with its own source AbstractState. 0 = auto (use std::thread::hardware_concurrency()). Typical 4-8x build-time speedup at N >= 4 on a " \
89 "multi-core machine. Default is 1 because: (a) REFPROP is process-global and not thread-safe under SETUPdll (the parallel path falls back " \
90 "to serial when the source is REFPROP regardless of this setting); (b) per-worker source instantiation roughly multiplies peak build-time " \
91 "memory footprint by N, which can matter on capped CI containers. Set > 1 when build cost on a fresh ~/.CoolProp/SVDTables/ cache or " \
92 "post-rev-bump rebuild becomes the bottleneck.") \
93 X(TABULAR_NX, "TABULAR_NX", static_cast<int>(200), \
94 "Number of x-axis grid points (T for PT table, h for PH table) for the BICUBIC and TTSE tabular backends. Increase for higher accuracy in " \
95 "regions with steep gradients (e.g. near the critical point). Memory and build cost scale as O(Nx*Ny). Tables auto-rebuild when changed.") \
96 X(MIXTURE_STABILITY_ALGORITHM, "MIXTURE_STABILITY_ALGORITHM", 1, "0: legacy, 1: Michelsen (default)") \
97 X(TABULAR_NY, "TABULAR_NY", static_cast<int>(200), \
98 "Number of y-axis grid points (log P) for the BICUBIC and TTSE tabular backends. Increase for higher accuracy. Memory and build cost scale " \
99 "as O(Nx*Ny). Tables auto-rebuild when changed.")
104#define X(Enum, String, Default, Desc) Enum,