|
[Sponsors] |
UDF for calculating Oscillatory Shear Index (OSI) |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22 ![]() |
I am writing a UDF for calculating Oscillatory Shear Index (OSI).
The definition of OSI can be found here (right side bottom of 2nd page) http://utopia.duth.gr/~soulis/Public...0of%20Non-.pdf Any hint or help about this? |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Join Date: Sep 2013
Posts: 2
Rep Power: 0 ![]() |
I'm trying to do the same actually
![]() |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Join Date: Sep 2011
Posts: 15
Rep Power: 14 ![]() |
hi dear colleague, to calculate the shear oscillation index in FLUENT I found these two links:
http://www.cfd-online.com/Forums/flu...ng-fluent.html http://cape-forum.com/index.php/topic,1074.0.html but in the second link the colleague "infocfd" is about a UDF attached, but I can’t download it ... if you can download the UDF or help me to understand the principle of calculated OSI on FLUENT please answer me ... thank you for your cooperation. Last edited by wyldckat; October 26, 2014 at 11:22. Reason: fixed Google'lized links |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22 ![]() |
Sorry but I cant download it either. Anyways I calculated OSI with matlab however visualization of the calculated is still an issue for us.
|
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Join Date: Oct 2013
Posts: 4
Rep Power: 12 ![]() |
Hello Guys,
I did some work in this field awhile ago, you can use the attached UDF I wrote for my uses back then. Hope it helps, and yeah I know this one is an oldie... Regards. |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22 ![]() |
I will give it a try. Thanks Khuti!
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Join Date: Jun 2014
Posts: 1
Rep Power: 0 ![]() |
Thank you, Khuti.
I want to clarify if the OSI values are area-averaged. |
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Join Date: Oct 2013
Posts: 4
Rep Power: 12 ![]() |
Hi Dhplsy,
Sorry for the delayed response. The values that are being used in the calculation are taken from the Fluent raw data storage, so they are per cell face and averaged by the relevant cell face area. Also please note, that you might want to delete some of the code related to the names of the UDM: DEFINE_EXECUTE_ON_LOADING(nameinit, libudf) { Set_User_Memory_Name(0, "uWSS"); Set_User_Memory_Name(1, "uWSSx"); Set_User_Memory_Name(2, "uWSSy"); Set_User_Memory_Name(3, "uWSSz"); Set_User_Memory_Name(4, "OSI"); } ( as I remember it caused some problems, hadn't the chance to figure out what was the problem) Enjoy! |
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Andrea
Join Date: Oct 2019
Location: Italy
Posts: 2
Rep Power: 0 ![]() |
Hello,
I've been used the UDF above. I don't understand why the WSS values are not in good agreement as those automatically calculated by Fluent. Consequently, the calculation of OSI is not consistent ... Has anyone solved this problem? Thanks |
|
![]() |
![]() |
![]() |
![]() |
#10 |
New Member
wangke
Join Date: Jan 2020
Posts: 1
Rep Power: 0 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#11 |
New Member
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5 ![]() |
hello KHUTI,
I am confused, i interpret the UDF you had provided and run the simulation but after solution is complete, where did the result of OSI has been saved? please suggest the correct way thank you |
|
![]() |
![]() |
![]() |
![]() |
#12 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
go to contours
-> contours of -> user -defined memory -> select "OSI" (also it could be udm-4)
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#13 |
New Member
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#14 | |
New Member
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5 ![]() |
Quote:
could you please explain it in detail. because I have tried it by interpreting the UDF in Fluent. then in contours drobox I didn't found any user-defined option. please help thank you |
||
![]() |
![]() |
![]() |
![]() |
#15 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 ![]() |
You have to make a new contour first.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
![]() |
![]() |
![]() |
![]() |
#16 |
Member
Alexandre M S Costa
Join Date: Apr 2009
Posts: 31
Rep Power: 17 ![]() |
Hi All,
For using the code : DEFINE_EXECUTE_AT_END(OSI) { Domain *domain; real area; face_t f; real A[ND_ND]; cell_t c, c0; Thread *t,*t0, *c_thread; real wallshear [ND_ND]; domain = Get_Domain(domain_ID); t = Lookup_Thread(domain,zone_ID); begin_f_loop(f, t) { F_AREA(A,f,t); area = NV_MAG(A); NV_V(wallshear,=,F_STORAGE_R_N3V(f,t, SV_WALL_SHEAR)); c0 = F_C0(f,t); t0 = THREAD_T0(t); C_UDMI(c0,t0,0) += NV_MAG(wallshear)/area; C_UDMI(c0,t0,1) += -wallshear[0]/area; C_UDMI(c0,t0,2) += -wallshear[1]/area; C_UDMI(c0,t0,3) += -wallshear[2]/area; C_UDMI(c0,t0,4) = (1.-sqrt(C_UDMI(c0,t0,1)*C_UDMI(c0,t0,1) + C_UDMI(c0,t0,2)*C_UDMI(c0,t0,2) + C_UDMI(c0,t0,3)*C_UDMI(c0,t0,3))/C_UDMI(c0,t0,0))/2; } end_f_loop(f,t) } In Fluent must be enabled Data Sampling for Time Statistics and defined CFFs = UDM(0),...(4) ? In this way unsteady statistics(such time averaged) results are available for the UDMs ? |
|
![]() |
![]() |
![]() |
![]() |
#17 | |
New Member
shima mohammadi
Join Date: Oct 2022
Posts: 14
Rep Power: 3 ![]() |
Quote:
I try to calculate "osi" and i compiled this udf After finished run, i go to contours and select OSI but any thing is showing!! What's the problem?? Thank you |
||
![]() |
![]() |
![]() |
![]() |
#18 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
in case you could select OSI inside contours menu everything is OK.
may be you are using wrong settings for contours if you still have problems, show your code, compilation log, whats fluent version you are using, explain how you are making contours
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
![]() |
#19 | |
New Member
shima mohammadi
Join Date: Oct 2022
Posts: 14
Rep Power: 3 ![]() |
Quote:
Oscillatory shear index ************************************************** ****/ #include "udf.h" #include "math.h" #include "storage.h" #include "sg_udms.h" #define domain_ID 1 #define zone_ID 7 /* Define Names for the WSS UDMI and its components */ DEFINE_EXECUTE_ON_LOADING(nameinit, libudf) { Set_User_Memory_Name(0, "uWSS"); Set_User_Memory_Name(1, "uWSSx"); Set_User_Memory_Name(2, "uWSSy"); Set_User_Memory_Name(3, "uWSSz"); Set_User_Memory_Name(4, "OSI"); } /* Initialize the UDM value to zero in complete domain */ DEFINE_INIT(meminit,domain) { Thread *c_thread; cell_t c; thread_loop_c(c_thread,domain) { begin_c_loop(c, c_thread) { C_UDMI(c,c_thread,0)= 0; C_UDMI(c,c_thread,1)= 0; C_UDMI(c,c_thread,2)= 0; C_UDMI(c,c_thread,3)= 0; C_UDMI(c,c_thread,4)= 0; } end_c_loop(c, c_thread) } } /* Calculate wall shear stress and store them in UDM */ DEFINE_EXECUTE_AT_END(OSI) { Domain *domain; real area; face_t f; real A[ND_ND]; cell_t c, c0; Thread *t,*t0, *c_thread; real wallshear [ND_ND]; domain = Get_Domain(domain_ID); t = Lookup_Thread(domain,zone_ID); begin_f_loop(f, t) { F_AREA(A,f,t); area = NV_MAG(A); NV_V(wallshear,=,F_STORAGE_R_N3V(f,t, SV_WALL_SHEAR)); c0 = F_C0(f,t); t0 = THREAD_T0(t); C_UDMI(c0,t0,0) += NV_MAG(wallshear)/area; C_UDMI(c0,t0,1) += -wallshear[0]/area; C_UDMI(c0,t0,2) += -wallshear[1]/area; C_UDMI(c0,t0,3) += -wallshear[2]/area; C_UDMI(c0,t0,4) = (1.-sqrt(C_UDMI(c0,t0,1)*C_UDMI(c0,t0,1) + C_UDMI(c0,t0,2)*C_UDMI(c0,t0,2) + C_UDMI(c0,t0,3)*C_UDMI(c0,t0,3))/C_UDMI(c0,t0,0))/2; } end_f_loop(f,t) } I compiled udf with visual studio 2010 Fluent version: 19R3 I go to contours>>new contour Location:wall body Variable:OSI>>apply But range of osi display is 0.0-0.0 |
||
![]() |
![]() |
![]() |
![]() |
#20 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
code seems to be correct
did you hook functions in fluent GUI? user-defined - > function hooks
__________________
best regards ****************************** press LIKE if this message was helpful |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
specified shear at wall - temperature gradient - UDF - access violation error | senD | Fluent UDF and Scheme Programming | 9 | September 18, 2014 07:29 |
Accessing wall shear stress using UDF | Robert | Fluent UDF and Scheme Programming | 2 | July 31, 2013 08:34 |
UDF of shear flows - Just need a little little help | yannossss | FLUENT | 5 | July 11, 2011 07:11 |
OpenFOAM install on Ubuntu Natty 11.04 | bkubicek | OpenFOAM | 13 | May 26, 2011 05:48 |
UDF for wall slipping | HFLUENT | Fluent UDF and Scheme Programming | 0 | April 27, 2011 12:03 |