CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Error: The fl process could not be started (https://www.cfd-online.com/Forums/fluent-udf/197612-error-fl-process-could-not-started.html)

mohsensalehi1993 January 11, 2018 03:10

Error: The fl process could not be started
 
Hi ٍeveryone,
i'm going to simulate grains of solid rocket engine with udf.
i use DEFINE_PROFILE and DEFINE_CG MOTION macros to link moving boundary to pressure....
my udf's code As follows:


#include "udf.h"
#include "sg.h"

DEFINE_PROFILE(mflux,t,i)
{
int m = 0;
face_t f;
double a,nn,y1,y2;
double PRESSURE,PRESSURE2,press,rdot;
double x[ND_ND];
a=0.001499;
nn=0.4255;
PRESSURE=0;

begin_f_loop(f,t)
{
PRESSURE += F_P(f,t);
m = m + 1;
}
end_f_loop(f,t)
printf("sum P on boundary: %d = %f pas\n", PRESSURE);

PRESSURE2 = PRESSURE/m;
printf("average P on boundary: %d = %f pas\n", PRESSURE2);

press = (PRESSURE2)*1e-6;
rdot = (a * pow(press,nn));


begin_f_loop(f,t)
{

F_CENTROID(x,f,t);
y2=x[1];

if (y2<=0.05)
F_PROFILE(f,t,i) = 1605.*rdot + 1e-6; /* 1605=density*/
else
F_PROFILE(f,t,i) = 1e-6;
}
end_f_loop(f,t)

printf("burning rate: %f\n", rdot);

}


DEFINE_GRID_MOTION(moving_inlet,d,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(disp);
real y,x,dis,dis_y,dis_x;
double PRESSURE,PRESSURE2,press,rdot;
int n,ig;
int m = 0;
real a=0.001499;
real nn=0.4255;
real k[ND_ND];

PRESSURE=0;

begin_f_loop(f,tf)
{
PRESSURE += F_P(f,tf);
m = m + 1;
}
end_f_loop(f,tf)

PRESSURE2 = PRESSURE/m;

press = (PRESSURE2)*1e-6;
rdot = (a * pow(press,nn));

SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf));

dis_x = 0.0;
dis_y = 0.0;

begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
if(NODE_POS_NEED_UPDATE(v))
{
NODE_POS_UPDATED(v);
x = NODE_X(v);
y = NODE_Y(v);

if(y>=0.05)
{
dis_x = 0.;
dis_y = 0.;
}
else
{
dis_x = 0.;
dis_y = rdot*dtime;
}

NV_D(disp, = ,dis_x,dis_y,0);
NV_V(NODE_COORD(v), +=, disp);
}
}
}
end_f_loop(f,tf)

printf("dis y: %f\n", dis_y);

}


After I do the basic settings; while i choose "reference value"and compute "mass flow inlet" The following error is seen in fluent console:

Node 0: Process 34456: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 1: Process 29852: Received signal SIGSEGV.

================================================== ============================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.


what is the problem?
So could anyone can help to solve this?
Thank you.

obscureed January 11, 2018 08:07

OK, my first piece of advice is to simplify things a lot, to build up the complexity in stages. So, for example, I would recommend starting with a constant (non-pressure-dependent) rate first. I would probably recommend a non-UDF inlet condition at first -- and constant velocity-inlet is more stable than mass-flow-inlet. The mesh motion will be the hardest thing to get working (apart from convergence), so start on as simple a case as you can.

It has been a while since I used mesh motion, but I do remember that Fluent was extremely fussy (or basically bug-ridden) about the set-up, and often generated errors like the one you have mentioned. So, whenever there is even a small risk that Fluent could have stupidly forgotten about the DEFINE_GRID_MOTION UDF, go back and reapply it. This definitely includes when you recompile the UDF, and when you reopen a .cas file -- possibly also when you save as .cas file. Absolute paranoia is unfortunately helpful here. I think this was such an annoying situation that I reported it as a bug -- so be sure to use the latest version of Fluent if you can. ANSYS support will not help you much if you are using an old version, especially (and justifiably) if they know that bugs have been fixed.

mohsensalehi1993 January 11, 2018 11:33

Thank you for your reply

i think this code have a basically problem....because i tested this code with ansys 16.2, 17.2 and 18.2

i think problem is here(at DEFINE_PROFILE):

begin_f_loop(f,t)
{
PRESSURE += F_P(f,t);
m = m + 1;
}
end_f_loop(f,t)

PRESSURE2 = PRESSURE/m;
press = (PRESSURE2)*1e-6;
rdot = (a*pow(press,nn));


while i remove that few lines, code runs correctly.

obscureed January 11, 2018 13:35

OK, that's interesting.

The only problem I can see in those lines would be if press2 (the average pressure in MPa) was negative -- in which case pow(press2,0.4255) would generate an error. (This would not be the fault of C -- it means your formula makes no sense.) You should test for this.

You can also debug by temporarily adding lots of lines saying things like:
Message("have calculated press = %16.8g\n",press); /* DEBUG */

I stick with the advice of running a simulation with a fixed burn rate. Good luck!

AlexanderZ January 11, 2018 23:42

Debug your code on single core first (not parallel)
than move to parallel version.

best regards

mohsensalehi1993 January 12, 2018 02:37

i run my code on serial (not parallel)....

problem not here...

pakk January 13, 2018 08:09

I think that the problem is that you are calculating GRID_MOTION for all threads, not only for the boundary thread.

mohsensalehi1993 January 15, 2018 12:22

The problem is solved
 
i add DEFINE_ADJUST to my code an the problem is solved..

thanks all....

Mutlaq October 17, 2020 04:24

Hi mohsensalehi1993

where you added
DEFINE_ADJUST


All times are GMT -4. The time now is 07:45.