Interface ThermodynamicModelSettings

All Superinterfaces:
Serializable

public interface ThermodynamicModelSettings extends Serializable

ThermodynamicModelSettings interface.

Version:
$Id: $Id
Author:
Even Solbraa
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Mutable per-thread flag holder.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
    When true, Component.init(type=0) preserves existing K-values instead of resetting them to the Wilson initial guess.
    static final int
    Constant MAX_NUMBER_OF_COMPONENTS=200.
    static final double
    Constant phaseFractionMinimumLimit=1e-12.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static boolean
    Returns true if warm-start K-value preservation is enabled for the current thread.
    static void
    setUseWarmStartKValues(boolean enabled)
    Enable or disable warm-start K-value preservation for the current thread.
  • Field Details

    • phaseFractionMinimumLimit

      static final double phaseFractionMinimumLimit
      Constant phaseFractionMinimumLimit=1e-12.
      See Also:
    • MAX_NUMBER_OF_COMPONENTS

      static final int MAX_NUMBER_OF_COMPONENTS
      Constant MAX_NUMBER_OF_COMPONENTS=200.
      See Also:
    • DEFAULT_USE_WARM_START_K

      static final boolean DEFAULT_USE_WARM_START_K
      When true, 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 is false to preserve exact numerical reproducibility for regression baselines. Set via setUseWarmStartKValues(boolean) or the system property neqsim.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 the neqsim.warmStartK system 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 in Component.init(0) (exact baseline-compatible behavior).