You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that these implicit functions are problematic, see also #3399
The function:
function T_hX "Return temperature from specific enthalpy and mass fraction"
extends Modelica.Icons.Function;
input SpecificEnthalpy h "Specific enthalpy";
input MassFraction[nX] X "Mass fractions of composition";
input Boolean exclEnthForm=excludeEnthalpyOfFormation
"If true, enthalpy of formation Hf is not included in specific enthalpy h";
input Modelica.Media.Interfaces.Choices.ReferenceEnthalpy
refChoice=referenceChoice
"Choice of reference enthalpy";
input SI.SpecificEnthalpy h_off=h_offset
"User defined offset for reference enthalpy, if referenceChoice = UserDefined";
output Temperature T "Temperature";
protected
MassFraction[nX] Xfull = if size(X,1) == nX then X else cat(1,X,{1-sum(X)});
function f_nonlinear "Solve h_TX(T,X) for T with given h"
extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction;
input SpecificEnthalpy h "Specific enthalpy";
input MassFraction[:] Xfull "Mass fractions of composition";
algorithm
y := h_TX(T=u, X=Xfull) - h;
end f_nonlinear;
algorithm
T := Modelica.Math.Nonlinear.solveOneNonlinearEquation(
function f_nonlinear(h=h, Xfull=Xfull), 200, 6000);
annotation(inverse(h = h_TX(T,X,exclEnthForm,refChoice,h_off)));
end T_hX;
Has the following issues:
The inverse-annotation uses the extra arguments, exclEnthForm, refChoice, h_off, but the actual solution ignores them. I believe it is simplest to just remove them completely.
Creating Xfull is unnecessary since the input X is declared with the size nX. The inverse also uses X directly.
The text was updated successfully, but these errors were encountered:
It seems that these implicit functions are problematic, see also #3399
The function:
Has the following issues:
exclEnthForm
,refChoice
,h_off
, but the actual solution ignores them. I believe it is simplest to just remove them completely.Xfull
is unnecessary since the inputX
is declared with the sizenX
. The inverse also usesX
directly.The text was updated successfully, but these errors were encountered: