Changeset 1948

Show
Ignore:
Timestamp:
12/05/2008 01:58:54 AM (5 weeks ago)
Author:
mwetter
Message:

Added trace substances C as a parameter and/or input signal.
Provided default values for enthalpy and pressure in existing source models.
Moved RealInput instances to make space for C_in input.
Added test model for C as a source.

Location:
Modelica_Fluid/branches/StreamConnector/Modelica_Fluid
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • Modelica_Fluid/branches/StreamConnector/Modelica_Fluid/Sources.mo

    r1703 r1948  
    3030      annotation (Dialog(group = "Only for multi-substance flow", enable=Medium.nXi > 0)); 
    3131 
     32    parameter Medium.ExtraProperty C[Medium.nC]( 
     33         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     34      "Boundary trace substances"  
     35      annotation (Dialog(group = "Only for trace-substance flow", enable=Medium.nC > 0)); 
     36 
    3237    annotation (defaultComponentName="boundary", 
    3338      Icon(coordinateSystem( 
     
    4954<li> Boundary pressure or boundary density.</li> 
    5055<li> Boundary temperature or boundary specific enthalpy.</li> 
    51 <li> Boundary composition (only for multi-substance flow).</li> 
     56<li> Boundary composition (only for multi-substance or trace-substance flow).</li> 
    5257</ul> 
    5358<p> 
    54 Note, that boundary temperature, density, specific enthalpy 
    55 and mass fractions have only an effect if the mass flow 
     59Note, that boundary temperature, density, specific enthalpy, 
     60mass fractions and trace substances have only an effect if the mass flow 
    5661is from the Boundary into the port. If mass is flowing from 
    5762the port into the boundary, the boundary definitions, 
     
    7681 
    7782    medium.Xi = X[1:Medium.nXi]; 
     83 
     84    ports.C_outflow = fill(C, nPorts); 
    7885  end FixedBoundary; 
    7986 
    8087  model FixedBoundary_pTX 
    81     "Boundary pressure, temperature and mass fraction source" 
     88    "Boundary pressure, temperature, mass fraction and trace substances source" 
    8289    extends Sources.BaseClasses.PartialSource; 
    83     parameter Medium.AbsolutePressure p "Boundary pressure"; 
    84     parameter Medium.Temperature T "Boundary temperature"; 
     90    parameter Medium.AbsolutePressure p=Medium.p_default "Boundary pressure"; 
     91    parameter Medium.Temperature T=Medium.T_default "Boundary temperature"; 
    8592    parameter Medium.MassFraction X[Medium.nX]( 
    8693         quantity=Medium.substanceNames) = Medium.X_default 
     
    8895      annotation (Dialog(group = "Only for multi-substance flow", 
    8996                  enable=Medium.nXi > 0)); 
     97    parameter Medium.ExtraProperty C[Medium.nC]( 
     98         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     99      "Boundary trace substances"  
     100      annotation (Dialog(group = "Only for trace-substance flow", enable=Medium.nC > 0)); 
    90101    annotation (defaultComponentName="boundary", 
    91102      Icon(coordinateSystem( 
     
    107118<li> Boundary pressure.</li> 
    108119<li> Boundary temperature.</li> 
    109 <li> Boundary composition (only for multi-substance flow).</li> 
     120<li> Boundary composition (only for multi-substance or trace-substance flow).</li> 
    110121</ul> 
    111122<p> 
    112 Note, that boundary temperature 
    113 and mass fractions have only an effect if the mass flow 
     123Note, that boundary temperature, 
     124mass fractions and trace substances have only an effect if the mass flow 
    114125is from the boundary into the port. If mass is flowing from 
    115126the port into the boundary, the boundary definitions, 
     
    123134    medium.T   = T; 
    124135    medium.Xi = X[1:Medium.nXi]; 
     136    ports.C_outflow = fill(C, nPorts); 
    125137  end FixedBoundary_pTX; 
    126138 
    127139  model FixedBoundary_phX 
    128     "Boundary pressure, specific enthalpy and mass fraction source" 
     140    "Boundary pressure, specific enthalpy, mass fraction and trace substances source" 
    129141    extends Sources.BaseClasses.PartialSource; 
    130     parameter Medium.AbsolutePressure p "Boundary pressure"; 
    131     parameter Medium.SpecificEnthalpy h "Boundary specific enthalpy"; 
     142    parameter Medium.AbsolutePressure p=Medium.p_default "Boundary pressure"; 
     143    parameter Medium.SpecificEnthalpy h=Medium.h_default 
     144      "Boundary specific enthalpy"; 
    132145    parameter Medium.MassFraction X[ 
    133146      Medium.nX](quantity=Medium.substanceNames) = Medium.X_default 
    134147      "Boundary mass fractions m_i/m"  annotation (Dialog(group= 
    135148            "Only for multi-substance flow", enable=Medium.nXi > 0)); 
     149    parameter Medium.ExtraProperty C[Medium.nC]( 
     150         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     151      "Boundary trace substances"  
     152      annotation (Dialog(group = "Only for trace-substance flow", enable=Medium.nC > 0)); 
    136153    annotation (defaultComponentName="boundary", 
    137154      Icon(coordinateSystem( 
     
    153170<li> Boundary pressure.</li> 
    154171<li> Boundary specific enthalpy.</li> 
    155 <li> Boundary composition (only for multi-substance flow).</li> 
     172<li> Boundary composition (only for multi-substance or trace-substance flow).</li> 
    156173</ul> 
    157174<p> 
    158 Note, that boundary specific enthalpy 
    159 and mass fractions have only an effect if the mass flow 
     175Note, that boundary specific enthalpy, 
     176mass fractions and trace substances have only an effect if the mass flow 
    160177is from the boundary into the port. If mass is flowing from 
    161178the port into the boundary, the boundary definitions, 
     
    169186    medium.h = h; 
    170187    medium.Xi = X[1:Medium.nXi]; 
     188    ports.C_outflow = fill(C, nPorts); 
    171189  end FixedBoundary_phX; 
    172190 
     
    178196</html>")); 
    179197  model PrescribedBoundary_pTX 
    180     "Boundary with prescribed pressure, temperature and composition" 
     198    "Boundary with prescribed pressure, temperature, composition and trace substances" 
    181199    extends Sources.BaseClasses.PartialSource; 
    182200    parameter Boolean usePressureInput = false 
     
    189207      "Get the composition from the input connector"  
    190208      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
     209    parameter Boolean useTraceInput = false 
     210      "Get the trace substances from the input connector"  
     211      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
    191212    parameter Medium.AbsolutePressure p = Medium.p_default 
    192213      "Fixed value of pressure"  
     
    201222      annotation (Evaluate = true, 
    202223                  Dialog(enable = (not useCompositionInput) and Medium.nXi > 0)); 
     224    parameter Medium.ExtraProperty C[Medium.nC]( 
     225         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     226      "Boundary trace substances"  
     227      annotation (Evaluate=true, 
     228                  Dialog(enable = (not useTraceInput) and Medium.nC > 0)); 
    203229    Modelica.Blocks.Interfaces.RealInput p_in if              usePressureInput 
    204230      "Prescribed boundary pressure"  
    205       annotation (Placement(transformation(extent={{-140,40},{-100,80}}, 
     231      annotation (Placement(transformation(extent={{-140,60},{-100,100}}, 
    206232            rotation=0))); 
    207233    Modelica.Blocks.Interfaces.RealInput T_in if         useTemperatureInput 
    208234      "Prescribed boundary temperature"  
    209       annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, 
     235      annotation (Placement(transformation(extent={{-140,20},{-100,60}}, 
    210236            rotation=0))); 
    211237    Modelica.Blocks.Interfaces.RealInput X_in[Medium.nX] if  
    212238                                                          useCompositionInput 
    213239      "Prescribed boundary composition"  
    214       annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}, 
     240      annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}, 
     241            rotation=0))); 
     242    Modelica.Blocks.Interfaces.RealInput C_in[Medium.nC] if  
     243                                                          useTraceInput 
     244      "Prescribed boundary trace substances"  
     245      annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}, 
    215246            rotation=0))); 
    216247  protected 
     
    220251      "Needed to connect to conditional connector"; 
    221252    Modelica.Blocks.Interfaces.RealInput X_in_internal[Medium.nX] 
     253      "Needed to connect to conditional connector"; 
     254    Modelica.Blocks.Interfaces.RealInput C_in_internal[Medium.nC] 
    222255      "Needed to connect to conditional connector"; 
    223256    annotation (defaultComponentName="boundary", 
     
    237270          Line( 
    238271            visible=usePressureInput, 
    239             points={{-100,60},{-80,60}}, 
     272            points={{-100,80},{-58,80}}, 
     273            color={0,0,255}), 
     274          Line( 
     275            visible=useTemperatureInput, 
     276            points={{-100,40},{-92,40}}, 
    240277            color={0,0,255}), 
    241278          Line( 
    242279            visible=useCompositionInput, 
    243             points={{-100,-60},{-80,-60}}, 
     280            points={{-100,-40},{-92,-40}}, 
    244281            color={0,0,255}), 
     282          Line( 
     283            visible=useTraceInput, 
     284            points={{-100,-80},{-60,-80}}, 
     285            color={0,0,255}), 
    245286          Text( 
    246287            visible=usePressureInput, 
    247             extent={{-146,110},{-62,70}}, 
     288            extent={{-152,134},{-68,94}}, 
    248289            lineColor={0,0,0}, 
    249290            fillColor={255,255,255}, 
     
    252293          Text( 
    253294            visible=useCompositionInput, 
    254             extent={{-160,-22},{-58,-62}}, 
     295            extent={{-164,4},{-62,-36}}, 
    255296            lineColor={0,0,0}, 
    256297            fillColor={255,255,255}, 
     
    258299            textString="X"), 
    259300          Text( 
     301            visible=useTraceInput, 
     302            extent={{-164,-90},{-62,-130}}, 
     303            lineColor={0,0,0}, 
     304            fillColor={255,255,255}, 
     305            fillPattern=FillPattern.Solid, 
     306            textString="C"), 
     307          Text( 
    260308            visible=useTemperatureInput, 
    261             extent={{-158,44},{-56,4}}, 
     309            extent={{-162,34},{-60,-6}}, 
    262310            lineColor={0,0,0}, 
    263311            fillColor={255,255,255}, 
     
    271319<li> Prescribed boundary pressure.</li> 
    272320<li> Prescribed boundary temperature.</li> 
    273 <li> Prescribed boundary composition (only for multi-substance flow).</li> 
     321<li> Boundary composition (only for multi-substance or trace-substance flow).</li> 
    274322</ul> 
    275323<p>If <tt>usePressureInput</tt> is false (default option), the <tt>p</tt> parameter 
    276324is used as boundary pressure, and the <tt>p_in</tt> input connector is disabled; if <tt>usePressureInput</tt> is true, then the <tt>p</tt> parameter is ignored, and the value provided by the input connector is used instead.</p>  
    277 <p>The same thing goes for the temperature and composition</p> 
    278 <p> 
    279 Note, that boundary temperature 
    280 and mass fractions have only an effect if the mass flow 
     325<p>The same thing goes for the temperature, composition and trace substances.</p> 
     326<p> 
     327Note, that boundary temperature, 
     328mass fractions and trace substances have only an effect if the mass flow 
    281329is from the boundary into the port. If mass is flowing from 
    282330the port into the boundary, the boundary definitions, 
     
    294342    connect(T_in, T_in_internal); 
    295343    connect(X_in, X_in_internal); 
     344    connect(C_in, C_in_internal); 
    296345    if not usePressureInput then 
    297346      p_in_internal = p; 
     
    302351    if not useCompositionInput then 
    303352      X_in_internal = X; 
     353    end if; 
     354    if not useTraceInput then 
     355      C_in_internal = C; 
    304356    end if; 
    305357    medium.p = p_in_internal; 
    306358    medium.T = T_in_internal; 
    307359    medium.Xi = X_in_internal[1:Medium.nXi]; 
     360    ports.C_outflow = fill(C_in_internal, nPorts); 
    308361  end PrescribedBoundary_pTX; 
    309362 
    310363  model PrescribedBoundary_phX 
    311     "Boundary with prescribed pressure, specific enthalpy and composition" 
     364    "Boundary with prescribed pressure, specific enthalpy, composition and trace substances" 
    312365    extends Sources.BaseClasses.PartialSource; 
    313366    parameter Boolean usePressureInput = false 
     
    320373      "Get the composition from the input connector"  
    321374      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
     375    parameter Boolean useTraceInput = false 
     376      "Get the trace substances from the input connector"  
     377      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
    322378    parameter Medium.AbsolutePressure p = Medium.p_default 
    323379      "Fixed value of pressure"  
     
    332388      annotation (Evaluate = true, 
    333389                  Dialog(enable = (not useCompositionInput) and Medium.nXi > 0)); 
     390    parameter Medium.ExtraProperty C[Medium.nC]( 
     391         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     392      "Boundary trace substances"  
     393      annotation (Evaluate=true, 
     394                  Dialog(enable = (not useTraceInput) and Medium.nC > 0)); 
    334395    Modelica.Blocks.Interfaces.RealInput p_in if              usePressureInput 
    335396      "Prescribed boundary pressure"  
    336       annotation (Placement(transformation(extent={{-140,40},{-100,80}}, 
     397      annotation (Placement(transformation(extent={{-140,60},{-100,100}}, 
    337398            rotation=0))); 
    338399    Modelica.Blocks.Interfaces.RealInput h_in if              useEnthalpyInput 
    339400      "Prescribed boundary specific enthalpy"  
    340       annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, 
     401      annotation (Placement(transformation(extent={{-140,20},{-100,60}}, 
    341402            rotation=0))); 
    342403    Modelica.Blocks.Interfaces.RealInput X_in[Medium.nX] if  
    343404                                                          useCompositionInput 
    344405      "Prescribed boundary composition"  
    345       annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}, 
     406      annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}, 
     407            rotation=0))); 
     408    Modelica.Blocks.Interfaces.RealInput C_in[Medium.nC] if  
     409                                                          useTraceInput 
     410      "Prescribed boundary trace substances"  
     411      annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}, 
    346412            rotation=0))); 
    347413    annotation (defaultComponentName="boundary", 
     
    361427          Line( 
    362428            visible=usePressureInput, 
    363             points={{-100,60},{-66,60}}, 
     429            points={{-100,80},{-60,80}}, 
     430            color={0,0,255}), 
     431          Line( 
     432            visible=useEnthalpyInput, 
     433            points={{-100,40},{-92,40}}, 
    364434            color={0,0,255}), 
    365435          Line( 
    366436            visible=useCompositionInput, 
    367             points={{-100,-60},{-66,-60}}, 
     437            points={{-100,-40},{-92,-40}}, 
    368438            color={0,0,255}), 
     439          Line( 
     440            visible=useTraceInput, 
     441            points={{-100,-80},{-60,-80}}, 
     442            color={0,0,255}), 
    369443          Text( 
    370444            visible=usePressureInput, 
    371             extent={{-148,120},{-70,80}}, 
     445            extent={{-150,134},{-72,94}}, 
    372446            lineColor={0,0,0}, 
    373447            fillColor={255,255,255}, 
     
    376450          Text( 
    377451            visible=useEnthalpyInput, 
    378             extent={{-100,20},{2,-20}}, 
    379             lineColor={255,255,255}, 
     452            extent={{-166,34},{-64,-6}}, 
     453            lineColor={0,0,0}, 
    380454            fillColor={255,255,255}, 
    381455            fillPattern=FillPattern.Solid, 
     
    383457          Text( 
    384458            visible=useCompositionInput, 
    385             extent={{-140,-86},{-38,-126}}, 
    386             lineColor={0,0,0}, 
    387             fillColor={255,255,255}, 
    388             fillPattern=FillPattern.Solid, 
    389             textString="X")}), 
     459            extent={{-164,4},{-62,-36}}, 
     460            lineColor={0,0,0}, 
     461            fillColor={255,255,255}, 
     462            fillPattern=FillPattern.Solid, 
     463            textString="X"), 
     464          Text( 
     465            visible=useTraceInput, 
     466            extent={{-164,-90},{-62,-130}}, 
     467            lineColor={0,0,0}, 
     468            fillColor={255,255,255}, 
     469            fillPattern=FillPattern.Solid, 
     470            textString="C")}), 
    390471      Documentation(info="<html> 
    391472<p> 
     
    395476<li> Prescribed boundary pressure.</li> 
    396477<li> Prescribed boundary temperature.</li> 
    397 <li> Prescribed boundary composition (only for multi-substance flow).</li> 
     478<li> Boundary composition (only for multi-substance or trace-substance flow).</li> 
    398479</ul> 
    399480<p>If <tt>usePressureInput</tt> is false (default option), the <tt>p</tt> parameter 
     
    401482<p>The same thing goes for the specific enthalpy and composition</p> 
    402483<p> 
    403 Note, that boundary temperature 
    404 and mass fractions have only an effect if the mass flow 
     484Note, that boundary temperature, 
     485mass fractions and trace substances have only an effect if the mass flow 
    405486is from the boundary into the port. If mass is flowing from 
    406487the port into the boundary, the boundary definitions, 
     
    414495      "Needed to connect to conditional connector"; 
    415496    Modelica.Blocks.Interfaces.RealInput X_in_internal[Medium.nX] 
     497      "Needed to connect to conditional connector"; 
     498    Modelica.Blocks.Interfaces.RealInput C_in_internal[Medium.nC] 
    416499      "Needed to connect to conditional connector"; 
    417500  equation 
     
    421504    connect(h_in, h_in_internal); 
    422505    connect(X_in, X_in_internal); 
     506    connect(C_in, C_in_internal); 
    423507    if not usePressureInput then 
    424508      p_in_internal = p; 
     
    429513    if not useCompositionInput then 
    430514      X_in_internal = X; 
     515    end if; 
     516    if not useTraceInput then 
     517      C_in_internal = C; 
    431518    end if; 
    432519    medium.p = p_in_internal; 
    433520    medium.h = h_in_internal; 
    434521    medium.Xi = X_in_internal[1:Medium.nXi]; 
     522    ports.C_outflow = fill(C_in_internal, nPorts); 
    435523  end PrescribedBoundary_phX; 
    436524 
    437525  model PrescribedMassFlowRate_TX 
    438     "Ideal flow source that produces a prescribed mass flow with prescribed temperature and mass fraction" 
     526    "Ideal flow source that produces a prescribed mass flow with prescribed temperature, mass fraction and trace substances" 
    439527    extends Sources.BaseClasses.PartialSource; 
    440528    parameter Boolean useFlowRateInput = false 
     
    447535      "Get the composition from the input connector"  
    448536      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
     537    parameter Boolean useTraceInput = false 
     538      "Get the trace substances from the input connector"  
     539      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
    449540    parameter Medium.MassFlowRate m_flow = 0 
    450541      "Fixed mass flow rate going out of the fluid port"  
     
    459550      annotation (Evaluate = true, 
    460551                  Dialog(enable = (not useCompositionInput) and Medium.nXi > 0)); 
     552    parameter Medium.ExtraProperty C[Medium.nC]( 
     553         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     554      "Boundary trace substances"  
     555      annotation (Evaluate=true, 
     556                  Dialog(enable = (not useTraceInput) and Medium.nC > 0)); 
    461557    Modelica.Blocks.Interfaces.RealInput m_flow_in if     useFlowRateInput 
    462558      "Prescribed mass flow rate"  
    463       annotation (Placement(transformation(extent={{-113,40},{-73,80}}, 
    464             rotation=0))); 
     559      annotation (Placement(transformation(extent={{-120,60},{-80,100}}, 
     560            rotation=0), iconTransformation(extent={{-120,60},{-80,100}}))); 
    465561    Modelica.Blocks.Interfaces.RealInput T_in if         useTemperatureInput 
    466562      "Prescribed fluid temperature"  
    467       annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, 
    468             rotation=0))); 
     563      annotation (Placement(transformation(extent={{-140,20},{-100,60}}, 
     564            rotation=0), iconTransformation(extent={{-140,20},{-100,60}}))); 
    469565    Modelica.Blocks.Interfaces.RealInput X_in[Medium.nX] if  
    470566                                                          useCompositionInput 
    471567      "Prescribed fluid composition"  
    472       annotation (Placement(transformation(extent={{-112,-81},{-72,-41}}, 
     568      annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}, 
     569            rotation=0))); 
     570    Modelica.Blocks.Interfaces.RealInput C_in[Medium.nC] if  
     571                                                          useTraceInput 
     572      "Prescribed boundary trace substances"  
     573      annotation (Placement(transformation(extent={{-120,-100},{-80,-60}}, 
    473574            rotation=0))); 
    474575  protected 
     
    479580    Modelica.Blocks.Interfaces.RealInput X_in_internal[Medium.nX] 
    480581      "Needed to connect to conditional connector"; 
     582    Modelica.Blocks.Interfaces.RealInput C_in_internal[Medium.nC] 
     583      "Needed to connect to conditional connector"; 
    481584    annotation (defaultComponentName="boundary", 
    482585      Icon(coordinateSystem( 
    483           preserveAspectRatio=false, 
     586          preserveAspectRatio=true, 
    484587          extent={{-100,-100},{100,100}}, 
    485588          grid={1,1}), graphics={ 
     
    521624          Text( 
    522625            visible=useFlowRateInput, 
    523             extent={{-194,112},{-54,80}}, 
     626            extent={{-185,132},{-45,100}}, 
    524627            lineColor={0,0,0}, 
    525628            fillColor={255,255,255}, 
     
    528631          Text( 
    529632            visible=useTemperatureInput, 
    530             extent={{-100,14},{-60,-20}}, 
     633            extent={{-111,71},{-71,37}}, 
    531634            lineColor={0,0,0}, 
    532635            fillColor={255,255,255}, 
     
    535638          Text( 
    536639            visible=useCompositionInput, 
    537             extent={{-144,-90},{-24,-118}}, 
    538             lineColor={0,0,0}, 
    539             fillColor={255,255,255}, 
    540             fillPattern=FillPattern.Solid, 
    541             textString="X")}), 
     640            extent={{-153,-44},{-33,-72}}, 
     641            lineColor={0,0,0}, 
     642            fillColor={255,255,255}, 
     643            fillPattern=FillPattern.Solid, 
     644            textString="X"), 
     645          Text( 
     646            visible=useTraceInput, 
     647            extent={{-155,-98},{-35,-126}}, 
     648            lineColor={0,0,0}, 
     649            fillColor={255,255,255}, 
     650            fillPattern=FillPattern.Solid, 
     651            textString="C")}), 
    542652      Window( 
    543653        x=0.45, 
     
    551661      Documentation(info="<html> 
    552662<p> 
    553 Models an ideal flow source, with prescribed values of flow rate, temperature and composition: 
     663Models an ideal flow source, with prescribed values of flow rate, temperature, composition and trace substances: 
    554664</p> 
    555665<ul> 
    556666<li> Prescribed mass flow rate.</li> 
    557667<li> Prescribed temperature.</li> 
    558 <li> Prescribed composition (only for multi-substance flow) .</li> 
     668<li> Boundary composition (only for multi-substance or trace-substance flow).</li> 
    559669</ul> 
    560670<p>If <tt>useFlowRateInput</tt> is false (default option), the <tt>m_flow</tt> parameter 
     
    562672<p>The same thing goes for the temperature and composition</p> 
    563673<p> 
    564 Note, that boundary temperature 
    565 and mass fractions have only an effect if the mass flow 
     674Note, that boundary temperature, 
     675mass fractions and trace substances have only an effect if the mass flow 
    566676is from the boundary into the port. If mass is flowing from 
    567677the port into the boundary, the boundary definitions, 
     
    575685    connect(T_in, T_in_internal); 
    576686    connect(X_in, X_in_internal); 
     687    connect(C_in, C_in_internal); 
    577688    if not useFlowRateInput then 
    578689      m_flow_in_internal = m_flow; 
     
    583694    if not useCompositionInput then 
    584695      X_in_internal = X; 
     696    end if; 
     697    if not useTraceInput then 
     698      C_in_internal = C; 
    585699    end if; 
    586700    sum(ports.m_flow) = -m_flow_in_internal; 
    587701    medium.T = T_in_internal; 
    588702    medium.Xi = X_in_internal[1:Medium.nXi]; 
     703    ports.C_outflow = fill(C_in_internal, nPorts); 
    589704  end PrescribedMassFlowRate_TX; 
    590705 
    591706  model PrescribedMassFlowRate_hX 
    592     "Ideal flow source that produces a prescribed mass flow with prescribed specific enthalpy and mass fraction" 
     707    "Ideal flow source that produces a prescribed mass flow with prescribed specific enthalpy, mass fraction and trace substances" 
    593708    extends Sources.BaseClasses.PartialSource; 
    594709    parameter Boolean useFlowRateInput = false 
     
    601716      "Get the composition from the input connector"  
    602717      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
     718    parameter Boolean useTraceInput = false 
     719      "Get the trace substances from the input connector"  
     720      annotation(Evaluate=true, HideResult=true, choices(__Dymola_checkBox=true)); 
    603721    parameter Medium.MassFlowRate m_flow = 0 
    604722      "Fixed mass flow rate going out of the fluid port"  
     
    613731      annotation (Evaluate = true, 
    614732                  Dialog(enable = (not useCompositionInput) and Medium.nXi > 0)); 
     733    parameter Medium.ExtraProperty C[Medium.nC]( 
     734         quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) 
     735      "Boundary trace substances"  
     736      annotation (Evaluate=true, 
     737                  Dialog(enable = (not useTraceInput) and Medium.nC > 0)); 
    615738    Modelica.Blocks.Interfaces.RealInput m_flow_in if     useFlowRateInput 
    616739      "Prescribed mass flow rate"