Hi, I am getting some warnings from some classes I have made. The simulations I made with these classes seem to run fine anyway, but I would like to know why these seem to cause problems.
This is the code listing (text continues below); it is used to calculate
specific heat and enthalpy for oxygen. The reason for the weird class
hierarchy is that the Shomate equation is used in other classes (for
nitrogen, carbon dioxide, and other compound's properties).
--------------------------
partial function OxygenShomateParameters
input Real T(unit="K", min=298.0, max=6000.0);
protected
constant Real A = 29.65900;
constant Real B = 6.137261;
constant Real C = -1.186521;
constant Real D = 0.095780;
constant Real E = -0.219663;
constant Real F = -9.861391;
constant Real G = 237.9480;
constant Real H = 0.000000;
end OxygenShomateParameters;
partial function ShomateEnthalpy
output Real h(unit="J/mol");
protected
Real t;
algorithm
t := T / 1000.0;
h := ( A*t + (B*t^2)/2 + (C*t^3)/3 + (D*t^4)/4 - E/t + F - H )
* 1000;
end ShomateEnthalpy;
partial function ShomateSpecificHeat
output Real cp(unit="J/mol K");
protected
Real t;
algorithm
t := T / 1000.0;
cp := A + B*t + C*t^2 + D*t^3 + E/t^2;
end ShomateSpecificHeat;
function h_o2
extends ShomateEnthalpy;
extends OxygenShomateParameters;
end h_o2;
function cp_o2
extends ShomateSpecificHeat;
extends OxygenShomateParameters;
end cp_o2;
class Test
Real T, h, cp;
equation
T = time;
h = h_o2(T);
cp = cp_o2(T);
end Test;
------------------
When I do a instantiateModel(Test) I get the following warnings:
Base class ShomateEnthalpy not found in scope h_o2
Base class OxygenShomateParameters not found in scope h_o2
Base class ShomateSpecificHeat not found in scope cp_o2
Base class OxygenShomateParameters not found in scope cp_o2
Yet, simulation of class Test works just fine. I also get warnings when
evaluating cp_o2(2000) or h_o2(2000).
Does anyone have an idea of what OMShell is trying to tell me?
Cheers,
-Federico
pgpOCG4bTHhia.pgp
Description: PGP signature
