|
[Sponsors] |
UDF not running. Problem known but I can't solve it |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 5, 2020, 12:05 |
UDF not running. Problem known but I can't solve it
|
#1 |
Member
|
Hi,
How can I adress the input arguments for c_vol? I need a cell value in my f_loop, but i don't know how to get the value. It would be enough to know the volume off the cell which belongs with one face to the boundary that I want to specify by define_profile. Any help would be great. Is the a solution to adress with pointers the cell of the face in normal direction maybe? Without the c_vol the code works great. DEFINE_PROFILE(massfraction_for_const_RH,thread,po sition) { cell_t cell; face_t f; double a= -5800.2206; double T,massfraction_new; double p_sat, c_vol; begin_f_loop(f,thread) { T=F_T(f,thread); c_vol = C_VOLUME(cell, thread); p_sat= exp(a*pow(T,-1)); massfraction_new=0.7*p_sat/c_vol; F_PROFILE(f,thread,position)=massfraction_new; } end_f_loop(f,thread) } Last edited by schwaral; August 5, 2020 at 19:20. |
|
August 6, 2020, 05:03 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
try this code, compile it
Code:
DEFINE_PROFILE(massfraction_for_const_RH,t,i) { cell_t c,c0; face_t f; Thread *t0; real a= -5800.2206; real T,massfraction_new; real p_sat, c_vol; begin_f_loop(f,t) { T=F_T(f,t); c0 = F_C0(f,t); t0 = F_C0_THREAD(f,t); c_vol = C_VOLUME(c0, t0); /*get volume of cell adjusted to face */ p_sat= exp(a*pow(T,-1)); massfraction_new=0.7*p_sat/c_vol; F_PROFILE(f,t,i)=massfraction_new; } end_f_loop(f,t) }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 6, 2020, 07:06 |
|
#3 |
Member
|
Thanks a lot AlexanderZ for the reply!
Unfortunately this does not work. The Error is: structure reference not implemented in the following line: t0 = F_C0_THREAD(f,t); I like your idea using the Connectivity Variables. Somehow I can't find a post where someone used DEFINE_PROFILE in combination with a cell_value of the boundary cells one tries to modify. best regards, Alex Last edited by schwaral; August 6, 2020 at 08:34. |
|
August 13, 2020, 10:31 |
|
#4 |
Member
|
I am very sorry for my previous answer. Your solutioon works perfect. I did not read, that you have to compile it. Instead i tried with interpreting.
Thanks again! |
|
Tags |
cell value, define profile, loop, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF problem for Population balance model | Amir.11 | Fluent UDF and Scheme Programming | 6 | May 30, 2022 05:36 |
Problem with running UDF of linux | Tomsho | Fluent UDF and Scheme Programming | 2 | June 12, 2019 13:59 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Can I use UDF function to solve this problem? | bright181 | Fluent UDF and Scheme Programming | 3 | December 10, 2010 05:46 |
Can I solve this problem by Fluent? | Kai_kc | FLUENT | 1 | October 27, 2010 06:29 |