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

UDS to get the gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2013, 07:51
Default UDS to get the gradient
  #1
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
In the following UDF, the heat source, which depends on the gradient of a diffusivity, is trying to be calculated. One UDS2 is defined and updated to be the diffusivity at the end of each iteration through 'execute_at_end'. But I got error as

Error:
C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0
tx86\2ddp\fl1450s.exe 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: #f

any idea for this problem?

DEFINE_SOURCE(energy_source, cell, thread, dS, eqn)
{
real source;
real s_p;
real xc[ND_ND];
C_CENTROID(xc,cell,thread);

s_p = - NV_DOT(C_UDSI_G(cell,thread,2), C_UDSI_G(cell,thread,0));
s_p = -s_p*C_T(cell,thread)*C_UDSI_DIFF(cell,thread,0);

source = s_p;
dS[eqn] = 0.0;
return source;
}


DEFINE_EXECUTE_AT_END(execute_at_end)
{
Domain *domain;
cell_t cell;
Thread *thread;
int tec_zoneID;
int i;
for (i = 0; i < n_tec_zones; i++)
{
tec_zoneID = tec_solid_zone[i];
thread = Lookup_Thread(domain, tec_zoneID);
begin_c_loop(cell,thread)
{
C_UDSI(cell,thread,2) = C_UDSI_DIFF(cell,thread,2);
C_UDSI(cell,thread,3) = C_UDSI_DIFF(cell,thread,2)*C_T_G(cell,thread)[0];
}
end_c_loop(cell,thread)
}
}
Raymond.Leoi is offline   Reply With Quote

Old   February 19, 2013, 09:52
Default
  #2
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
I use domain = Get_Domain(1), and then it seems working even thought it's not perfect. But it's observed that the gradient of diffusivitity is not correct particularly at the two rows of cells attached with the boundaries. How to fix it?
Raymond.Leoi is offline   Reply With Quote

Old   June 6, 2013, 12:41
Default Same error
  #3
Member
 
Nick Cleveland
Join Date: Mar 2012
Posts: 35
Rep Power: 14
NCle is on a distinguished road
Hi Raymond,

I am also trying to use the DEFINE_EXECUTE_AT_END macro, and get the same exact "access-violation" error in Fluent. I think it is because of the UDF somehow, is this true?
NCle is offline   Reply With Quote

Old   June 25, 2013, 03:54
Default
  #4
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14
A CFD free user is on a distinguished road
Are you using UDM in your code as well? in this case, you have to first define them using Fluent user defined memory then execute your code. It'll vanish.
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   July 2, 2013, 01:03
Default
  #5
Member
 
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13
yashganatra is on a distinguished road
Hi,
try using solve-set-expert text command line and when asked keep temporary solver memory from being freed enter yes.
Also allocate number of user defined memories
yashganatra is offline   Reply With Quote

Reply


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
Gradient of UDS gemini Fluent UDF and Scheme Programming 2 December 24, 2013 00:24
UDS gradient ?? akm Fluent UDF and Scheme Programming 0 April 23, 2012 14:49
How to compute UDS fourth order gradient Emma66 FLUENT 1 April 27, 2010 05:44
reconstruction gradient of a UDS gemini Fluent UDF and Scheme Programming 0 June 7, 2009 16:03
Gradient UDS tom FLUENT 1 April 28, 2006 03:46


All times are GMT -4. The time now is 13:16.