VolumeExt

model VolumeExt
    import HydraulicsByFluidon.Media;
    import HydraulicsByFluidon.Media.Base.FluidInterface;
    import SI = Modelica.SIunits;

    parameter SI.Volume capacity(displayUnit = "l") = 0.001 "Size of the volume";
    parameter SI.BulkModulus bulkModulus(displayUnit = "bar") = 2.1e+11 "Bulk modulus housing";
    SI.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.ExtendedCapacity fluidVolume(capacity = capacity, bulkModulus = bulkModulus);
equation
    connect(fluidVolume.fluidPort,fluidPort);
    fluidVolume.p = p;

    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 with consideration of surrounding housing. 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                The capacity <i>C</i> used to calculate the rate of pressure change takes into account the compression modulus of the fluid and \n                the Young's modulus of the housing.\n            </html>"));
end VolumeExt;