|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Karan
Join Date: Dec 2018
Posts: 4
Rep Power: 9 ![]() |
The following code uses a UDS and an EXECUTE_AT_END Macros. It gets interpreted and hooked, but whenever I run the simulation, I seem to get a segmentation error. Could somebody please help me out in pointing what the error is? New to UDFs.
Code:
include "udf.h"
enum
{
UDS2
};
DEFINE_EXECUTE_AT_END(execute_at_end)
{
Thread *t;
cell_t c;
float T=C_T(c,t);
begin_c_loop(c,t)
{
C_UDSI(c,t,UDS2)=8.439*pow(10,-4) - (3.81e-6)*T + (6.736e-9)*pow(T,-9) - (3.934e-12)*pow(T,-12);
}
end_c_loop(c,t)
}
|
|
|
|
|
|
|
|
|
#2 | |
|
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 18 ![]() |
Quote:
|
||
|
|
|
||
|
|
|
#3 |
|
New Member
Karan
Join Date: Dec 2018
Posts: 4
Rep Power: 9 ![]() |
Yes, I have selected a UDS in the menu.
|
|
|
|
|
|
|
|
|
#4 |
|
New Member
Karan
Join Date: Dec 2018
Posts: 4
Rep Power: 9 ![]() |
Edit: I wrote the code without a UDS, but it still seems to give a segmentation fault. Could you please help me point out where my error is? Thanks!
#include "udf.h" #include "sg.h" DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *d; Thread *t; cell_t c; real T; d=Get_Domain(8); thread_loop_c(t,d) { begin_c_loop(c,t) { T=C_T(c,t); } end_c_loop(c,t) } } |
|
|
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 28 ![]() |
Maybe your Get_Domain(8) does not exist. Do you really have a multiphase flow with 8 phases???
And for your first code of 31 January: I think you are confusing UDS with UDM. |
|
|
|
|
|
![]() |
| Tags |
| udf code, udf crash |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| udf for one dimensional linear motion based on force | maccheese | Fluent UDF and Scheme Programming | 2 | September 1, 2019 03:18 |
| Save output of udf in another udf! | JuanJoMex | FLUENT | 0 | February 8, 2018 13:43 |
| UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
| UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
| UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |