I don't see why can't use trig functions in this code - what problem are you seeing with it.
By the way, if you are using C++ (which is the forum you posted in), then the recommended form for new code is #include <cmath> instead of <math.h>.
I would also prefer to see constants in this form, again, if you are using C++ rather than traditional C:
Code:
const double gamma =1.4;
const double Pr=0.71;
const double mu_ref=1.7894e-5; // kg/(m*s)
...
This makes the constants have a type as well as a value, which means that the compiler has a better chance to help you get the code working right in the way that it gives warnings and uses function calls.
I'm not entirely sure if you can do this by assigning the result of functions, you may have to resort to one of two things: keep it as a define, or make it a const function that has inline prefix. For example:
Code:
inline const double uratio() {
return sqrt(1.707);
}
If the compiler is good, it will calculate sqrt of 1.707 as a constant, and replace the whole function with that constant value. If the compiler isn't that clever, it probably won't help to have the macro replacement with sqrt(1.707), but you need to calculate yourself the result of sqrt(1.707).
--
Mats