CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming


Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   September 19, 2012, 16:26
Default DEFINE_SOURCE error?
New Member
Join Date: Feb 2012
Posts: 6
Rep Power: 7
twray is on a distinguished road
I'm trying to implement the RAS turbulence model and am having a problem with the R transport equation. If I hard code a value for R and turn the equation off I get reasonable results and trends for all my variables. When I turn the R equation on the solution diverges or I get non physical results. Based on trial and error, I think the problem is in my DEFINE_SOURCE.

DEFINE_SOURCE(r_source, c, t, dS, eqn)
real source;
source = C_UDMI(c,t,C1)*C_R(c,t)*sqrt(C_UDMI(c,t,P)*C_UDSI( c,t,RTilda))-C_UDMI(c,t,C2)*C_R(c,t)*SQR(C_UDSI_G(c,t,RTilda)[0]+C_UDSI_G(c,t,RTilda)[1]);
dS[eqn] = 0.0;
return source;

RTilda is a UDS so that I can use C_UDSI_G to get the gradient easily. Is my use of C_UDSI_G correct? Is there some other error here?
twray is offline   Reply With Quote



Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM 300 October 29, 2014 19:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43
Saving ParaFoam views and case sail OpenFOAM Paraview & paraFoam 9 November 25, 2011 16:46
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
user defined function cfduser CFX 0 April 29, 2006 10:58

All times are GMT -4. The time now is 17:04.