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

UDF works in 2D but not in 3D? Suggestions?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2006, 12:36
Default UDF works in 2D but not in 3D? Suggestions?
  #1
Brian
Guest
 
Posts: n/a
I have a simple UDF to simulate sloshing of a tank. It works in 2D but not 3D. Anyone know why? I can't seem to find any documentation on 3D and UDF's. The UDF is below as a source term that I use in the BC's to the momentum eqn.

#include "udf.h"

#define period 1.689

#define amplitude 0.005

DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) {

real source;

source =(-1.0*amplitude)*pow((2.0*M_PI/period),2.0)*C_R(cell,thread)*sin((2.0*M_PI/period)*CURRENT_TIME);

dS[eqn] = 0.0;

return source; }

  Reply With Quote

Old   March 14, 2006, 09:11
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #2
kharicha
Guest
 
Posts: n/a
M_PI and CURRENT_TIME seem to not have been defined.... I assume you did it in your code....so ?

what do you mean by not working ? no compilling or not converging calculation ?
  Reply With Quote

Old   March 14, 2006, 09:34
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #3
Brian
Guest
 
Posts: n/a
M_PI and CURRENT_TIME don't need to be defined. These are internal to the code. I use this as an interpreted UDF in 2D and it works (interprets, runs, etc...) fine. However, once I go to 3D the code crashes. It still interprets but I get an ACCESS_VIOLATION error when I try to run it.
  Reply With Quote

Old   March 14, 2006, 10:13
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #4
kharicha
Guest
 
Posts: n/a
try to compile it, see if it is ok ? do you have an define adjust in your code ?
  Reply With Quote

Old   March 14, 2006, 12:34
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #5
Brian
Guest
 
Posts: n/a
I don't have a c-compiler yet which is why I've been using the interpreted version. That shouldn't make a difference, should it? Also, I don't have a define adjust in my code. The only thing I do is use the UDF as a source term for the x-momentum equation.
  Reply With Quote

Old   March 14, 2006, 12:45
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #6
kharicha
Guest
 
Posts: n/a
I suggest to start calculation without your udf, for some time steps...then activate the udf..and see if it works...
  Reply With Quote

Old   March 14, 2006, 14:26
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #7
Brian
Guest
 
Posts: n/a
I've tried that already too.
  Reply With Quote

Old   March 15, 2006, 03:29
Default Re: UDF works in 2D but not in 3D? Suggestions?
  #8
kharicha
Guest
 
Posts: n/a
So without UDF the calculation work without bugs....mhh...

Try with replacing M_PI and CURRENT_TIME with constant numbers....
  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


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF using c_face_loop(c,t,i) frederic FLUENT 3 January 17, 2017 00:17
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF problem with Parallel Solver manu FLUENT 0 January 24, 2008 15:31
UDF : Chemical Reaction in Catalytic Converter adhimac FLUENT 1 March 27, 2001 15:04
UDF modification merac FLUENT 4 March 1, 2001 07:42


All times are GMT -4. The time now is 02:57.