Search code examples
warningsmodelicadymola

Warning "use Modelica.Icons.Package instead" in Modelica code


I meet a warning use Modelica.Icons.Package instead in the Modelica code. it seems I am using a wrong icon so the tool chooses to use Modelica.Icons.Package instead.

So I check the code that showed in the warning message, there is no icon in this component, so why this warning happens?

The following screenshot shows the warning message and the Modelica code of the wrong component.

enter image description here

model HeatTransferTwoPhase "Heat transfer model for two-phase correlations"
  replaceable package Medium =
    Modelon.Media.PreDefined.TwoPhase.WaterIF97                            constrainedby 
    Modelon.Media.Interfaces.TwoPhaseMedium                                                             annotation(Dialog(group="Medium"),choicesAllMatching);
  replaceable model HeatTransfer =
      ThermalPower.SubComponents.HeatTransfer.Pipes.KcZero constrainedby 
    ThermalPower.SubComponents.HeatTransfer.Pipes.Interfaces.Tubes                                                                      annotation(Dialog(group="Heat Transfer model"),choicesAllMatching);
  parameter Integer n(min=1) "Total discretization number";
  parameter Modelica.SIunits.Area[n] A "Flow cross sectional area";
  parameter Modelica.SIunits.Area[n] A_heat
    "Heat transfer area (per channel)";
  parameter Modelica.SIunits.Length L
    "Channel length (total length in case of discretized channel)";
  parameter Modelica.SIunits.Length[n] Dhyd "Hydraulic diameter";
  parameter Real[n] n_channels(each min=1.0) = fill(1.0, n)
    "Number of parallel channels";
  parameter Real F_user = 1.0
    "user defined enhancement factor for heat transfer"
      annotation (Dialog(tab="Advanced"));
  parameter Modelica.SIunits.Pressure pcrit = Medium.criticalPressure
    "Critical pressure of fluid for boiling correlations";
    parameter Boolean TubeOrientationHorizontal=true
    "Horizontal tubes: true; vertical tubes: false"
    annotation (Dialog(group="Geometry"), Evaluate=true);
  parameter Boolean staggeredTubes=false
    "Staggered or inline tube arrangement"
    annotation (Dialog(group="Geometry"), Evaluate=true);
  parameter Integer numberOfTubeRows(min=1)=1 "Number of tube rows" annotation (Dialog(group="Geometry"), Evaluate=true);

  input Modelica.SIunits.MassFlowRate m_flow[n] "mass flow" annotation(Dialog(group="Inputs"));

  input Modelica.SIunits.Pressure p[n] "Pressure" annotation(Dialog(group="Inputs"));
  input Modelica.SIunits.SpecificHeatCapacity cp[n] "specific heat capacity" annotation(Dialog(group="Inputs"));
  input Modelica.SIunits.ReynoldsNumber Re[n] "Reynolds number" annotation(Dialog(group="Inputs"));
  input Modelica.SIunits.DynamicViscosity eta[n] "dynamic viscosity" annotation(Dialog(group="Inputs"));
  input Modelica.SIunits.ThermalConductivity lam[n] "thermal conductivity" annotation(Dialog(group="Inputs"));
  input Modelica.SIunits.FroudeNumber Fr[n] "Froude number" annotation(Dialog(group="Inputs"));
  input Modelica.SIunits.ReynoldsNumber Re_liq[n]
    "Reynolds number, boiling curve" annotation(Dialog(group="Inputs"));
  input Medium.PhaseBoundaryProps sat[n] "saturation properties" annotation(Dialog(group="Inputs"));
  input Real[n] twoPhaseFraction
    "fraction of the overall control volume with two-phase conditions"  annotation(Dialog(group="Inputs"));

   HeatTransfer heatTransfer(
     redeclare package Medium=Medium,
     TubeOrientationHorizontal=TubeOrientationHorizontal,
     staggeredTubes=staggeredTubes,
     numberOfTubeRows=numberOfTubeRows,
     n=n,
     A=A,
     A_heat=A_heat,
     L=L,
     Dhyd=Dhyd,
     F_user=F_user,
     m_flow=m_flow,
     T=q_fluid.T,
     T_wall=q_wall.T,
     p=p,
     cp=cp,
     Re=Re,
     eta=eta,
     lam=lam,
     Fr=Fr,
     Re_liq=Re_liq,
     sat=sat,
     twoPhaseFraction=twoPhaseFraction,
     Q_s=q_wall.Q_flow);

  Thermal.Interfaces.HeatPort_a q_wall[n]
                                      annotation (Placement(
        transformation(extent={{10,88},{-10,108}}, rotation=0),
        iconTransformation(extent={{10,88},{-10,108}})));
  Thermal.Interfaces.HeatPort_a q_fluid[n]         annotation (Placement(
        transformation(extent={{10,-112},{-10,-92}},
                                                   rotation=0),
        iconTransformation(extent={{10,-112},{-10,-92}})));
equation 
  for i in 1:n loop
    q_wall[i].Q_flow+q_fluid[i].Q_flow=0;
    q_wall[i].Q_flow = heatTransfer.alpha[i] * n_channels[i] * A_heat[i] * (q_wall[i].T - q_fluid[i].T);
  end for;

  annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
            {100,100}}), graphics={      Line(
          points={{0,70},{0,40},{-20,30},{20,10},{-20,-10},{20,-30},{0,-40},{0,-70}},
          color={255,0,0},
          thickness=0.5),          Polygon(
          points={{-15,-65},{15,-65},{0,-90},{-15,-65}},
          lineColor={255,0,0},
          fillColor={255,0,0},
          fillPattern=FillPattern.Solid),Polygon(
          points={{-15,65},{15,65},{0,90},{-15,65}},
          lineColor={255,0,0},
          fillColor={255,0,0},
          fillPattern=FillPattern.Solid)}), Diagram(coordinateSystem(
          preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics),
    Documentation(revisions="<html>
<hr><p><font color=\"#E72614\"><b>Copyright &copy; 2004-2019, MODELON AB</b></font> <font color=\"#AFAFAF\"><br /><br /> The use of this software component is regulated by the licensing conditions for Modelon Libraries. <br /> This copyright notice must, unaltered, accompany all components that are derived from, copied from, <br /> or by other means have their origin from any Modelon Library. </font></p>
</html>",
        info="<html>
<h4>Description</h4>
<p>Generic heat transfer model where the heat transfer correlation is replaceable and is compatible with heat-correlations for two-phase correlations.</p>
<h4>Parametrization</h4>
<p>This model is parametrized by it&apos;s geometry and operating point. The operating point and  flow properties are specified as inputs and can therefore be variables that change with time.</p>
<h4>Assumptions</h4>
<ul>
<li>No heat storage</li>
</ul>
</html>"));
end HeatTransferTwoPhase;


Solution

  • Thanks for sharing. This will be updated in next release of Thermal Power Library from Modelon.

    br Per-Ola Larsson, Thermofluid team at Modelon