|
[Sponsors] |
January 31, 2013, 11:49 |
Problem with C_T_G(cell,thread)[0]
|
#1 |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
when I set C_UDSI(cell,thread,3) = C_UDSI_DIFF(cell,thread,2)*C_T_G(cell,thread)[0] in DEFINE_EXECUTE_AT_END(execute_at_end), FLUENT couldn't run with the following error,
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? |
|
January 31, 2013, 17:11 |
|
#2 |
Member
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 13 |
It is better if you post the whole UDF.
|
|
January 31, 2013, 19:06 |
|
#3 |
Senior Member
Join Date: Mar 2010
Posts: 173
Rep Power: 17 |
two quick thoughts ...
1) obviously since you are calling temperature gradients, make sure you are solving the energy equation (!) 2) from memory, if you want to access gradient data, you need to tell the solver to retain temporary solution data: solve > set > expert 'yes' to prevent temporary solver data from being freed (i think its second or third option depending on what models you have enabled). cheers jonathan |
|
February 1, 2013, 05:07 |
|
#4 | |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
Thanks a lot, Jonathan. It seems working after choosing 'yes' for 'temporary data from being freed'.
Quote:
|
||
February 1, 2013, 05:31 |
|
#5 |
Senior Member
Join Date: Mar 2010
Posts: 173
Rep Power: 17 |
hi Raymond,
great - glad its working! that info is only in the small print in the UDF guide |
|
August 8, 2013, 05:54 |
|
#6 |
Member
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 14 |
Hi,
I have a similar problem. I tried your advice but get the same error when I initialize the simulation. My first thought is: Could it be that the simulation need some iterations before i use the udf? The grsdient (and the UDF) needs values from former itarations, maybe it can only work if there are some data files in fluents memory? #include "udf.h" DEFINE_PROPERTY(test_Gradienten,c,t) { /************************************************** ************************** Standard UDF Befehle ************************************************** ***************************/ double Rho = 0.0; double gradient = 0.0; double s1 = 0.5; /************************************************** ************************** Variablen aufrufen ************************************************** ***************************/ gradient = C_T_G(c,t)[1]; /************************************************** ************************* Zeiger Druck und Temperatur ************************************************** ***************************/ Rho = 1 + gradient * s1; return Rho; } Error: C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0\win6 4\3ddp\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 |
|
August 8, 2013, 06:27 |
|
#7 | |
Senior Member
Join Date: Mar 2010
Posts: 173
Rep Power: 17 |
hi,
sorry - i just replied to your PM and then saw this. i cant see exactly what is wrong right now, but if you send me you .cas and udf files i can perhaps have a look and see tonight if i get time. what version of ansys are you using? it matters only because some UDF's will not cross-compile on newer versions ... cheers jonathan Quote:
|
||
August 8, 2013, 09:02 |
|
#8 | |
Member
Join Date: Feb 2012
Posts: 59
Rep Power: 14 |
Well, you might try initialising your case first or even running few iterations before specifying your UDF. The fact is that there's no C_T_G(c,t) at the very beginning, which can probably cause your problem.
Quote:
|
||
August 8, 2013, 09:36 |
|
#9 |
Member
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 14 |
@ Jonathan & Raymond.Leoi thank you for your comments.
The problem was close to Raymonds approach. The user Blackmask helped me to fix it with one more line. #include "udf.h" DEFINE_PROPERTY(test_Gradienten,c,t) { /************************************************** ************************** Standard UDF Befehle ************************************************** ***************************/ double Rho = 0.0; double gradient = 0.0; double s1 = 5; /************************************************** ************************** Variablen aufrufen ************************************************** ***************************/ if (NNULLP(THREAD_STORAGE(t, SV_T_G))) gradient = C_T_G(c,t)[1]; /************************************************** ************************* Zeiger Druck und Temperatur ************************************************** ***************************/ Rho = 1 + gradient * s1; return Rho; } This line fixed all problems @ Jonathan: I coppied your hint, the expert solver settings and the fixing line in the UDF were both needed. |
|
August 8, 2013, 09:43 |
mem.h
|
#10 | |
Senior Member
Join Date: Mar 2010
Posts: 173
Rep Power: 17 |
ALso, i just noticed you are missing mem.h from your includes ...
as per the UDF manual (pg. 210) for accessing variable gradients, you need to include the memory header file in your user code ... cheers jonathan Quote:
|
||
|
|