CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

diffusivity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2016, 13:10
Default diffusivity
  #1
New Member
 
Join Date: Jul 2016
Posts: 13
Rep Power: 10
Ribes is on a distinguished road
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
Ribes is offline   Reply With Quote

Old   September 20, 2016, 05:46
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Ribes View Post
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.

Last edited by Bruno Machado; September 20, 2016 at 10:53.
Bruno Machado is offline   Reply With Quote

Old   September 20, 2016, 06:38
Default
  #3
New Member
 
Join Date: Jul 2016
Posts: 13
Rep Power: 10
Ribes is on a distinguished road
Thanks, I added the {} but now it tells me :
line 4: structure reference not implemented
Ribes is offline   Reply With Quote

Old   September 20, 2016, 07:30
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by Ribes View Post
Thanks, I added the {} but now it tells me :
line 4: structure reference not implemented
have you defined the variables you used?
Bruno Machado is offline   Reply With Quote

Old   September 21, 2016, 05:49
Default
  #5
New Member
 
Join Date: Jul 2016
Posts: 13
Rep Power: 10
Ribes is on a distinguished road
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?

Last edited by Ribes; September 21, 2016 at 06:26. Reason: didn't write the full error
Ribes is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kinematic Diffusivity - Problem with additional variable clau90 CFX 3 May 14, 2014 10:54
PEM modeling UDS diffusivity in mixture gemini FLUENT 6 August 7, 2012 08:37
What is UDS diffusivity of a self-defined material? aleisia FLUENT 0 March 5, 2011 23:08
Species Diffusivity in PEMFC Simulation circle2000 FLUENT 0 September 20, 2004 23:12
Species diffusivity zhou1 FLUENT 0 November 4, 2003 18:23


All times are GMT -4. The time now is 22:05.