# DPM body force to express electric forces

 Register Blogs Members List Search Today's Posts Mark Forums Read

October 30, 2012, 15:20
#21
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by Payam89 Hi I have a Electric field in my flow in FLUENT which it's function is E=Q/2*pi*E0 (1/X +1/S-X ) Q=1 electric charge pi=3.141 E0=electric permability X= x direction S=1.87 cm please help me to write a UDF Should i use MHD? PLEASEEE.....
Hi,

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

Join Date: Oct 2012
Posts: 32
Rep Power: 5
Quote:
 Originally Posted by Amir Hi, 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,
Thank you

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. UDS-0 :- source = -( C_UDSI(c,t,1) ) / (8.8514e-12) ; dS[eqn] = 0 ; return source ; UDS-1:- 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)*2e-4; /* 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 UDS-1 (charge density) when I initialise it with anything except zero. If I initialise UDS-1 with 0 then the residual monitors of UDS-1 instantly go to e-43 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 UDS-1 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 Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post elah599 Fluent UDF and Scheme Programming 52 June 17, 2012 07:38 wwt650420 FLUENT 8 January 6, 2012 21:06 colopolo CFX 13 October 4, 2011 22:03 Sandilya Garimella FLUENT 1 April 8, 2008 03:30 Sandilya FLUENT 0 May 21, 2007 13:32

All times are GMT -4. The time now is 23:54.