﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1952	SCodeDependency removes necessary classes in some cases	Adrian Pop	somebody	"Run this:
{{{
loadModel(Modelica, {""3.2.1""}); getErrorString();
saveTotalSCode(""BranchingDynamicPipes.mo"", Modelica.Fluid.Examples.BranchingDynamicPipes); getErrorString();
}}}
Have a look at file BranchingDynamicPipes.mo.\\
It contains inside SingleGasNasa:\\
{{{
          function T_h 
            extends Modelica.Icons.Function;
            input SpecificEnthalpy h;
            output Temperature T;

          protected
            package Internal 
              extends Modelica.Media.Common.OneNonLinearEquation;
              redeclare function extends solve end solve;
            end Internal;
          algorithm
            T := Internal.solve(h, 200, 6000, 100000.0, {1}, data);
          end T_h;
}}}
Now have a look at the real code of SingleGasNasa.T_h:
{{{
  function T_h ""Compute temperature from specific enthalpy""
    extends Modelica.Icons.Function;
    input SpecificEnthalpy h ""Specific enthalpy"";
    output Temperature T ""Temperature"";

  protected
  package Internal
      ""Solve h(data,T) for T with given h (use only indirectly via temperature_phX)""
    extends Modelica.Media.Common.OneNonLinearEquation;
    redeclare record extends f_nonlinear_Data
        ""Data to be passed to non-linear function""
      extends Modelica.Media.IdealGases.Common.DataRecord;
    end f_nonlinear_Data;

    redeclare function extends f_nonlinear
    algorithm
        y := Modelica.Media.IdealGases.Common.Functions.h_T(
                 f_nonlinear_data,x);
    end f_nonlinear;

    // Dummy definition has to be added for current Dymola
    redeclare function extends solve
    end solve;
  end Internal;

  algorithm
    T := Internal.solve(h, 200, 6000, 1.0e5, {1}, data);
  end T_h;
}}}
As you can see some rather important parts were removed:
{{{
redeclare record extends f_nonlinear_Data ...
redeclare function extends f_nonlinear ...
}}}
"	defect	closed	high	1.9.0	Frontend	trunk	fixed		Per Östlund Adrian Pop
