|
[Sponsors] |
Execute_ At_ End udf for Time dependent toruqe |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 13, 2014, 03:09 |
Execute_ At_ End udf for Time dependent toruqe
|
#1 |
New Member
shashank mishra
Join Date: Sep 2011
Posts: 12
Rep Power: 15 |
Hi All,
I am using udf Execute_At_End to print in console time dependent value of torque. The problem I have is , the example given in fluent udf manual is for entire domain. I only want to calculate torque for one boundary zone which is a face thread of blades of a rotor. This is the code I am using #include"udf.h" DEFINE_EXECUTE_AT_END(torque_time) { Domain *d; Thread *t; face_t f; real NV_VEC(A); real NV_VEC(force); real NV_VEC(torque); real x[ND_ND]; real NV_VEC(radius); real NV_VEC(torque_final); real tor; NV_S(force,= ,0.0); NV_S(torque_final,= ,0.0); NV_S(torque,= ,0.0); d = Get_Domain(9); begin_f_loop(f,t) { F_AREA(A,f,t); F_CENTROID(x,f,t); NV_S(force,= , F_AREA(A,f,t), * , F_P(f,t)); NV_D(radius,= ,x[0],x[1],x[2]); NV_CROSS(torque,radius,force); NV_VV(torque_final,= ,torque_final,+, torque); tor= NV_MAG(torque_final); } end_f_loop(f,t) printf("Value of torque at the blades is = %f", tor ); } I used d= Get_Domain(9) because the integer id of that face thread is 9. But its not printing anything on the console and I know I cannot use Get_Domain(9). Can anyone advise me how to specify one particular face thread for execute_at_end macro |
|
July 15, 2014, 11:35 |
|
#2 |
Member
David
Join Date: Aug 2012
Posts: 48
Rep Power: 14 |
you need to do the following:
d=Get_Domain(1); t = Lookup_Thread(d, Zone_ID); /*Here is where you give the id read in BC as zone_id*/ |
|
July 15, 2014, 16:04 |
|
#3 |
New Member
shashank mishra
Join Date: Sep 2011
Posts: 12
Rep Power: 15 |
Thanks David,
but still I am not able to print anything in console window. I dont know why. There is no error while compiling or interpreting this udf. |
|
July 16, 2014, 08:11 |
|
#4 |
Member
David
Join Date: Aug 2012
Posts: 48
Rep Power: 14 |
Your case is multiphase? Have you tried changing the ZOne_id? Post here the new UDF code
|
|
July 16, 2014, 22:30 |
|
#5 |
New Member
shashank mishra
Join Date: Sep 2011
Posts: 12
Rep Power: 15 |
||
July 16, 2014, 22:32 |
|
#6 |
New Member
shashank mishra
Join Date: Sep 2011
Posts: 12
Rep Power: 15 |
Here is the UDF Code:
#include"udf.h" DEFINE_EXECUTE_AT_END(torque_time) { Domain *d; Thread *t; face_t f; real NV_VEC(A); real NV_VEC(force); real NV_VEC(torque); real x[ND_ND]; real NV_VEC(radius); real NV_VEC(torque_final); real tor; NV_S(force,= ,0.0); NV_S(torque_final,= ,0.0); NV_S(torque,= ,0.0); d = Get_Domain(1); t = Lookup_Thread(d, 12); begin_f_loop(f,t) { F_AREA(A,f,t); F_CENTROID(x,f,t); NV_S(force,= , F_AREA(A,f,t), * , F_P(f,t)); NV_D(radius,= ,x[0],x[1],x[2]); NV_CROSS(torque,radius,force); NV_VV(torque_final,= ,torque_final,+, torque); tor= NV_MAG(torque_final); } end_f_loop(f,t) Message("Value of torque at the blades is = %f", tor ); } I am running Fluent on Linux. |
|
July 17, 2014, 03:12 |
|
#8 | |
New Member
shashank mishra
Join Date: Sep 2011
Posts: 12
Rep Power: 15 |
Quote:
Thanks for the input. I made that correction. And now I am getting at least print message with value always =0.000. I thought I am doing something wrong with cross product so I tried printing force value, still 0.000. Then for the sake of checking, I tried printing sum of area values, that is also 0.000. I dont know what is wrong in the logic of udf? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
particle tracking | sakurabogoda | CFX | 7 | December 5, 2013 00:12 |
cyclone separator particle tracking prob.. | sakurabogoda | CFX | 33 | May 29, 2013 07:36 |
How tensor parameters to be entered in CFX-pre? | hadi.iraji | CFX | 1 | May 7, 2013 05:03 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |