ThermofluidStream icon indicating copy to clipboard operation
ThermofluidStream copied to clipboard

Use 'redeclare' instead of 'final redeclare' for FluidConstants

Open tobolar opened this issue 2 years ago • 1 comments

Dymola's pedantic check complains the following.

Use 'redeclare' instead of 'final redeclare', since there are modifiers for components of the class FluidConstants.

  • Component declared as FluidConstants fluidConstants in class ThermofluidStream.Media.myMedia.IdealGases.Common.SingleGasNasa.
  • Attempted modification at component context: ThermofluidStream.Media.myMedia.Air.DryAirNasa.fluidConstants in ThermofluidStream.Media.myMedia.Air.DryAirNasa (and a plenty of single gas models).

Problem detected in (actually where DryAirNasa is used, not necessary to change the following models):

  • ThermofluidStream.ThermofluidStream.Examples.SimpleGasTurbine.mo, line 5
  • ThermofluidStream.ThermofluidStream.Examples.SimpleCoolingCycle.mo, line 9
  • ThermofluidStream.ThermofluidStream.Examples.VaporCycle.mo, line 5
  • etc.

Possible solution: deleting final in redeclaration of FluidConstants in class Media.myMedia.IdealGases.Common.SingleGasNasa could fix the problem.

tobolar avatar Mar 07 '23 10:03 tobolar

There are principally two possible solutions:

  1. short way: delete final in redeclaration of FluidConstants in TFS.Media.myMedia.IdealGases.Common.SingleGasNasa
  2. more effort but reliable: copy Modelica.Media of the next MSL release into TFS.Media.myMedia - since the "final redeclare" issue was resolved in https://github.com/modelica/ModelicaStandardLibrary/pull/3764. This is even reasonable when https://github.com/modelica/ModelicaStandardLibrary/pull/3825 would be merged and then the mass fraction function becomes standard in Modelica.Media package.

Which of the two solutions will be realized depends on when MSL and TFS will be released, and shall be decided right before the next TFS release.

tobolar avatar Jul 31 '23 11:07 tobolar