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

Missing argument to Internal.solve #890

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 1 comment
Closed

Missing argument to Internal.solve #890

modelica-trac-importer opened this issue Jan 14, 2017 · 1 comment
Assignees
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by sjoelund.se on 29 Oct 2012 10:23 UTC
In Modelica.Media.Air.MoistAir.PsychrometricData.Medium.saturationTemperature.Internal.solve there is an undefined input:

diff -u -x .svn -r libraries/Modelica 3.2.1/Media/Air.mo build/lib/omlibrary/Modelica 3.2.1/Media/Air.mo
--- libraries/Modelica 3.2.1/Media/Air.mo	2012-10-12 14:33:01.720035052 +0200
+++ build/lib/omlibrary/Modelica 3.2.1/Media/Air.mo	2012-10-29 11:04:35.259722248 +0100
@@ -474,7 +474,7 @@
      end solve;
     end Internal;
     algorithm
-      T:=Internal.solve(p, T_min, T_max);
+      T:=Internal.solve(p, T_min, T_max, f_nonlinear_data = Internal.f_nonlinear_Data());
       annotation (Documentation(info="<html>
  Computes saturation temperature from (partial) pressure via numerical inversion of the function <a href=\"modelica://Modelica.Media.Air.MoistAir.saturationPressure\">saturationPressure</a>. Therefore additional inputs are required (or the defaults are used) for upper and lower temperature bounds.
 </html>"));

An alternative patch would be to use:

redeclare function extends f_nonlinear(f_nonlinear_data = f_nonlinear_Data())

This does not work in OpenModelica, and I did not test it in any other tool. It is an internal use in only 1 place anyway, so the initial patch should cover it.

The root cause seems to be that Dymola allows an empty record as default input to a function because it considers empty records as constants...

function f
  input R r;
  output Real o;
algorithm
  o := 1.0;
end f;

Dymola flat:

function M.f
  constant input M.R r := M.R() = M.R();
  output Real o;
algorithm 
  o := 1.0;
end M.f;

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

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.1 milestone Jan 14, 2017
@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Media Issue addresses Modelica.Media labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 3 Dec 2012 22:16 UTC
Fixed in 219a8fd

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
Projects
None yet
Development

No branches or pull requests

2 participants