CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF for density gradient

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 21, 2004, 03:09
Default UDF for density gradient
  #1
Nandu Menon
Guest
 
Posts: n/a
Hi, this is a UDF that i am attempting to use to determine the magnitude of the gradient of density in the flowfield.

DEFINE_ON_DEMAND(dens_grad) { Domain *domain; cell_t c; Thread *t;

domain=Get_Domain(1);

/* Fill the UDM with magnitude of gradient. */ thread_loop_c (t,domain)

{

begin_c_loop (c,t)

{

C_UDMI(c,t,0) = NV_MAG(C_R_G(c,t));

}

end_c_loop (c,t)

} }

but when i run the execute on demand option, Fluent displays the follwing error:

FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

Does any one have any idea why this is hapenning? I feel it might have something to do with the use fo the user defined memory. any help to this regard is greatly appreciated.

cheers Nandu

  Reply With Quote

Old   July 22, 2004, 00:09
Default Re: UDF for density gradient
  #2
Ajay
Guest
 
Posts: n/a
Hi In your UDF you are not defining your thread pointer t properly .Hence the error .

Include this before using begin_f_loop()

t=lookup_thread(d,id)

id= number you see for your fluid in the boundary condition panel window.

when you use

thread_loop_c (t,domain)

you get the thread for the whole domain which includes the boundaries .So when it tries to get the gradient you get that error Hope this helps .Mail me if you have additional trouble my email id is arao at uh dot edu

-Ajay
  Reply With Quote

Old   July 22, 2004, 08:57
Default Re: UDF for density gradient
  #3
Peter
Guest
 
Posts: n/a
In addition to what Ajay correctly pointed out, it is often necessary when trying to access data such as gradients to tell Fluent to save the data by typing the command "solve/set/expert" and answer 'yes' to the question "keep temporary solver memory from being freed?"
  Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
temperature gradient problem in udf Souviktor Fluent UDF and Scheme Programming 3 July 11, 2015 15:49
UDF to Access Wall Normal Concentration Gradient Daniel Tanner Fluent UDF and Scheme Programming 4 February 18, 2015 15:35
Gradient of Volume fraction in UDF Babar Sharfuddin FLUENT 1 December 8, 2014 04:14
specified shear at wall - temperature gradient - UDF - access violation error senD Fluent UDF and Scheme Programming 9 September 18, 2014 07:29
UDF for Species Mass Fraction Gradient *IN SPECIFIC ZONE * -- e.g. along axis of sym. ksiegs2 Fluent UDF and Scheme Programming 0 February 27, 2011 13:55


All times are GMT -4. The time now is 15:00.