Karthik R

This macro works best as a compiled UDF. So, going forward, please compile the code.

It almost seems like the temperature spots are observed because of the jumps in your Cp value. Are you seeing the correct Cp value based on your temperature range?

I have another idea. What if you were to use Fluent Expressions instead of the UDF? You should be able to write out conditional statements using expressions. Since all your Cps are analytical expressions, theoretically, you should be able to write out this expression?

Looking forward to hearing what you find.