|
[Sponsors] |
April 14, 2015, 11:02 |
define_profile and F_UDMI
|
#1 |
Member
Join Date: Jan 2015
Posts: 40
Rep Power: 11 |
Hi all,
I am trying to set a particular wall heat transfer coefficient to an external wall. I also wanted to monitor the value computed by my UDF, then I used the user-defined memory. But the correspondent variable (when I search for it in FLuent) is always zero. Note that if I write in the UDF printf('variable name') I get the good values....but I need to put these values into a variable! I copy paste the simplified UDF: Code:
DEFINE_PROFILE(name,t,i) { real h; begin_f_loop(f,t){ h=10.0; F_UDMI(f,t,0) = h; printf("h:%f\n",h); F_PROFILE(f,t,i)= h; } end_f_loop(f,t) } Can someone explain me what is the problem? Thanks in advance philus |
|
April 14, 2015, 11:57 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
I have seen this behavior too. The UDM stored with F_UDMI did not show up in my Fluent results. I don't know if this is intended or a bug, but I found a workaround that worked for me:
Code:
F_UDMI(f,t,0) = h; C_UDMI(F_C0(f,t),THREAD_T0(t),0) = F_UDMI(f,t,0); |
|
April 15, 2015, 05:56 |
|
#3 |
Member
Join Date: Jan 2015
Posts: 40
Rep Power: 11 |
Hi pakk,
effectively this workaround works well, thank you!! philus |
|
November 5, 2023, 08:46 |
|
#4 |
New Member
anonymous96
Join Date: Nov 2022
Posts: 17
Rep Power: 4 |
Hi Pakk
I am trying to calculate volumetric flow rate through an interior surface and using DEFINE_ON_DEMAND macro for the same. A piece of my code is as follows: DEFINE_ON_DEMAND(ach_udf) { Thread *t; face_t f; Domain *d; real A[ND_ND]; real ACHt_mean_out=0; real ACHt_mean_in=0; t = Lookup_Thread(d,2); begin_f_loop(f,t) { F_AREA(A,f,t); real vel_roof= F_FLUX(f,t)/(NV_MAG(A)*1.12); if (vel_roof>0) { ACHt_mean_out += vel_roof*NV_MAG(A); } else { ACHt_mean_in +=vel_roof*NV_MAG(A); } } end_f_loop(f,t) } The code is compiled successfully but as soon as I am executing it using EXECUTE_ON_DEMAND, it is giving the following error: Node 1: Process 20248: Received signal SIGSEGV. ================================================== ============================ ================================================== ============================ Node 999999: Process 6872: Received signal SIGSEGV. ================================================== ============================ ================================================== ================================= = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = RANK 2 PID 4296 RUNNING AT DESKTOP-PA0EM1I = EXIT STATUS: -1 (ffffffff) Can anyone tell how to fix this? |
|
November 6, 2023, 05:31 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
d is not defined
compile code and READ log to avoid typoes
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 6, 2023, 06:11 |
|
#6 |
New Member
anonymous96
Join Date: Nov 2022
Posts: 17
Rep Power: 4 |
Thankyou Alexander. If figured that out but I am getting stuck at one more point. I have posted in another thread and you are a part of it too. Can you please look into it.
|
|
November 6, 2023, 06:16 |
|
#7 |
New Member
anonymous96
Join Date: Nov 2022
Posts: 17
Rep Power: 4 |
||
|
|