|
[Sponsors] |
Why i can't change injection through DEFINE_DPM_INJECTION_INIT |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 4, 2016, 01:08 |
Why i can't change injection through DEFINE_DPM_INJECTION_INIT
|
#1 |
New Member
Weijia Qian
Join Date: Mar 2016
Posts: 6
Rep Power: 10 |
Hi, i hope anyone could help me or give me some advices.
The problem is: I create a surface injection in GUI, and the flow is unsteady and particle tracking is also unsteady. Then i want to change the particle temperature through UDF. the UDF can be built, loaded and hooked, but it does no change to the particle temperature at all. I also tried a DEFINE_ADJUST, and the problem is same. the UDF is: #include "udf.h" DEFINE_DPM_INJECTION_INIT(particle, I) { Particle *p; Message("Initializing Injection qwj: %s\n",I->name); loop(p,I->p_init) { P_INIT_TEMP(p)=1500; P_T(p)=1400; } } |
|
March 8, 2016, 18:14 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
This approach should work fine (both the DEFINE_DPM_INJECTION_INIT and DEFINE_ADJUST macros). Are you sure this macro is being called correctly? Try printing a message to the screen within the loop including the particle ID:
Code:
Message("Particle ID = %d\n",p->part_id); |
|
March 8, 2016, 22:56 |
|
#3 | |
New Member
Weijia Qian
Join Date: Mar 2016
Posts: 6
Rep Power: 10 |
Quote:
I tried, and there is no message show the particle ID. When build the UDF, it shows that warning C4113: void (*)() and void (*)(void) have different parameter list. I think UDF cannot create a particle when we need one in the solving process via UDF, so i have turned to OpenFOAM. |
||
March 9, 2016, 04:06 |
|
#4 | |||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Quote:
Quote:
|
||||
March 9, 2016, 06:25 |
|
#5 | |
New Member
Weijia Qian
Join Date: Mar 2016
Posts: 6
Rep Power: 10 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
loop over all injection streams in order to get the particles specifications | alighaffari | Fluent UDF and Scheme Programming | 0 | August 28, 2012 02:42 |
loop over all injection streams | alighaffari | Main CFD Forum | 1 | August 27, 2012 17:00 |
How to change turbulence model in InterFoam | Gildeh | OpenFOAM Running, Solving & CFD | 4 | March 28, 2012 13:04 |
DEFINE_SOURCE, injection in one Cell, mass balance | Vitali | FLUENT | 2 | April 27, 2007 17:39 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |