|
[Sponsors] |
February 19, 2013, 07:51 |
UDS to get the gradient
|
#1 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
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) } } |
|
February 19, 2013, 09:52 |
|
#2 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
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?
|
|
June 6, 2013, 12:41 |
Same error
|
#3 |
Member
Nick Cleveland
Join Date: Mar 2012
Posts: 35
Rep Power: 14 |
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? |
|
June 25, 2013, 03:54 |
|
#4 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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 |
|
July 2, 2013, 01:03 |
|
#5 |
Member
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13 |
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 |
|
|
|
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 |