You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by hansolsson on 11 Jun 2015 13:23 UTC
Several functions in the Media library assumedly require that several input arrays have the same length - but that is not declared in the Modelica code.
It would be better to make that assumption explicit, and in case there is an error that will be detected more easily.
In case I am wrong and additional elements are allowed in some vectors that should be stated more clearly.
Examples with proposed changes (all the uses of size(y,1) below):
within Modelica.Media.IdealGases.Common.MixtureGasNasa;
function gasMixtureViscosity
"Return viscosities of gas mixtures at low pressures (Wilke method)"
extends Modelica.Icons.Function;
input MoleFraction[:] yi "Mole fractions";
input MolarMass[size(yi,1)] M "Mole masses";
input DynamicViscosity[size(yi,1)] eta "Pure component viscosities";
...
function mixtureViscosityChung
"Return the viscosity of gas mixtures without access to component viscosities (Chung, et. al. rules)"
extends Modelica.Icons.Function;
input Temperature T "Temperature";
input Temperature[size(y,1)] Tc "Critical temperatures";
input MolarVolume[size(y,1)] Vcrit "Critical volumes (m3/mol)";
input Real[size(y,1)] w "Acentric factors";
input Real[size(y,1)] mu "Dipole moments (debyes)";
input MolarMass[size(y,1)] MolecularWeights "Molecular weights (kg/mol)";
input MoleFraction[:] y "Molar Fractions";
input Real[:] kappa = zeros(nX) "Association Factors";
...
function lowPressureThermalConductivity
"Return thermal conductivities of low-pressure gas mixtures (Mason and Saxena Modification)"
extends Modelica.Icons.Function;
input MoleFraction[:] y "Mole fraction of the components in the gas mixture";
input Temperature T "Temperature";
input Temperature[size(y,1)] Tc "Critical temperatures";
input AbsolutePressure[size(y,1)] Pc "Critical pressures";
input MolarMass[size(y,1)] M "Molecular weights";
input ThermalConductivity[size(y,1)] lambda
Additionally h_TX in the same package should use 'nX' as size for the X input (since its derivative has this restriction).
(There are other functions that also allow a reduced X-vector.)
Comment by hansolsson on 17 Jun 2015 12:54 UTC
The package Modelica.Media.Interfaces.PartialRealCondensingGases should likely also use "nX" instead of ":" (same as h_TX above) - see also #1572
Reported by hansolsson on 11 Jun 2015 13:23 UTC
Several functions in the Media library assumedly require that several input arrays have the same length - but that is not declared in the Modelica code.
It would be better to make that assumption explicit, and in case there is an error that will be detected more easily.
In case I am wrong and additional elements are allowed in some vectors that should be stated more clearly.
Examples with proposed changes (all the uses of size(y,1) below):
Additionally h_TX in the same package should use 'nX' as size for the X input (since its derivative has this restriction).
(There are other functions that also allow a reduced X-vector.)
Migrated-From: https://trac.modelica.org/Modelica/ticket/1732
The text was updated successfully, but these errors were encountered: