|
[Sponsors] |
UDF Macro for Mass Diffusivity using Kinetic Theory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 6, 2018, 09:08 |
UDF Macro for Mass Diffusivity using Kinetic Theory
|
#1 |
Member
Emerson
Join Date: May 2018
Posts: 35
Rep Power: 8 |
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. |
|
December 6, 2018, 11:42 |
|
#2 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
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 |
|
December 6, 2018, 12:49 |
|
#3 |
Member
Emerson
Join Date: May 2018
Posts: 35
Rep Power: 8 |
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 |
|
December 6, 2018, 14:12 |
|
#4 |
Member
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 61
Rep Power: 12 |
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.
|
|
December 6, 2018, 20:11 |
|
#5 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
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 |
|
May 28, 2019, 15:28 |
|
#6 |
Senior Member
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9 |
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? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Diffusivity UDF in Fluent | max.kozak | Fluent UDF and Scheme Programming | 0 | April 4, 2018 20:16 |
UDF for anisotropic diffusivity | Zerzura | Fluent UDF and Scheme Programming | 2 | December 20, 2015 10: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 11:00 |
what does FLUID_THREAD_P(t) macro do in udf? | borhan_sd@yahoo.com | Fluent UDF and Scheme Programming | 2 | June 10, 2013 06:49 |
solid kinetic theory | wan xiaotao | Main CFD Forum | 6 | August 10, 1999 19:43 |