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

Problem with valve incompressible

Problem with valve incompressible

Hello

I am beginner on openmodelica and I want to model a simple system in transient:

pressure source --> valve (with kv coefficient) --> pipe --> closedvolume.

This model is composed only hydrogen gas with very high pressure (between 100 and 700bar)
I build my model step by step.

When I run my model, I have problem inside my valve and I don't understand why.

following it's my little model

model valve_cas

  replaceable package Medium =
      Modelica.Media.Incompressible.Examples.Glycol47
    constrainedby Modelica.Media.Interfaces.PartialMedium;
   
  inner Modelica.Fluid.System system(T_ambient(displayUnit = "K") = -15, energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial) 
  annotation(
    Placement(visible = true, transformation(origin = {-160, 76}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    Modelica.Fluid.Sources.FixedBoundary boundary(
    redeclare package Medium = Medium, T = Modelica.SIunits.Conversions.from_degC(-15), p = 2000000, use_p = true) 
    annotation(
    Placement(visible = true, transformation(origin = {-64, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Vessels.ClosedVolume reservoir(
    redeclare package Medium = Medium,V = 0.35, massDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial, nPorts = 1, p_start = system.p_ambient, use_HeatTransfer = false, use_portsData = false) 
    annotation(
    Placement(visible = true, transformation(origin = {130, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Valves.ValveIncompressible valveIncompressible(
    redeclare package Medium = Medium,CvData = Modelica.Fluid.Types.CvTypes.Kv, Kv = 0.11, allowFlowReversal = false, checkValve = false, dp(displayUnit = "Pa", start = 10), dp_nominal(displayUnit = "Pa") = 1e6, m_flow_nominal = 0.04579, opening_nominal = 1, show_T = false) 
    annotation(
    Placement(visible = true, transformation(origin = {28, -14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.DynamicPipe pipe(
    redeclare package Medium = Medium,
  allowFlowReversal = false,diameter = 0.005, length = 1)  annotation(
    Placement(visible = true, transformation(origin = {86, -16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(boundary.ports[1], valveIncompressible.port_a) annotation(
    Line(points = {{-54, -26}, {-15, -26}, {-15, -14}, {18, -14}}, color = {0, 127, 255}));
  connect(valveIncompressible.port_b, pipe.port_a) annotation(
    Line(points = {{38, -14}, {52, -14}, {52, -16}, {76, -16}}, color = {0, 127, 255}));
  connect(pipe.port_b, reservoir.ports[1]) annotation(
    Line(points = {{96, -16}, {130, -16}, {130, 10}}, color = {0, 127, 255}));
  annotation(
    Diagram(coordinateSystem(extent = {{-200, -100}, {200, 100}})),
    Icon(coordinateSystem(extent = {{-200, -100}, {200, 100}})),
    version = "",
    uses(Modelica(version = "3.2.3")));
end valve_cas;

Re: Problem with valve incompressible

I find my problem. An error of beginner. I forget the time of my valve.

Re: Problem with valve incompressible

Hi,
I saw other problems. There is not the ports size for the boundary, You must include nPorts=1 inside the parenthesis. The valve needs a value for the apperture, that is missing. The value for T_ambient of the system is -15K, an impossible value. This last problem I see is due to a bug of OMEdit: it allows you to select the units in deg C., but when you enter a minus sign it changes inmediately to Kelvin.
You selected also an incompressible Medium, if it is incompressible the only solution for the system is no flow and pressure in the reservoir equal to that of the boundary. I think you can use Modelica.Media.IdealGases.SingleGases.H2, it is not a good model for high pressure, but is the only one available directly in Modelica. I attach a modified code.

ModelicaTest28.mo


Carlos

Attachments:

Re: Problem with valve incompressible

Hi

Thank you very much for your help

There are 0 guests and 0 other users also viewing this topic
You are here: