Reputation: 41
I tried to develop a model of an Organic Rankine Cycle from scratch. The heat exchanger is the only dynamic submodel of the cycle, and it runs perfectly whenever I use water as the medium (both in single use and in a closed loop). However, since I want to change the medium from water to a refrigerant, for example, R245fa or R134a, I get the error message "Failed to differentiate the equation" and "Failed to reduce the DAE index." I was trying to use the XRG Media Library (within the ThermoFluidStream Library), but the media don't seem to work for this purpose so far. Why do I only get this error message when using refrigerants but not with water? Is it because there are some underlying functions that cannot be calculated within the XRG Media Library (for example I used functions like Medium.dDewDensity_dPressure
)? Again, the exact same model works with water, so I don’t believe I have any errors left in my code.
Has anyone experienced downloading/using/setting up the ExternalMedia Library with the CoolProp Media for Dymola 2023, and knows if these media support this kind of model? I tried downloading it, but I can’t seem to compile it. Same question with the TSMedia Library. I am afraid if I buy it, it will give me the same error.
I tried water as a medium. It worked. Just not any kind of refrigerant. Also I tried R134 from MSL.
Also didn't work.
Upvotes: 2
Views: 76
Reputation: 101
Try to avoid index reduction by modifying your balance equations or implement the index reduction manually.
Based on additional thermodynamic equations such as Clausius Clapeyron (https://en.wikipedia.org/wiki/Clausius%E2%80%93Clapeyron_relation), some balance equations might be rearranged so that the index reduction is not necessary. Try to find an analytical/thermodynamic solution to this problem.
Usually, the index reduction is caused by a constraint equation which connects two balance equations. This might happen on system level with two connected volumes as mentioned in the comment by matth. But this might also happen in a volume model if you add a constraint equation on a state variable (such as temperature constraint) or use der()
to differentiate some property.
We implemented derivatives for some properties in some medium models in TSMedia/TILMedia. How to define derivatives is described in https://www.claytex.com/blog/applying-derivatives-to-functions-in-dymola/ or https://specification.modelica.org/master/functions.html#derivatives-and-inverses-of-functions. The derivative of the saturated properties of the mentioned mediums is not implemented for the equation of state based models in our library, so you will get the same error. You try the freely available library from https://github.com/TLK-Thermo/TILMediaClaRa, but the desired mediums are not included. Using spline interpolation fluid property models, the derivative is implemented in TSMedia/TILMedia. We avoided index reduction when implementing the TIL Library.
Upvotes: 1