0

during some Dymola exercises, I like to pump some fluid out of a closed volume. The model looks quite simple:

model

Unfortunatelly, I always get the "Simulation failed for:" message.. The medium is always the same (Modelica.Media.Air.MoistAir).

error and warnings Here is the code:

model pump_out_example
    
  Modelica.Fluid.Machines.ControlledPump pump(
    use_m_flow_set=true,
    redeclare package Medium = Modelica.Media.Air.MoistAir,
    allowFlowReversal=false,
    control_m_flow=true,
    nParallel=1,
    use_T_start=true,
    m_flow_nominal=1.5,
    T_start=293.15,
    p_a_nominal=102200,
    p_b_nominal=102400)
    annotation (Placement(transformation(extent={{-14,-22},{-34,-2}})));
  Modelica.Fluid.Sources.FixedBoundary ambient_air(
    use_T=true,
    redeclare package Medium = Modelica.Media.Air.MoistAir,
    p=system.p_ambient,
    T=system.T_ambient,
    nPorts=1)
    annotation (Placement(transformation(extent={{-72,-22},{-52,-2}})));
  Modelica.Blocks.Sources.RealExpression kg_s(y=0.1)
    annotation (Placement(transformation(extent={{0,-2},{-12,20}})));
  inner Modelica.Fluid.System system(
    energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    m_flow_start=0,
    allowFlowReversal=false,
    T_ambient=283.15)
    annotation (Placement(transformation(extent={{-90,10},{-70,30}})));
  Modelica.Fluid.Vessels.ClosedVolume Fixvolume(
    V=50,
    nPorts=1,
    redeclare package Medium = Modelica.Media.Air.MoistAir,
    use_T_start=true,
    use_portsData=false,
    T_start=293.15)
    annotation (Placement(transformation(extent={{10,-2},{30,18}})));
equation 
  connect(pump.port_b, ambient_air.ports[1])
    annotation (Line(points={{-34,-12},{-52,-12}}, color={0,127,255}));
  connect(kg_s.y, pump.m_flow_set)
    annotation (Line(points={{-12.6,9},{-19,9},{-19,-3.8}}, color={0,0,127}));
  connect(pump.port_a, Fixvolume.ports[1])
    annotation (Line(points={{-14,-12},{20,-12},{20,-2}}, color={0,127,255}));
  annotation (
    uses(Modelica(version="3.2.2")),
    Diagram(coordinateSystem(extent={{-100,-40},{60,80}})),
    Icon(coordinateSystem(extent={{-100,-40},{60,80}})));
end pump_out_example;
desertnaut
  • 57,590
  • 26
  • 140
  • 166
Cyanblue
  • 21
  • 3
  • For me the model works in both, Dymola 2020x and 2021x. After 36.3s there is an error related to the mass fraction of the medium, but that seems reasonable to me. Could you give some more details on the type of error you get. Which version of Dymola are you using? – Markus A. May 05 '21 at 06:05
  • Hi Markus, thanks for the answer. I added a picture of the warnings and error. (It just sais error). I am using Dymola 2018 – Cyanblue May 05 '21 at 10:00
  • may you explain what you mean with mass fraction? thanks – Cyanblue May 05 '21 at 11:01
  • The comment for the mass-faction is: "Independent mixture mass fractions m_i/m close to the connection point if m_flow < 0". Basically this defines how much of which fluid is in the connector in case that there is a mixture of multiple. This needs to be a positive value and it get's negative for your model - which triggers the error. – Markus A. May 05 '21 at 11:39
  • I tested with Dymola 2017 FD01 and Dymola 2018 FD01. There is no such error like you are showing in the screenshot. Try with an empty working directory and with default Dymola settings (by renaming the setup.dymx file). – marco May 05 '21 at 11:40

0 Answers0