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

BaseClasses.Carnot has wrong definition and use of evaluate_etaPL #1200

Closed
mwetter opened this issue Sep 12, 2019 · 0 comments · Fixed by #1201
Closed

BaseClasses.Carnot has wrong definition and use of evaluate_etaPL #1200

mwetter opened this issue Sep 12, 2019 · 0 comments · Fixed by #1201
Assignees

Comments

@mwetter
Copy link
Contributor

mwetter commented Sep 12, 2019

The value of evaluate_etaPL is incorrect, but it is also used incorrectly, leading to the correct results. The following change should be made

   Real etaPL(final unit = "1")=
     if evaluate_etaPL
-      then 1
-    else IBPSA.Utilities.Math.Functions.polynomial(a=a, x=yPL)
+      then IBPSA.Utilities.Math.Functions.polynomial(a=a, x=yPL)
+    else 1
     "Efficiency due to part load (etaPL(yPL=1)=1)";
 
   Real COP(min=0, final unit="1") = etaCarnot_nominal_internal * COPCar * etaPL
@@ -157,8 +157,8 @@ protected
 
   // For Carnot_y, computing etaPL = f(yPL) introduces a nonlinear equation.
   // The parameter below avoids this if a = {1}.
-  final parameter Boolean evaluate_etaPL=
-    (size(a, 1) == 1 and abs(a[1] - 1)  < Modelica.Constants.eps)
+  final parameter Boolean evaluate_etaPL=not (
+    (size(a, 1) == 1 and abs(a[1] - 1)  < Modelica.Constants.eps))
     "Flag, true if etaPL should be computed as it depends on yPL"
     annotation(Evaluate=true);
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.

1 participant