Class LumpingConfigBuilder

java.lang.Object
neqsim.thermo.characterization.LumpingConfigBuilder

public class LumpingConfigBuilder extends Object
Builder class for configuring lumping models with a fluent API.

This builder provides a clear and intuitive way to configure lumping settings, avoiding the confusion between setNumberOfLumpedComponents and setNumberOfPseudoComponents.

Example usage:

// For PVTlumpingModel: keep C6-C9 separate, lump C10+ into 5 groups
fluid.getCharacterization().configureLumping().model("PVTlumpingModel").plusFractionGroups(5)
    .build();

// For standard model: create exactly 6 total pseudo-components from C6+
fluid.getCharacterization().configureLumping().model("standard").totalPseudoComponents(6)
    .build();

// No lumping: keep all individual SCN components
fluid.getCharacterization().configureLumping().noLumping().build();
Version:
1.0
Author:
ESOL
  • Field Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
      Logger object for class.
    • characterise

      private final Characterise characterise
    • modelName

      private String modelName
    • plusFractionGroups

      private int plusFractionGroups
    • totalPseudoComponents

      private int totalPseudoComponents
    • customBoundaries

      private int[] customBoundaries
      Custom carbon number boundaries.
  • Constructor Details

    • LumpingConfigBuilder

      public LumpingConfigBuilder(Characterise characterise)
      Constructor for LumpingConfigBuilder.
      Parameters:
      characterise - the Characterise instance to configure
  • Method Details

    • model

      public LumpingConfigBuilder model(String modelName)
      Set the lumping model to use.

      Available models:

      • "PVTlumpingModel" - Default. Keeps TBP fractions (C6-C9) separate, only lumps C10+
      • "standard" - Lumps all fractions from C6 into equal-weight groups
      • "no lumping" - Keeps all individual SCN components (C6-C80)
      Parameters:
      modelName - the name of the lumping model
      Returns:
      this builder for method chaining
    • noLumping

      public LumpingConfigBuilder noLumping()
      Configure for no lumping - keeps all individual SCN components.

      This is equivalent to calling model("no lumping").

      Returns:
      this builder for method chaining
    • plusFractionGroups

      public LumpingConfigBuilder plusFractionGroups(int n)
      Set the number of groups to create from the plus fraction only (C10+).

      Use with: "PVTlumpingModel"

      This method directly controls how many lumped groups are created from the plus fraction (C10 through C80). The TBP fractions (C6-C9) are kept as separate pseudo-components.

      Total pseudo-components = number of TBP fractions + plusFractionGroups

      Parameters:
      n - number of groups to create from C10+ fraction
      Returns:
      this builder for method chaining
    • totalPseudoComponents

      public LumpingConfigBuilder totalPseudoComponents(int n)
      Set the total number of pseudo-components to create.

      Use with: "standard" model

      This method controls the total number of pseudo-components created by lumping all heavy fractions (C6 through C80) into equal-weight groups.

      Warning: When used with "PVTlumpingModel", the actual number of lumped groups is calculated as: totalPseudoComponents - numberOfTBPfractions. If this results in fewer groups than the default minimum, the setting may be overridden.

      Parameters:
      n - total number of pseudo-components
      Returns:
      this builder for method chaining
    • customBoundaries

      public LumpingConfigBuilder customBoundaries(int... boundaries)
      Set custom carbon number boundaries for lumping groups.

      This allows matching specific PVT lab report groupings. For example:

      // Creates groups: C6, C7-C9, C10-C14, C15-C19, C20+
      .customBoundaries(6, 7, 10, 15, 20)
      

      Each value represents the starting carbon number for a group. The final group extends to the heaviest component (C80 typically).

      Parameters:
      boundaries - starting carbon numbers for each group
      Returns:
      this builder for method chaining
    • build

      public Characterise build()
      Build and apply the lumping configuration.

      This method validates the configuration and applies it to the characterization model.

      Returns:
      the configured Characterise instance for further operations
      Throws:
      IllegalArgumentException - if configuration is invalid