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

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 29, 2010, 12:04 specified shear at wall - temperature gradient - UDF - access violation error #1 New Member   Deb Join Date: Jul 2010 Posts: 1 Rep Power: 0 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) }

 January 18, 2011, 21:41 #2 New Member   anonymous Join Date: Jan 2011 Posts: 12 Rep Power: 7 m facin similar problem .. if u got thru thn plz help me out

 January 21, 2011, 13:27 #3 Member   Nikolopoulos Aristeidis Join Date: Jan 2011 Location: Athens, Greece Posts: 62 Rep Power: 7 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

 February 2, 2011, 05:24 #4 New Member   anonymous Join Date: Jan 2011 Posts: 12 Rep Power: 7 i am getting access violation if i try to use C_T_G(c,t) ..if i dont use it then everything works fine

 February 2, 2011, 06:04 #5 Member   Nikolopoulos Aristeidis Join Date: Jan 2011 Location: Athens, Greece Posts: 62 Rep Power: 7 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. "

 February 2, 2011, 23:19 #6 New Member   anonymous Join Date: Jan 2011 Posts: 12 Rep Power: 7 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

 February 3, 2011, 02:39 #7 Member   Nikolopoulos Aristeidis Join Date: Jan 2011 Location: Athens, Greece Posts: 62 Rep Power: 7 I don't think it is a problem of graphics. Can you post your new code that is compiled?

 May 12, 2012, 18:23 hi #8 New Member   moon Join Date: Feb 2012 Posts: 24 Rep Power: 6 i have the same problem ,also with using solve/set/expert and chose yes in the question

 September 8, 2014, 04:24 Solution #9 New Member   Join Date: May 2013 Posts: 11 Rep Power: 5 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

 September 18, 2014, 07:29 #10 New Member   sarighulikhan Join Date: Mar 2014 Posts: 15 Rep Power: 4 becouse u didnt include its header file mem.h

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sega OpenFOAM Running, Solving & CFD 12 February 17, 2010 10:30 gschaider OpenFOAM Installation 120 December 2, 2009 11:23 allenzhao OpenFOAM Installation 127 January 30, 2009 20:08 Andrew FLUENT 0 March 8, 2006 23:19 Ale FLUENT 2 May 28, 2002 02:50

All times are GMT -4. The time now is 01:21.

 Contact Us - CFD Online - Top