Injection initialization generate a segmentation fault!!
Hello!
I am trying to track the particle trajectory by DPM model using unsteady tracking. First I simulate steady flow for my continuous phase without activating DPM model, after convergence, I import the profile of velocity and temperature at the outlet for using it as inlet conditions for the new simulation with the DPM. Now I want to assign the velocity and temperature of the fluid to particles in each injection. However, my domain is a cylinder so I have to work with the cylindrical coordinates. I used this UDF to impose to particles the velocity of the flow when they will be injected(initialization). The code was compiled successfully but when calculation started I get a Segmentation fault. Code:
#include "mem.h" |
use message0 macro to figure out which line leads to error
best regards |
Thanks for your reply!
I Insert the message0 macro after each line, but it didn't show me anything, it still generates the same error. Any suggestions? Code:
|
AlexanderZ please I need to know if I did something wrong? can you please give me any guidelines?
|
the reason could be the fact, that you didn't define domian
add Code:
Domain *d; |
I added these two lines in the code but the same error still remain :(
|
show your UDF,
compile it and show log RP_CELL macro is defined in "surf.h" library, which is not defined in your UDF, but you said, you've compiled without errors best regards |
here is the message that I get after compilation:
Code:
> Copied C:\Users\hp\Downloads\Compressed\Nouveau dossier\Nouveau dossier\Nouveau dossier/initial1.c to libudf33\src Code:
I don't get it, how to initialize the pârticle, I use originally this UDF for initializing my injected particles? |
when you run your UDF did you ever get ????
Code:
point a Code:
Message("point a\n"); everywhere I've found this macro it is used as Boolean (true or false) how this should work from your point of view? Code:
NV_V(origin, =, THREAD_VAR(t).cell.origin); Code:
#include "udf.h" best regards |
Your problem is that you forget to loop. See your code (simplified):
Code:
DEFINE_DPM_INJECTION_INIT(inj_vel,I) What do you want? You first want p to point to the first particle in the injection. Then to the second. Then to the third. And so on. So it's a loop. And the Fluent manual on DEFINE_DPM_INJECTION_INIT shows how to use this loop! So just add this loop, and let p loop over all particles in the injection: Code:
DEFINE_DPM_INJECTION_INIT(inj_vel,I) |
AlexanderZ thanks for your cooperation :)
1-even I use the macro Code:
Message("point a\n"); 2- Actually first I didn't know how to program the conversion from cartesian to cylindrical coordinates by Fluent macros and I did some research. I found Code:
NV_V(origin, =, THREAD_VAR(t).cell.origin); so I use the part of the code in my own program, I think Code:
NV_V(origin, =, THREAD_VAR(t).cell.origin); 3- I run Code:
|
pakk thanks for your explanation!
1- I used the Code:
loop(p,I->p_init) { } 2- after your suggestion the warning is gone and also the segmentation fault. I think my program was wrong. I did some changes now, do you think my code is correct now, first I transformed the velocities of fluid and particles from cartesian to cylindrical and I suppose that the velocity and temperature of particles at the inlet of my pipe initially equal to those of the fluid. Code:
#include "udf.h" |
All times are GMT -4. The time now is 17:02. |