CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   A question about the access of properties? (

zouzhengkaoyan June 27, 2010 01:45

A question about the access of properties?
Hello! In the UDF of Fluent, is there any difference among the macro of MATERIAL_PROP( , ),generic property (name,c,t,prop,id,T)and C_***(c,t),such as MATERIAL_PROP(sp,PROP_RHO),generic property (name,c,t,PROP_RHO,id,T) and rho_s= C_R(cell, htread_s)?
Thank you in advanced!:)

TDi July 2, 2010 17:28

I think those must be the same thing. They're all macros defined by Fluent.

zouzhengkaoyan July 4, 2010 23:11

Thank you ! May be they are the same, but I find the results are not same using different macro!

gera October 31, 2014 02:56


As far as I can judge, the difference is following.

MATERIAL_PROP(sp,PROP_mu) returns the value of viscosity if it is constant. If we use power dependence on temperture the returned value is zero.

generic_property(c,t,PROP_mu,i,T) takes into account temperature in cell c; so we can use viscosity as a function of temperature, but I found that it does not work for power-law option. At the same time, it works well for polynomial option.

Does anybody know how to get viscosity of mixture component if viscosity has the power-law option?

Thank you!

ghost82 October 31, 2014 08:40

If you can't access the mixture viscosity when it is set to power-law, what do you think of write the udf for mixture power-law viscosity, declare as a global variable the mixture viscosity so you can access it in other macros?

gera October 31, 2014 08:49

I've done it. Of course, it works fine, but if I change viscosity in GUI of Fluent, I need to change my udf. This is inconvinient. So the idea was to use fluent for viscosity calculation. In that case if user changes the viscosity law, for example, to "kinetic" then udf-code automatically uses new viscosity dependence (not necessary to re-compile).

All times are GMT -4. The time now is 04:56.