|
[Sponsors] |
March 27, 2021, 03:49 |
UDF for electric flux in diffusion
|
#1 |
Member
L.A.Isanka
Join Date: Jul 2020
Posts: 55
Rep Power: 6 |
Hello!
I am trying to simulate the diffusion of nanoparticles under an electric field. There are both diffusion flux and electric flux. My objective is to model this as a homogeneous mixture, considering the effect of the electrostatic force on each nanoparticle flux. 𝐽 = −D 𝜕𝐶/𝜕𝑥 + (𝑣_𝑒𝑚 + 𝑣_𝑒𝑜 )𝐶 where, 𝑣_𝑒𝑚 = electro migration velocity 𝑣_𝑒𝑜 = 𝑒𝑙𝑒𝑐𝑡𝑟𝑜 𝑜𝑠𝑚𝑜𝑠𝑖𝑠 𝑣𝑒𝑙𝑜𝑐𝑖𝑡𝑦 C = concentration I am planning to use fluent species transport model with a UDF to add the flux due to the electrostatic field ( the part indicated in red colour). Can someone please help me with this? What is the macro I should use to define the electrostatic flux? Please help! Thank you. |
|
April 2, 2021, 22:42 |
|
#2 |
Member
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 51
Rep Power: 19 |
Use DEFINE_SOURCE
|
|
April 25, 2021, 02:30 |
|
#3 |
Member
L.A.Isanka
Join Date: Jul 2020
Posts: 55
Rep Power: 6 |
Hello Yasser,
Thank you for your reply. I wrote the following code to add the term mentioned above. #include "udf.h" #include "mem.h" Thread *t; cell_t c; face_t f; DEFINE_SOURCE(electrostatic_flux,c,t,dS,eqn) { real source,x,d,v,con; x = C_YI(c,t,0); /* Species mass fraction */ d = C_R(c,t); con = x*(d/104); v = 17.6131*pow(10,(-10)); source = con*v; return source; } This code compiles and runs without any error. But I haven't added the dS term which is defined for source terms macro in UDF manual. Can someone please tell me whether it is necessary to add the dS term for source terms macro? Thank you! |
|
Tags |
diffusion, mass flux, species transfer |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
Doubt - Variable Heat Flux input - UDF | Neethu_N | FLUENT | 1 | December 19, 2017 12:48 |
Difficulty with UDF code for HEAT FLUX | etudiant_IITB | Fluent UDF and Scheme Programming | 1 | December 7, 2015 09:07 |
UDF for UDS flux | gyf135 | Fluent UDF and Scheme Programming | 0 | October 13, 2015 21:02 |
UDF Mass flux computing | Carlo | FLUENT | 6 | November 23, 2014 22:59 |