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

DEFINE_DPM_BC -- mass flow rate of aborted particle

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

Like Tree1Likes
  • 1 Post By `e`

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2015, 22:42
Default DEFINE_DPM_BC -- mass flow rate of aborted particle
  #1
Senior Member
 
Sangwoo Kim
Join Date: Jul 2014
Location: Seoul, South Korea
Posts: 115
Rep Power: 11
swtbkim is on a distinguished road
I'm trying to practice DEFINE_DPM_BC example of UDF manual.
There, some particles are active and some aborted.

I want to calculate the mass flow rate of aborted particles and display it in contour.
My first idea was using user defined memory and P_FLOW_RATE(p).
--> cell_t c;
--> C_UDMI(c,t,0)=P_FLOW_RATE(p);

But it didn't work. I don't know whether this idea is bad or there was just some mistake in coding.


How can I do it?


I just begin to learn about UDF and I don't know almost everything about UDF.
So any help or idea will be highly appreciated!
__________________
Best regards

Last edited by swtbkim; October 14, 2015 at 03:29.
swtbkim is offline   Reply With Quote

Old   October 14, 2015, 11:03
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Code:
I want to calculate the mass flow rate of aborted particles and display it in contour.
I am not 100% sure what you want to do. Is your goal is to calculate the mass flow rate that you see when you do a summary report? (See for example section 24.7.2.2.2 of Ansys Help 16.1.)
If your only goal would be to get the number, you can stop programming because it is already implemented in Fluent. But if you want to learn how to make UDFs, it is a good exercise.

You say:
Quote:
My first idea was using user defined memory and P_FLOW_RATE(p).
This is not a plan. You describe which tools you have, but you don't say how you plan to use them. Suppose you would be building a birdhouse, the plan to build it would not be "use a saw and hammer". A plan could be "start by sawing the correct pieces, then nail them together".

So, how would you calculate the mass flow rate if you were the computer? Just make a simple plan (in English or another "human" language) that the computer should follow. That is 80% of programming. If you do this properly, you will get a short, simple, easy, program.

The other 20% is translating the human language into computer language. If you did the first 80% correctly, it will be just a few lines. If you did the first 80% poorly, this will be very annoying work. So spend time on getting the 'plan' ok.

Last edited by pakk; October 14, 2015 at 11:10. Reason: actually you tried to be clear
pakk is offline   Reply With Quote

Old   October 17, 2015, 00:49
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
It sounds like you want to calculate the mass flow rate of particles on a cell-by-cell basis and display this distribution with contours. Try looping through all particles and adding their flow rate to the cell in which they reside (with user-defined memory). Because of the discrete nature of Lagrangian particle tracking, the contours may have patches (increase the number of particles to smooth the distribution).
souza.emer likes this.
`e` is offline   Reply With Quote

Old   January 11, 2018, 04:00
Default
  #4
New Member
 
BigZ
Join Date: Jan 2018
Posts: 11
Rep Power: 8
bigfish_1023 is on a distinguished road
Quote:
Originally Posted by pakk View Post
Code:
I want to calculate the mass flow rate of aborted particles and display it in contour.
I am not 100% sure what you want to do. Is your goal is to calculate the mass flow rate that you see when you do a summary report? (See for example section 24.7.2.2.2 of Ansys Help 16.1.)
If your only goal would be to get the number, you can stop programming because it is already implemented in Fluent. But if you want to learn how to make UDFs, it is a good exercise.

You say:

This is not a plan. You describe which tools you have, but you don't say how you plan to use them. Suppose you would be building a birdhouse, the plan to build it would not be "use a saw and hammer". A plan could be "start by sawing the correct pieces, then nail them together".

So, how would you calculate the mass flow rate if you were the computer? Just make a simple plan (in English or another "human" language) that the computer should follow. That is 80% of programming. If you do this properly, you will get a short, simple, easy, program.

The other 20% is translating the human language into computer language. If you did the first 80% correctly, it will be just a few lines. If you did the first 80% poorly, this will be very annoying work. So spend time on getting the 'plan' ok.
Hi, pakk. i encountered the similar problem. and i also want to export the position of the trapped particle. With using the Message Macro, P_POS(p) and P_FLOW_RATE(p), i obtained the mass flow rate of the trapped particles and corresponding position. The number of trapped particle stream i counted in the information of Message is same as the fluent computes itself. But to my surprise, the total of P_FLOW_RATE of trapped particles was larger than the inlet mass flow of particles. Please give me some advices on this issue. Thanks very much!
bigfish_1023 is offline   Reply With Quote

Old   January 11, 2018, 08:23
Default
  #5
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
The recent discussion of bigfish_1023's case might be useful: see UDF for statistics of dpm trapped on the wall.

The overall plan of adding to User-Defined Memory during calls to DEFINE_DPM_BC sounds like a good start to me. My preference would be to aim for mesh-independent values, and hence to divide face impact rates by face area.

Note that the parameters passed to DEFINE_DPM_BC relate to the wall face, not the cell. If you allocate a User-Defined Memory, then wall faces have it as well as cells, so you can add to F_UDMI(f,ft). You will eventually want a UDF (maybe DEFINE_ON_DEMAND) to set the UDM back to zero. Plotted contours typically use cell values, so you might also want to look up the cell and add to C_UDMI(c,ct) -- see the code snippets I posted in that other thread.
obscureed is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mass flow rate: calculation v/s computation beguxa FLUENT 5 December 2, 2018 21:02
Target Mass Flow Rate Nitin FLUENT 9 June 17, 2017 10:30
DEM - Post Processing : Particle Mass Flow Rate yesaswi92 STAR-CCM+ 4 August 27, 2014 15:23
How to define a fixed velocity for a given mass flow rate on inlet mqasimali FLUENT 2 April 12, 2013 17:24
mass flow rate error Masood FLUENT 0 May 22, 2005 00:32


All times are GMT -4. The time now is 13:04.