Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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] Dynamic modelling for water heat exchanger does not work #429

Closed
WYuanJun opened this issue Feb 13, 2023 · 8 comments
Closed

[Bug] Dynamic modelling for water heat exchanger does not work #429

WYuanJun opened this issue Feb 13, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@WYuanJun
Copy link

WYuanJun commented Feb 13, 2023

IMPORTANT: This section is for code-related bugs. For usage issues, please go to the Support Forums.

Describe the bug
When trying to solve a water to water heat exchanger in dynamic mode the pressure and temperature goes out of range. The model solves in steady state mode.
It then has an error: the given key was not present in dictionary.

Note: The thermodynamic property package used is Raoult's Law. (The same problem happens in IAPWS steam table package)

To Reproduce
Steps to reproduce the behavior:

  1. Created a water to water heat exchangers hot inlet at 53°C and the cold inlet at 26°C with PID control on the cold stream outlet valve and specification block for the hot stream mass flow rate.
  2. Click solve in steady state mode. It solves.
  3. Click on dynamic mode to activate dynamic mode, then run schedule.
  4. See the information panel for error.

Expected behavior
I would expect the heat exchanger to find a valve opening percentage with the correct pressure and flow in dynamic mode.

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

Desktop (please complete the following information):

  • OS: Windows 10
  • Version v8.3.5

Additional context
Add any other context about the problem here.
The heat exchanger calculation type is calculate outlet temperatures (UA) mode.
This is in normal DWSIM not the Cross Platform

Many thanks

@WYuanJun WYuanJun added the bug Something isn't working label Feb 13, 2023
@WYuanJun WYuanJun reopened this Feb 13, 2023
@DanWBR
Copy link
Owner

DanWBR commented Feb 18, 2023

@WYuanJun can you share the flowsheet?

@WYuanJun
Copy link
Author

@WYuanJun can you share the flowsheet?

Hi Dan,

The testHX6 file is the original with the problem but the "given key not present" error has somehow gone away but the model still does not show the correct temperature, pressure and mass flow as I would expect.

The testHX7 file is also another model with the exact same process model I tried to recreate but with different heat exchanger parameter, UA and area but I am still not getting the correct output for temperature, pressure and flow rates.

Your support and advice would be great appreciated! Thank you!
testHX6.zip

testHX7.zip

@DanWBR
Copy link
Owner

DanWBR commented Feb 20, 2023

@WYuanJun something is missing here:
image

as for HX7, it doesn't look right indeed. I'll take a look

@WYuanJun
Copy link
Author

@WYuanJun something is missing here: image

as for HX7, it doesn't look right indeed. I'll take a look

Oh yes for the screenshot I had the other outlet streams from the heat exchanger before and it had the same problem as HX7 so I deleted those streams (it was named 8 & 9) so that is why it is missing from the monitored variables. Sorry I forgot I did that. Maybe that is what is causing the problem.

But yes HX7 still has some issues I believe

DanWBR added a commit that referenced this issue Feb 20, 2023
@DanWBR
Copy link
Owner

DanWBR commented Feb 20, 2023

@WYuanJun what exactly are you trying to control? you selected mass flow but inserted a value like 1 bar, this doesn't make sense.

@DanWBR
Copy link
Owner

DanWBR commented Feb 20, 2023

@WYuanJun it doesn't make sense to control pressure if you have only liquid in the process.

@WYuanJun
Copy link
Author

Hi Dan

You are right I should be using flow in the dynamics tab to control the flow.

I guess I wasn't thinking it through at the time, but I was just trying to copy the heat exchanger example but with just water instead.

For HX7 I was trying to control the outlet (stream 10) temperature to be at 50C by changing the opening of valve 3 to do so to change the flow rate to control the outlet temperature.

Sorry I am not very experienced with dynamic modelling and are trying to learn.
I have attached the HX7_v3 and in there I have changed the dynamics from pressure to flow. But again, the pressure and temperature are still out of range.

Many thanks!
testHX7_v3.zip

Cheers

@WYuanJun
Copy link
Author

Or to control stream 12 temperature by changing the valve 3 opening.
testHX7_v4.zip

Repository owner locked and limited conversation to collaborators Mar 4, 2023
@DanWBR DanWBR converted this issue into discussion #442 Mar 4, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants