Dpm udf
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" |
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); 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); 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; |
Quote:
|
All times are GMT -4. The time now is 16:37. |