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

specified shear at wall - temperature gradient - UDF - access violation error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2010, 12:04
Default specified shear at wall - temperature gradient - UDF - access violation error
  #1
New Member
 
Deb
Join Date: Jul 2010
Posts: 1
Rep Power: 0
senD is on a distinguished road
Hi
A simple rectangular geometry. Have temp gradient in domain as walls at different temperature. Need to specify shear at wall. The specified shear depends on temperature gradient. Wrote udf to specify it.
the udf uses the x- and y- components of temperature gradient to calculate shear stress. Getting 'ACCESS VIOLATION ERROR'

NOTE:
[1] Tried to even run a few steps and then hook the udf, still error.
[2] runs ok if I use C_T i.e. it can access the temp but cannot access the gradient!!!

ANY HELP WOULD BE VERY MUCH APPRECIATED
Doing in Fluent

The UDF is as follows:

#include "udf.h"
#define SurfTenGrad -0.43e-3 /*temperature coefficient of surface tension in N/(m-K)*/

/*Specifying x-component of shear on top surface*/
DEFINE_PROFILE(xShearStress,t,j)
{
cell_t c;

begin_c_loop(c,t)
{
/*C_T_G(c,t)[0] = returns x-component of cell temp gradient vector*/

C_PROFILE(c,t,j) = SurfTenGrad*C_T_G(c,t)[0];

}
end_c_loop(c,t)
}

/*Specifying y-component of shear on top surface*/
DEFINE_PROFILE(yShearStress,t,l)
{
cell_t c;

begin_c_loop(c,t)
{
/*C_T_G(c,t)[1] = returns y-component of cell temp gradient vector*/

C_PROFILE(c,t,l) = SurfTenGrad*C_T_G(c,t)[0];

}
end_c_loop(c,t)
}
senD is offline   Reply With Quote

Old   January 18, 2011, 20:41
Default
  #2
New Member
 
anonymous
Join Date: Jan 2011
Posts: 12
Rep Power: 15
calvin is on a distinguished road
m facin similar problem .. if u got thru thn plz help me out
calvin is offline   Reply With Quote

Old   January 21, 2011, 12:27
Default
  #3
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
Sorry but i don't understand why are you using
C_PROFILE instead of F_PROFILE.

I think that this udf is for boundary faces and not for boundary cells

Nikolopoulos Aristeidis
Nikolopoulos is offline   Reply With Quote

Old   February 2, 2011, 04:24
Default
  #4
New Member
 
anonymous
Join Date: Jan 2011
Posts: 12
Rep Power: 15
calvin is on a distinguished road
i am getting access violation if i try to use C_T_G(c,t) ..if i dont use it then everything works fine
calvin is offline   Reply With Quote

Old   February 2, 2011, 05:04
Default
  #5
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
I think your problem and solution is discribed in UDF manual:

"Table 3.2.9 shows a list of cell gradient vector macros. Note that gradient variables are available only when the equation for that variable is being solved. For example, if you are defining a source term for energy, your UDF can access the cell temperature gradient (using C_T_G), but it cannot get access to the x-velocity gradient (using C_U_G). The reason for this is that the solver continually removes data from memory that it doesn't need. In order to retain the gradient data (when you want to set up user-defined scalar transport equations, for example), you can prevent the solver from freeing up memory by issuing the text command solve/set/expert and then answering yes to the question Keep temporary solver memory from being freed?. Note that when you do this, all of the gradient data is retained, but the calculation requires more memory to run. "
Nikolopoulos is offline   Reply With Quote

Old   February 2, 2011, 22:19
Default
  #6
New Member
 
anonymous
Join Date: Jan 2011
Posts: 12
Rep Power: 15
calvin is on a distinguished road
hi Nikolopoulos,

thnx a lot for ur prompt responses

i later found that on other threads and things r wrkin fine now... but m facing another problem - m gettin floating point error
wen i am trying to display any profile..the udf compiles well widout givin ne error..it iterates too givin a correct indicative range of soln but wen i try to get a "display" its gives an FPE widout givin ne display ..is it a problem with my graphics card.

cheers
calvin is offline   Reply With Quote

Old   February 3, 2011, 01:39
Default
  #7
Member
 
Nikolopoulos Aristeidis
Join Date: Jan 2011
Location: Athens, Greece
Posts: 62
Rep Power: 15
Nikolopoulos is on a distinguished road
I don't think it is a problem of graphics.
Can you post your new code that is compiled?
Nikolopoulos is offline   Reply With Quote

Old   May 12, 2012, 18:23
Default hi
  #8
New Member
 
moon
Join Date: Feb 2012
Posts: 26
Rep Power: 14
moun139 is on a distinguished road
i have the same problem ,also with using solve/set/expert and chose yes in the question
moun139 is offline   Reply With Quote

Old   September 8, 2014, 04:24
Default Solution
  #9
New Member
 
Join Date: May 2013
Posts: 11
Rep Power: 12
Bill Tuer is on a distinguished road
Hi calvin,

I know this is a old thread, but it would be very nice if you would share your solution or post the link where you found the solution.

Thank you
Bill Tuer is offline   Reply With Quote

Old   September 18, 2014, 07:29
Default
  #10
New Member
 
sarighulikhan
Join Date: Mar 2014
Posts: 15
Rep Power: 12
hane is on a distinguished road
becouse u didnt include its header file
mem.h
hane is offline   Reply With Quote

Reply

Tags
access violation error, specified shear at wall, surface tension, temperature gradient, udf


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
Wall shear stress gradient udf Andrew FLUENT 3 April 4, 2018 01:36
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." sega OpenFOAM Community Contributions 12 February 17, 2010 09:30
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
Error (ACCESS VIOLATION) with UDF Ale FLUENT 2 May 28, 2002 02:50


All times are GMT -4. The time now is 07:24.