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

Execute_at_end udf

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2019, 14:12
Exclamation Execute_at_end udf
  #1
New Member
 
Karan
Join Date: Dec 2018
Posts: 4
Rep Power: 7
karan_97 is on a distinguished road
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)
}
karan_97 is offline   Reply With Quote

Old   February 1, 2019, 04:12
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by karan_97 View Post
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)
}
Have you allocate UDS in the menu?
gearboy is offline   Reply With Quote

Old   February 1, 2019, 04:21
Default
  #3
New Member
 
Karan
Join Date: Dec 2018
Posts: 4
Rep Power: 7
karan_97 is on a distinguished road
Yes, I have selected a UDS in the menu.
karan_97 is offline   Reply With Quote

Old   February 2, 2019, 04:59
Default
  #4
New Member
 
Karan
Join Date: Dec 2018
Posts: 4
Rep Power: 7
karan_97 is on a distinguished road
Quote:
Originally Posted by gearboy View Post
Have you allocate UDS in the menu?
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)
}

}
karan_97 is offline   Reply With Quote

Old   February 4, 2019, 10:24
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Reply

Tags
udf code, udf crash

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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 02:18
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 12:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 04:42.