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

DPM particle INITIALIZATION- A NOVICE NEEDS HELP

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2007, 14:45
Default DPM particle INITIALIZATION- A NOVICE NEEDS HELP
  #1
Sandilya
Guest
 
Posts: n/a
Hi all, I am new to writing UDFs. I am trying to track particles using DPM. At the inlet I am trying to put a random velocity distribution to the particles!!! How can I do that... What is the macro so that all the particles are referenced one after the other. I am giving the algorithm below... can anyone suggest the macros I need. I am new, so please let me know if there are any errors.....

Algorithm: #include "udf.h" #include "surf.h" /* RP_CELL and RP_THREAD are defined in surf.h */ #include "dpm.h"

DEFINE_DPM_INJECTION_INIT(init_vel,I) {

int j;

Particle *p;

cell_t cell;

Thread *cthread;

(LOOP OVER ALL PARTICLES) /*I need this MACRO*/

{

for(j=0;j<2;j++)

{

P_VEL(p)[j] = (some random number here generated using standard functions in C);

}

}

}

  Reply With Quote

Old   June 1, 2007, 15:40
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #2
A A S
Guest
 
Posts: n/a
I don't know if this will work, but I would try defining a surface injection. Correct me if I am wrong, but a surface injection injects particles thru the centroid of each cell face corresponding to the inlet thread. If this is the case, then you can loop over each cell (instead of particle loop) and set the particle velocity at each cell in the thread. Sorry I couldn't be more help.

regards AAS
  Reply With Quote

Old   June 4, 2007, 08:38
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #3
Henrik
Guest
 
Posts: n/a
Hello!

Actually, I would recommend not to loop over any cells or faces unless really necessary, as this is usually quite heavy. For the initialization of particles with the DPM model, use the DEFINE_DPM_INJECTION_INIT macro and then:

* if in steady-state mode, loop over I->p

EXAMPLE:

loop(p, I->p) { ... }

* if in unsteady or spray mode, use I->p_init

EXAMPLE:

loop(p, I->p_init) { ... }

I have done this several times and it works great. Good luck!

/Henrik
  Reply With Quote

Old   June 4, 2007, 10:13
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #4
Sandilya
Guest
 
Posts: n/a
Thank you very much for the response. I tried the loop(p,I->p_init) macro { mine is a unsteady case } But when I interpret it the following error comes

Error: C:\---\prtcl_init_condn.c: line 14: structure reference not implemented

This error is at the line of calling the loop(p,I->p_init) macro.

I dont know where teh error is.. Can you see the algorithm I gave and tell if there is some error?

Thank you

Bye Sandilya

  Reply With Quote

Old   June 4, 2007, 10:22
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #5
Henrik
Guest
 
Posts: n/a
Hi again

I cannot see what the error is... loop(p,I->p_init) should loop over all particles p that belong to the injection I for which the DEFINE-macro is called in an unsteady simulation (or a simulation using spray-related models), and I is passed to the macro by the solver. udf.h and dpm.h are all you need to include. It works fine for me in Fluent 6.2 but I have not yet tried it in Fluent 6.3... I don't know if there are any changes that will affect these things. Maybe you should want to try I->p only instead?

/Henrik
  Reply With Quote

Old   June 5, 2007, 11:02
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #6
A A S
Guest
 
Posts: n/a
Thanks Henrik, I wasn't aware of those macros for particle loops.

Cheers A A S
  Reply With Quote

Old   June 5, 2007, 11:07
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #7
Sandilya
Guest
 
Posts: n/a
Hi Henrik Thank you for your help. loop(p,I->p) also doesn't work. I am not understanding where the error.

I am trying to figure out the error.

If you find anything please let me know

Thank you

Sandilya
  Reply With Quote

Old   June 5, 2007, 11:11
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #8
R.
Guest
 
Posts: n/a
It would be easier to write your own routine (not a udf) that outputs the initial particle conditions to a file.

The file format is documented in the help files.

In the injector dialog box, under injector type, pick 'file'

R.

  Reply With Quote

Old   June 11, 2007, 11:50
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #9
Markus Alzon
Guest
 
Posts: n/a
Hey Henrik,

sorry for being that late, but I use the same approach as you do (looping over the particles). And this (sucessfully) with Fluent 6.3.

Greetings

MA

  Reply With Quote

Old   June 11, 2007, 11:53
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #10
Markus Alzon
Guest
 
Posts: n/a
What exactly do you mean, by "the error"?

I am using the loop, without any problems. Are there any particles set in during the calculation? If so, then your udf should be working. Maybe you can send us some parts of your udf?

Take care,

MA
  Reply With Quote

Old   June 11, 2007, 12:06
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #11
Sandilya
Guest
 
Posts: n/a
Thank you Markus The UDF that I am referring to is in the first post of this thread. I interpreted it into Fluent 6.2.16 but it is not interpreting and giving the error saying Structure not referenced..

It is strange to me that it works for you and not for me.

Can you tell if there is an error in the code that I wrote for the UDF in terms of syntax or other things?

Thank you

Sandilya
  Reply With Quote

Old   June 12, 2007, 06:07
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #12
Markus Alzon
Guest
 
Posts: n/a
Hello Sandilya,

You wrote in one Post:

"Error: C:\---\prtcl_init_condn.c: line 14: structure reference not implemented"

I'd like to know, what that is.

On the other hand, I never used interpreted UDFs, I always compile mine in. Maybe you should try this too?

Good luck,

MA

  Reply With Quote

Old   June 12, 2007, 10:07
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #13
Sandilya
Guest
 
Posts: n/a
Hello Marcus,

The Error : ---- is the error statement that I am getting on interpreting the UDF in Fluent. I dont know what it means. Actually I put up another post seeking answer to this question as well, but didnt get any response to it.

Also I tried compiling the UDF and still there was some error.

Thank you very much for your help!!! Please let me know if you find anything!!

Regards Sandilya Garimella
  Reply With Quote

Old   June 13, 2007, 12:13
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #14
A A S
Guest
 
Posts: n/a
It might help to read the compilation log when debugging UDFs. That is why it is much better to compile than interpret.

Good luck
  Reply With Quote

Old   June 14, 2007, 05:28
Default Re: DPM particle INITIALIZATION- A NOVICE NEEDS HE
  #15
Markus Alzon
Guest
 
Posts: n/a
Maybe it would help us all, if you could post (or send by email) your code, so that we can try it ourselves.

I don't think it is a really complicated issue.

Take care,

MA
  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
DPM particle time step amos FLUENT 1 January 4, 2020 09:46
DPM particle tracking in stirred tank parisa- FLUENT 1 August 7, 2012 13:03
DPM particle tracking parisa- Main CFD Forum 2 June 15, 2011 06:12
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
About Particle velocity of DPM in Fluent? long zhengwei FLUENT 0 March 13, 2009 05:02


All times are GMT -4. The time now is 10:39.