|
[Sponsors] |
September 19, 2012, 17:26 |
DEFINE_SOURCE error?
|
#1 |
New Member
Join Date: Feb 2012
Posts: 6
Rep Power: 14 |
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? |
|
Tags |
define_source |
|
|
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 |