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

guard against low pressures #1148

Closed
Mathadon opened this issue May 29, 2019 · 5 comments · Fixed by #1154
Closed

guard against low pressures #1148

Mathadon opened this issue May 29, 2019 · 5 comments · Fixed by #1154
Assignees

Comments

@Mathadon
Copy link
Member

Mathadon commented May 29, 2019

I just had an issue where someone set an air pressure of 10 Pa, which caused negative absolute humidities to be computed, leading to funny computations elsewhere. The simulation however did not crash, stop or error. Should we somehow check/guard against these kind of errors to avoid wrong results to be generated? We could integrate an assert in some partials, perhaps in a mixing volume and/or medium implementation. However, this will generate overhead.. Any thoughts on this?

@Mathadon Mathadon self-assigned this May 29, 2019
@mwetter
Copy link
Contributor

mwetter commented May 31, 2019

How was such a low pressure achieved? Through a signal input, or through a parameter? I would think catching this at the source would be more efficient than in the volume, e.g., in the solution to an ODE.

@Mathadon
Copy link
Member Author

Mathadon commented Jun 2, 2019

Good point, through a parameter in this case. The PartialSimpleMedium does not define p_min or p_max. I guess we cannot add it since this would prohibit the use of media other than those from IBPSA? The better option then seems to add p_min and p_max for both water and air in the Boundary e.g. check based on the chemical formula of the Medium?

@mwetter
Copy link
Contributor

mwetter commented Jun 4, 2019

What do you mean by the chemical formula? Is there anything in PartialMedium (other than a string comparison which would be expensive).

@Mathadon
Copy link
Member Author

Mathadon commented Jun 4, 2019

Modelica.Media.Water.ConstantPropertyLiquidWater contains

constant Modelica.Media.Interfaces.Types.Basic.FluidConstants[1]
    simpleWaterConstants(
    each chemicalFormula="H2O",
    each structureFormula="H2O",
    each casRegistryNumber="7732-18-5",
    each iupacName="oxidane",
    each molarMass=0.018015268);

However I did not realize that we cannot use this since it does not exist in PartialMedium. Can we use mediumName instead? I don't see why a string comparison would be problematic since the comparison should be performed only once?

@mwetter
Copy link
Contributor

mwetter commented Jun 4, 2019

If the string is compared only once, then this would be fine. But I thought we call checkBoundary also from an equation section in some models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants