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

particle body force and scalar update.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2006, 07:53
Default particle body force and scalar update.
  #1
Kasper Skriver
Guest
 
Posts: n/a
Hi

I'm looking on particle transport between two plates subjected to a potential diff of 10kV.

The potential between the two plates has been defined as an user scalar, and calculated with boundary values 0 and 10kV. This is no problem.

The next step is modelling how the particles act in the potential field. First i define a charge of the particle as a scalar update(DEFINE_DPM_SCALAR_UPDATE). Then the body force as an additional acceleration DEFINE_DPM_BODY_FORCE. The code is at the bottom. Compiling works and loading does to.

When using these two UDF's in the discrete phase model I get the following error:
:>> Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () <<<

1. there is nothing but this event. 2. wont help. 3. same same. 4. they are a bit slow The error object is empty, why!!!!

I have an idea that it has something to do with the C_UDSI_G command, but I'm not sure.

Please help

-------------------------------------------- CODE:

#include "udf.h" #include "surf.h"

Particle *p;

DEFINE_DPM_SCALAR_UPDATE(charge,cell,thread,initia lize,p)

{

real P_charge_density;

if (initialize) /* only if init */

{

P_charge_density = - 1.e-3; /* [C/kg], if minus => negative charge */

p->user[0] = P_charge_density * P_MASS(p);

}

}

DEFINE_DPM_BODY_FORCE(elstat_force,p,i)

{

cell_t cell = P_CELL(p);

Thread *thread = P_CELL_THREAD(p);

real P_charge;

real NV_VEC(P_accelleration);

P_charge = -1.0 * P_USER_REAL(p,0); /* makes the gradient negativ */

NV_V(P_accelleration, =, C_UDSI_G(cell, thread, 0)); /*Coulomb force*/

NV_S(P_accelleration, *=, P_charge);

NV_S(P_accelleration, /=, P_MASS(p)); /* acceleration required */

return (P_accelleration[i]);

}
  Reply With Quote

Old   March 21, 2006, 10:55
Default Re: particle body force and scalar update.
  #2
RoM
Guest
 
Posts: n/a
There is nothing wrong with your code except the global "Particel *p;" which is not needed. It runs perfectly well on my machine. Maybe you did not allocate the particle scalar (define->models->discrete phase , in udf tab set number of scalars to 1)

RoM
  Reply With Quote

Reply


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
Adding side force to forceCoeffs.C drrbradford OpenFOAM Programming & Development 25 October 17, 2017 04:12
Tomiyama wall lubrication force Edy OpenFOAM 10 December 13, 2010 12:41
charged particle UDS, UDF JJi Fluent UDF and Scheme Programming 0 May 12, 2009 05:32
model particle movement under magnetic force phsieh2005 Main CFD Forum 8 March 28, 2007 08:12
How to see Scalar Force Datas? Tunc Siemens 1 September 20, 2005 11:24


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