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

R134a Medium #1394

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 12 comments
Closed

R134a Medium #1394

modelica-trac-importer opened this issue Jan 14, 2017 · 12 comments
Assignees
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media P: high High priority issue
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by nicolas.albarello on 15 Jan 2014 15:36 UTC
The R134 medium works in the provided examples (using volume and short pipe) but fails when using it in other fluid components (e.g. DynamicPipe). The reason for that is the use of pTX functions with a two-phase fluid.
Could you provide a fixing procedure for this ?
Thanks,


Migrated-From: https://trac.modelica.org/Modelica/ticket/1394

@modelica-trac-importer
Copy link
Author

Modified by dietmarw on 20 Jun 2014 10:57 UTC

@modelica-trac-importer modelica-trac-importer added the L: Fluid.Dissipation Issue addresses Modelica.Fluid.Dissipation label Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Modified by wischhusen on 20 Jun 2014 11:12 UTC

@modelica-trac-importer modelica-trac-importer added L: Media Issue addresses Modelica.Media and removed L: Fluid.Dissipation Issue addresses Modelica.Fluid.Dissipation labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by hubertus on 20 Jun 2014 16:12 UTC
R134a has been implemented by XRG, owner is changed back to Stefan.

@modelica-trac-importer
Copy link
Author

Comment by wischhusen on 23 Jun 2014 16:15 UTC
This issue is known. The problem is, that _pTX-functions are not a good choice for twophase media. In the two-phase region the enthalpy cannot be determined from pressure and temperature. Nevertheless, two-phase is an important operation region for refrigerants.

The reason, why _pTX functions are used in Modelica.Fluid is certainly the simpler parameterization of the initialization and boundary conditions.

Anyhow, the functions of R134a are just intended for p,h states to allow a proper solution in any domain. Models that use R134a should avoid _pTX functions. If the Modelica.Fluid pipe does not, it cannot be used with R134a or has to be changed to allow an initialization with _phX.

@modelica-trac-importer modelica-trac-importer added the wontfix Issue that will not be fixed label Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by hubertus on 23 Jun 2014 19:03 UTC
The same argument is of course also true for the IF97 steam tables, and still the functions are also available with pTX as inputs. There are many situations in which it is known that the fluid is in one phase only, or I know that I have a phase separating device, and then these functions are appropriate. It is much worde to have inconsistent usage and user interface in different properties that follow the same interface. The _pTX funtions are available in the interface, and they have to be provided by any compatible implementation. This would be different if our two-phase interfaces would not contain the _pTX functions. If part of the functions are not implemented, the interface is useless and confusing.

@modelica-trac-importer modelica-trac-importer removed the wontfix Issue that will not be fixed label Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by wischhusen on 24 Jun 2014 07:29 UTC
"The _pTX funtions are available in the interface, and they have to be provided by any compatible implementation."

Yes, that's why we implemented _pTX functions with an error message to explain the failure potential. The media model is just declared to be valid with p,h as states.

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 7 Dec 2015 13:56 UTC
Can you fix this? This is a pretty old issue

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.2 milestone Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by wischhusen on 8 Dec 2015 15:19 UTC
I think the issue comes from Modelica.Fluid components which call _pTX functions allthough they shouldn't. Careless use of _pTX functions close to the phase boundaries will lead to large failures for the enthalpy. This is why the supply of the functions was refused.

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 8 Dec 2015 15:35 UTC
Well, but in my mind this is really a very wrong way to fix the problem: if someone uses a function in an API (which I'd say the medium interfaces are) in the wrong way, it is not a good ideas to simply not implement the function, which still exists for a good reason. So I'd suggest to file tickets for the bad usages in Modelica.Fluid, with high priority and urgency, and go ahead and complete the functions in R134a. If there is a partial function in the interface, it is a promise for the implementation to be there, and a strict checking Modelica tool should reject the complete R134a package as faulty, and rightly so. If this is not fixed until the next major release that allows non-backwards compatible changes, the package should be removed. I want to strictly only have compliant and correct code in the MSL. As you can see, I updated the Severity, because this simply is non-compliant code and should have been rejected through better testing earlier.

@modelica-trac-importer modelica-trac-importer added the P: high High priority issue label Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by wischhusen on 14 Dec 2015 09:11 UTC
In order to overcome problems with ambiguous inputs close to the phase boundary the functions will be implemented with a safety margin of 2 Kelvin around the two-phase region (and 0.1 bar with regard to the critical point). Within this margin the pTX functions will throw an error which is required to keep the user aware of potential errors caused through measurement errors, other implementations of R134a properties and so on.

@modelica-trac-importer
Copy link
Author

Comment by wischhusen on 21 Dec 2015 14:23 UTC
Was fixed with a4fbb25.

@modelica-trac-importer
Copy link
Author

Changelog modified by wischhusen on 21 Dec 2015 14:23 UTC
Added new functions to calculate setState_pTX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media P: high High priority issue
Projects
None yet
Development

No branches or pull requests

4 participants