Changeset 704

Show
Ignore:
Timestamp:
10/15/2007 11:23:57 PM (15 months ago)
Author:
hubertus
Message:

made all ThermoDynamicState and FluidConstants records not replaceable in media packages that implement functions accessing them.

Location:
Modelica/trunk/Modelica/Media
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Media/Air.mo

    r680 r704  
    100100    import Modelica.Constants; 
    101101    import Modelica.Media.IdealGases.Common.SingleGasNasa; 
     102     
     103    redeclare record extends ThermodynamicState  
     104      "ThermodynamicState record for moist air"  
     105    end ThermodynamicState; 
    102106     
    103107    redeclare replaceable model extends BaseProperties( 
  • Modelica/trunk/Modelica/Media/IdealGases/Common/package.mo

    r692 r704  
    144144</p> 
    145145</HTML>"), 
    146     Icon(graphics), 
    147     Diagram(graphics)); 
     146    Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 
     147            100}}), 
     148         graphics), 
     149    Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 
     150            100,100}}), 
     151            graphics)); 
    148152   
    149153  extends Interfaces.PartialPureSubstance( 
     
    158162     AbsolutePressure(start=10e5, nominal=10e5)); 
    159163   
    160   redeclare replaceable record extends ThermodynamicState  
     164  redeclare record extends ThermodynamicState  
    161165    "thermodynamic state variables for ideal gases"  
    162166    AbsolutePressure p "Absolute pressure of medium"; 
     
    164168  end ThermodynamicState; 
    165169   
    166   redeclare replaceable record extends FluidConstants  
    167     "Extended fluid constants"  
     170  redeclare record extends FluidConstants "Extended fluid constants"  
    168171    Temperature criticalTemperature "critical temperature"; 
    169172    AbsolutePressure criticalPressure "critical pressure"; 
     
    774777It has been developed by Hubertus Tummescheit. 
    775778</p> 
    776 </HTML>"), Icon(graphics)); 
     779</HTML>"), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, 
     780            {100,100}}), 
     781                graphics)); 
    777782   
    778783  import Modelica.Math; 
     
    789794     AbsolutePressure(start=10e5, nominal=10e5), 
    790795     Temperature(start=500, nominal=500)); 
     796   
     797    redeclare record extends ThermodynamicState "thermodynamic state variables"  
     798    end ThermodynamicState; 
     799   
     800  redeclare record extends FluidConstants "fluid constants"  
     801  end FluidConstants; 
    791802   
    792803  constant Modelica.Media.IdealGases.Common.DataRecord[:] data  
  • Modelica/trunk/Modelica/Media/IdealGases/MixtureGases.mo

    r550 r704  
    2020    extends Common.MixtureGasNasa( 
    2121       mediumName="MoistAir", 
    22        data={Common.SingleGasesData.H2O, 
    23       Common.SingleGasesData.Air}, 
     22       data={Common.SingleGasesData.H2O, Common.SingleGasesData.Air}, 
     23      fluidConstants={Common.FluidData.H2O, 
     24        Common.FluidData.N2}, 
    2425       substanceNames = {"Water","Air"}, 
    2526       reference_X={0.0,1.0}); 
  • Modelica/trunk/Modelica/Media/IdealGases/SingleGases.mo

    r592 r704  
    5151  package CO "Ideal gas \"CO\" from NASA Glenn coefficients"  
    5252    extends Common.SingleGasNasa( 
    53        mediumName="Carbon Monoxide"); 
     53       mediumName="Carbon Monoxide", 
     54       data=Common.SingleGasesData.CO, 
     55       fluidConstants={Common.FluidData.CO}); 
    5456    annotation (preferedView="info", Documentation(info="<HTML> 
    5557      <IMG SRC=\"../Images/Media/IdealGases/SingleGases/CO.png\"></HTML>")); 
  • Modelica/trunk/Modelica/Media/package.mo

    r692 r704  
    27452745        annotation (Diagram(graphics={ 
    27462746              Ellipse( 
    2747                 extent={{-100,100},{100,-100}},  
    2748                 lineColor={0,127,255},  
    2749                 fillColor={0,127,255},  
    2750                 fillPattern=FillPattern.Solid),  
     2747                extent={{-100,100},{100,-100}}, 
     2748                lineColor={0,127,255}, 
     2749                fillColor={0,127,255}, 
     2750                fillPattern=FillPattern.Solid), 
    27512751              Ellipse( 
    2752                 extent={{-100,100},{100,-100}},  
    2753                 lineColor={0,0,0},  
    2754                 fillColor={0,127,255},  
    2755                 fillPattern=FillPattern.Solid),  
    2756               Text(extent={{-88,206},{112,112}}, textString =               "%name")}), 
     2752                extent={{-100,100},{100,-100}}, 
     2753                lineColor={0,0,0}, 
     2754                fillColor={0,127,255}, 
     2755                fillPattern=FillPattern.Solid), 
     2756              Text(extent={{-88,206},{112,112}}, textString=                "%name")}), 
    27572757             Icon(graphics={Ellipse( 
    2758                 extent={{-100,100},{100,-100}},  
    2759                 lineColor={0,127,255},  
    2760                 fillColor={0,127,255},  
     2758                extent={{-100,100},{100,-100}}, 
     2759                lineColor={0,127,255}, 
     2760                fillColor={0,127,255}, 
    27612761                fillPattern=FillPattern.Solid), Ellipse( 
    2762                 extent={{-100,100},{100,-100}},  
    2763                 lineColor={0,0,0},  
    2764                 fillColor={0,127,255},  
     2762                extent={{-100,100},{100,-100}}, 
     2763                lineColor={0,0,0}, 
     2764                fillColor={0,127,255}, 
    27652765                fillPattern=FillPattern.Solid)}), 
    27662766          Documentation(info="<html>Modelica.Media.Examples.Tests.Components.FluidPort_a 
     
    27722772        annotation (Diagram(graphics={ 
    27732773              Ellipse( 
    2774                 extent={{-100,100},{100,-100}},  
    2775                 lineColor={0,127,255},  
    2776                 fillColor={0,127,255},  
    2777                 fillPattern=FillPattern.Solid),  
     2774                extent={{-100,100},{100,-100}}, 
     2775                lineColor={0,127,255}, 
     2776                fillColor={0,127,255}, 
     2777                fillPattern=FillPattern.Solid), 
    27782778              Ellipse( 
    2779                 extent={{-100,100},{100,-100}},  
    2780                 lineColor={0,0,0},  
    2781                 fillColor={0,127,255},  
    2782                 fillPattern=FillPattern.Solid),  
     2779                extent={{-100,100},{100,-100}}, 
     2780                lineColor={0,0,0}, 
     2781                fillColor={0,127,255}, 
     2782                fillPattern=FillPattern.Solid), 
    27832783              Ellipse( 
    2784                 extent={{-80,80},{80,-80}},  
    2785                 lineColor={0,127,255},  
    2786                 fillColor={255,255,255},  
    2787                 fillPattern=FillPattern.Solid),  
    2788               Text(extent={{-88,192},{112,98}}, textString =              "%name")}), 
     2784                extent={{-80,80},{80,-80}}, 
     2785                lineColor={0,127,255}, 
     2786                fillColor={255,255,255}, 
     2787                fillPattern=FillPattern.Solid), 
     2788              Text(extent={{-88,192},{112,98}}, textString=               "%name")}), 
    27892789             Icon(graphics={ 
    27902790              Ellipse( 
    2791                 extent={{-100,100},{100,-100}},  
    2792                 lineColor={0,127,255},  
    2793                 fillColor={0,127,255},  
    2794                 fillPattern=FillPattern.Solid),  
     2791                extent={{-100,100},{100,-100}}, 
     2792                lineColor={0,127,255}, 
     2793                fillColor={0,127,255}, 
     2794                fillPattern=FillPattern.Solid), 
    27952795              Ellipse( 
    2796                 extent={{-100,100},{100,-100}},  
    2797                 lineColor={0,0,0},  
    2798                 fillColor={0,127,255},  
    2799                 fillPattern=FillPattern.Solid),  
     2796                extent={{-100,100},{100,-100}}, 
     2797                lineColor={0,0,0}, 
     2798                fillColor={0,127,255}, 
     2799                fillPattern=FillPattern.Solid), 
    28002800              Ellipse( 
    2801                 extent={{-80,80},{80,-80}},  
    2802                 lineColor={0,127,255},  
    2803                 fillColor={255,255,255},  
     2801                extent={{-80,80},{80,-80}}, 
     2802                lineColor={0,127,255}, 
     2803                fillColor={255,255,255}, 
    28042804                fillPattern=FillPattern.Solid)}), 
    28052805          Documentation(info="<html>  
     
    28482848         Icon(graphics={ 
    28492849              Ellipse( 
    2850                 extent={{-100,100},{100,-100}},  
    2851                 lineColor={0,0,0},  
    2852                 fillPattern=FillPattern.Sphere,  
    2853                 fillColor={170,213,255}),  
     2850                extent={{-100,100},{100,-100}}, 
     2851                lineColor={0,0,0}, 
     2852                fillPattern=FillPattern.Sphere, 
     2853                fillColor={170,213,255}), 
    28542854              Text(extent={{-144,178},{146,116}}, textString= 
    2855                                                       "%name"),  
     2855                                                      "%name"), 
    28562856              Text( 
    2857                 extent={{-130,-108},{144,-150}},  
    2858                 lineColor={0,0,0},  
     2857                extent={{-130,-108},{144,-150}}, 
     2858                lineColor={0,0,0}, 
    28592859                textString= 
    28602860                     "V=%V")}),Documentation(info="<html> 
     
    29312931          "Medium in the source"; 
    29322932        FluidPort_b port(redeclare package Medium = Medium)  
    2933           annotation (Placement(transformation(extent={{100,-10},{120,10}},  
     2933          annotation (Placement(transformation(extent={{100,-10},{120,10}}, 
    29342934                rotation=0))); 
    29352935        annotation ( 
    29362936          Icon(coordinateSystem( 
    2937               preserveAspectRatio=true,  
    2938               extent={{-100,-100},{100,100}},  
     2937              preserveAspectRatio=true, 
     2938              extent={{-100,-100},{100,100}}, 
    29392939              grid={2,2}), graphics={ 
    29402940              Rectangle( 
    2941                 extent={{20,60},{100,-60}},  
    2942                 lineColor={0,0,0},  
    2943                 fillPattern=FillPattern.HorizontalCylinder,  
    2944                 fillColor={192,192,192}),  
     2941                extent={{20,60},{100,-60}}, 
     2942                lineColor={0,0,0}, 
     2943                fillPattern=FillPattern.HorizontalCylinder, 
     2944                fillColor={192,192,192}), 
    29452945              Rectangle( 
    2946                 extent={{38,40},{100,-40}},  
    2947                 lineColor={0,0,0},  
    2948                 fillPattern=FillPattern.HorizontalCylinder,  
    2949                 fillColor={0,127,255}),  
     2946                extent={{38,40},{100,-40}}, 
     2947                lineColor={0,0,0}, 
     2948                fillPattern=FillPattern.HorizontalCylinder, 
     2949                fillColor={0,127,255}), 
    29502950              Ellipse( 
    2951                 extent={{-100,80},{60,-80}},  
    2952                 fillColor={255,255,255},  
    2953                 fillPattern=FillPattern.Solid),  
     2951                extent={{-100,80},{60,-80}}, 
     2952                fillColor={255,255,255}, 
     2953                fillPattern=FillPattern.Solid), 
    29542954              Polygon( 
    2955                 points={{-60,70},{60,0},{-60,-68},{-60,70}},  
    2956                 lineColor={0,0,255},  
    2957                 fillColor={0,0,255},  
    2958                 fillPattern=FillPattern.Solid),  
     2955                points={{-60,70},{60,0},{-60,-68},{-60,70}}, 
     2956                lineColor={0,0,255}, 
     2957                fillColor={0,0,255}, 
     2958                fillPattern=FillPattern.Solid), 
    29592959              Text( 
    2960                 extent={{-54,32},{16,-30}},  
    2961                 lineColor={255,0,0},  
    2962                 fillColor={255,0,0},  
    2963                 fillPattern=FillPattern.Solid,  
     2960                extent={{-54,32},{16,-30}}, 
     2961                lineColor={255,0,0}, 
     2962                fillColor={255,0,0}, 
     2963                fillPattern=FillPattern.Solid, 
    29642964                textString= 
    2965                      "m"),  
     2965                     "m"), 
    29662966              Text(extent={{-142,142},{156,88}}, textString= 
    2967                                                      "%name"),  
     2967                                                     "%name"), 
    29682968              Text( 
    2969                 extent={{-154,-88},{150,-132}},  
    2970                 lineColor={0,0,0},  
     2969                extent={{-154,-88},{150,-132}}, 
     2970                lineColor={0,0,0}, 
    29712971                textString= 
    2972                      "%m_flow"),  
     2972                     "%m_flow"), 
    29732973              Ellipse( 
    2974                 extent={{-26,30},{-18,22}},  
    2975                 lineColor={255,0,0},  
    2976                 fillColor={255,0,0},  
     2974                extent={{-26,30},{-18,22}}, 
     2975                lineColor={255,0,0}, 
     2976                fillColor={255,0,0}, 
    29772977                fillPattern=FillPattern.Solid)}), 
    29782978          Window( 
     
    29822982            height=0.65), 
    29832983          Diagram(coordinateSystem( 
    2984               preserveAspectRatio=true,  
    2985               extent={{-100,-100},{100,100}},  
     2984              preserveAspectRatio=true, 
     2985              extent={{-100,-100},{100,100}}, 
    29862986              grid={2,2}), graphics), 
    29872987          Documentation(info="<html> 
     
    30333033        Medium.BaseProperties medium "Medium in the source"; 
    30343034        FluidPort_b port(redeclare package Medium = Medium)  
    3035           annotation (Placement(transformation(extent={{100,-10},{120,10}},  
     3035          annotation (Placement(transformation(extent={{100,-10},{120,10}}, 
    30363036                rotation=0))); 
    30373037        annotation ( 
    30383038          Icon(coordinateSystem( 
    3039               preserveAspectRatio=true,  
    3040               extent={{-100,-100},{100,100}},  
     3039              preserveAspectRatio=true, 
     3040              extent={{-100,-100},{100,100}}, 
    30413041              grid={2,2}), graphics={Ellipse( 
    3042                 extent={{-100,80},{100,-80}},  
    3043                 lineColor={0,0,0},  
    3044                 fillPattern=FillPattern.Sphere,  
    3045                 fillColor={0,127,255}), Text(extent={{-136,144},{132,82}},  
    3046                   textString =                                           "%name")}), 
     3042                extent={{-100,80},{100,-80}}, 
     3043                lineColor={0,0,0}, 
     3044                fillPattern=FillPattern.Sphere, 
     3045                fillColor={0,127,255}), Text(extent={{-136,144},{132,82}}, 
     3046                  textString=                                            "%name")}), 
    30473047          Documentation(info="<html> 
    30483048<p> 
     
    30943094         
    30953095        FluidPort_a port_a(redeclare package Medium = Medium)  
    3096           annotation (Placement(transformation(extent={{-120,-10},{-100,10}},  
     3096          annotation (Placement(transformation(extent={{-120,-10},{-100,10}}, 
    30973097                rotation=0))); 
    30983098        FluidPort_b port_b(redeclare package Medium = Medium)  
    3099           annotation (Placement(transformation(extent={{120,-10},{100,10}},  
     3099          annotation (Placement(transformation(extent={{120,-10},{100,10}}, 
    31003100                rotation=0))); 
    31013101        // Medium.BaseProperties medium_a(p=port_a.p, h=port_a.h, Xi=port_a.Xi)  
     
    31063106          "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; 
    31073107        Modelica.SIunits.Pressure dp "Pressure drop from port_a to port_b"; 
    3108                                                                                          annotation (Icon(graphics 
    3109               ={ 
     3108                                                                                         annotation (Icon(graphics= 
     3109               { 
    31103110              Rectangle( 
    3111                 extent={{-100,60},{100,-60}},  
    3112                 lineColor={0,0,0},  
    3113                 fillPattern=FillPattern.HorizontalCylinder,  
    3114                 fillColor={192,192,192}),  
     3111                extent={{-100,60},{100,-60}}, 
     3112                lineColor={0,0,0}, 
     3113                fillPattern=FillPattern.HorizontalCylinder, 
     3114                fillColor={192,192,192}), 
    31153115              Rectangle( 
    3116                 extent={{-100,34},{100,-36}},  
    3117                 lineColor={0,0,0},  
    3118                 fillPattern=FillPattern.HorizontalCylinder,  
    3119                 fillColor={0,127,255}),  
     3116                extent={{-100,34},{100,-36}}, 
     3117                lineColor={0,0,0}, 
     3118                fillPattern=FillPattern.HorizontalCylinder, 
     3119                fillColor={0,127,255}), 
    31203120              Text( 
    3121                 extent={{-150,140},{150,80}},  
    3122                 lineColor={0,0,0},  
    3123                 fillPattern=FillPattern.HorizontalCylinder,  
    3124                 fillColor={0,127,255},  
     3121                extent={{-150,140},{150,80}}, 
     3122                lineColor={0,0,0}, 
     3123                fillPattern=FillPattern.HorizontalCylinder, 
     3124                fillColor={0,127,255}, 
    31253125                textString= 
    3126                      "%name"),  
     3126                     "%name"), 
    31273127              Text( 
    3128                 extent={{-136,-62},{122,-108}},  
    3129                 lineColor={0,0,0},  
     3128                extent={{-136,-62},{122,-108}}, 
     3129                lineColor={0,0,0}, 
    31303130                textString= 
    31313131                     "k=%m_flow_nominal/%dp_nominal")}), 
     
    31853185                          X_start = X_start, 
    31863186                          V=0.1)  
    3187                  annotation (Placement(transformation(extent={{-40,0},{-20,20}},  
     3187                 annotation (Placement(transformation(extent={{-40,0},{-20,20}}, 
    31883188                rotation=0))); 
    31893189        FixedMassFlowRate fixedMassFlowRate(redeclare package Medium = Medium, 
     
    32083208          m_flow_nominal=1, 
    32093209          dp_nominal=0.1e5)  
    3210           annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation 
    3211                 =0))); 
     3210          annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation= 
     3211                 0))); 
    32123212      equation  
    32133213        connect(fixedMassFlowRate.port, volume.port) annotation (Line(points={{ 
     
    32393239                          X_start = X_start, 
    32403240                          V=0.1)  
    3241                  annotation (Placement(transformation(extent={{-60,0},{-40,20}},  
     3241                 annotation (Placement(transformation(extent={{-60,0},{-40,20}}, 
    32423242                rotation=0))); 
    32433243        FixedMassFlowRate fixedMassFlowRate(redeclare package Medium = Medium, 
     
    32623262          m_flow_nominal=1, 
    32633263          dp_nominal=0.1e5)  
    3264           annotation (Placement(transformation(extent={{-30,0},{-10,20}},  
     3264          annotation (Placement(transformation(extent={{-30,0},{-10,20}}, 
    32653265                rotation=0))); 
    32663266        PortVolume volume1( 
     
    32713271                          X_start = X_start, 
    32723272                          V=0.1)  
    3273                  annotation (Placement(transformation(extent={{0,0},{20,20}},  
     3273                 annotation (Placement(transformation(extent={{0,0},{20,20}}, 
    32743274                rotation=0))); 
    32753275        ShortPipe shortPipe1( 
     
    32773277          m_flow_nominal=1, 
    32783278          dp_nominal=0.1e5)  
    3279           annotation (Placement(transformation(extent={{36,0},{56,20}},  
     3279          annotation (Placement(transformation(extent={{36,0},{56,20}}, 
    32803280                rotation=0))); 
    32813281      equation  
     
    39973997       Modelica.SIunits.Conversions.to_bar(p)  
    39983998        "Absolute pressure of medium in [bar]"; 
    3999       annotation (Icon(graphics={Rectangle( 
     3999      annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{ 
     4000                -100,-100},{100,100}}), graphics={Rectangle( 
    40004001              extent={{-100,100},{100,-100}},  
    40014002              fillColor={255,255,255},  
    40024003              fillPattern=FillPattern.Solid), Text(extent={{-152,164},{152,102}},  
    4003                 textString =               "%name")})); 
     4004                textString="%name")})); 
    40044005       
    40054006      // Local connector definition, used for equation balancing check 
     
    47504751      "if true, entries in thermodynamic Jacobian are constant, taken at reference conditions"; 
    47514752     
    4752       redeclare replaceable record ThermodynamicState  
     4753      redeclare record ThermodynamicState  
    47534754      "a selction of variables that uniquely defines the thermodynamic state"  
    47544755        AbsolutePressure p "Absolute pressure of medium"; 
     
    59725973    constant Temperature T0= reference_T "Zero enthalpy temperature"; 
    59735974     
    5974     redeclare replaceable record extends ThermodynamicState  
     5975    redeclare record extends ThermodynamicState  
    59755976      "Thermodynamic state of ideal gas"  
    59765977      AbsolutePressure p "Absolute pressure of medium"; 
    59775978      Temperature T "Temperature of medium"; 
    59785979    end ThermodynamicState; 
     5980     
     5981    redeclare record extends FluidConstants "fluid constants"  
     5982    end FluidConstants; 
    59795983     
    59805984    redeclare replaceable model extends BaseProperties( 
     
    60556059     
    60566060    redeclare function extends pressure "Return pressure of ideal gas"  
     6061       
    60576062      annotation(Documentation(info="<html></html>")); 
    60586063    algorithm  
     
    60616066     
    60626067    redeclare function extends temperature "Return temperature of ideal gas"  
     6068       
    60636069      annotation(Documentation(info="<html></html>")); 
    60646070    algorithm  
     
    61106116     
    61116117    redeclare function extends dynamicViscosity "Return dynamic viscosity"  
     6118       
    61126119      annotation(Documentation(info="<html></html>")); 
    61136120    algorithm  
     
    61176124    redeclare function extends thermalConductivity  
    61186125      "Return thermal conductivity"  
     6126       
    61196127      annotation(Documentation(info="<html></html>")); 
    61206128    algorithm  
     
    61246132    redeclare function extends specificHeatCapacityCp  
    61256133      "Return specific heat capacity at constant pressure"  
     6134       
    61266135      annotation(Documentation(info="<html></html>")); 
    61276136    algorithm  
     
    61316140    redeclare function extends specificHeatCapacityCv  
    61326141      "Return specific heat capacity at constant volume"  
     6142       
    61336143      annotation(Documentation(info="<html></html>")); 
    61346144    algorithm  
     
    61376147     
    61386148    redeclare function extends isentropicExponent "Return isentropic exponent"  
     6149       
    61396150      annotation(Documentation(info="<html></html>")); 
    61406151    algorithm  
     
    61436154     
    61446155    redeclare function extends velocityOfSound "Return velocity of sound "  
     6156       
    61456157      annotation(Documentation(info="<html></html>")); 
    61466158    algorithm  
<