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

Dpm udf

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

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2017, 11:57
Default Dpm udf
  #1
Senior Member
 
SinaJ
Join Date: Nov 2009
Posts: 136
Rep Power: 16
sina_mech is on a distinguished road
Hi,

I would like to set flow rate for an injection of particles. The injection is a surface injection. Over the loop, I set P_FLOW_RATE(p), but I noticed that the flow rate applies to every stream in that injection. So for example, for a surface injection (of say 100 streams at inlet), instead of having 1 kg/s , I have 100kg/s eventually! any fix? I would like to have 1kg/s for the entire injection, also "Scale flow rate by face area".

This is a sample code that I use:

Code:
#include "udf.h"
DEFINE_DPM_INJECTION_INIT(init_prt,  I)
{
	Particle *p;
	real t = CURRENT_TIME;
	
	if (t>=0)
	{
		loop(p,I->p_init)
		{
			P_FLOW_RATE(p) = 1.0;

		}
	}
}
sina_mech is offline   Reply With Quote

Old   February 16, 2017, 12:32
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
P_FLOW_RATE(p) defines the flow rate for trajectory p. If you want to distribute 1 kg/s over 100 different trajectories, you will have to do that yourself!

If you know that there are exactly 100, and you want to distribute them equally over the trajectories, the simplest way is to do the calculation yourself and conclude you need 0.01 kg/s for each trajectory:

Code:
P_FLOW_RATE(p) = 0.01;
If you want to make it proportional to the face area, you have to:
1. Find out which on which face the particle is.
2. Calculate the area of that face.
3. Put that area in the equation.

I will put some thoughts on these 3 steps below.

1. Find out which on which face the particle is:

I don't know how to find the face, but to find the cell, you do:
Code:
cell=P_CELL(p);
cell_thread=P_CELL_THREAD
Maybe P_FACE(p) also works...

2. Calculate the area of that face:
If you know it is on face "face" on face thread "face_thread":
Code:
F_AREA(A,face,face_thread);
facearea=NV_MAG(A);
3. Put that area in the equation.
You need to know the total flow rate that you want to have (1kg/s in your case), and the total area of the surface. Either you read that one from Fluent, or you use a UDF to calculate that. Then, the relevant part becomes:

Code:
P_FLOW_RATE(p) = facearea/totalarea*totalflowrate;
sina_mech likes this.

Last edited by pakk; February 17, 2017 at 04:50. Reason: minor textual improvements
pakk is offline   Reply With Quote

Old   February 19, 2017, 17:26
Default
  #3
Senior Member
 
SinaJ
Join Date: Nov 2009
Posts: 136
Rep Power: 16
sina_mech is on a distinguished road
Quote:
Originally Posted by pakk View Post
P_FLOW_RATE(p) defines the flow rate for trajectory p. If you want to distribute 1 kg/s over 100 different trajectories, you will have to do that yourself!

If you know that there are exactly 100, and you want to distribute them equally over the trajectories, the simplest way is to do the calculation yourself and conclude you need 0.01 kg/s for each trajectory:

Code:
P_FLOW_RATE(p) = 0.01;
If you want to make it proportional to the face area, you have to:
1. Find out which on which face the particle is.
2. Calculate the area of that face.
3. Put that area in the equation.

I will put some thoughts on these 3 steps below.

1. Find out which on which face the particle is:

I don't know how to find the face, but to find the cell, you do:
Code:
cell=P_CELL(p);
cell_thread=P_CELL_THREAD
Maybe P_FACE(p) also works...

2. Calculate the area of that face:
If you know it is on face "face" on face thread "face_thread":
Code:
F_AREA(A,face,face_thread);
facearea=NV_MAG(A);
3. Put that area in the equation.
You need to know the total flow rate that you want to have (1kg/s in your case), and the total area of the surface. Either you read that one from Fluent, or you use a UDF to calculate that. Then, the relevant part becomes:

Code:
P_FLOW_RATE(p) = facearea/totalarea*totalflowrate;
pakk, thank you very much. I will try this.
sina_mech 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
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
Add Mass to a Particle with UDF (DPM) sega Fluent UDF and Scheme Programming 6 October 24, 2013 23:14
please help me. i have question about the UDF at the DPM motallebi FLUENT 0 July 6, 2009 12:27
Velocity of Fluid @ different positions of Particle in DPM using UDF pmghadge FLUENT 1 June 16, 2009 20:11
UDF DPM injection M.A. Rakib FLUENT 0 June 13, 2000 09:28


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