Interface ThermodynamicModelSettings
- All Superinterfaces:
Serializable
ThermodynamicModelSettings interface.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classMutable per-thread flag holder. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanWhentrue,Component.init(type=0)preserves existing K-values instead of resetting them to the Wilson initial guess.static final intConstantMAX_NUMBER_OF_COMPONENTS=200.static final doubleConstantphaseFractionMinimumLimit=1e-12. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic booleanReturns true if warm-start K-value preservation is enabled for the current thread.static voidsetUseWarmStartKValues(boolean enabled) Enable or disable warm-start K-value preservation for the current thread.
-
Field Details
-
phaseFractionMinimumLimit
static final double phaseFractionMinimumLimitConstantphaseFractionMinimumLimit=1e-12.- See Also:
-
MAX_NUMBER_OF_COMPONENTS
static final int MAX_NUMBER_OF_COMPONENTSConstantMAX_NUMBER_OF_COMPONENTS=200.- See Also:
-
DEFAULT_USE_WARM_START_K
static final boolean DEFAULT_USE_WARM_START_KWhentrue,Component.init(type=0)preserves existing K-values instead of resetting them to the Wilson initial guess. Enables a warm-start that can speed up iterative flashes (PSflash, PHflash, dew/bubble point) and recycle loops by 2-3x, but may converge to numerically slightly different (though physically equivalent) solutions than the cold Wilson path. Default isfalseto preserve exact numerical reproducibility for regression baselines. Set viasetUseWarmStartKValues(boolean)or the system propertyneqsim.warmStartK=true.The flag is stored per-thread (
ThreadLocal) so that concurrent flash calls do not interfere with each other's try/finally restoration. The process-wide initial value is read from theneqsim.warmStartKsystem property.
-
-
Method Details
-
isUseWarmStartKValues
static boolean isUseWarmStartKValues()Returns true if warm-start K-value preservation is enabled for the current thread.- Returns:
- warm-start flag
-
setUseWarmStartKValues
static void setUseWarmStartKValues(boolean enabled) Enable or disable warm-start K-value preservation for the current thread.- Parameters:
enabled- true to preserve K-values across flash calls (faster, but may yield numerically slightly different converged solutions), false to always reset to the Wilson guess inComponent.init(0)(exact baseline-compatible behavior).
-