Martin Adam
Jan 23 2008, 04:24 PM
Hello,
I try to use the Modelica library FluidHeatFlow. But my models do not work. Also the example of the libraty do not work. The error message is always the same:
>> simulate(Modelica.Thermal.FluidHeatFlow.Examples.SimpleCooling)
record
resultFile = "Simulation failed.
Class FluidHeatFlow.Media.Medium (its type) not found in scope Modelica.Thermal.FluidHeatFlow.Examples.SimpleCooling.
No matching function found for FluidHeatFlow.Media.Medium
Class FluidHeatFlow.Media.Medium not found in scope Modelica.Thermal.FluidHeatFlow.Examples.SimpleCooling.
Error occured while flattening model Modelica.Thermal.FluidHeatFlow.Examples.SimpleCooling
"
end record
I am using OMShell v1.1 (for OpenModelica 1.4.3) and the Modelica standard library 2.2.2.
Thank you for helping.
Carsten
Jan 24 2008, 03:13 PM
Hi Martin,
in Dymola the model runs fine. Maybe you should try to replace the Medium-class by a certain Medium (e.g. Modelica.Thermal.FluidHeatFlow.Media.Air_30degC)
Medium it self looks more as a base class. The other media, such as Air_30degC inherit from the base class Medium. In the MSL 2.2.2 I use, the Medium class is still a common record. But IMHO this should only be there as a partial record. And then the parameters should have no default values. Maybe your version is newer than my.
So try to replace the medium class. If it does not, work, tell me!
regards
Carsten
Martin Adam
Jan 26 2008, 12:11 PM
Hello Carsten!
To replace the class "FluidHeatFlow.Media.Medium" by "Air_30degC" I already tried. I also tried to build a model without a record of FluidHeatFlow.Media.*. Without have any success.
The problem is that nearly every components extends a class that includes the command:
parameter FluidHeatFlow.Media.Medium medium=FluidHeatFlow.Media.Medium();
and in my opinion the command cause my described error.
For example the component "FluidHeatFlow.IsolatedPipe" extends "FluidHeatFlow.TwoPort". In "FluidHeatFlow.TwoPort" the parameter "FluidHeatFlow.Media.Medium medium....
Martin
Carsten
Jan 28 2008, 10:28 AM
Dear Martin,
as all the models of FluidHeatFlow in my MSL run unter Dymola, please attach a whole model which you tried. Then I can check, if it is an OpenModelica problem.
regards
Carsten
Martin Adam
Jan 29 2008, 07:09 PM
Hi Carsten
I made a simple model with the FluidHeatFlow. The model is:
Ambient1 - Pumpe - Isolated Pipe - Ambient2
model Fluid
parameter Modelica.Thermal.FluidHeatFlow.Media.Medium medium=Modelica.Thermal.FluidHeatFlow.Media.Water();
parameter Modelica.SIunits.CelsiusTemperature TAmb=20 "Ambient temperature";
Modelica.Thermal.FluidHeatFlow.Sources.Ambient Ambient1(T_Ambient=Modelica.SIunits.Conversions.from_degC(TAmb), medium=medium);
Modelica.Thermal.FluidHeatFlow.Sources.PrescribedVolumeFlow Pump1(medium=medium, m=0, T0=Modelica.SIunits.Conversions.from_degC(TAmb));
Modelica.Thermal.FluidHeatFlow.Components.IsolatedPipe Pipe1(medium=medium,m=0.1,T0=Modelica.SIunits.Conversions.from_degC(TAmb));
Modelica.Thermal.FluidHeatFlow.Sources.Ambient Ambient2(T_Ambient=Modelica.SIunits.Conversions.from_degC(TAmb), medium=medium);
Modelica.Blocks.Sources.Constant VolumeFlow(k=1);
equation
connect(Ambient1.flowPort, Pump1.flowPort_a);
connect(Pump1.flowPort_b, Pipe1.flowPort_a);
connect(Pipe1.flowPort_b, Ambient2.flowPort);
connect(VolumeFlow.y, Pump1.VolumeFlow);
end Fluid;
Thanks Martin
wagner
Jan 29 2008, 09:07 PM
Hello Martin,
I succesfully simulated your model in Dymola 6.1 using Modelica Standard Library 2.2.1, but it doesn't run in my OpenModelica Version 1.4.1.
I built a very simple package to test the instantiation of a record instance extended from another one (see attachment).
The Example.Working model is working in OpenModelica. The instantiated record is of the same record type as the parameter reference.
The Example.NotWorking model uses the same mechanism as in your posted model. The instantiated record is of another type than the reference. OpenModelica seems to have a problem with this. In Dymola 6.1 it's working.
Regards,
Florian
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.