|
[Sponsors] |
An error occurs after initialized FLuent loaded UDF. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 29, 2017, 06:52 |
An error occurs after initialized FLuent loaded UDF.
|
#1 |
New Member
DENG Weriping
Join Date: Jun 2015
Posts: 16
Rep Power: 11 |
1, When I compiled my UDFs, it didn't show any error. But after initialized Fluent, an error occurs.
2, Error: received a fatal signal (segmentation fault). 3, /*My UDF is about the fluid properties depending on temperatures.*/ /* my_density */ #include "udf.h" double Tm1[2] = { 293.15 , 294.15 }; double D[2] = { 0.16632 , 0.03831 }; DEFINE_PROPERTY(my_density,c,t) { int i; double density; double temp = C_T(c,t); if(temp <= Tm1[0]) density = D[0]; else if(temp > Tm1[1]) density = D[1]; else { for(i = 0;i <1;i++) { if(temp > Tm1[i] && temp <= Tm1[i+1]) density = D[i] + (temp - Tm1[i]) * (D[i+1] - D[i]) / (Tm1[i+1] - Tm1[i]); } } return density; } 4, Help me, Please! I really want to solve this problem quickly. |
|
March 29, 2017, 08:39 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
First initialize, then load the UDF.
|
|
March 29, 2017, 09:01 |
initialize first?
|
#3 |
New Member
DENG Weriping
Join Date: Jun 2015
Posts: 16
Rep Power: 11 |
||
March 29, 2017, 09:13 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
That does not really matter, but if possible do something close to your expected result. Define it for example with a uniform density based on a typical temperature in your problem.
|
|
March 29, 2017, 11:30 |
Thanks!
|
#5 |
New Member
DENG Weriping
Join Date: Jun 2015
Posts: 16
Rep Power: 11 |
||
April 6, 2017, 05:46 |
I am also facing the same error
|
#6 | |
New Member
Karthikeyan
Join Date: Nov 2016
Posts: 14
Rep Power: 10 |
I am getting the "received a fatal signal (segmentation fault)" error. Is it because the function is not able to access the previous timestep values using F_U_M1 and C_U_M1?
Code:
#include"udf.h" DEFINE_PROFILE(CBC_u_vel,t,i) { real u_f_old, u_c_old, u_temp, u_cor, mass_out = 0, ds; real x[ND_ND], y[ND_ND]; Thread *nt; face_t f; cell_t c, nc; begin_f_loop(f,t) { mass_out+=F_FLUX(f,t); } end_f_loop(f,t) u_cor = (20 - mass_out)/20; begin_f_loop(f,t) { nc = F_C0(f,t); nt = THREAD_T0(t); F_CENTROID(x,f,t); C_CENTROID(y,nc,nt); ds = x[0] - y[0]; u_f_old = F_U_M1(f,t); u_c_old = C_U_M1(nc,nt); u_temp = u_f_old - CURRENT_TIMESTEP*(u_f_old - u_c_old)/ds; F_PROFILE(f,t,i) = u_temp + u_cor; } end_f_loop(f,t) } Quote:
Any help would be appreciated. |
||
April 6, 2017, 22:41 |
Don't worry about the error!
|
#7 | |
New Member
DENG Weriping
Join Date: Jun 2015
Posts: 16
Rep Power: 11 |
Quote:
I don't know your UDFs, maybe you can check carefully by yourself. But if you cannot running the Fluent, you can try the method, which using a constant velocity to initialize the Fluent and then load your UDFs to running the Fluent. Maybe your problems can be solved. If cannot, you can ask for help to others. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem running fluent with udf on batch | tobi b. | Fluent UDF and Scheme Programming | 3 | April 14, 2016 14:54 |
implementing UDF for fluent in workbench for running multiple simulations | faizan_habib7 | Fluent UDF and Scheme Programming | 0 | March 18, 2016 23:29 |
Running UDF with Supercomputer | roi247 | FLUENT | 4 | October 15, 2015 14:41 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 11:16 |
UDF of Zimont model in fluent | Z | Main CFD Forum | 0 | February 17, 2005 04:07 |