|
[Sponsors] |
January 15, 2009, 15:34 |
UDF problem
|
#1 |
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? |
|
January 21, 2009, 12:48 |
Re: UDF problem
|
#2 |
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 |
|
|
|
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 |