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

UDF for electric flux in diffusion

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yasser

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2021, 02:49
Default UDF for electric flux in diffusion
  #1
Member
 
L.A.Isanka
Join Date: Jul 2020
Posts: 55
Rep Power: 5
Achini is on a distinguished road
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.
Achini is offline   Reply With Quote

Old   April 2, 2021, 21:42
Default
  #2
Member
 
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 52
Rep Power: 19
Yasser is on a distinguished road
Use DEFINE_SOURCE
Achini likes this.
Yasser is offline   Reply With Quote

Old   April 25, 2021, 01:30
Default
  #3
Member
 
L.A.Isanka
Join Date: Jul 2020
Posts: 55
Rep Power: 5
Achini is on a distinguished road
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!
Achini is offline   Reply With Quote

Reply

Tags
diffusion, mass flux, species transfer


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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Doubt - Variable Heat Flux input - UDF Neethu_N FLUENT 1 December 19, 2017 11:48
Difficulty with UDF code for HEAT FLUX etudiant_IITB Fluent UDF and Scheme Programming 1 December 7, 2015 08:07
UDF for UDS flux gyf135 Fluent UDF and Scheme Programming 0 October 13, 2015 20:02
UDF Mass flux computing Carlo FLUENT 6 November 23, 2014 21:59


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