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

UDF problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2009, 15:34
Default UDF problem
  #1
Travis
Guest
 
Posts: n/a
I'm trying to write a UDF for a modified v2f turbulence model. I'm getting the following error:

Error: (path)\v2f.c: line 142: function returning double returns float.

That section of code reads like this:

DEFINE_UDS_FLUX(user_flux, f, t, eqn) {

switch (eqn) { case K: return F_FLUX(f,t); break;

case E: return F_FLUX(f,t); break;

case V2: return F_FLUX(f,t); break;

case F: return 0.0; <--- This is the line with the error break;

default: return 0.0; }

}

Any thoughts on why I'm getting that error?
  Reply With Quote

Old   January 21, 2009, 12:48
Default Re: UDF problem
  #2
KJ Larsen
Guest
 
Posts: n/a
Hello Travis

The error is because the function returns a double and the finickity compiler must consider 0.0 to be a float but not a double (not sure how this is possible). You could define a global variable double zero = 0.0; although this could just move the problem somwhere else. Internet defines the double range as +/-1.7E+/-108 which does annoyingly omit 0. Afraid I don't know what to do... Normally initialise everything that isn't an integer to be a real. Define_UDS_Flux's definition in udf.h seems to suggest real is the type of value it wants to return.

Hope that is helpful. Kris
  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
VOF diffuse problem on two fluids problem Fang Jin FLUENT 5 February 17, 2011 05:38
Problem in Modelling Heat Transfer Problem Deepak R FLUENT 1 December 6, 2007 09:37
Problem in cavity flow problem saad Main CFD Forum 4 November 1, 2007 07:45
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
problem in solving "wave generation" problem san FLUENT 2 April 3, 2006 23:37


All times are GMT -4. The time now is 06:19.