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

body force as distance

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 4, 2014, 20:08
Default body force as distance
  #1
New Member
 
Join Date: Mar 2009
Posts: 7
Rep Power: 9
microfin is on a distinguished road
Hello,

I am trying to assign the body force for DPM model.
It is the magnetic force form and I've modified the existing udf file as follows.
When I compile it, I get the following warning message.

"warning C4700: uninitialized local variable 'x' used"

Could you help me if there is any problem with this udf?

Thanks in advance.

#include "udf.h"
#define Q 1.0
#define BZ 3.0
DEFINE_DPM_BODY_FORCE(particle_body_force,p,i)
{
real x[ND_ND];
real bforce=0;
if(i==0) bforce=Q*BZ*P_VEL(p)[1]/sqrt(x[0]*x[0]+x[1]*x[1])/pow(10,10);
else if(i==1) bforce=-Q*BZ*P_VEL(p)[0]/sqrt(x[0]*x[0]+x[1]*x[1])/pow(10,10);
else bforce=0;
return (bforce/P_MASS(p));
}
microfin is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActuatorDiskExplicitForce in OF2.1. Help be_inspired OpenFOAM Programming & Development 8 July 3, 2014 10:54
force convergence problems in CFX 6DOF rigid body solver ajay_ks CFX 8 March 25, 2013 05:02
Force can not converge colopolo CFX 13 October 4, 2011 22:03
Body force at the cell face Souviktor Fluent UDF and Scheme Programming 0 March 31, 2009 08:54
UDF for lift force on a bluff body sawa FLUENT 2 April 11, 2005 03:06


All times are GMT -4. The time now is 03:56.