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

UDF Macro for Mass Diffusivity using Kinetic Theory

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By rewol
  • 1 Post By obscureed

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 6, 2018, 08:08
Default UDF Macro for Mass Diffusivity using Kinetic Theory
  #1
Member
 
Emerson
Join Date: May 2018
Posts: 35
Rep Power: 7
souza.emer is on a distinguished road
Hello everyone

I want to use the Kinetic Theory model for Mass Diffusivity and use its value, for each species, in a UDF to calculate the reaction rate. My question is, which macro should I use? Is it one of those two?

C_DIFF_L(c,t); Laminar species diffusivity

C_DIFF_EFF(c,t,i); Effective species diffusivity

If not, how can I call it?

Thanks for the attention.
souza.emer is offline   Reply With Quote

Old   December 6, 2018, 10:42
Default
  #2
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi there,

The macros that you mention are for accessing values, not setting them. For defining, look at DEFINE_DIFFUSIVITY. If you want to include the effects of turbulence on diffusion (which, in a turbulent situation, you definitely do), you need to add this to the diffusivity of a User-Defined Scalar. (The manual's example makes this clear.) For a species, I *think* turbulence effects are added separately -- this is what the Theory Guide appears to say, but I don't remember checking in detail.

But then, there is a built-in version of kinetic theory for diffusivity, and this uses the molecular masses, species by species. (In fact, it seems to calculate it for each species-species pair, which does not seem possible in the UDF. Hmm.)

Good luck!
Ed
obscureed is offline   Reply With Quote

Old   December 6, 2018, 11:49
Default
  #3
Member
 
Emerson
Join Date: May 2018
Posts: 35
Rep Power: 7
souza.emer is on a distinguished road
Hello

Yeah, I know that Macros are used for accessing the values, that's why I'm in doubt because I'm not sure of how I could use the value of diffusivity calculated by the Kinect Theory when I set this previously at the materials menu in Fluent.
I do not want to use the macro to modify the current diffusivity coefficient calculated by Kinect Theory theory, I just want to use the value which Fluent calculates.

I think you thought that I wanted to modify it, which I do not want to, yet.

Do you know how I can do this? Or make any suggestions?

Best
souza.emer is offline   Reply With Quote

Old   December 6, 2018, 13:12
Default
  #4
Member
 
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 53
Rep Power: 11
rewol is on a distinguished road
You can use DEFINE_NET_REACTION_RATE macro to calculate reaction rates and inside the code you can utilize C_DIFF_L(c,t) or C_DIFF_EFF(c,t,i) to access mass diffusivities of the species.
souza.emer likes this.
rewol is offline   Reply With Quote

Old   December 6, 2018, 19:11
Default
  #5
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi Souza.Emer,

Yes, you are correct that I assumed you wanted to define the values. Sorry, this is a more frequent request than accessing values in UDF (because you can access the values in normal postprocessing if you want).

For accessing the built-in values, without any turbulent influence, C_DIFF_L is what you want. But check the manual for syntax -- C_DIFF_L(c,t) is not correct.

You can do this accessing inside several types of UDF -- rewol mentions one, though that is specific to the kinds of model that will accept it. DEFINE_ON_DEMAND is a general option: first look up a domain pointer, then find some cell or face zones, and loop through some faces or zones.

Good luck!
Ed
souza.emer likes this.
obscureed is offline   Reply With Quote

Old   May 28, 2019, 14:28
Default
  #6
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
Weiqiang Liu is on a distinguished road
hello, can I ask a question under this thread?
I checked the syntax in manual and found the correct syntax is C_DIFF_L(c,t,i,j). I am wondering is the diffusion coefficient I am accessing with this macro is binary diffusion coefficient? what if I want to access mixture averaged diffusion coefficient or multi-component diffusion coefficient?
Weiqiang Liu is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Diffusivity UDF in Fluent max.kozak Fluent UDF and Scheme Programming 0 April 4, 2018 19:16
UDF for anisotropic diffusivity Zerzura Fluent UDF and Scheme Programming 2 December 20, 2015 09:37
the macro DEFINE_MASS_TRANSFER can't use as compile udf in ansys14.0 fangdian Fluent UDF and Scheme Programming 13 August 23, 2014 10:00
what does FLUID_THREAD_P(t) macro do in udf? borhan_sd@yahoo.com Fluent UDF and Scheme Programming 2 June 10, 2013 05:49
solid kinetic theory wan xiaotao Main CFD Forum 6 August 10, 1999 18:43


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