Metroscope-dev / metroscope-modeling-library

Modelica library to build physical models of nuclear and combined cycle gas power plants. Based on ThermoSysPro library
https://www.metroscope.tech/
Other
27 stars 1 forks source link

[FEATURE] Vapor fraction for WaterStream components #449

Open Aymeric-La opened 1 year ago

Aymeric-La commented 1 year ago

What is your precise need ?

Having developed a water medium model, i felt it would be useful to have vapor fractions here and there to check more easily if we are still in the good phase.

What solution do you see ?

I manually added an x_in and an x_out in each WaterStream/BaseClasses and in a few other components.

Do you see any other alternative ?

On a second thought, I think it would even be even better and easier to put vapor fractions directly in the WaterStream/Connectors Inlet and Outlet.

Little worry

As we must implement an if condition to determine in which thermodynamic state we are to calculate the vapor fraction, I wonder if we should recommand not to fix these vapor fractions as inputs of the model for convergence reasons. I think they should only be considered as indicators.

pierre-eliep-met commented 1 year ago

Thanks for the issue ! I agree it is relevant to know what is the current vapor fraction, we'll add that soon :)

pierre-eliep-met commented 1 year ago

I think we can't put that in the connectors, because of the stream connectors, and I don't think we can put equations in connectors, so it will have to be in base classes

Aymeric-La commented 1 year ago

Ok, I did not think about that. As I said, I have only put them in the four WaterStream/Baseclasses so that I can find them back in the exchangers for instance and I have also coded them in the pipes (the component itself, not the partial one). But doing this way, we do not really use the advantage of inheritance. And I guess putting it in the very basic flowmodel from the Partial package would not be very clean since it can be used for media other than water (meaning we would need a medium distinction in it to actually activate the vapor fractions or something like this I guess). So if you find a compromise it would be nice, otherwise, it is not a big problem, just a useful feature.

pierre-eliep-met commented 1 year ago

Agreed, it is a simple feature, but tricky to implement properly...