To calculate dew pressure of hydrocarbon mixture by PC-SAFT

Click For Summary

Discussion Overview

The discussion revolves around the use of the PC-SAFT (Perturbed-Chain Statistical Associating Fluid Theory) method for calculating the dew point and bubble point pressures of hydrocarbon mixtures, with a focus on the challenges faced in achieving convergence for dew pressure calculations. Participants explore the theoretical and practical aspects of the method, including the differences in fugacity calculations between bubble and dew pressures.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports success in calculating bubble pressure that aligns well with experimental data but encounters convergence issues when calculating dew pressure at various temperatures.
  • The participant suggests that the accuracy of bubble pressure calculations indicates that the internal parameters of PC-SAFT are likely correct, raising the question of why dew pressure calculations fail.
  • Another participant requests the equations used in the calculations instead of the code provided.
  • A later reply reiterates the complexity of the PC-SAFT method and offers to share screenshots of the calculation algorithm to clarify the issue faced.
  • One participant requests a report related to the discussion, indicating a desire for further information or documentation.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the reasons for the convergence issues in dew pressure calculations, and multiple viewpoints regarding the approach and information shared remain evident.

Contextual Notes

The discussion highlights the complexity of the PC-SAFT method and the potential challenges in fugacity calculations, but does not resolve the specific issues faced in the calculations.

yan3220
Messages
2
Reaction score
0
Hello, everyone:
I'm trying to use the PC-SAFT (Perturbed-Chain Statistical Associating Fluid Theory) method to calculate the bubble point and dew point pressures of hydrocarbon mixtures, and subsequently plot the PT phase envelope. My calculations for bubble pressure match the experimental data very well. However, when calculating dew pressure at different temperatures, the program fails to converge. I understand that the difference between calculating bubble pressure and dew pressure lies in how the component compositions are determined through fugacity calculations. Therefore, if the bubble pressure calculations are very accurate, it indicates that the internal parameters of PC-SAFT are correct. So why can't the dew pressure be calculated at all?
I have attached the code for calculating dew pressure below.
I'm really hoping someone can offer me some help and advice. Thank you so much!



Code:
def cal_VLE_dew_point(temperature, initial_system_pressure, component_mixture,pc_saft_para_dict,component_name,univeral_model_constant=univeral_model_constant):

    composition_liquid = component_mixture.copy()
    composition_vapor = component_mixture.copy()
    def wrapped_cal_pressure(initial_packing_fraction, temperature, component_mixture, pc_saft_para_dict, target_pressure):
        calculated_pressure = cal_pressure(initial_packing_fraction,temperature,univeral_model_constant,component_name, component_mixture, pc_saft_para_dict,boltzmann_constant = 1.3806*10**-23)
        return np.array(calculated_pressure, dtype=np.float64) - target_pressure
    iteration = 0
    error = 100
    vapor_packing_fraction = 10**-10
    liquid_packing_fraction = 0.5
    while (error > 0.00001) and iteration < 300:
        result = least_squares(wrapped_cal_pressure, liquid_packing_fraction, args=(temperature, composition_liquid, pc_saft_para_dict, initial_system_pressure), xtol=1e-12,ftol=1e-12,gtol=1e-12,max_nfev=50000) 
        liquid_packing_fraction = result.x 
        result = least_squares(wrapped_cal_pressure, vapor_packing_fraction, args=(temperature, composition_vapor, pc_saft_para_dict, initial_system_pressure), xtol=1e-12,ftol=1e-12,gtol=1e-12,max_nfev=50000) 
        vapor_packing_fraction = result.x



        fugacity_coefficient_liquid = cal_fugacity(liquid_packing_fraction, temperature, univeral_model_constant,component_name, composition_liquid, pc_saft_para_dict)
        fugacity_coefficient_vapor = cal_fugacity(vapor_packing_fraction, temperature, univeral_model_constant,component_name, composition_vapor, pc_saft_para_dict)

        update_liquid_compostion = {}
        total_composition_liquid = 0
        for i in component_name:
            update_liquid_compostion = fugacity_coefficient_vapor*composition_vapor/fugacity_coefficient_liquid
            total_composition_liquid += update_liquid_compostion
        for k,v in update_liquid_compostion.items():
            update_liquid_compostion[k] = update_liquid_compostion[k]/total_composition_liquid
        composition_liquid = update_liquid_compostion.copy()
        initial_system_pressure = total_composition_liquid * initial_system_pressure
        error = np.abs(total_composition_liquid - 1.0)
        iteration += 1
    dew_point_pressure = cal_pressure(liquid_packing_fraction,temperature, univeral_model_constant,component_name, composition_liquid, pc_saft_para_dict,boltzmann_constant = 1.3806*10**-23)

    return composition_liquid, composition_vapor, dew_point_pressure
 
Last edited by a moderator:
Science news on Phys.org
Rather than attaching the code, please provide the equations you used.
 
  • Like
Likes   Reactions: yan3220
Thank you very much for your response. The PC-SAFT method has many formulas. Here, I have attached screenshots of my calculation algorithm in hopes that it will more clearly illustrate the problem I am encountering. Thank you.

1720785645594.png
 
can I get this report here please