|
[Sponsors] |
February 16, 2017, 11:57 |
Dpm udf
|
#1 |
Senior Member
SinaJ
Join Date: Nov 2009
Posts: 136
Rep Power: 17 |
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; } } } |
|
February 16, 2017, 12:32 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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; 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 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); 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; Last edited by pakk; February 17, 2017 at 04:50. Reason: minor textual improvements |
|
February 19, 2017, 17:26 |
|
#3 | |
Senior Member
SinaJ
Join Date: Nov 2009
Posts: 136
Rep Power: 17 |
Quote:
|
||
|
|
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 |