SimplePump

model SimplePump "Simple Pump"
    import HydraulicsByFluidon.Media.Base.FluidInterface;

    extends HydraulicsByFluidon.Components.Pumps.Interfaces.PartialPumpOneDir;

    parameter Modelica.SIunits.VolumeFlowRate nominalVolumeFlow(min = 0) = 5e-4 "Nominal volume flow";
    Modelica.SIunits.VolumeFlowRate volumeFlow;
protected
    parameter Boolean intFlowDemand = true;
equation
    if intFlowDemand then 
        assert(0 <= nominalVolumeFlow, "Invalid parameter value: nominalVolumeFlow must be >= 0");
        volumeFlow = nominalVolumeFlow;
    end if;
    0 = fluidPortA.mFlow + fluidPortB.mFlow;
    volumeFlowA = volumeFlow;

    annotation (
        Icon(coordinateSystem(
            preserveAspectRatio = true,
            extent = {
                {-100, -100}, 
                {100, 100}})),
        Documentation(info = "<html>                           \n                                     <p>\n                                        The component SimplePump is an ideal flow source. While the mass\n                                        flow is constant, the resulting volume flows at both ports depend on the\n                                        corresponding pressures and fluid temperatures. The parameter nominalVolumeFlow\n                                        refers to the flow at Port A (suction side).\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 SimplePump;