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

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2021, 07:31
Post UDF for shear stress
  #1
PXY
New Member
 
pxy
Join Date: Apr 2021
Posts: 3
Rep Power: 2
PXY is on a distinguished road
Hello everyone,
I'm writing a code to define the wall shear stress, but it's always wrong. How to write it correctly?

τzx=-(σz*f+(ρ*g*vx^2)/ξ)

#include"udf.h"
#define F 0.3 /*friction coefficient*/
#define B 1000 /*turbulence parameter*/
#define D 1630 /*density*/
#define g 9.81
DEFINE_PROFILE(taux_profile, t, i)
{
real u, p;
face_t f;
Thread* t0;
cell_t c0;
begin_f_loop(f, t)
{
t0 = THREAD_T0(t);
c0 = F_C0(f, t);
p = C_P(c0, t0);
u = C_U(c0, t0);
F_PROFILE(f, t, i) = p * F + D * g * u * u / B;
}
end_f_loop(f, t)
}
DEFINE_PROFILE(tauy_profile, t, i)
{
real v, p;
face_t f;
Thread* t0;
cell_t c0;
begin_f_loop(f, t)
{
t0 = THREAD_T0(t);
c0 = F_C0(f, t);
p = C_P(c0, t0);
v = C_V(c0, t0);
F_PROFILE(f, t, i) = p * F + D * g * v * v / B;
}
end_f_loop(f, t)
}
PXY is offline   Reply With Quote

Old   May 19, 2021, 11:23
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,867
Rep Power: 23
pakk will become famous soon enough
Please explain how you concluded that it's wrong.
__________________
"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   May 19, 2021, 20:45
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,723
Rep Power: 28
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
check values of P and V/U you are extracting from adjusted to wall cells
you may do it using Messages to console
Code:
p = C_P(c0, t0);
u = C_U(c0, t0);
Message0("u = %f, p = %f\n",u,p);
__________________
best regards


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

Old   May 19, 2021, 23:55
Default
  #4
PXY
New Member
 
pxy
Join Date: Apr 2021
Posts: 3
Rep Power: 2
PXY is on a distinguished road
Quote:
Originally Posted by pakk View Post
Please explain how you concluded that it's wrong.
Similarly, when I don't use UDF, the result is convergent, but when I add UDF, my result shows "floating point exception"
PXY is offline   Reply With Quote

Old   June 5, 2021, 05:57
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,867
Rep Power: 23
pakk will become famous soon enough
Initialize, don't run, plot the shear stress.

Is it what you expect?
__________________
"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   June 9, 2021, 01:14
Default
  #6
PXY
New Member
 
pxy
Join Date: Apr 2021
Posts: 3
Rep Power: 2
PXY is on a distinguished road
Quote:
Originally Posted by pakk View Post
Initialize, don't run, plot the shear stress.

Is it what you expect?
Initialize but do not run, why is the shear stress a straight line equal to 0? Is my UDF written wrong?


I checked the units, length (m), Pressure (Pascal), but when I run it, it shows that the shear stress of wall is especially small.

PXY is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
How to validate udf for shear stress on a fluid cibi FLUENT 0 December 11, 2020 05:44
Fluent UDF Wall Shear Stress Segmentation Fault a1ananth Fluent UDF and Scheme Programming 3 February 24, 2015 03:23
Fluent UDF for interfacial stress in VOF rsingh7 Fluent UDF and Scheme Programming 0 July 18, 2014 16:54
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 23:33.