Calculating quality of refrigerant as it flows thru the evaporator or condenser can be done with NIST RefProp
http://www.nist.gov/srd/nist23.cfm
Not for the faint hearted, however. One should have an understanding of the various two-phase flow models. I find the Dukler model useful in this regard.
It would be helpful to understand
calculus to do the necessary math.
