I'm currently trying to get to grips with the OpenModelica software. I'm trying to make a simple model, composed of a fixed volume, a pipe and a piston. However, when I run the simulation, I get an error and I can't get out of it. I'd also like to know how I can impose a certain amount of mass in my fixed volume. That's why I'm asking for your help. I would be grateful if you could help me. Thanks in advance, Have a nice day!
What I've tried:
Modelica.Fluid.Machines.SweptVolume sweptVolume(redeclare package Medium = Modelica.Media.Air.SimpleAir, clearance = 0.0001, nPorts = 1, pistonCrossArea = 0.001) annotation(
Placement(visible = true, transformation(origin = {18, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Fluid.Vessels.ClosedVolume volume(redeclare package Medium = Modelica.Media.Air.SimpleAir, V = 6e-4, nPorts = 1, use_portsData = false) annotation(
Placement(visible = true, transformation(origin = {-66, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
inner Modelica.Fluid.System system annotation(
Placement(visible = true, transformation(origin = {-82, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Modelica.Media.Air.SimpleAir, diameter = 0.8, length = 1, nParallel = 1) annotation(
Placement(visible = true, transformation(origin = {-28, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Translational.Components.Mass mass(m = 0.1) annotation(
Placement(visible = true, transformation(origin = {54, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(volume.ports[1], pipe.port_a) annotation(
Line(points = {{-66, 10}, {-66, 0}, {-38, 0}}, color = {0, 127, 255}));
connect(pipe.port_b, sweptVolume.ports[1]) annotation(
Line(points = {{-18, 0}, {8, 0}}, color = {0, 127, 255}));
connect(sweptVolume.flange, mass.flange_a) annotation(
Line(points = {{28, 0}, {44, 0}}, color = {0, 127, 0}));
annotation(
end ClosedSwept; ```
# The error:
# The arguments u_min and u_max provided in the function call solveOneNonlinearEquation(f,u_min,u_max) do not bracket the root of the single non-linear equation 0=f(u): u_min = 200 u_max = 6000 fa = f(u_min) = 212529 fb = f(u_max) = 7.66508e+06 fa and fb must have opposite sign which is not the case
# Process crashed Simulation process failed. Exited with code 0xffffffffc0000005.
I can't reproduce the error. Which version are you using? I'm assuming latest stable on windows.
In any case, this error is a "permission denied" type of error. This might be caused by the configuration of your antivirus, or even your firewall. You might want to whitelist the folder
C:\Program Files\OpenModelica<....>as well as the folder where the models run:
C:\Users\<....>\AppData\Temp\OpenModelicawith the
<....>parts adapted to your machine. Additionally you might want to check in your firewall if local programs are allowed to open unprivileged ports on localhost, and if not, allow it.