CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF Error "the fl process could not be started"

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2021, 14:31
Default UDF Error "the fl process could not be started"
  #1
New Member
 
Nishant Kakkar
Join Date: Dec 2020
Posts: 9
Rep Power: 2
nishantkakkar71 is on a distinguished road
I am working on a 3D geometry and using the DPM particle tracking model. I am using 2 UDFs and have been able to compile and load them successfully (although there were 1-2 warnings during the compilation, I can tell what exactly the warnings were, if needed). However, on trying to run the simulation after incorporating those UDFs, I am constantly facing an error "The fl process could not be started". One of the 2 UDFs is as follows -

#include "udf.h"
#include "dpm.h"
#include "unsteady.h"
#include "stdio.h"
DEFINE_DPM_BC(Sticky, p, t, f, f_normal, dim)
{

int n;
n = N_TIME;
char filename[50];
snprintf(filename,50,"./STICKY_FILES/ParticleInfo_%d.txt",n);
char particle_info[100];
//sprintf(particle_info,"%time, %step, %ntime , %iter , %posx, %posy, %velx, %vely, %ptime, %pdt %"int64_fmt"\n", CURRENT_TIME, CURRENT_TIMESTEP, N_TIME, N_ITER, P_POS(p)[0], P_POS(p)[1], P_VEL(p)[0], P_VEL(p)[1], P_TIME(p), P_DT(p));
sprintf(particle_info,"%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f \n", CURRENT_TIME, CURRENT_TIMESTEP, N_TIME, N_ITER, P_POS(p)[0], P_POS(p)[1], P_POS(p)[2], P_VEL(p)[0], P_VEL(p)[1], P_VEL(p)[2], P_TIME(p), P_DT(p));

FILE * fp;
fp = fopen(filename, "a");
fprintf(fp, particle_info);
fclose(fp);

return PATH_ABORT;
}

The objective behind the above code is to be able to store certain data (position coordinates, velocity etc.) for every particle that is "trapped", in a separate .txt file. The simulation runs normally for 2 iterations, but I get the error just after that. I am unable to figure out the exact problem, and would highly appreciate any sort of help. Thanks in advance.
nishantkakkar71 is offline   Reply With Quote

Old   March 3, 2021, 00:37
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,781
Rep Power: 22
pakk will become famous soon enough
My guess is that your string partivle_info is more than 100 characters. Make it bigger, or eliminate the variable and directly put the data in the fprintf statement.
pakk is offline   Reply With Quote

Old   March 3, 2021, 05:41
Default
  #3
New Member
 
Nishant Kakkar
Join Date: Dec 2020
Posts: 9
Rep Power: 2
nishantkakkar71 is on a distinguished road
Thank you so much for your response. I changed it from 100 to 300 and it worked fine. May I also please request you to have a look at the 2nd UDF which I am using, which is as follows -

#include "udf.h"
#include "dpm.h"
#include "math.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

DEFINE_DPM_INJECTION_INIT(Both_Random,I)
{
Particle *p;
cell_t cell;
Thread *t;

srand((unsigned int)time(NULL));
float a = 0.001;
float b = 0.0001;
float c = 0.0015;

Message("Initializing Injection: %s\n",I->name);
loop(p,I->p)
{
if(P_POS(p)[0] > 0.0004){
P_POS(p)[1] = -0.0005 + ((float)rand()/((float)(RAND_MAX)) * a);
P_POS(p)[0] = 0.0004 - ((float)rand()/((float)(RAND_MAX)) * b);
P_POS(p)[2] = ((float)rand()/((float)(RAND_MAX)) * c);
}
if(P_POS(p)[0] < 0.0004 && P_POS(p)[0] > 0.0004 - b){
cell = P_CELL(p);
t = P_CELL_THREAD(p);
P_VEL(p)[1] = C_V(cell,t);
P_VEL(p)[0] = C_U(cell,t);
P_VEL(p)[2] = C_W(cell,t);
}
}
}

Since the particles enter the domain in a distribution which is dependent on the mesh density, the objective behind this one is to basically randomize the particles in all 3 directions (x,y,z) after they are injected from the inlet face. The dimensions of the flow domain are (1000 micron, 1000 micron, 1500 micron), and the particles are travelling in the negative x direction.
In this case, not even a single iteration is running successfully. The error which I am getting in this case is mentioned below -

Advancing DPM injections ....

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

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

Node 0: Process 13884: Received signal SIGSEGV.

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

Node 1: Process 16804: Received signal SIGSEGV.

================================================== ============================
The fl process could not be started.

I request you to please help me in figuring out what mistake I am making. Let me know if there is any clarification needed from my side. Looking forward to a response. Thanks in advance.
nishantkakkar71 is offline   Reply With Quote

Old   March 3, 2021, 14:01
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,781
Rep Power: 22
pakk will become famous soon enough
Your goal is to define position. What does "if(P_POS(p)[0] > 0.0004)" mean? Fluent does not know if the position is more than 0.0004, so what do you expect this to do?
pakk is offline   Reply With Quote

Old   March 4, 2021, 09:14
Default
  #5
New Member
 
Nishant Kakkar
Join Date: Dec 2020
Posts: 9
Rep Power: 2
nishantkakkar71 is on a distinguished road
Thanks for your response. I have fixed the above code. However, I have another doubt. Is it possible to have 2 functions in a single code, such that I can use the output of one function in the other one? For example -

#include "udf.h"
#include "dpm.h"
#include "math.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

int sum(int a, int b){
return a+b;
}


DEFINE_DPM_INJECTION_INIT(Both_Random,I)
{
Particle *p;
cell_t cell;
Thread *t;

srand((unsigned int)time(NULL));
float a = 0.001;
float b = 0.0001;
float c = 0.0015;

Message("Initializing Injection: %s\n",I->name);
loop(p,I->p)
{
if(P_POS(p)[0] > 0.0004){
P_POS(p)[1] = sum(0.00001, 0.00002);
P_POS(p)[0] = 0.0004 - ((float)rand()/((float)(RAND_MAX)) * b);
P_POS(p)[2] = ((float)rand()/((float)(RAND_MAX)) * c);
}
if(P_POS(p)[0] < 0.0004 && P_POS(p)[0] > 0.0004 - b){
cell = P_CELL(p);
t = P_CELL_THREAD(p);
P_VEL(p)[1] = C_V(cell,t);
P_VEL(p)[0] = C_U(cell,t);
P_VEL(p)[2] = C_W(cell,t);
}
}
}

In the above code, the first function (sum) returns the addition of 2 numbers, and that function has been called in my main code {at P_POS(p)[1]}. Can you please tell me if this will work fine? Or is there any other syntax which I need to use? In anticipation of your response. Thanks in advance.
nishantkakkar71 is offline   Reply With Quote

Old   March 4, 2021, 09:28
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,781
Rep Power: 22
pakk will become famous soon enough
This concept works. (But your example will not, because you define your function with ints, and use it with floats.)
pakk is offline   Reply With Quote

Old   March 4, 2021, 09:35
Default
  #7
New Member
 
Nishant Kakkar
Join Date: Dec 2020
Posts: 9
Rep Power: 2
nishantkakkar71 is on a distinguished road
Okay so if I just change the ints to float in the "sum" function, then the entire code would work right?
nishantkakkar71 is offline   Reply With Quote

Old   March 4, 2021, 10:19
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,781
Rep Power: 22
pakk will become famous soon enough
I guess so, but the best way to find out is not to ask me, but just to try it.
pakk is offline   Reply With Quote

Old   March 8, 2021, 13:10
Default
  #9
New Member
 
Nishant Kakkar
Join Date: Dec 2020
Posts: 9
Rep Power: 2
nishantkakkar71 is on a distinguished road
Thank you so much for your help. Could you please clarify another thing for me? I want to include Brownian motion effects for my particles. In the Ansys user guide (http://www.pmt.usp.br/academic/marto...rs%20Guide.pdf), it is mentioned that this can be done simply by enabling the "Brownian Motion" option under the "Physical Models" tab (Page 1181). However, I can't see any option named "Brownian Motion" in that tab. The options visible are as follows: Saffman Lift Force, Virtual Mass Force, Pressure Gradient Force, Erosion/Accretion, Two-way Turbulence Coupling, DEM Collision, Stochastic Collision, Breakup. I am attaching the image of the same for your reference. I request you to please let me know if there is some other option which I might be missing here. Thanks in advance. In anticipation of your response.

nishantkakkar71 is offline   Reply With Quote

Old   March 8, 2021, 13:37
Default
  #10
New Member
 
Nishant Kakkar
Join Date: Dec 2020
Posts: 9
Rep Power: 2
nishantkakkar71 is on a distinguished road
UPDATE: I turned on the "Energy Equation" and now I can see the Brownian Motion dialog box after changing the drag law to "Stokes Cunningham" under the "Physical Models" tab in the "Set Injection Properties" panel. My main objective is to look at particle trapping over a surface (number of particles getting trapped). Can someone please clarify if turning on that "energy equation" affects the number of particles getting trapped over the surface in any manner, other than whatever effect Brownian Motion would be having? Also, I need to enter the "Cunningham Correction" value before proceeding. How can I calculate this value? I would be highly grateful for any help. Thanks in advance.
nishantkakkar71 is offline   Reply With Quote

Reply

Tags
dpm, error, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel fluent process exiting before reading the mesh file harsha2398 FLUENT 3 December 29, 2020 00:58
Compiling and loading UDF using Batch ALBATTROSS FLUENT 3 May 20, 2019 21:50
Replicating Scalable Wall Function with a UDF yousefaz FLUENT 0 August 4, 2017 02:30
The fl process could not be started because of UDF majid_kamyab Fluent UDF and Scheme Programming 6 December 15, 2015 08:42
help UDF error message Clementine FLUENT 0 January 24, 2008 11:17


All times are GMT -4. The time now is 14:18.