Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] #711

Closed
hsfmailubcca opened this issue Jan 30, 2025 · 12 comments
Closed

[Bug] #711

hsfmailubcca opened this issue Jan 30, 2025 · 12 comments
Labels
bug Something isn't working

Comments

@hsfmailubcca
Copy link

IMPORTANT: This section is meant for bug reporting only. For usage issues, please go to the Support Forums.

Describe the bug
DWSIM calculates the pressure drop of pure hydrogen with huge errors; errors as high as 100% or 50 bars.

To Reproduce

PLEASE ATTACH THE ZIPPED FLOWSHEET FILE and/or inform the steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
The pressure drop from analytical calculations is 25 bar and not 49 bar estimated by DWSIM.

PressureDropH2ResultsReport.pdf

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows, Linux, macOS]
  • Version [e.g. v6.4.1]

Additional context
Add any other context about the problem here.

@hsfmailubcca hsfmailubcca added the bug Something isn't working label Jan 30, 2025
@hsfmailubcca
Copy link
Author

I can provide some other examples that DWSIM estimates the pressure drop with 50% error. Such errors can cause pressure errors as high as 50 to 200 bar at high pressures (200 to 1000 bar).

@DanWBR
Copy link
Owner

DanWBR commented Jan 31, 2025

@hsfmailubcca I would need the simulation file, if possible

@hsfmailubcca
Copy link
Author

PressureDropH2.zip

Here you go.

@hsfmailubcca
Copy link
Author

@DanWBR Any updates?

@DanWBR
Copy link
Owner

DanWBR commented Feb 6, 2025

@hsfmailubcca DWSIM uses the Jossi-Stiel-Thodos method to correct vapor viscosity for high pressures. I'm not sure if it is suitable for pressures up to 600 bar. Probably not.

@hsfmailubcca
Copy link
Author

hsfmailubcca commented Feb 6, 2025

@DanWBR It is just pure hydrogen. There is no vapor in it. DWSIM should be able to do such a straightforward pressure drop calculation for a pure hydrogen gas. Why don't you use equation#9 in the paper below for gases?

https://elmoukrie.com/2022/02/16/friction-factor/

@DanWBR
Copy link
Owner

DanWBR commented Feb 6, 2025

@hsfmailubcca vapor = vapor phase, not water vapor

@Spogis
Copy link

Spogis commented Feb 6, 2025

Dear @hsfmailubcca,

I believe there is a slight misunderstanding on your part here. To calculate a pressure drop (as in your case), it is necessary to compute a dimensionless number called the Reynolds number.

This number depends on two fluid properties: density and viscosity. An improper calculation of these two properties will lead to an incorrect Reynolds number, and consequently, an inaccurate pressure drop calculation.

What @DanWBR is pointing out is that DWSIM uses the Jossi-Stiel-Thodos equation to calculate viscosity at high pressures. If you read the work by Jossi, Stiel, and Thodos (1962), you will notice that their equations were developed for the range of 70-100 bar, which is about six times lower than the 600 bar you are trying to calculate.

Thus, the work of Jossi, Stiel, and Thodos assumes weak intermolecular forces: the method is based on nonpolar or weakly polar substances. At 600 bar, strong intermolecular interactions (e.g., hydrogen bonding, molecular association, or high-density effects) may make the correction inaccurate.

Therefore, my friend, before assuming there is a bug in DWSIM, understand that ALL thermodynamic models have operational limits for accurate results. Do not use models outside their intended range of applicability.

If you analyze at lower pressures, you will see that DWSIM is not miscalculating. Use DWSIM and any other code only in cases where you fully understand that you are operating within the limits proposed by the researchers' studies.

Deviation at very high densities: At 600 bar, the gas may be in a dense supercritical state, where the JST correction might underestimate or overestimate viscosity due to increased molecular interactions.

@hsfmailubcca
Copy link
Author

Hello @Spogis @DanWBR

Thank you for your response. All you said is correct and I agree with you. All good; I will do more comparisons and report here.

1- As a user, I expect that a software can autodetect operating range and subsequently, auto select the appropriate models in the background.

2- Suggestion:
For pure gases, NIST provide numerical properties. MATLAB can do two variable curve fitting where we can get viscosity of pure gases in terms of temperature and pressures for a wide range. Then the viscosity can be interpolated for any temperature and pressure, no matter how high or low they are.

3- Suggestion:
Perhaps, DWSIM does it but could be useful to add one option where the user can add its numerical viscosity.

@Spogis
Copy link

Spogis commented Feb 6, 2025

Hello @Spogis @DanWBR

Thank you for your response. All you said is correct and I agree with you. All good; I will do more comparisons and report here.

1- As a user, I expect that a software can autodetect operating range and subsequently, auto select the appropriate models in the background.

2- Suggestion: For pure gases, NIST provide numerical properties. MATLAB can do two variable curve fitting where we can get viscosity of pure gases in terms of temperature and pressures for a wide range. Then the viscosity can be interpolated for any temperature and pressure, no matter how high or low they are.

3- Suggestion: Perhaps, DWSIM does it but could be useful to add one option where the user can add its numerical viscosity.

  1. Even commercial software like Aspen or HYSYS do not automatically detect operating ranges and select appropriate models in the background.
  2. Create your interpolation function and go to step 3 ...
  3. You can use your own formula to calculate the viscosity! Simply create your interpolation and apply the property override function.

Image

@DanWBR
Copy link
Owner

DanWBR commented Feb 6, 2025

@hsfmailubcca you can override the vapor phase viscosity just like it is done for liquid in the "Liquid VIscosity Override Script" sample flowsheet:

Image

@hsfmailubcca
Copy link
Author

Hello @Spogis @DanWBR
All good; thank you.

@DanWBR DanWBR closed this as completed Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants