CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   diffusivity (https://www.cfd-online.com/Forums/fluent-udf/177713-diffusivity.html)

Ribes September 19, 2016 12:10

diffusivity
 
HI!
I wrote this code to define a different diffusivity for the air in the porous media and not porous media:
#include "udf.h"
DEFINE_DIFFUSIVITY(diffusion_coefficient,c,t,i)
if (C_POR(c,t)==1)
Diff=2.31*e5*101325/C_P(c,t)*pow(C_T(c,t)/273.15,1.81)
else
Diff=2.31*e5*101325/C_P(c,t)*pow(C_T(c,t)/273.15,1.81)*pow(C_POR(c,t),2.24)
return Diff

when I compile it gives parse error on line 3....is it because of the C_POR macro? I founded this notation in the forums..thanks for any help

Bruno Machado September 20, 2016 04:46

Quote:

Originally Posted by Ribes (Post 618499)
HI!
I wrote this code to define a different diffusivity for the air in the porous media and not porous media:
#include "udf.h"
DEFINE_DIFFUSIVITY(diffusion_coefficient,c,t,i)
if (C_POR(c,t)==1)
Diff=2.31*e5*101325/C_P(c,t)*pow(C_T(c,t)/273.15,1.81)
else
Diff=2.31*e5*101325/C_P(c,t)*pow(C_T(c,t)/273.15,1.81)*pow(C_POR(c,t),2.24)
return Diff

when I compile it gives parse error on line 3....is it because of the C_POR macro? I founded this notation in the forums..thanks for any help

if you dont say what error you got, we cant help you properly. at a first sight I can tell that you didnt put { and } to define the boundaries of your DEFINE_DIFFUSIVITY macro.

Ribes September 20, 2016 05:38

Thanks, I added the {} but now it tells me :
line 4: structure reference not implemented

Bruno Machado September 20, 2016 06:30

Quote:

Originally Posted by Ribes (Post 618581)
Thanks, I added the {} but now it tells me :
line 4: structure reference not implemented

have you defined the variables you used?

Ribes September 21, 2016 04:49

Yes...I think the problem is that I need to compile the function instead to just interpret it..I'm a little confused by the difference between this proceedings(I read also in the manual but it still isn't clear to me). When I compile it I get the error:

"RPC RCX_SC_SET_ERR_MSG failed: RPC: Can't encode arguments
The UDF library you are trying to load is not compiled for 2ddp on the current platform (win64)."
I haven't any spaces in the files name..is it an error in the code or in the systems settings?


All times are GMT -4. The time now is 18:01.