modelica-3rdparty / OpenHydraulics

A free Modelica package providing components describing 1-dimensional fluid flow in hydraulic circuits.
BSD 3-Clause "New" or "Revised" License
39 stars 25 forks source link

Bugs in GenericOil, real-equality-with-0 #11

Closed harmanpa closed 11 years ago

harmanpa commented 11 years ago

GenericOil references a type, Density, and a variable, T, neither of which is defined. Density is presumably SI.Density, T should be Toperating as this is done in dynamicViscosity()? (Though I'm not sure if a function should access a parameter in the enclosing scope).

ConstVolumeSource contains an if-equation that compares a Real parameter q with 0, however since the right-hand-side of the resulting equation is multiplied by q the same effect can be achieved by forcing q to be evaluated.

Other change (removal of Streams.print() in favor of assert()) in previous pull-request has been reverted

xogeny commented 11 years ago

I tried this version and everything seems to work with the Example. Ideally, we should add a bunch of test cases (using XogenyTest?) so that future submissions can really be tested. I planned a blog post about testing and hydraulics, perhaps I can write some test cases here and blog about them.

Anyway, these changes are in.