
[Sponsors] 
October 30, 2012, 15:20 

#21  
Senior Member

Quote:
You have different options and one of them is implementation of MHD module, but it's not really necessary for such simple purpose. All you need is to add a source term to the NS equation; for this aim, refer to the UDF manual and read the explanation and examples of DEFINE_SOURCE macro. PS: The goal of this community is to learn you fishing not to provide a fish! Bests,
__________________
Amir 

October 31, 2012, 10:05 
Electric Field

#22  
Member
payamfadaei
Join Date: Oct 2012
Location: Mashhad/Iran
Posts: 32
Rep Power: 4 
Quote:
I didn't want a solution but I asked sb to help me to start writing my UDF. do you mean i can add a momentum source to NS equation? I don't think it is a matter if sb could help me by wrinting a UDF for me too! thank you Amir 

January 15, 2013, 08:49 

#23 
Member
Yanlong Li
Join Date: Jan 2013
Location: BeiJing
Posts: 47
Rep Power: 4 
Dear Qin,
I want to define Body force for particles in DPM Model, F=C*(density_liquid/density_particle)*(velocity_liquid  velocity_particle)*▽*velocity_liquid. the ▽*velocity_liquid is rotation of liquid. 1.Could you help me how to calculate this value ? 2.If I defined body force for particle and hooked it, do I need to define an oppsite force for the liquid? Does the FLUENT add this force to liquid automatically with an oppsite vector ? 

February 20, 2013, 14:23 

#24 
New Member
Raghuvir
Join Date: May 2012
Location: India
Posts: 2
Rep Power: 0 
Hi,I have a similar problem. I am working on adding a body force to navier stokes equation, which is a function of voltage and charge density.
I added Voltage and charge density as two UDS,0 and 1 respectively. For UDS'0' (volt), I use poissons potential equation i.e., del^2(V) = rho_q/enod. So,diffusivity is 1 and source term is charge_density/e_nod. For UDS'1', I use charge conservation equation. i.e., grad(charge_density*mu_constant*E) = 0 where E = grad(V). So, I use flux equation, calculate gradv term at face by taking average of two neighbour cells or zero if its boundary. UDS0 : source = ( C_UDSI(c,t,1) ) / (8.8514e12) ; dS[eqn] = 0 ; return source ; UDS1: NV_VS_VS(fluxvec, =, C_UDSI_G(c0,t0,0), * , 0.5, + , C_UDSI_G (c1,t1,0) , * , 0.5 ) ; flux = NV_DOT(fluxvec, A)*2e4; /* Average flux through face */ return flux; Model : two electrodes surrounded by air. one electrode with 27k volt and charge density as 0.016. another electrode with 0 volt and o charge density. PROBLEM : I get Nan values for UDS1 (charge density) when I initialise it with anything except zero. If I initialise UDS1 with 0 then the residual monitors of UDS1 instantly go to e43 values. But I see changes in UDS scalars only near electrodes and near domain boundaries, rest of the domain has constant UDS values. I Tried initialising without udf and then adding them after some iterations....but no luck. I am guessing its sth to do with flux equation in that UDS1 equation. Could anyone please help me with finding the error. 

August 1, 2013, 13:34 

#25 
New Member
Qin
Join Date: Feb 2012
Posts: 15
Rep Power: 5 
Since we can only take the gradient of a vector in FLUENT, to calculate laplacian of a vector whose value is stored in a UDS C_UDSI(c,t,0), for example two dimensional d2f/dx2+d2f/dy2, you can use one C_UDSI(c,t,1) to store df/dx (C_UDSI_G(c,t,0)[0]) and a second C_UDSI(c,t,2) to store df/dy(C_UDSI_G(c,t,0)[1]), then, take gradient of C_UDSI(c,t,1)[0] and C_UDSI(c,t,2)[1], then the laplacian = C_UDSI(c,t,1)[0]+C_UDSI(c,t,2)[1]


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UDF for body force in DPM  elah599  Fluent UDF and Scheme Programming  52  June 17, 2012 07:38 
StepbyStep Procedure for DPM body force  wwt650420  FLUENT  8  January 6, 2012 21:06 
Force can not converge  colopolo  CFX  13  October 4, 2011 22:03 
DPM Body Force  Sandilya Garimella  FLUENT  1  April 8, 2008 03:30 
DPM body force Doubt  Sandilya  FLUENT  0  May 21, 2007 13:32 