PRVstatic

model PRVstatic
    parameter Modelica.SIunits.Pressure OpeningPressure = 2e+7 "Opening pressure (relative value)";
    parameter Modelica.SIunits.VolumeFlowRate NominalVolumeFlow = 5e-4 "Nominal volume flow";
    parameter Modelica.SIunits.Pressure NominalPressureDifference = 500000 "Nominal pressure difference";
    parameter Modelica.SIunits.Density ReferenceDensity = 860 "Reference density for volume flow and pressure difference";
    parameter Modelica.SIunits.Volume deadVolume(final min = 1e-9) = 1e-6 "Dead volume at ports";
    parameter Boolean Balanced = true "Balanced valve"
        annotation (choices(checkBox = true));
    parameter Boolean exact = false "Find exact opening point"
        annotation (choices(checkBox = true));

    extends HydraulicsByFluidon.Components.Valves.Base.PartialPRV;

    HydraulicsByFluidon.Components.Valves.Base.SimplePRVstatic simplePRVstatic(deltap = deltap, forwardFluidProperties = false, OpeningPressure = OpeningPressure, NominalVolumeFlow = NominalVolumeFlow, NominalPressureDifference = NominalPressureDifference, ReferenceDensity = ReferenceDensity, Balanced = Balanced, exact = exact) annotation (Placement(
        visible = true,
        transformation(
            origin = {0, 0},
            extent = {
                {-12, -10}, 
                {12, 10}},
            rotation = 0)));
    HydraulicsByFluidon.Components.Volumes.Volume volumeB(capacity = deadVolume) annotation (Placement(
        visible = true,
        transformation(
            origin = {0, 70},
            extent = {
                {-10, -10}, 
                {10, 10}},
            rotation = 0)));
    HydraulicsByFluidon.Components.Volumes.Volume volumeA(capacity = deadVolume) annotation (Placement(
        visible = true,
        transformation(
            origin = {0, -70},
            extent = {
                {-10, -10}, 
                {10, 10}},
            rotation = 0)));
equation
    connect(fluidPortA,volumeA.fluidPort) annotation (Line(
        points = {
            {0, -100}, 
            {0, -70}},
        color = {0, 93, 152}));
    connect(volumeA.fluidPort,simplePRVstatic.fluidPortA) annotation (Line(
        points = {
            {0, -70}, 
            {0, -10}},
        color = {0, 93, 152}));
    connect(volumeB.fluidPort,fluidPortB) annotation (Line(
        points = {
            {0, 70}, 
            {0, 100}},
        color = {0, 93, 152}));
    connect(simplePRVstatic.fluidPortB,volumeB.fluidPort) annotation (Line(
        points = {
            {0, 10}, 
            {0, 70}},
        color = {0, 93, 152}));

    annotation (
        Icon(graphics = {
            Line(
                origin = {40, 0},
                points = {
                    {0, 0}, 
                    {4, 20}, 
                    {12, -20}, 
                    {20, 20}, 
                    {28, -20}, 
                    {36, 20}, 
                    {44, -20}, 
                    {48, 0}})}),
        Documentation(info = "<html>\n            <p>\n                The component PRVstatic is a model of a direct controlled pressure relief valve without\n                dynamic characteristics. For all pressures exceeding <var>Opening pressure</var> the valve opens and \n                the flow increases linearly following the slope given by parameters <var>Nominal volume flow</var> and \n                <var>Nominal pressure difference</var>.\n            </p>\n            <p>\n                If the valve is balanced (<var>Balanced valve</var> = true) the valve opens when the supply pressure exceeds \n                the opening pressure:\n            </p>\n            <p>\n                Opening condition: fluidPortA.p &#62; <var>Opening pressure</var> + pAmbient\n            </p>\n            <p>\n                If the valve is not balanced (<var>Balanced valve</var> = false) the tank pressure is considered: \n            </p>\n            <p>\n                Opening condition: fluidPortA.p &#62; <var>Opening pressure</var> + fluidPortB.p\n            </p>\n            <p>\n                If <var>Find exact opening point</var> is set to true, the valve opens exactly at the time when the opening pressure is exceeded. \n                If it is set to false, the valve may open earlier or later depending on simulation's step size.\n                This setting avoids an event (and probably a slow down of simulation) by using noEvent().\n            </p>\n            <p>\n                The component part PRVstatic is not a model of a pressure relief valve according to its \n                physical structure. It merely represents the characteristic behavior of a pressure relief \n                valve. Therefore dynamic effects such as forces due to inertia will not be represented.\n            </p>\n            </html>"));
end PRVstatic;