|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
Dragos
Join Date: Mar 2009
Posts: 637
Rep Power: 9 ![]() |
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 |
|
|
|
|
|
|
|
|
#2 | |
|
Member
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 94
Rep Power: 5 ![]() |
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"); } |
||
|
|
|
||
|
|
|
#3 |
|
Senior Member
Dragos
Join Date: Mar 2009
Posts: 637
Rep Power: 9 ![]() |
Thanks Ji,
Do you have a similar check for species? Dragos |
|
|
|
|
|
|
|
|
#4 |
|
Member
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 94
Rep Power: 5 ![]() |
||
|
|
|
|
|
|
|
#5 |
|
Senior Member
Dragos
Join Date: Mar 2009
Posts: 637
Rep Power: 9 ![]() |
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 08:45. |
|
|
|
|
|
|
|
|
#6 | |
|
Senior Member
Dragos
Join Date: Mar 2009
Posts: 637
Rep Power: 9 ![]() |
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 08:46. |
||
|
|
|
||
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 16:15 |
| Modelling the Heat flow inside the curing oven | Marios Vlad | CFX | 1 | February 6, 2008 07:11 |
| Energy dissipation and Drag coefficient | Freeman | Main CFD Forum | 10 | January 27, 2006 07:42 |
| Species Mass Fraction inside UDF using PDF? | Daniel Schneider | FLUENT | 0 | September 20, 2000 06:34 |
| Why FVM for high-Re flows? | Zhong Lei | Main CFD Forum | 23 | May 14, 1999 13:22 |