CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF for calculating Oscillatory Shear Index (OSI)

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2013, 05:59
Default UDF for calculating Oscillatory Shear Index (OSI)
  #1
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22
vasava will become famous soon enough
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?
vasava is offline   Reply With Quote

Old   October 15, 2013, 08:53
Default
  #2
New Member
 
Join Date: Sep 2013
Posts: 2
Rep Power: 0
Mailto is on a distinguished road
I'm trying to do the same actually
Mailto is offline   Reply With Quote

Old   October 22, 2014, 07:02
Default osi in Fluent
  #3
New Member
 
Join Date: Sep 2011
Posts: 15
Rep Power: 14
djing is on a distinguished road
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
djing is offline   Reply With Quote

Old   October 23, 2014, 01:46
Default
  #4
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22
vasava will become famous soon enough
Sorry but I cant download it either. Anyways I calculated OSI with matlab however visualization of the calculated is still an issue for us.
vasava is offline   Reply With Quote

Old   October 29, 2015, 03:24
Default Osi udf
  #5
New Member
 
Join Date: Oct 2013
Posts: 4
Rep Power: 12
khuti is on a distinguished road
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.
Attached Files
File Type: c osi.c (1.7 KB, 445 views)
khuti is offline   Reply With Quote

Old   November 18, 2015, 01:39
Default
  #6
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 22
vasava will become famous soon enough
I will give it a try. Thanks Khuti!
vasava is offline   Reply With Quote

Old   November 25, 2015, 04:49
Default
  #7
New Member
 
Join Date: Jun 2014
Posts: 1
Rep Power: 0
dhplsy is on a distinguished road
Thank you, Khuti.
I want to clarify if the OSI values are area-averaged.
dhplsy is offline   Reply With Quote

Old   December 20, 2015, 04:33
Default
  #8
New Member
 
Join Date: Oct 2013
Posts: 4
Rep Power: 12
khuti is on a distinguished road
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!
khuti is offline   Reply With Quote

Old   October 26, 2019, 15:20
Exclamation Osi udf
  #9
New Member
 
Andrea
Join Date: Oct 2019
Location: Italy
Posts: 2
Rep Power: 0
andrea impiombato is on a distinguished road
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
andrea impiombato is offline   Reply With Quote

Old   January 3, 2020, 05:22
Default
  #10
ATT
New Member
 
wangke
Join Date: Jan 2020
Posts: 1
Rep Power: 0
ATT is on a distinguished road
Quote:
Originally Posted by khuti View Post
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.
Can you give me?Thank you
ATT is offline   Reply With Quote

Old   August 11, 2021, 05:13
Default
  #11
New Member
 
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5
aerosuraj1 is on a distinguished road
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
aerosuraj1 is offline   Reply With Quote

Old   August 11, 2021, 23:48
Default
  #12
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
go to contours
-> contours of
-> user -defined memory
-> select "OSI" (also it could be udm-4)
aerosuraj1 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 12, 2021, 00:22
Default
  #13
New Member
 
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5
aerosuraj1 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
go to contours
-> contours of
-> user -defined memory
-> select "OSI" (also it could be udm-4)
thank you Alexander Z
aerosuraj1 is offline   Reply With Quote

Old   August 16, 2021, 02:19
Default
  #14
New Member
 
Suraj Shembekar
Join Date: Feb 2021
Location: India
Posts: 18
Rep Power: 5
aerosuraj1 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
go to contours
-> contours of
-> user -defined memory
-> select "OSI" (also it could be udm-4)
Dear Alexander sir,
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
Attached Images
File Type: png Screenshot (3).png (65.3 KB, 64 views)
aerosuraj1 is offline   Reply With Quote

Old   August 17, 2021, 12:42
Default
  #15
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   August 5, 2022, 15:23
Default time averaged values
  #16
Member
 
Alexandre M S Costa
Join Date: Apr 2009
Posts: 31
Rep Power: 17
amscosta is on a distinguished road
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 ?
amscosta is offline   Reply With Quote

Old   October 19, 2022, 03:07
Default Contour of OSI
  #17
New Member
 
shima mohammadi
Join Date: Oct 2022
Posts: 14
Rep Power: 3
sara9310 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
go to contours
-> contours of
-> user -defined memory
-> select "OSI" (also it could be udm-4)
Hello Alexander
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
sara9310 is offline   Reply With Quote

Old   October 19, 2022, 03:55
Default
  #18
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
AlexanderZ is offline   Reply With Quote

Old   October 19, 2022, 07:22
Default
  #19
New Member
 
shima mohammadi
Join Date: Oct 2022
Posts: 14
Rep Power: 3
sara9310 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
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
Code:/************************************************** ****
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
sara9310 is offline   Reply With Quote

Old   October 21, 2022, 02:21
Default
  #20
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
AlexanderZ is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 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


All times are GMT -4. The time now is 13:24.