|
[Sponsors] |
UDF for calculating Oscillatory Shear Index (OSI) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 27, 2013, 06:59 |
UDF for calculating Oscillatory Shear Index (OSI)
|
#1 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
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? |
|
October 15, 2013, 09:53 |
|
#2 |
New Member
Join Date: Sep 2013
Posts: 2
Rep Power: 0 |
I'm trying to do the same actually
|
|
October 22, 2014, 08:02 |
osi in Fluent
|
#3 |
New Member
Join Date: Sep 2011
Posts: 15
Rep Power: 15 |
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 12:22. Reason: fixed Google'lized links |
|
October 23, 2014, 02:46 |
|
#4 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
Sorry but I cant download it either. Anyways I calculated OSI with matlab however visualization of the calculated is still an issue for us.
|
|
October 29, 2015, 04:24 |
Osi udf
|
#5 |
New Member
Join Date: Oct 2013
Posts: 4
Rep Power: 13 |
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. |
|
November 18, 2015, 02:39 |
|
#6 |
Senior Member
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23 |
I will give it a try. Thanks Khuti!
|
|
November 25, 2015, 05:49 |
|
#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. |
|
December 20, 2015, 05:33 |
|
#8 |
New Member
Join Date: Oct 2013
Posts: 4
Rep Power: 13 |
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! |
|
October 26, 2019, 16:20 |
Osi udf
|
#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 |
|
January 3, 2020, 06:22 |
|
#10 |
New Member
wangke
Join Date: Jan 2020
Posts: 1
Rep Power: 0 |
||
August 11, 2021, 06:13 |
|
#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 |
|
August 12, 2021, 00:48 |
|
#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 |
|
August 12, 2021, 01:22 |
|
#13 |
New Member
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5 |
||
August 16, 2021, 03:19 |
|
#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 |
||
August 17, 2021, 13:42 |
|
#15 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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". |
|
August 5, 2022, 16:23 |
time averaged values
|
#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 ? |
|
October 19, 2022, 04:07 |
Contour of OSI
|
#17 | |
New Member
shima mohammadi
Join Date: Oct 2022
Posts: 14
Rep Power: 4 |
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 |
||
October 19, 2022, 04:55 |
|
#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 |
|
October 19, 2022, 08:22 |
|
#19 | |
New Member
shima mohammadi
Join Date: Oct 2022
Posts: 14
Rep Power: 4 |
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 |
||
October 21, 2022, 03:21 |
|
#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 |
|
|
|
Similar Threads | ||||
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 08:29 |
Accessing wall shear stress using UDF | Robert | Fluent UDF and Scheme Programming | 2 | July 31, 2013 09:34 |
UDF of shear flows - Just need a little little help | yannossss | FLUENT | 5 | July 11, 2011 08:11 |
OpenFOAM install on Ubuntu Natty 11.04 | bkubicek | OpenFOAM | 13 | May 26, 2011 06:48 |
UDF for wall slipping | HFLUENT | Fluent UDF and Scheme Programming | 0 | April 27, 2011 13:03 |