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

DEFINE_SOURCE error?

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

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

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 294 July 12, 2013 05:39
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 17:43
Saving ParaFoam views and case sail OpenFOAM Paraview & paraFoam 9 November 25, 2011 15: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 05:13.