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

DEFINE_SOURCE error?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2012, 17:26
Default DEFINE_SOURCE error?
  #1
New Member
 
Join Date: Feb 2012
Posts: 6
Rep Power: 14
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

Reply

Tags
define_source


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
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 18:43
[OpenFOAM] Saving ParaFoam views and case sail ParaView 9 November 25, 2011 16:46
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
user defined function cfduser CFX 0 April 29, 2006 11:58


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