Changeset 1940

Show
Ignore:
Timestamp:
12/03/2008 08:52:48 AM (5 weeks ago)
Author:
rfranke
Message:

Junctions

  • new BaseClasses.PartialTJunction
  • rename JunctionVolume TJunctionVolume
  • rename JunctionIdeal to IdealTJunction

Volumes

  • rename ClosedVolume to Volume
  • new BaseClasses.PartialDistributedVolume

Pipes

  • remove BaseClasses.PartialDynamicFlow
  • rename PartialTwoPortFlow to PartialPipe

TestOverdeterminedSteadyStateInit

  • add simple example using DistributedPipeLumpedPressure
Location:
Modelica_Fluid/branches/StreamConnector/Modelica_Fluid
Files:
18 modified

Legend:

Unmodified
Added
Removed
  • Modelica_Fluid/branches/StreamConnector/Modelica_Fluid/Examples/AST_BatchPlant.mo

    r1927 r1940  
    149149      annotation (Placement(transformation(extent={{-114,210},{-134,230}}, 
    150150            rotation=0))); 
    151     Junctions.JunctionIdeal volume2( 
     151    Modelica_Fluid.Junctions.IdealTJunction volume2( 
    152152      redeclare package Medium = BatchMedium)  
    153153               annotation (Placement(transformation( 
     
    161161      annotation (Placement(transformation(extent={{112,210},{132,230}}, 
    162162            rotation=0))); 
    163     Junctions.JunctionIdeal volume8( 
     163    Modelica_Fluid.Junctions.IdealTJunction volume8( 
    164164      redeclare package Medium = BatchMedium)  
    165165               annotation (Placement(transformation( 
     
    191191          extent={{-10,10},{10,-10}}, 
    192192          rotation=90))); 
    193     Modelica_Fluid.Volumes.ClosedVolume volume1( 
     193    Modelica_Fluid.Volumes.Volume volume1( 
    194194      redeclare package Medium = BatchMedium, 
    195195      initType=Modelica_Fluid.Types.Init.InitialValues, 
     
    226226          extent={{10,-10},{-10,10}}, 
    227227          rotation=270))); 
    228     Modelica_Fluid.Volumes.ClosedVolume volume7( 
     228    Modelica_Fluid.Volumes.Volume volume7( 
    229229      redeclare package Medium = BatchMedium, 
    230230      initType=Modelica_Fluid.Types.Init.InitialValues, 
     
    279279          extent={{10,10},{-10,-10}}, 
    280280          rotation=180))); 
    281     Modelica_Fluid.Examples.AST_BatchPlant.BaseClasses.JunctionVolume volume5( 
     281    BaseClasses.JunctionVolume volume5( 
    282282      redeclare package Medium = BatchMedium, 
    283283      initType=Modelica_Fluid.Types.Init.InitialValues, 
     
    23572357      SI.Mass[Medium.nXi] mXi "Independent masses"; 
    23582358 
    2359       Interfaces.FluidStatePorts_a[nPorts_a] ports_a( 
     2359      Interfaces.FluidPorts_a[nPorts_a] ports_a( 
    23602360        redeclare each package Medium=Medium, 
    23612361        m_flow(each min=if allowFlowReversal then -Constants.inf else 0)) 
     
    23632363        annotation (Placement( 
    23642364            transformation(extent={{-110,40},{-90,-40}}, rotation=0))); 
    2365       Interfaces.FluidStatePorts_b[nPorts_b] ports_b( 
     2365      Interfaces.FluidPorts_b[nPorts_b] ports_b( 
    23662366        redeclare each package Medium=Medium, 
    23672367        m_flow(each max=if allowFlowReversal then +Constants.inf else 0)) 
  • Modelica_Fluid/branches/StreamConnector/Modelica_Fluid/Interfaces.mo

    r1706 r1940  
    116116  end FluidPort_b; 
    117117 
    118   connector FluidStatePort_a 
    119     "Fluid connector at design inlet with potential pressure state" 
    120     extends FluidPort; 
    121     annotation (defaultComponentName="port_a", 
    122                 Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, 
    123               -100},{100,100}}), graphics={Ellipse( 
    124             extent={{-40,40},{40,-40}}, 
    125             lineColor={0,0,255}, 
    126             fillColor={0,127,255}, 
    127             fillPattern=FillPattern.Solid), Text(extent={{-150,110},{150,50}}, 
    128               textString="%name")}), 
    129          Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 
    130               100,100}}), graphics={ 
    131           Ellipse( 
    132             extent={{-100,100},{100,-100}}, 
    133             lineColor={0,127,255}, 
    134             fillColor={0,127,255}, 
    135             fillPattern=FillPattern.Solid), 
    136           Ellipse( 
    137             extent={{-100,100},{100,-100}}, 
    138             lineColor={0,0,0}, 
    139             fillColor={0,127,255}, 
    140             fillPattern=FillPattern.Solid), 
    141           Ellipse( 
    142             extent={{-18,20},{22,-20}}, 
    143             lineColor={0,0,0}, 
    144             fillColor={0,0,0}, 
    145             fillPattern=FillPattern.Solid)})); 
    146   end FluidStatePort_a; 
    147  
    148   connector FluidStatePort_b 
    149     "Fluid connector at design outlet with potential pressure state" 
    150    extends FluidPort; 
    151     annotation (defaultComponentName="port_b", 
    152                 Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, 
    153               -100},{100,100}}), graphics={ 
    154           Ellipse( 
    155             extent={{-40,40},{40,-40}}, 
    156             lineColor={0,0,255}, 
    157             fillColor={0,127,255}, 
    158             fillPattern=FillPattern.Solid), 
    159           Ellipse( 
    160             extent={{-30,30},{30,-30}}, 
    161             lineColor={0,127,255}, 
    162             fillColor={255,255,255}, 
    163             fillPattern=FillPattern.Solid), 
    164           Text(extent={{-150,110},{150,50}}, textString="%name")}), 
    165          Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 
    166               100,100}}), graphics={ 
    167           Ellipse( 
    168             extent={{-100,100},{100,-100}}, 
    169             lineColor={0,127,255}, 
    170             fillColor={0,127,255}, 
    171             fillPattern=FillPattern.Solid), 
    172           Ellipse( 
    173             extent={{-100,100},{100,-100}}, 
    174             lineColor={0,0,0}, 
    175             fillColor={0,127,255}, 
    176             fillPattern=FillPattern.Solid), 
    177           Ellipse( 
    178             extent={{-80,80},{80,-80}}, 
    179             lineColor={0,127,255}, 
    180             fillColor={255,255,255}, 
    181             fillPattern=FillPattern.Solid), 
    182           Ellipse( 
    183             extent={{-18,20},{22,-20}}, 
    184             lineColor={0,0,0}, 
    185             fillColor={0,0,0}, 
    186             fillPattern=FillPattern.Solid)})); 
    187   end FluidStatePort_b; 
    188  
    189118  connector FluidPorts_a 
    190119    "Fluid connector with filled, large icon to be used for vectors of FluidPorts (vector dimensions must be added after dragging)" 
     
    331260  end FluidPorts_b; 
    332261 
    333   connector FluidStatePorts_a 
    334     "Fluid connector with filled, large icon to be used for vectors of FluidPorts (vector dimensions must be added after dragging)" 
    335     extends FluidPort; 
    336     annotation (defaultComponentName="ports_a", 
    337                 Diagram(coordinateSystem( 
    338           preserveAspectRatio=false, 
    339           extent={{-50,-200},{50,200}}, 
    340           grid={1,1}, 
    341           initialScale=0.2), graphics={ 
    342           Text(extent={{-75,130},{75,100}}, textString="%name"), 
    343           Rectangle( 
    344             extent={{-25,100},{25,-100}}, 
    345             lineColor={0,127,255}, 
    346             fillColor={255,255,255}, 
    347             fillPattern=FillPattern.Solid), 
    348           Ellipse( 
    349             extent={{-25,90},{25,40}}, 
    350             lineColor={0,0,0}, 
    351             fillColor={0,127,255}, 
    352             fillPattern=FillPattern.Solid), 
    353           Ellipse( 
    354             extent={{-25,25},{25,-25}}, 
    355             lineColor={0,0,0}, 
    356             fillColor={0,127,255}, 
    357             fillPattern=FillPattern.Solid), 
    358           Ellipse( 
    359             extent={{-25,-40},{25,-90}}, 
    360             lineColor={0,0,0}, 
    361             fillColor={0,127,255}, 
    362             fillPattern=FillPattern.Solid)}), 
    363          Icon(coordinateSystem( 
    364           preserveAspectRatio=false, 
    365           extent={{-50,-200},{50,200}}, 
    366           grid={1,1}, 
    367           initialScale=0.2), graphics={ 
    368           Rectangle( 
    369             extent={{-50,200},{50,-200}}, 
    370             lineColor={0,127,255}, 
    371             fillColor={255,255,255}, 
    372             fillPattern=FillPattern.Solid), 
    373           Ellipse( 
    374             extent={{-50,180},{50,80}}, 
    375             lineColor={0,0,0}, 
    376             fillColor={0,127,255}, 
    377             fillPattern=FillPattern.Solid), 
    378           Ellipse( 
    379             extent={{-50,50},{50,-50}}, 
    380             lineColor={0,0,0}, 
    381             fillColor={0,127,255}, 
    382             fillPattern=FillPattern.Solid), 
    383           Ellipse( 
    384             extent={{-50,-80},{50,-180}}, 
    385             lineColor={0,0,0}, 
    386             fillColor={0,127,255}, 
    387             fillPattern=FillPattern.Solid), 
    388           Ellipse( 
    389             extent={{-20,150},{20,110}}, 
    390             lineColor={0,0,0}, 
    391             fillColor={0,0,0}, 
    392             fillPattern=FillPattern.Solid), 
    393           Ellipse( 
    394             extent={{-20,20},{20,-20}}, 
    395             lineColor={0,0,0}, 
    396             fillColor={0,0,0}, 
    397             fillPattern=FillPattern.Solid), 
    398           Ellipse( 
    399             extent={{-19,-111},{21,-151}}, 
    400             lineColor={0,0,0}, 
    401             fillColor={0,0,0}, 
    402             fillPattern=FillPattern.Solid)})); 
    403   end FluidStatePorts_a; 
    404  
    405   connector FluidStatePorts_b 
    406     "Fluid connector with outlined, large icon to be used for vectors of FluidPorts (vector dimensions must be added after dragging)" 
    407     extends FluidPort; 
    408     annotation (defaultComponentName="ports_b", 
    409                 Diagram(coordinateSystem( 
    410           preserveAspectRatio=false, 
    411           extent={{-50,-200},{50,200}}, 
    412           grid={1,1}, 
    413           initialScale=0.2), graphics={ 
    414           Text(extent={{-75,130},{75,100}}, textString="%name"), 
    415           Rectangle( 
    416             extent={{-25,100},{25,-100}}, 
    417             lineColor={0,127,255}, 
    418             fillColor={255,255,255}, 
    419             fillPattern=FillPattern.Solid), 
    420           Ellipse( 
    421             extent={{-25,90},{25,40}}, 
    422             lineColor={0,0,0}, 
    423             fillColor={0,127,255}, 
    424             fillPattern=FillPattern.Solid), 
    425           Ellipse( 
    426             extent={{-25,25},{25,-25}}, 
    427             lineColor={0,0,0}, 
    428             fillColor={0,127,255}, 
    429             fillPattern=FillPattern.Solid), 
    430           Ellipse( 
    431             extent={{-25,-40},{25,-90}}, 
    432             lineColor={0,0,0}, 
    433             fillColor={0,127,255}, 
    434             fillPattern=FillPattern.Solid), 
    435           Ellipse( 
    436             extent={{-15,-50},{15,-80}}, 
    437             lineColor={0,127,255}, 
    438             fillColor={255,255,255}, 
    439             fillPattern=FillPattern.Solid), 
    440           Ellipse( 
    441             extent={{-15,15},{15,-15}}, 
    442             lineColor={0,127,255}, 
    443             fillColor={255,255,255}, 
    444             fillPattern=FillPattern.Solid), 
    445           Ellipse( 
    446             extent={{-15,50},{15,80}}, 
    447             lineColor={0,127,255}, 
    448             fillColor={255,255,255}, 
    449             fillPattern=FillPattern.Solid)}), 
    450          Icon(coordinateSystem( 
    451           preserveAspectRatio=false, 
    452           extent={{-50,-200},{50,200}}, 
    453           grid={1,1}, 
    454           initialScale=0.2), graphics={ 
    455           Rectangle( 
    456             extent={{-50,200},{50,-200}}, 
    457             lineColor={0,127,255}, 
    458             fillColor={255,255,255}, 
    459             fillPattern=FillPattern.Solid), 
    460           Ellipse( 
    461             extent={{-50,180},{50,80}}, 
    462             lineColor={0,0,0}, 
    463             fillColor={0,127,255}, 
    464             fillPattern=FillPattern.Solid), 
    465           Ellipse( 
    466             extent={{-50,50},{50,-50}}, 
    467             lineColor={0,0,0}, 
    468             fillColor={0,127,255}, 
    469             fillPattern=FillPattern.Solid), 
    470           Ellipse( 
    471             extent={{-50,-80},{50,-180}}, 
    472             lineColor={0,0,0}, 
    473             fillColor={0,127,255}, 
    474             fillPattern=FillPattern.Solid), 
    475           Ellipse( 
    476             extent={{-45,44},{45,-44}}, 
    477             lineColor={0,127,255}, 
    478             fillColor={255,255,255}, 
    479             fillPattern=FillPattern.Solid), 
    480           Ellipse( 
    481             extent={{-43,88},{43,172}}, 
    482             lineColor={0,127,255}, 
    483             fillColor={255,255,255}, 
    484             fillPattern=FillPattern.Solid), 
    485           Ellipse( 
    486             extent={{-43,-84},{45,-175}}, 
    487             lineColor={0,127,255}, 
    488             fillColor={255,255,255}, 
    489             fillPattern=FillPattern.Solid), 
    490           Ellipse( 
    491             extent={{-20,151},{20,111}}, 
    492             lineColor={0,0,0}, 
    493             fillColor={0,0,0}, 
    494             fillPattern=FillPattern.Solid), 
    495           Ellipse( 
    496             extent={{-20,21},{20,-19}}, 
    497             lineColor={0,0,0}, 
    498             fillColor={0,0,0}, 
    499             fillPattern=FillPattern.Solid), 
    500           Ellipse( 
    501             extent={{-19,-110},{21,-150}}, 
    502             lineColor={0,0,0}, 
    503             fillColor={0,0,0}, 
    504             fillPattern=FillPattern.Solid)})); 
    505   end FluidStatePorts_b; 
    506  
    507262  connector HeatPorts_a 
    508263    "HeatPort connector with filled, large icon to be used for vectors of HeatPorts (vector dimensions must be added after dragging)" 
     
    570325    import Modelica.Constants; 
    571326    outer Modelica_Fluid.System system "System wide properties"; 
     327 
    572328    replaceable package Medium =  
    573329        Modelica.Media.Interfaces.PartialMedium "Medium in the component"  
    574330        annotation (choicesAllMatching = true); 
    575331 
    576     // Assumptions 
    577332    parameter Boolean allowFlowReversal = system.allowFlowReversal 
    578333      "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)" 
     
    591346      annotation (Placement(transformation(extent={{110,-10},{90,10}}, rotation= 
    592347               0), iconTransformation(extent={{110,-10},{90,10}}))); 
    593  
    594348    // Model structure, e.g. used for visualization 
    595349  protected 
     
    598352    parameter Boolean port_b_exposesState = false 
    599353      "= true if port_b.p exposes the state of a fluid volume"; 
     354 
    600355    annotation ( 
    601356      Diagram(coordinateSystem( 
     
    607362This partial model defines an interface for components with two ports.  
    608363The components may transport fluid and have internal storage.  
    609 The treatment of design flow direction and flow reversal are predefined. 
     364The treatment of design flow direction and flow reversal are predefined. The variable 
    610365</p> 
     366<ul> 
     367<li><tt>m_flow</tt> defines the mass flow rate in design direction, which is port_a.m_flow.</li>  
     368</ul> 
    611369<p> 
    612370A derived component providing direct access to internal storage of mass or energy through port_a or port_b  
  • Modelica_Fluid/branches/StreamConnector/Modelica_Fluid/Junctions.mo

    r1927 r1940  
    33  extends Modelica_Fluid.Icons.VariantLibrary; 
    44 
    5   model JunctionIdeal 
     5  model IdealTJunction 
    66    "Splitting/joining component with static balances for an infinitesimal control volume" 
    7     import Modelica_Fluid.Types; 
    8     import Modelica_Fluid.Types.PortFlowDirection; 
    9  
    10     replaceable package Medium=Modelica.Media.Interfaces.PartialMedium 
    11       "Fluid medium model"  
    12       annotation (choicesAllMatching=true); 
    13  
    14     Modelica_Fluid.Interfaces.FluidPort_a port_1(redeclare package Medium =  
    15           Medium, m_flow(min=if (portFlowDirection_1 == PortFlowDirection.Entering) then  
    16                   0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_1 
    17              == PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
    18       annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, 
    19             rotation=0))); 
    20     Modelica_Fluid.Interfaces.FluidPort_b port_2(redeclare package Medium =  
    21           Medium, m_flow(min=if (portFlowDirection_2 == PortFlowDirection.Entering) then  
    22                   0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_2 
    23              == PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
    24       annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation= 
    25              0))); 
    26     Modelica_Fluid.Interfaces.FluidPort_a port_3( 
    27       redeclare package Medium=Medium, 
    28       m_flow(min=if (portFlowDirection_3==PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, 
    29       max=if (portFlowDirection_3==PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
    30       annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation= 
    31              0))); 
     7    extends BaseClasses.PartialTJunction; 
     8 
     9  equation 
     10    connect(port_1, port_2) annotation (Line( 
     11        points={{-100,0},{100,0}}, 
     12        color={0,127,255}, 
     13        smooth=Smooth.None)); 
     14    connect(port_1, port_3) annotation (Line( 
     15        points={{-100,0},{0,0},{0,100}}, 
     16        color={0,127,255}, 
     17        smooth=Smooth.None)); 
    3218 
    3319    annotation(Documentation(info="<html> 
     
    4430          preserveAspectRatio=false, 
    4531          extent={{-100,-100},{100,100}}, 
    46           grid={1,1}), graphics={ 
    47           Rectangle( 
    48             extent={{-100,41},{100,-47}}, 
    49             lineColor={0,0,0}, 
    50             fillPattern=FillPattern.HorizontalCylinder, 
    51             fillColor={192,192,192}), 
    52           Rectangle( 
    53             extent={{-100,37},{100,-43}}, 
    54             lineColor={0,0,0}, 
    55             fillPattern=FillPattern.HorizontalCylinder, 
    56             fillColor={0,127,255}), 
    57           Rectangle( 
    58             extent={{-34,100},{34,37}}, 
    59             lineColor={0,0,0}, 
    60             fillPattern=FillPattern.VerticalCylinder, 
    61             fillColor={192,192,192}), 
    62           Rectangle( 
    63             extent={{-30,100},{30,35}}, 
    64             lineColor={0,0,0}, 
    65             fillPattern=FillPattern.VerticalCylinder, 
    66             fillColor={0,127,255}), 
    67           Text( 
    68             extent={{-150,-60},{150,-100}}, 
    69             lineColor={0,0,255}, 
    70             textString="%name")}), 
     32          grid={1,1}), graphics), 
    7133      Diagram(coordinateSystem( 
    7234          preserveAspectRatio=false, 
    7335          extent={{-100,-100},{100,100}}, 
    7436          grid={1,1}), graphics)); 
    75  
    76   protected 
    77     parameter PortFlowDirection portFlowDirection_1=PortFlowDirection.Bidirectional 
    78       "Flow direction for port_1"  
    79      annotation(Dialog(tab="Advanced")); 
    80     parameter PortFlowDirection portFlowDirection_2=PortFlowDirection.Bidirectional 
    81       "Flow direction for port_2"  
    82      annotation(Dialog(tab="Advanced")); 
    83     parameter PortFlowDirection portFlowDirection_3=PortFlowDirection.Bidirectional 
    84       "Flow direction for port_3"  
    85      annotation(Dialog(tab="Advanced")); 
    86  
    87   equation 
    88     connect(port_1, port_2) annotation (Line( 
    89         points={{-100,0},{100,0}}, 
    90         color={0,127,255}, 
    91         smooth=Smooth.None)); 
    92     connect(port_1, port_3) annotation (Line( 
    93         points={{-100,0},{0,0},{0,100}}, 
    94         color={0,127,255}, 
    95         smooth=Smooth.None)); 
    96   end JunctionIdeal; 
     37  end IdealTJunction; 
    9738 
    9839  annotation (Documentation(info="<html> 
    9940  
    10041</html>")); 
    101   model JunctionVolume 
     42  model TJunctionVolume 
    10243    "Splitting/joining component with static balances for a dynamic control volume" 
     44    extends BaseClasses.PartialTJunction; 
    10345    extends Volumes.BaseClasses.PartialLumpedVolume; 
    104     import Modelica_Fluid.Types; 
    105     import Modelica_Fluid.Types.PortFlowDirection; 
    106  
    107     parameter SI.Volume V "Volume"; 
    108  
    109     Modelica_Fluid.Interfaces.FluidPort_a port_1( 
    110       redeclare package Medium=Medium, 
    111       m_flow(min=if (portFlowDirection_1==PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, 
    112       max=if (portFlowDirection_1==PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
    113       annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, 
    114             rotation=0))); 
    115     Modelica_Fluid.Interfaces.FluidPort_b port_2( 
    116       redeclare package Medium=Medium, 
    117       m_flow(min=if (portFlowDirection_2==PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, 
    118       max=if (portFlowDirection_2==PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
    119       annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation= 
    120              0))); 
    121     Modelica_Fluid.Interfaces.FluidPort_a port_3( 
    122       redeclare package Medium=Medium, 
    123       m_flow(min=if (portFlowDirection_3==PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, 
    124       max=if (portFlowDirection_3==PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
    125       annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation= 
    126              0))); 
    127  
    128   protected 
    129     parameter PortFlowDirection portFlowDirection_1=PortFlowDirection.Bidirectional 
    130       "Flow direction for port_1"  
    131      annotation(Dialog(tab="Advanced")); 
    132     parameter PortFlowDirection portFlowDirection_2=PortFlowDirection.Bidirectional 
    133       "Flow direction for port_2"  
    134      annotation(Dialog(tab="Advanced")); 
    135     parameter PortFlowDirection portFlowDirection_3=PortFlowDirection.Bidirectional 
    136       "Flow direction for port_3"  
    137      annotation(Dialog(tab="Advanced")); 
    138  
    139     annotation (Icon(coordinateSystem( 
    140           preserveAspectRatio=true, 
    141           extent={{-100,-100},{100,100}}, 
    142           grid={1,1}), graphics={ 
    143           Rectangle( 
    144             extent={{-100,41},{100,-47}}, 
    145             lineColor={0,0,0}, 
    146             fillPattern=FillPattern.HorizontalCylinder, 
    147             fillColor={192,192,192}), 
    148           Rectangle( 
    149             extent={{-100,37},{100,-43}}, 
    150             lineColor={0,0,0}, 
    151             fillPattern=FillPattern.HorizontalCylinder, 
    152             fillColor={0,127,255}), 
    153           Rectangle( 
    154             extent={{-34,100},{34,37}}, 
    155             lineColor={0,0,0}, 
    156             fillPattern=FillPattern.VerticalCylinder, 
    157             fillColor={192,192,192}), 
    158           Rectangle( 
    159             extent={{-30,100},{30,35}}, 
    160             lineColor={0,0,0}, 
    161             fillPattern=FillPattern.VerticalCylinder, 
    162             fillColor={0,127,255}), 
    163           Ellipse( 
    164             extent={{-9,10},{11,-10}}, 
    165             lineColor={0,0,0}, 
    166             fillColor={0,0,0}, 
    167             fillPattern=FillPattern.Solid), 
    168           Text( 
    169             extent={{-150,-60},{150,-100}}, 
    170             lineColor={0,0,255}, 
    171             textString="%name")}), 
    172       Diagram(coordinateSystem( 
    173           preserveAspectRatio=false, 
    174           extent={{-100,-100},{100,100}}, 
    175           grid={1,1}), graphics)); 
     46 
     47    parameter SI.Volume V "Mixing volume inside junction"; 
    17648 
    17749  equation 
     
    20880    fluidVolume = V; 
    20981    ms_flow = port_1.m_flow + port_2.m_flow + port_3.m_flow "Mass balance"; 
    210     mXis_flow = port_1.m_flow*actualStream(port_1.Xi_outflow) 
     82    msXi_flow = port_1.m_flow*actualStream(port_1.Xi_outflow) 
    21183                + port_2.m_flow*actualStream(port_2.Xi_outflow) 
    21284                + port_3.m_flow*actualStream(port_3.Xi_outflow) 
     
    229101    Ws_flow = 0; 
    230102    Qs_flow = 0; 
    231   end JunctionVolume; 
     103 
     104    annotation (Documentation(info="<html> 
     105  This model introduces a mixing volume into a junction.  
     106  This might be useful to examine the non-ideal mixing taking place in a real junction.</html>"), 
     107  Icon(coordinateSystem( 
     108          preserveAspectRatio=true, 
     109          extent={{-100,-100},{100,100}}, 
     110          grid={1,1}), graphics={Ellipse( 
     111            extent={{-9,10},{11,-10}}, 
     112            lineColor={0,0,0}, 
     113            fillColor={0,0,0}, 
     114            fillPattern=FillPattern.Solid)}), 
     115      Diagram(coordinateSystem( 
     116          preserveAspectRatio=false, 
     117          extent={{-100,-100},{100,100}}, 
     118          grid={1,1}), graphics)); 
     119  end TJunctionVolume; 
    232120 
    233121  model MultiPort 
     
    323211  end MultiPort; 
    324212 
     213  package BaseClasses "Base classes for junctions" 
     214    extends Modelica_Fluid.Icons.BaseClassLibrary; 
     215 
     216    partial model PartialTJunction 
     217      "Base class for a splitting/joining component with three ports" 
     218      import Modelica_Fluid.Types; 
     219      import Modelica_Fluid.Types.PortFlowDirection; 
     220 
     221      replaceable package Medium=Modelica.Media.Interfaces.PartialMedium 
     222        "Fluid medium model"  
     223        annotation (choicesAllMatching=true); 
     224 
     225      Modelica_Fluid.Interfaces.FluidPort_a port_1(redeclare package Medium =  
     226            Medium, m_flow(min=if (portFlowDirection_1 == PortFlowDirection.Entering) then  
     227                    0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_1 
     228               == PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
     229        annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, 
     230              rotation=0))); 
     231      Modelica_Fluid.Interfaces.FluidPort_b port_2(redeclare package Medium =  
     232            Medium, m_flow(min=if (portFlowDirection_2 == PortFlowDirection.Entering) then  
     233                    0.0 else -Modelica.Constants.inf, max=if (portFlowDirection_2 
     234               == PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
     235        annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation= 
     236               0))); 
     237      Modelica_Fluid.Interfaces.FluidPort_a port_3( 
     238        redeclare package Medium=Medium, 
     239        m_flow(min=if (portFlowDirection_3==PortFlowDirection.Entering) then 0.0 else -Modelica.Constants.inf, 
     240        max=if (portFlowDirection_3==PortFlowDirection.Leaving) then 0.0 else Modelica.Constants.inf))  
     241        annotation (Placement(transformation(extent={{-10,90},{10,110}}, rotation= 
     242               0))); 
     243 
     244      annotation(Icon(coordinateSystem( 
     245            preserveAspectRatio=false, 
     246            extent={{-100,-100},{100,100}},