SharpEdgedOrifice

model SharpEdgedOrifice "Pressure drop due to sharp edged orifice (for both flow directions)"
    import NonSI = Modelica.SIunits.Conversions.NonSIunits;

    extends BaseClasses.QuadraticTurbulent.BaseModel(final data = BaseClasses.QuadraticTurbulent.LossFactorData.sharpEdgedOrifice(diameter, leastDiameter, length, alpha));

    parameter SI.Length length "Length of orifice";
    parameter SI.Diameter diameter "Inner diameter of pipe (= same at port_a and port_b)";
    parameter SI.Diameter leastDiameter "Smallest diameter of orifice";
    parameter NonSI.Angle_deg alpha "Angle of orifice";

    annotation (
        defaultComponentName = "orifice",
        Documentation(info = "<html>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = false,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    extent = {
                        {-100, 44}, 
                        {100, -44}},
                    fillPattern = FillPattern.HorizontalCylinder,
                    fillColor = {0, 127, 255}), 
                Polygon(
                    points = {
                        {-25, 44}, 
                        {-25, 7}, 
                        {35, 37}, 
                        {35, 44}, 
                        {-25, 44}},
                    fillPattern = FillPattern.Backward,
                    fillColor = {175, 175, 175}), 
                Polygon(
                    points = {
                        {-25, -7}, 
                        {-25, -44}, 
                        {35, -44}, 
                        {35, -36}, 
                        {-25, -7}},
                    fillColor = {175, 175, 175},
                    fillPattern = FillPattern.Backward)}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = false,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    extent = {
                        {-100, 60}, 
                        {100, -60}},
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Solid), 
                Polygon(
                    points = {
                        {-30, 60}, 
                        {-30, 12}, 
                        {30, 50}, 
                        {30, 60}, 
                        {-30, 60}},
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Backward), 
                Polygon(
                    points = {
                        {-30, -10}, 
                        {-30, -60}, 
                        {30, -60}, 
                        {30, -50}, 
                        {-30, -10}},
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Backward), 
                Line(
                    points = {
                        {-82, -60}, 
                        {-82, 60}},
                    color = {0, 0, 255},
                    arrow = {Arrow.Filled, Arrow.Filled}), 
                Text(
                    extent = {
                        {-78, 16}, 
                        {-44, -8}},
                    lineColor = {0, 0, 255},
                    textString = "diameter"), 
                Line(
                    points = {
                        {-30, -10}, 
                        {-30, 12}},
                    color = {0, 0, 255},
                    arrow = {Arrow.Filled, Arrow.Filled}), 
                Text(
                    extent = {
                        {-24, 14}, 
                        {8, -10}},
                    lineColor = {0, 0, 255},
                    textString = "leastDiameter"), 
                Text(
                    extent = {
                        {-20, 84}, 
                        {18, 70}},
                    lineColor = {0, 0, 255},
                    textString = "length"), 
                Line(
                    points = {
                        {30, 68}, 
                        {-30, 68}},
                    color = {0, 0, 255},
                    arrow = {Arrow.Filled, Arrow.Filled}), 
                Line(
                    points = {
                        {16, 40}, 
                        {32, 18}, 
                        {36, -2}, 
                        {34, -20}, 
                        {20, -42}},
                    color = {0, 0, 255},
                    arrow = {Arrow.Filled, Arrow.Filled}), 
                Text(
                    extent = {
                        {38, 8}, 
                        {92, -6}},
                    lineColor = {0, 0, 255},
                    textString = "alpha")}));
end SharpEdgedOrifice;