Volume

model Volume
    import HydraulicsByFluidon.Media;
    import HydraulicsByFluidon.Media.Base.FluidInterface;

    parameter Modelica.SIunits.Volume capacity = 0.001 "Size of the volume";
    Modelica.SIunits.AbsolutePressure p(start = environment.pAmbient, stateSelect = StateSelect.always, nominal = 100000);
    HydraulicsByFluidon.Interfaces.FluidPort fluidPort "Hydraulic port"
        annotation (Placement(transformation(extent = {
            {-10, -10}, 
            {10, 10}})));
protected
    outer HydraulicsByFluidon.Media.Environment environment;
    HydraulicsByFluidon.Components.Base.Capacity fluidVolume;
equation
    connect(fluidVolume.fluidPort,fluidPort);
    fluidVolume.p = p;
    fluidVolume.capacity = capacity;

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Ellipse(
                    extent = {
                        {-30, 30}, 
                        {30, -30}},
                    lineColor = {0, 93, 152},
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Sphere)}),
        Documentation(info = "<html>\n            <p>\n                Model of a simple hydraulic capacity. It can be used to represent the volume of adjacent components that lack\n                any spatial expansion, e. g. the <i>IdealResistor</i> component. The temporal change rate of pressure equals the net mass\n                flow into the capacity.\n            </p>\n            <p>\n                <center><img align=\"middle\" src=\"modelica://HydraulicsByFluidon/Resources/Images/Components/Volumes/pressureChangeRate.png\"></center>\n            </p>\n            <p>\n                The capacity <i>C</i> used to calculate the rate of pressure change takes into account the compression modulus of the fluid. \n                The housing is assumed to be ideally rigid (in comparison to fluid). If the housing is to be taken into account, \n                component <i>VolumeExt</i> must be used.\n            </p></html>"));
end Volume;