|
[Sponsors] |
Issues with UDF for velocity components: the fluent process could not be started |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 24, 2021, 04:54 |
Issues with UDF for velocity components: the fluent process could not be started
|
#1 |
New Member
Join Date: Jul 2019
Posts: 14
Rep Power: 7 |
Hello everyone,
I am new to Fluent and UDFs and c. I hope the community can help me with fixing the errors in my first UDF. I am trying to sample the components of velocity at two points close to a rotating airfoil at every timestep. Firstly, I find the location of the sampling points in global coordinates as a function of theta (which is dependent on time). Then, I use CX_Find_Cell_With_Point to find the cells with these points. Once the cells are found, the centroid is calculated and the velocities are extracted. I have compiled the udf successfully in Fluent but when I start the simulation, at the end of the first timestep, I get an error message saying the fluent process could not be started. I have already tried checking it with both single and parallel processing and also with and without double precision as suggested by some on this forum with no success. I have attached the udf and the error message here. Kindly help me resolve this issue. Thank you. Code: Code:
#include "udf.h" #include "cxndsearch.h" static ND_Search *domain_table1 = NULL; static ND_Search *domain_table2 = NULL; static float c_centroid1[2]; static float c_centroid2[2]; static int starting_dt = 200; /* Setting the starting time step. */ static float R = 0.25; /* Radius */ static cell_t c1; static cell_t c2; static Thread *t1; static Thread *t2; static CX_Cell_Id *cx_cell1; static CX_Cell_Id *cx_cell2; real pt1[3]; real pt2[3]; real U_vel1; real V_vel1; real U_vel2; real V_vel2; real xTheory; real yTheory; real theta; FILE *velocity_t1; FILE *velocity_t2; real current_dt; DEFINE_EXECUTE_AT_END(execute) { #if !RP_HOST Message("UDF begin execution"); current_dt = CURRENT_TIMESTEP; Message("Current timestep acquired"); if (current_dt <=starting_dt) { theta = 0; } else { theta = (current_dt - starting_dt)* 0.004363323; /* dtheta = 0.004363323 rad. Change if dt changes)*/ } xTheory = 0 - R * sin(theta); /* Point at the mounting point of the airfoil */ yTheory = 0 + R * cos(theta); /* Evaluation point near the LE*/ if (theta <= M_PI) { pt1[0] = xTheory - 0.0375; } else { pt1[0] = xTheory + 0.0375; } if (yTheory >= 0) { pt1[1] = yTheory + 0.05; } else { pt1[1] = yTheory - 0.05; } pt1[2] = 0.0; /* Evaluation point near the TE*/ if (theta <= M_PI) { pt2[0] = xTheory - 0.0375; } else { pt2[0] = xTheory + 0.0375; } if (yTheory >= 0) { pt2[1] = yTheory - 0.05; } else { pt2[1] = yTheory + 0.05; } pt2[2] = 0.0; domain_table1 = CX_Start_ND_Point_Search(domain_table1,TRUE,-1); cx_cell1 = CX_Find_Cell_With_Point(domain_table1,pt1,0.0); if (cx_cell1) { c1 = RP_CELL(cx_cell1); t1 = RP_THREAD(cx_cell1); C_CENTROID(c_centroid1,c1,t1); U_vel1 = C_U(c1,t1); V_vel1 = C_V(c1,t1); } else { Message("Could not find cell!\n"); } domain_table1= CX_End_ND_Point_Search(domain_table1); domain_table2 = CX_Start_ND_Point_Search(domain_table2,TRUE,-1); cx_cell2 = CX_Find_Cell_With_Point(domain_table2,pt2,0.0); if (cx_cell2) { c1 = RP_CELL(cx_cell2); t1 = RP_THREAD(cx_cell2); C_CENTROID(c_centroid2,c2,t2); U_vel2 = C_U(c2,t2); V_vel2 = C_V(c2,t2); } else { Message("Could not find cell!\n"); } domain_table2 = CX_End_ND_Point_Search(domain_table2); Message("UDF run finished"); #endif #if !RP_HOST velocity_t1=fopen("velocity1.txt","ab+"); fprintf(velocity_t1,"%15.4f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t\n",CURRENT_TIMESTEP,theta,xTheory,yTheory,c_centroid1[0],c_centroid1[1],U_vel1,V_vel1); fclose(velocity_t1); velocity_t2=fopen("velocity2.txt","ab+"); fprintf(velocity_t2,"%15.4f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t%15.6f\t\n",CURRENT_TIMESTEP,theta,xTheory,yTheory,c_centroid2[0],c_centroid2[1],U_vel2,V_vel2); fclose(velocity_t2); #endif } Node 0: Process 48048: Received signal SIGSEGV. ================================================== ============================ The fluent process could not be started. |
|
August 25, 2021, 03:43 |
Managed to fix it after debugging the commands in UDF.
|
#2 |
New Member
Join Date: Jul 2019
Posts: 14
Rep Power: 7 |
As mentioned in the title, I managed to fix the issue. It was because of the wrong use of CURRENT_TIME macro.
|
|
Tags |
starting udf, udf, velocity components |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parallel fluent process exiting before reading the mesh file | harsha2398 | FLUENT | 3 | December 29, 2020 01:58 |
About UDF compiling issues: 'nmake' | Haoyin Shan | Fluent UDF and Scheme Programming | 15 | November 4, 2019 19:05 |
Passing udf value to fluent | durg | Fluent UDF and Scheme Programming | 2 | February 11, 2019 13:55 |
Two questions on Fluent UDF | Steven | Fluent UDF and Scheme Programming | 7 | March 23, 2018 04:22 |
The fl process could not be started because of UDF | majid_kamyab | Fluent UDF and Scheme Programming | 6 | December 15, 2015 09:42 |