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

Problem with C_T_G(cell,thread)[0]

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2013, 11:49
Default Problem with C_T_G(cell,thread)[0]
  #1
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
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?
Raymond.Leoi is offline   Reply With Quote

Old   January 31, 2013, 17:11
Default
  #2
Member
 
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 13
czhao86 is on a distinguished road
It is better if you post the whole UDF.
czhao86 is offline   Reply With Quote

Old   January 31, 2013, 19:06
Default
  #3
Senior Member
 
Join Date: Mar 2010
Posts: 173
Rep Power: 17
Jonathan is on a distinguished road
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
Jonathan is offline   Reply With Quote

Old   February 1, 2013, 05:07
Default
  #4
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
Thanks a lot, Jonathan. It seems working after choosing 'yes' for 'temporary data from being freed'.

Quote:
Originally Posted by Jonathan View Post
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
Raymond.Leoi is offline   Reply With Quote

Old   February 1, 2013, 05:31
Default
  #5
Senior Member
 
Join Date: Mar 2010
Posts: 173
Rep Power: 17
Jonathan is on a distinguished road
hi Raymond,

great - glad its working! that info is only in the small print in the UDF guide
Jonathan is offline   Reply With Quote

Old   August 8, 2013, 05:54
Default
  #6
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 14
Jim87 is on a distinguished road
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
Jim87 is offline   Reply With Quote

Old   August 8, 2013, 06:27
Default
  #7
Senior Member
 
Join Date: Mar 2010
Posts: 173
Rep Power: 17
Jonathan is on a distinguished road
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:
Originally Posted by Jim87 View Post
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
Jonathan is offline   Reply With Quote

Old   August 8, 2013, 09:02
Default
  #8
Member
 
Join Date: Feb 2012
Posts: 59
Rep Power: 14
Raymond.Leoi is on a distinguished road
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:
Originally Posted by Jim87 View Post
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
Raymond.Leoi is offline   Reply With Quote

Old   August 8, 2013, 09:36
Default
  #9
Member
 
Stephan Langenberg
Join Date: Sep 2011
Location: Germany
Posts: 73
Rep Power: 14
Jim87 is on a distinguished road
@ 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.
Jim87 is offline   Reply With Quote

Old   August 8, 2013, 09:43
Default mem.h
  #10
Senior Member
 
Join Date: Mar 2010
Posts: 173
Rep Power: 17
Jonathan is on a distinguished road
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:
Originally Posted by Jim87 View Post
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
Jonathan 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



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