Search code examples
modelicaopenmodelica

Behaviour of Closed Volume and Sweptvolume - Modelica


I modeled a simpflied case which consists of a SweptVolume, ClosedVolume and dynamic pipe When the volume inside the piston becomes smaller with the movement of the piston, it pushes the water into the ClosedVolume when piston moves downwards, then water will be sucked into the piston chamber. I simulated this case and I see pressure increase inside the ClosedVolume decreases with time. What would be the reason of it?

enter image description here

enter image description here

model HD_Closedvolumebisclosedvolume
    //Declaration(s)
    Real V_max = 0.000003;
    Real V_tod = 0.000002;
    Real N = 2800;
    replaceable package medium = Modelica.Media.Water.StandardWater( );
    parameter Real A_Kolben = 0.0001131;
    replaceable package medium_500bar = Modelica.Media.Water.StandardWater( );
    //Component(s)
    Modelica.Fluid.Machines.SweptVolume Swept1 (
        pistonCrossArea = A_Kolben,
        clearance = 0.00000250621,
        redeclare package Medium = Modelica.Media.Water.StandardWater,
        nPorts = 1,
        use_portsData = false,
        p_start = 1e5,
        use_T_start = true,
        T_start = 293.15,
        V(start = 0.005),
        m(start = 0.005));
    inner Modelica.Fluid.System system (p_ambient = 101325);
    Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true, useSupport = false);
    Modelica.Blocks.Sources.Sine Sine1 (
        amplitude = 0.005567,
        freqHz = 46.66,
        offset = 0.005567,
        phase = -Modelica.Constants.pi/4);
    Modelica.Fluid.Vessels.ClosedVolume ClosedVolume (
        V = 0.000005,
        nPorts = 1,
        redeclare package Medium = medium,
        use_portsData = false);
    Modelica.Fluid.Pipes.DynamicPipe pipe (
        length = 0.005,
        diameter = 0.002,
        redeclare package Medium = medium,
        roughness = 2.5E-4);
    Modelica.Mechanics.Translational.Sensors.PositionSensor position;


equation
    //Connection(s)
    connect(Posit1.flange, Swept1.flange);
    connect(Sine1.y, Posit1.s_ref);
    connect(pipe.port_a, Swept1.ports[1]);
    connect(pipe.port_b, ClosedVolume.ports[1]);
    connect(Posit1.flange, position.flange);
end  HD_Closedvolumebisclosedvolume;`

Solution

  • Check if the total water mass is constant, due to numerical issues it might be that the mass of water decreases. Try to reduce the tolerance in order to reduce the loss of water.