VariableFlowPump

model VariableFlowPump
    import SI = Modelica.SIunits;

    extends HydraulicsByFluidon.Components.Pumps.Base.PartialPumpWithLeakage;

    Modelica.Blocks.Interfaces.RealInput setpoint annotation (Placement(
        visible = true,
        transformation(
            origin = {-100, 0},
            extent = {
                {-20, -20}, 
                {20, 20}},
            rotation = 0),
        iconTransformation(
            origin = {-80, 0},
            extent = {
                {-20, -20}, 
                {20, 20}},
            rotation = 0)));
    Modelica.Blocks.Nonlinear.Limiter limiter(limitsAtInit = true, strict = true, uMin = 0, uMax = 1);
protected
    Real flowFactor;
equation
    actVolumeFlow = nominalVolumeFlow * flowFactor;
    flowFactor = limiter.y;
    limiter.u = setpoint;

    annotation (
        Icon(
            coordinateSystem(initialScale = 0.1),
            graphics = {
                Line(points = {
                    {-80, -80}, 
                    {80, 80}}), 
                Polygon(
                    origin = {-33, 80},
                    rotation = -45,
                    fillPattern = FillPattern.Solid,
                    points = {
                        {80, 80}, 
                        {85, 60}, 
                        {75, 60}, 
                        {80, 80}})}),
        Documentation(info = "<html>                           \n            <p>\n                The component VariableFlowPump constitutes a model of a flow source in which the\n                delivery is calculated from the given nominal flow, the input signal, the leakage, and the suction pressure.\n            </p>\n            <p>\n                <center><img src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Pumps/VariableFlowPumpIcon.png\"></center>\n            </p>\n            <p>\n                Both internal and external leakage depend on the adjacent pressure difference.\n            </p>\n            <p>\n                <center><img align=\"middle\" src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Pumps/VariableFlowPump.png\"></center>\n            </p>\n            <p>\n                The parameter nominalVolumeFlow refers to the flow at Port A (suction side). \n            </p>\n            <p>\n                The valid range of the input signal at port <i>setpoint</i> is 0 < signal < 1.\n                Therefore 1 corresponds to 100 % of the nominal volume flow.\n            </p>\n            <p>\n                <i>minSuctionPressure</i> takes into account that a pump requires a minimaum suction pressure for full flow. Below this pressure, \n                the flow rate is reduced. In this model, the reduction is assumed to be simplified as a linear function of suction pressure in \n                relation to <i>minSuctionPressure</i>.\n            </p>\n            <p>\n                <center><img align=\"middle\" src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Pumps/PumpSuctionPressure.png\"></center>\n            </p>\n            <p>\n                VariableFlowPump does not provide a model of the physical design of a pump but\n                only copies its characteristic features. Thus, physical parameters (e. g. inertia\n                moment or hydraulic-mechanical efficiency) are not parameterized.\n            </p>\n            </html>"));
end VariableFlowPump;