|
[Sponsors] |
March 30, 2010, 08:25 |
Check if energy is enabled from inside udf
|
#1 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
I wrote a udf which reads the temperature field using macro C_T(c,t). However, if the energy equation is not enabled the udf generates a SEGMENTATION FAULT.
Is it possible to check from within the udf if there is a temperature field? Dragos |
|
March 31, 2010, 00:21 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
DEFINE_ON_DEMAND(test_temp_field) { Domain *domain; Thread *c_thread; domain=Get_Domain(1); thread_loop_c(c_thread, domain) /*loops over all cell threads in domain*/ { if(NNULLP(THREAD_STORAGE(c_thread,SV_T))) Message0("Temp. field exists\n"); else Message0("Temp. field doesn't exist\n"); } |
||
March 31, 2010, 03:38 |
|
#3 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Thanks Ji,
Do you have a similar check for species? Dragos |
|
March 31, 2010, 05:02 |
|
#4 |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
||
March 31, 2010, 05:56 |
|
#5 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
SV_Y_I is not working (sintax error), instead I think SV_Y_0 should be used and then check for particular SV_Y_I(i)
Last edited by dmoroian; April 12, 2010 at 09:45. |
|
April 12, 2010, 09:20 |
|
#6 | |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Quote:
Code:
if(!rp_spe) Error("Species transport is disabled!\n"); if(2 > n_spe) Error("Not enough species, minim 3, current %d.\n",n_spe); Last edited by dmoroian; April 12, 2010 at 09:46. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to make a UDF to repeat itself ??? | magnounibo | Fluent UDF and Scheme Programming | 5 | July 26, 2011 17:15 |
Modelling the Heat flow inside the curing oven | Marios Vlad | CFX | 1 | February 6, 2008 08:11 |
Energy dissipation and Drag coefficient | Freeman | Main CFD Forum | 10 | January 27, 2006 08:42 |
Species Mass Fraction inside UDF using PDF? | Daniel Schneider | FLUENT | 0 | September 20, 2000 07:34 |
Why FVM for high-Re flows? | Zhong Lei | Main CFD Forum | 23 | May 14, 1999 14:22 |