model ConstantFlowPump
    import SI = Modelica.SIunits;

    extends HydraulicsByFluidon.Components.Pumps.Base.PartialPumpWithLeakage;

    parameter SI.Duration startupTime(min = 0) = 0 "Startup time"
        annotation (Dialog(group = "Dynamic"));
    actVolumeFlow = smooth(1, if time < startupTime then nominalVolumeFlow * (0.5 * (Modelica.Math.sin(0.5 * (Modelica.Constants.pi * (2 * time / startupTime - 1))) + 1)) else nominalVolumeFlow);

    annotation (
            preserveAspectRatio = true,
            extent = {
                {-100, -100}, 
                {100, 100}})),
        Documentation(info = "<html>                           \n            <p>\n                The component ConstantFlowPump constitutes a model of a flow source in which the\n                delivery is calculated from the given nominal flow, the leakage, and the suction pressure.\n            </p>\n            <p>\n                <center><img src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Pumps/ConstantFlowPumpIcon.png\"></center>\n            </p>\n            <p>\n                Both internal and external leakage depend on the adjacent pressure difference. The parameter\n                <var>Nominal volume flow</var> refers to the flow at Port A (suction side).\n            </p>\n            <p>\n                <center><img align=\"middle\" src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Pumps/ConstantFlowPump.png\"></center>\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                The parameter <var>Startup time</var> > 0 describes the time, within whi    ch the flow reaches\n                <var>Nominal volume flow</var> starting at 0. The figure shows the startup function for \n                <var>Startup time</var> = 1.\n            </p>\n            <p>\n                <center><img align=\"middle\" src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Pumps/Startup.png\"></center>\n            </p>\n            <p>\n                If <var>Startup Time</var> = 0, flow starts at <var>Nominal volume flow</var>.\n            </p>\n            <p>\n                The component 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 ConstantFlowPump;