root/branches/maintenance/2.2.1/Modelica/Media/req_changes.txt

Revision 463, 15.5 kB (checked in by hubertus, 22 months ago)

Created maintenance version from Dynasims version with minimal changes (no checksum, 1 graphics, a few improved documentation places, structurallyIncomplete annotations in Visualizers)

Line 
1REQUESTED CHANGES TO MODELICA.MEDIA
20.
3Add package constants for all physical data that is needed by physical
4property estimation routines, and add to NASA data were available.
5Initial list:
6Molar Masses
7Critical Temperature, Pressure and Volume/Density
8Accentric factor
9Dipole Moments
10? Association factors
11
12scalar for pure substance, vector otherwise
13
141.
15Remove references to "gas" from Interfaces.PartialMixtureMedium
16---
17Date submitted: 13 Jan 2005 by: Francesco Casella
18Date fixed: 2005-01-14 by: Hubertus
19---
20
212.
22IdealGases.Common.SingleGas should probably be renamed to
23IdealGases.Common.SingleGasNasa for uniformity reasons
24---
25Date submitted: 13 Jan 2005 by: Francesco Casella
26Date fixed: 2005-01-14 by: Hubertus
27---
28
293.
30Interfaces.TemplateMedium should be updated with the last changes
31(add R=0 to BaseProperties, new nX and reducedX, etc.)
32It should be tested by creating a new, simple medium model from scratch
33just before the release of the library
34---
35Date submitted: 13 Jan 2005 by: Francesco Casella
36Assigned to: Francesco
37Date fixed: None by: None
38---
39
404.
41References to Prandtl and Brigdman are sometimes misspelled throughout
42the library
43---
44Date submitted: 13 Jan 2005 by: Francesco Casella
45Date fixed: 2005-01-14 by: Hubertus
46---
47
485.
49A final check of all the "restricted" WaterIF97 models should be performed,
50some of them, though restricted, do not perform better than the base model,
51and should then probably be removed.
52---
53Date submitted: 13 Jan 2005 by: Francesco Casella
54Assigned to: Francesco (keep me posted, Hubertus)
55Date fixed: None by: None
56---
57
586.
59Add WaterIF97_ph models, restricted to Region 1 and to Region 2, to
60allow for faster performance.
61---
62Date submitted: 13 Jan 2005 by: Francesco Casella
63Assigned to: Francesco Casella (?)
64Date fixed: None by: None
65---
66
677.
68The unit type used for the Volumetric coefficient of thermal expansion
69[Bejan], a.k.a. volume expansivity or beta coefficient, is called
70RelativePressureCoefficient. Although the actual unit is OK (1/K),
71this has nothing to do with pressure, so the name should be changed.
72----
73Date submitted: 13 Jan 2005 by: Francesco Casella
74Date fixed: 2005-01-14 by: Hubertus
75---
76
778.
78Function Interfaces.PartialMixtureMedium.density_derX requires the molar
79mass of the mixture as an input. Although this can be useful for ideal gas
80mixtures, it is probably of no use, e.g., for liquid mixtures. Therefore,
81it is probably better to remove it as an input, and to add it to the
82ThermodynamicState vector.
83Comment: I dissagree on that issue: the ThermodynamicState vector
84should be minimal if possible. But: this shows the need that a lot
85more package constants are needed, molar masses, critical data and the like.
86
87I fixed it a little differently: a new function mixtureMolaMass that
88takes state as input. It works for ideal gas mixtures.
89
90Name later changed to molarMass, since it also applies to pure media.
91----
92Date submitted: 13 Jan 2005 by: Francesco Casella
93Assigned to: Hubertus
94Testing assigned to: Francesco
95Date fixed: 2005-01-14 by: Hubertus
96Date fixed: 2005-02-17 by: Francesco
97---
98
999.
1001) Nasa vs. NASA: this is consistent: as part of a function or class
101name nameNasa, if by itself NASA
102* The spelling should be "discontinuous" and "monatomic" in the documentation of SingleGas that currently reads "A few of the data sets for monoatomic gases have a discontinous 1st derivative at 1000K, but this never caused problems so far."
103[The first I saw myself - the second I detected when using spell-checking in word, and Webster confirmed it.]
104* The Media-model should be SingleGas (singular) as you wrote in req_changes.txt.
105
106Date submitted: 13 Jan 2005 by: Hans
107Date fixed: 2005-01-14 by: Hubertus
108
10910.
110 Renaming of cp and cv
111Date fixed: 2005-01-16 by: Hubertus
112---
113
11411.
115Modelica_Media.Interfaces.PartialMixtureMedium.ThermodynamicState already contains p,T,X.
116Although fairly sophisticated models would probably just need those
117variables, an incompressible fluid model (e.g.) won't need the pressure
118p by definition. I would thus remove those declarations, and leave to
119each single medium model the task to declare its own state variables, as
120it's done with media extending PartialMedium.
121---
122Date submitted: 17 Jan 2005 by: Francesco Casella
123Assigned to: None
124Testing assigned to: None
125Date fixed:  by: None
126---
127
12812.
129Modelica_Media.Interfaces.PartialMixtureMedium.BaseProperties.MM
130This is surely needed for ideal gas mixtures, but maybe not for other
131models (e.g. for liquid mixtures). Same cure, remove from here and add
132to IdealGas.MixtureGasNasa.* models.
133---
134Date submitted: 17 Jan 2005 by: Francesco Casella
135Assigned to: None
136Testing assigned to: None
137Date fixed:  by: None
138---
139
14013.
141Modelica_Media.Interfaces.PartialMixtureMedium.BaseProperties.h_component[]
142Externally supplied media models (e.g. foreign C models) could supply the total
143mixture enthalpy h, but not the componentwise enthalpy. It is of course possible
144to set them to zero, but maybe it's better to remove this from the standard
145interface and to add it to gas mixture models as well.
146---
147Date submitted: 17 Jan 2005 by: Francesco Casella
148Assigned to: None
149Testing assigned to: None
150Date fixed:  by: None
151---
152
15314.
154Component molar masses in current IdealGases NASA models are contained
155in the package "data" record. Unfortunately, this datum, which can be
156important when dealing with chemical reactions, is not included in any
157generic medium interfaces. I'd suggest adding it to the PartialMixtureMedium
158interface.
159---
160Date submitted: 17 Jan 2005 by: Francesco Casella
161Assigned to: None
162Testing assigned to: None
163Date fixed:  by: None
164---
165
166
16715.
168o Dimension of nX is number of substances (nX=1 for one substance)
169o Changed size(substanceNames,1) everywhere to nX
170o Changed p_reference to reference_p
171  Changed referenceX  to reference_X
172o Changed SimpleMedium to PartialSimpleMedium
173o Introduced "MM_const" in PartialSimpleMedium
174o Set MM_const=18.016e-3 for ConstantPropertyLiquidWater
175---
176Date submitted: 21 Jan 2005 by: Martin Otter
177Assigned to: None
178Testing assigned to: None
179Date fixed:  by: Martin Otter
180
181
18216) Fixing viscosity and thermal conductivity for gases and consistent
183addition of data as it becomes available:
184
185Current situation:
186The currently implemented functions for ideal gas viscosity and
187thermal conductivity don't follow the standard for all other functions
188that have the state record as input. They can't: they require data
189that is not yet present in Modelica.Media.
190
191In order to fix the situation, more data is needed, and if the input
192convention is to be kept, the data has to be present in the form of
193package constants.
194
195The following constants are currently declared in the Media package:
196
197In PartialMedium
198    constant String mediumName "Name of the medium";
199    constant String substanceNames[:]= fill("",0) "Names of the mixture substances. Set substanceNames=fill(\"\",0) if only one substance.";
200    constant String extraPropertiesNames[:]= fill("",0) "Names of ... Set extraPropertiesNames=fill(\"\",0) if unused";
201    constant Boolean incompressible "= true, if medium is incompressible (i.e., density = constant)";
202    constant Integer nX =  if size(substanceNames, 1) > 1 then size(substanceNames, 1) else 0;
203    constant MassFraction referenceX[nX] "Default composition of medium";
204    constant Integer nC =  size(extraPropertiesNames,1) ;
205    constant AbsolutePressure p_reference = 101325 "reference pressure of Medium: default 1 atmosphere";
206
207In PartialPureSubstance:
208    constant String iupacName "complete IUPAC name";
209    constant String casRegistryNumber "chemical abstracts sequencing number";
210    constant String chemicalFormula "Chemical formula, (brutto, nomenclature according to Hill";
211    constant String structureFormula "Chemical structure formula";
212
213
214The following additional constants are needed to compute viscosity and
215thermal conductivity:
216
217criticalPressure
218criticalTemperature
219criticalDensity (or criticalVolume)
220molarMass
221dipoleMoment
222
223They could be in a record for each pure component, and a vector of
224records for each mixture, parallel to the heat capacity data from
225NASA. Most of the above are already defined the the record
226FluidConstats for two phase media, which would instead be "redeclare
227extends" from the basic one.
228
229Except for the molar mass, none of these is available in the NASA
230data. The NASA data comes with extra coefficients for viscosity in an
231extra file, but for much fewer components, and complex to use in
232mixtures due to separate "interaction parameters" for each pair of
233gases in a mixture. I have acess to a few hundred sets of
234critical data, but far less than the NASA-coefficients, and not even a
235proper subset.
236
237This highlights particular problems with medium data:
2381) Data has to be obtained and used from different sources.
2392) The situation changes yearly.
2403) Users need a simple means to take some data from Modelica.Media,
241and add their own when they have better data (subscription to a
242particularly "good" property databases comes at 36 000 Euro/year
243
244Obviously the best solution would be to completely separate the data
245from the model, and query the data on demand from a database (unless
246you run embedded of course).
247
248A solution that takes this situation into account should at least do
249the following:
2501) Each "data-source" that is used in Modelica.Media should have a
251name (e.g. the NASA-data comes from 1 public file that is widely used,
252the critical data that I have comes from a book, etc.)
2532) Each medium package should have a set of Booleans (a data
254structure) that lets a user query what data is available, and from
255what source it comes. This data structure can grow as we get access to
256more data. See a suggestion that covers the current status below.
257
258
259record DataSources "data sources"
260constant Boolean hasIdealGasHeatCapacity=false "true if ideal gas heat capacity is available";
261constant String idealGasHeatCapacitySource="none" "data source for ideal gas heat capacity coefficients";
262constant Boolean hasCriticalPressure=false "true if critical pressure is known";
263constant Boolean hasCriticalTemperature=false "true if critical temperature is known";
264constant Boolean hasCriticalVolume=false "true if critical volume is known";
265constant String criticalDataSource="none" "source for critical data";
266constant Boolean hasFundamentalEquation=false "true if a fundamental
267equation";
268constant String fundamentalEquationSource="none" "source of the fundamental
269equation model";
270constant Boolean hasLiquidHeatCapacity=false "true if liquid heat capacity is available";
271constant Boolean hasSolidHeatCapacity=false "true if solid heat capacity is available";
272constant Boolean hasAccurateViscosityData "true if accurate data for
273a viscosity function is available";
274constant Boolean hasAccurateConductivityData "true if accurate data for
275a thermal conductivity function is available";
276end DataSources;
277
278For some of the NASA data, there are heat capacity coefficients for
279the solid state too.  Molar Mass is always known, and could be a
280separate package constant that has to be defined always.
281
282That data record should be part of every pure medium data set, or
283medium package if we don't separate it. Mixture models need a way to
284query what data is available for all of the mixture constituents and
285based on that, the best possible method for computing properties is
286selected. In the current situation that woudl mean: only when critical
287data and dipole moments of all species in a mixture are known can the
288viscosity be computed.
289
290Now that there are a number of string parsing functions in
291Modelica_Utilities, the critical data could be stored on file as a
292primitive database and parsed: no changes to the medium models are
293necessary as we get access to more data.
294
295The goal is, that this could even work with external data, using a
296user-supplied query function. The casRegistryNumber is the simplest
297generally accepted identifier for a substance.
298
299I would at least like to be able to compute viscosities and thermal
300conductivity for the most important technical gases, i.e. combustion
301poducts, natural gas mixtures, gaseous fuels, refrigerants, ... for the 1.0
302release.
303
304Date submitted: 27 Jan 2005 by: Hubertus
305
306
307======================================================================
308Martin Feb. 22 2005:
309
310
311Results of Modelica_Media.Examples.Tests
312
313- Models that are satisfactorily (they simulate,
314  static state selection and no non-linear system of equations)
315    Modelica_Media.Examples.Tests.MediaTestModels.Air.SimpleAir
316    Modelica_Media.Examples.Tests.MediaTestModels.IdealGases.SimpleNaturalGas
317    Modelica_Media.Examples.Tests.MediaTestModels.Water.ConstantPropertyLiquidWater
318    Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97OnePhase_ph
319    Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97_ph
320
321
322- Issues to be fixed by Dynasim (Sven Erik/Hans):
323  o Modelica_Media.Examples.Tests.MediaTestModels.Air.DryAirNasa
324    Modelica_Media.Examples.Tests.MediaTestModels.IdealGases.Air
325    Modelica_Media.Examples.Tests.MediaTestModels.Water.IdealSteam
326      two non-linear systems of equations of size 1 each
327      (the same reason for all media)
328
329  o Modelica_Media.Examples.Tests.MediaTestModels.Incompressible.Glycol47
330    Modelica_Media.Examples.Tests.MediaTestModels.Incompressible.Essotherm650
331      two non-linear systems of equations of size 1 each
332      (the same reason for both media)
333
334  o Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97_pT
335      two non-linear systems of equations of size 1 each
336 
337  o Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97_dT
338      three non-linear systems of equations of size {1,2,2}
339
340  o Modelica_Media.Examples.Tests.MediaTestModels.Air.MoistAir
341    When using a function in MoistAir
342        h = h_pTX(p,T,X_i);
343    instead of
344        h = h_component *{X_steam, X_air} + enthalpyOfLiquid(T)*X_liquid;
345    Dymola does not translate
346        Error for function: Modelica_Media.Air.MoistAir.h_pTX:der.
347    This was already reported to Hans.
348    When replacing the function by the equation, the test model
349    translates and simulates. There are two non-linear systems of
350    equations of size 1 each (this is understandable, since h is not
351    computed via a function).
352
353
354- Issues to be fixed by Hubertus and/or Jonas:
355  o Modelica_Media.Examples.Tests.MediaTestModels.Incompressible.Glycol47
356    Modelica_Media.Examples.Tests.MediaTestModels.Incompressible.Essotherm650
357      Simulation fails (wrong initial conditions?)
358
359    The table based media have the general problem that "u" is a function
360    of "pressure". Therefore, there will be two states "p,T", two
361    differential equations and two initial conditions. The flag
362    "incompressible" was introduced to define whether an initial condition
363    for "p" or "d" has to be provided. This means "incompressible" has to
364    be set to "false", since 2 initial conditions are needed. I have
365    changed the flag from "true" to "false". However, then the general
366    name for the package "Incompressible" is odd.
367
368  o Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97_pT
369    Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97_dT
370      Simulation fails. This is a bit strange, because simulation with
371      Modelica_Media.Examples.Tests.MediaTestModels.Water.WaterIF97_ph
372      works fine.
373
374  o PartialMixtureMedium has "p" as ThermodynamicState.
375    This is not true for incompressible mixtures.
376    Probably best to remove redeclaration of ThermodynamicState
Note: See TracBrowser for help on using the browser.