Skip to content

Input Configurations

Enums

Enums provide named symbolic constants, making the code more understandable and less error-prone.


DWSIM Packages

Used to select the thermodynamic model from DWSIM, which governs how physical and chemical properties are calculated.

DWSIM Packages
class DWSIMPackage(Enum):
    ActivityCoefficient = 'ActivityCoefficient'
    BlackOil = 'BlackOil'
    CAPEOPEN = 'CAPEOPEN'
    ChaoSeader = 'ChaoSeader'
    CoolProp = 'CoolProp'
    CoolPropIncompressibleMixture = 'CoolPropIncompressibleMixture'
    CoolPropIncompressiblePure = 'CoolPropIncompressiblePure'
    DebyeHuckel = 'DebyeHuckel'
    ElectrolyteBase = 'ElectrolyteBase'
    ElectrolyteNRTL = 'ElectrolyteNRTL'
    ExUNIQUAC = 'ExUNIQUAC'
    GraysonStreed = 'GraysonStreed'
    Raoult = 'Raoult'
    LKP = 'LKP'
    LIQUAC2 = 'LIQUAC2'
    MODFAC = 'MODFAC'
    NISTMFAC = 'NISTMFAC'
    NRTL = 'NRTL'
    PengRobinson = 'PengRobinson'
    PengRobinson1978 = 'PengRobinson1978'
    PengRobinsonLK = 'PengRobinsonLK'
    PRSV2 = 'PRSV2'
    PRSV2VL = 'PRSV2VL'
    Seawater = 'Seawater'
    SRK = 'SRK'
    SourWater = 'SourWater'
    SteamTables = 'SteamTables'
    UNIFAC = 'UNIFAC'
    UNIFACLL = 'UNIFACLL'
    UNIQUAC = 'UNIQUAC'
    Wilson = 'Wilson'

Format Type

Used to standardize the input .xlsx file format to match the default output structure used during the processing phase.

Format Type
class FormatType(Enum):
    DEFAULT = 'Default'

Filter Operations

Operation Type

Defines types of operations that can be performed in the filtering phase.

Operations Filter
class OperationsFilter(Enum):
    CALORIFIC_VALUE = 0
    CO2_AND_H2S_FRACTION = 1
    DISPERSION = 2
    CO2_FRACTION = 3

Phase Type

Represents the phase of the material stream: overall, vapor, oily, or aqueous.

Phase Type
class PhaseType(Enum):
    OVERALL = 'Overall'
    VAPOR = 'Vapor'
    OIL = 'Liquid1'
    WATER = 'Liquid2'

Compound Basis

Defines the reference basis for compound data, with an associated default unit depending on the selected basis.

Compound Basis
class CompoundBasis(Enum):
    MOLE_FRAC = 'MolarComposition'
    MASS_FRAC = 'MassComposition'
    MOLE_FLOW = 'CompoundMolarFlow'
    MASS_FLOW = 'CompoundMassFlow'

    @property
    def default_unit(self):
        return {
            CompoundBasis.MASS_FLOW: 'kg/h',
            CompoundBasis.MOLE_FLOW: 'kmol/h',
            CompoundBasis.MOLE_FRAC: None,
            CompoundBasis.MASS_FRAC: None,
        }.get(self, None)

Molar Flow Unit

Specifies the unit of measurement for molar flow, used when a different unit is required instead of the default.

Molar Flow Unit
class MolarFlowUnit(Enum):
    KMOL_H = 'kmol/h'
    KMOL_S = 'kmol/s'
    MOL_S = 'mol/s'

Mass Flow Unit

Specifies the unit of measurement for mass flow, used when a different unit is required instead of the default.

Mass Flow Unit
class MassFlowUnit(Enum):
    KG_H = 'kg/h'
    G_H = 'g/h'
    KG_S = 'kg/s'

Global Variables

These global constants configure how the system reads input data, selects calculation options, handles logging, and writes results. They ensure consistent behavior across the application and should be set before processing begins.


File and Path Configuration

INPUT_FILE

Path to the input .xlsx file containing the composition data.

INPUT_FILE = os.path.abspath(os.path.join(current_dir, '../../files/test_files/composicao_teste.xlsx'))

OUTPUT_FOLDER

Directory to store the output files generated by the process.

OUTPUT_FOLDER = os.path.abspath(os.path.join(current_dir, '../../files/test_files'))

NAME

Descriptive name used to identify the final output file.

NAME = 'composition_teste'


Processing Options

PACKAGE

Thermodynamic model selected from DWSIMPackages, used for property calculations inside DWSIM.

PACKAGE = DWSIMPackages.PengRobinson1978

FORMAT_TYPE

Used to standardize the input file format with the expected default structure during processing.

FORMAT_TYPE = FormatType.DEFAULT

FRACTION_PHASE

Specifies which phase (overall, vapor, oil, or water) will be used for fraction output.

FRACTION_PHASE = PhaseType.OVERALL

BASIS

Defines the basis for compound data.

BASIS = CompoundBasis.MOLE_FLOW

BASIS_UNIT

Set the unit associated with the selected BASIS, such as 'kmol/h' for MOLE_FLOW.

BASIS_UNIT = BASIS.default_unit

OPERATION

Type of operation filter to apply (e.g., CO₂ filtering).

OPERATION = OperationsFilter.CO2_FRACTION

PHASE_TYPE

Defines the phase to consider during filtering.

PHASE_TYPE = PhaseType.OVERALL

ONLY_SIMULATED_VALUE

If True, only simulation-generated data is used. If False, pre-existing data in the input file will be included.

ONLY_SIMULATED_VALUE = False

DEBUG_MODE

When True, disables calculations like burn rate and evaporation, enabling debugging.

DEBUG_MODE = False


Logging Configuration

LOG_TYPE

Sets the log verbosity level, e.g., INFO, DEBUG, WARNING, etc.

LOG_TYPE = logging.INFO

WRITE_LOGGER

Controls whether logs should be written to a file.

WRITE_LOGGER = False

LOG_PATH

File path where the logger output is written if WRITE_LOGGER is True.

LOG_PATH = os.path.abspath(os.path.join(current_dir, '../../files/utils/composition_logs.log'))