Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » peste
  • » Profile

Posts

Posts

As I don't know how to delete the entries here the solution that I found:


In the standard library the conductivity of the component Modelica.Thermal.HeatTransfer.Components.ThermalConductor is defined as parameter. if i duplicate this copmonent in my own model and remove the parameter definition, I can refer to my own conductivity component and everything works fine. However, downturn is, that i cannot map my addons in a simple way into the standard library :-(

Hello,

I'd like to use the standard library Modelica.Thermal and extend the model with material properties for conductivity (basically conductivity as a function of temperature, which is i.e. relevant for thermal insulation problems). When I use the standard elements, e.g. Modelica.Thermal.HeatTransfer.Components.ThermalConductor, the thermal conductance is defined as parameter, hence a constant value.

Now I try to link it to a function as following:

model test2

  Modelica.SIunits.Temperature Tave;

  Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalConductor1(G = Thermo.Materials.S355f.G_funct(Tave))  annotation(
    Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature1(T = 573.15)  annotation(
    Placement(visible = true, transformation(origin = {-64, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature2(T = 473.15)  annotation(
 
    Placement(visible = true, transformation(origin = {40, 44}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

equation
  connect(thermalConductor1.port_b, fixedTemperature2.port) annotation(
    Line(points = {{10, 0}, {72, 0}, {72, 44}, {50, 44}, {50, 44}, {50, 44}}, color = {191, 0, 0}));
  connect(fixedTemperature1.port, thermalConductor1.port_a) annotation(
    Line(points = {{-54, 0}, {-10, 0}, {-10, 0}, {-10, 0}}, color = {191, 0, 0}));

  Tave = (thermalConductor1.port_b.T + thermalConductor1.port_a.T)/2;

  annotation(
    uses(Modelica(version = "3.2.2")));
end test2;


where the fucntion is defined as:

function G_funct
  input Real T "Temperature [K]";
  output Real G "thermal conductivity [W/(mK)]";
algorithm
  G := 1;
end G_funct;



With this I get following error message:


Component thermalConductor1.G of variability PARAM has binding Thermo.Materials.S355f.G_funct(Tave) of higher variability VAR.


So the question for me is, if and how it is possible to link the fixed parameter of an existing element with a function (or a table), which can show a dependancy on a variable like Temperature?

just solved:

  Modelica.Fluid.Fittings.Bends.CurvedBend curvedBend1(redeclare package Medium = Medium, geometry = Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry(d_hyd=0.1, R_0=1) )  annotation(Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Hello,

currently I'm trying to setup a flow network, using the Fluid library. In general with the given examples most of it I can solve, but somehow I struggle with the required input / syntax for the CurvedBend. The documentation nicley describes the physics of the modelling, which is fine, however, the geometric information somehow has to be set for the bend.

when I enter:

  Modelica.Fluid.Fittings.Bends.CurvedBend curvedBend1(redeclare package Medium = Medium, geometry = {Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry(d_hyd=0.1, R_0=1.5, delta=1.533)})  annotation(Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));


I receive following error message:

Type mismatch in binding geometry = {Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry(0.1, 1.5, 1.533, 2.5e-005)}, expected subtype of record Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry
  Real(min = 0.0, quantity = "Length", unit = "m") d_hyd;
  Real(min = 0.0, quantity = "Length", unit = "m") R_0;
  Real(quantity = "Angle", unit = "rad", displayUnit = "deg") delta;
  (type .Modelica.Icons.TypeReal bc:Real(quantity = "Length", unit = "m", displayUnit = "mm")) K;
end Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry;, got type record Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry
  Real(min = 0.0, quantity = "Length", unit = "m") d_hyd;
  Real(min = 0.0, quantity = "Length", unit = "m") R_0;
  Real(quantity = "Angle", unit = "rad", displayUnit = "deg") delta;
  (type .Modelica.Icons.TypeReal bc:Real(quantity = "Length", unit = "m", displayUnit = "mm")) K;
end Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry;[1].


somehow the "expected subtype" and the "got type" are the same, but I don't understand, why this gives then an error.

Thanks in advance for any valuable input!

Feb-11-10 16:29:54
Question how to successfully use external libraries within SimForge

Hello,

I'm quite new to this environment. However it looks very convenient. Nevertheless, somehow I struggle in using external libraries within SimForge.  When loading a library under Tools – Project properties, it can happen that these libraries show-up in “Modelica classes” (e.g. Modelica_Fluid 1.0) or in “Used external packages” (e.g. ThermoPower). Somehow this is confusing, and additionally these libraries seem not to be connected correctly, meaning e.g. the icons do not show up when I try to create a simulation model, and I receive error messages when trying to run a case. Now I assume, that the problem is somehow linked to setting the correct paths or something similar. I believe there must be a simple way to do this. Another question is, whether it is sufficient to load only the “package.mo” of the library, or all .mo files separately.

Therefore the question: Is there any description available (Tutorial or similar) that explains, how to connect/embed an external library successfully in SimForge? Otherwise, is anyone able to explain in a few sentences, how this feature works?

  • Index
  • » Users
  • » peste
  • » Profile
You are here: