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

Problem with UDF for Electrohydrodynamic Flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 1, 2014, 22:39
Default Problem with UDF for Electrohydrodynamic Flow
  #1
New Member
 
Paul
Join Date: Oct 2013
Posts: 8
Rep Power: 12
pxc3536 is on a distinguished road
I've written a UDF for electrohydrodynamic flow through a electrostatic precipitator like shown in attachments. I think I've got the UDF down for the most part, but a few problems remain.

/************************************************** *********************/
/* udsfluxes.c */
/* UDF for specifying fluxes on user scalars */
/* scalar 0 (pos ions) have normal flux, scalar 1 (elec potential) has no flux */
/************************************************** *********************/
#include "udf.h"
#include "surf.h"
#include "dpm.h"
#include "sg.h"

DEFINE_UDS_FLUX(udsfluxes, f,t,i)
{
real a;
if (i == 0)
{
a = F_FLUX(f,t);
}
else
{
a = 0;
}
return a;
}

/************************************************** ********************
UDF that computes diffusivity for user-defined
scalars. diff = k*temp*mob*C_R(c,t)/e;
************************************************** *********************/



DEFINE_DIFFUSIVITY(uds_diffs, c, t, i)
{
real diff;
real k=1.381e-23;
real temp=300;
real mob=2.4e-6;
real e=1.6e-19;

if (i == 0)
{
diff = 0;
}
else
{
diff = 8.854e-12;
}
return diff;
}


/************************************************** ****************/
/* UDF that adds source term and derivative for scalar potential equation (scalar 1)*/
/************************************************** ****************/

DEFINE_SOURCE(potential_source, cell, thread, dS, eqn)
{
real source;
real prho;

/* source term */
prho = C_UDSI(cell,thread, 0);
source = -prho;

/* derivative of source term w.r.t. potential */
dS[eqn] = 0;

return source;
}

DEFINE_PROFILE(rhowire_profile, thread, position)
{
real A[ND_ND];
real ds;
real es[ND_ND];
real A_by_es;
real dr0[ND_ND];
real flux;
face_t f;
Thread *t0;
cell_t c0;
real epsilon = 8.854e-12;
real E0 = 32.3*pow(10.0,5.0)*1.0 + 0.846*pow(10.0,5.0)*sqrt(1.0/0.0015);
//for(ID=7;ID=9;ID++)
//{
if (! Data_Valid_P()) return;/* Zone ID for wall-3 zone from Boundary Conditions panel */
begin_f_loop(f, thread) /* loops over all faces in the thread passed
in the DEFINE macro argument */
{
BOUNDARY_FACE_GEOMETRY(f,thread,A,ds,es,A_by_es,dr 0);
c0 = F_C0(f,thread);
t0 = THREAD_T0(thread);
if (NULLP(T_STORAGE_R_NV(t0,SV_UDSI_G(1))))
{
F_PROFILE(f,thread,position)=0.;
}
else
{
F_PROFILE(f, thread, position) = -epsilon/ds*((NV_MAG(C_UDSI_G(c0,t0,1))-E0));
}

}
end_f_loop(f, thread)

}



My first doubt is whether I am implementing the boundary condition for charge at the wire correctly. The charge density at the wire must be iterated with the solution because it is only partially fixed by the electric field value at the wire. Some papers suggested underrelaxation but I didnt' know how to implement. My second question is that for the user defined scalar 0 which is the space charge density, the diffusivity for the scalar is zero. Therefore, the transport equation has only convective terms. In this case, I should only be required to specify the boundary at the wire since the equation is first order. However, Fluent is requiring me to specify boundary conditions at all boundaries. Is there a way to specify the BC at other locations to be part of the solution or avoid specifying them entirely? Any help is greatly appreciated thank you. Please let me know if I need to provide more details.
Attached Images
File Type: jpg electrostatic precipitator.jpg (25.5 KB, 149 views)
pxc3536 is offline   Reply With Quote

Old   March 10, 2014, 05:52
Default
  #2
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 14
msaeedsadeghi is on a distinguished road
Hi Paul,
Why are you writing the UDF? Isn't better to use FLUENT MHD module?
msaeedsadeghi is offline   Reply With Quote

Old   March 10, 2014, 14:36
Default
  #3
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
@ PXC,
I didn't take your point regarding the first question. But for the second one, you can simply specify zero flux (zero gradient) for all the B.Cs. except the ones you know the value before. If you don't do that, Fluent do it itself for all wall B.Cs.
regards
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   March 20, 2014, 12:39
Default
  #4
New Member
 
Paul
Join Date: Oct 2013
Posts: 8
Rep Power: 12
pxc3536 is on a distinguished road
I was able to solve my problem, thanks for the replies. The zero flux boundary conditions for all other boundaries except the wire was correct and it turns out that a very strong underrelaxation factor is required. Also, it is important you give time for the electric potential equation residuals to settle down before updated the boundary condition for ion charge density at the wire.
pxc3536 is offline   Reply With Quote

Old   March 21, 2014, 03:57
Default
  #5
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 14
msaeedsadeghi is on a distinguished road
Do you know what is particle charge density in Fluent material panel? It is zero by default. Where can I find the real value for it?
msaeedsadeghi is offline   Reply With Quote

Old   March 27, 2014, 16:30
Default
  #6
New Member
 
Paul
Join Date: Oct 2013
Posts: 8
Rep Power: 12
pxc3536 is on a distinguished road
I obtained particle charge density values using semi-empirical models. I don't know of any particle charge database in Fluent. "Evaluation of various particle charging models for simulating particle dynamics in electrostatic precipitators" by Zhengwei Long, QiangYao has many different models.
pxc3536 is offline   Reply With Quote

Reply

Tags
boundary condition, electrostatic, udf and programming, uds


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
Review: Reversed flow CRT FLUENT 1 May 7, 2018 05:36
Convergence problem with target mass flow rate ADL FLUENT 2 May 29, 2012 21:11
transient, impregnating flow problem fgommer FLUENT 0 February 29, 2012 16:10
compatibility problem of UDF on LINUX manu FLUENT 4 December 19, 2007 04:58
fluid flow fundas ram Main CFD Forum 5 June 17, 2000 21:31


All times are GMT -4. The time now is 20:49.