CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   [DPM/DDPM]How to employ UDF only for total flow rate of a injection? (https://www.cfd-online.com/Forums/fluent/173729-dpm-ddpm-how-employ-udf-only-total-flow-rate-injection.html)

Narita June 26, 2016 10:19

[DPM/DDPM]How to employ UDF only for total flow rate of a injection?
 
Dear all,
My simulation is transient, and I have tried DEFINE_DPM_INJECTION_INIT and 'loop(p,I->p_init)' inside for a simple constant-flow-rate case. However, the tracked particle number didn't increase with time.
In this situation, I start to think about writing an UDF which only modifies the total flow rate of a injection. I believed I could do it since we have a dropdown right beside the total-flow-rate blank.
Unfortunately, I failed to find the way to do it although I thought I've well read through the UDF guide..
Does anyone has some good ideas?

Narita June 27, 2016 01:18

Quote:

Originally Posted by Narita (Post 606637)
Dear all,
My simulation is transient, and I have tried DEFINE_DPM_INJECTION_INIT and 'loop(p,I->p_init)' inside for a simple constant-flow-rate case. However, the tracked particle number didn't increase with time.
In this situation, I start to think about writing an UDF which only modifies the total flow rate of a injection. I believed I could do it since we have a dropdown right beside the total-flow-rate blank.
Unfortunately, I failed to find the way to do it although I thought I've well read through the UDF guide..
Does anyone has some good ideas?

!!!!!!!!!!!!!
It seems I made a mistake when employing DEFINE_DPM_INJECTION_INIT. I'm now attempting with it.
Back soon for any news!

Narita June 27, 2016 01:25

Quote:

Originally Posted by Narita (Post 606679)
!!!!!!!!!!!!!
It seems I made a mistake when employing DEFINE_DPM_INJECTION_INIT. I'm now attempting with it.
Back soon for any news!

!!!!!!!!!!!!!!!!!!

Sorry I made a mistake in my codes.
The good news is that you can freely use the macro to set the injection flow rate as a function as you like -- it perfectly works with the transient DPM simulation.

ala_liar May 2, 2022 11:17

ask for help
 
Quote:

Originally Posted by Narita (Post 606680)
!!!!!!!!!!!!!!!!!!

Sorry I made a mistake in my codes.
The good news is that you can freely use the macro to set the injection flow rate as a function as you like -- it perfectly works with the transient DPM simulation.

Hello Narita,recently I'm having the same problem you used to have. Here's my code:
DEFINE_DPM_INJECTION_INIT(fuel,I)
{
Particle *pt;
real time = RP_Get_Real("flow-time");
real m1=0.012667, m2=0.014057;

loop(p,I->p_init)
{
PP_FLOW_RATE(p) = (fuel_m1+(fuel_m2-fuel_m1)*time/0.6)/12;
}
}

When I intepret it, here's error:"reference not implemented",
when I compile it, erro:"not for parallel“

Now I wonder whether my code is right but not for parallel, or I got something wrong? Can you show me the way you solve it ? I'd appreciate your help!

AlexanderZ May 3, 2022 00:41

the only part which could be a problem for parallel consideration is this line:
Code:

real time = RP_Get_Real("flow-time");
change to
Code:

real time = CURRENT_TIME;


All times are GMT -4. The time now is 06:19.