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 a SEMIcircular inlet cross section (3D simulation)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 2, 2022, 08:49
Default UDF for a SEMIcircular inlet cross section (3D simulation)
  #1
New Member
 
Alex
Join Date: Dec 2020
Posts: 15
Rep Power: 5
Kerouac is on a distinguished road
I everyone,
currently I'm trying to solve numerically the multiphase flow in a semi-cylinder (the problem is symmetrical with respect to a given plane passing through the center of the cylinder; on that plane a symmetry b.c. has been imposed).
What I want to impose is a fully-developed flow as boundary inlet condition; the expression for the velocity profile, if the problem was 2D-axisymmetric, would be the following:

u(r)=-10.1424*r^3+0.0516*r^2-0.0197*r+0.087

does has anyone idea about how to write the UDF?

Thanks in advance,
Kerouac
Kerouac is offline   Reply With Quote

Old   January 3, 2022, 02:25
Default
  #2
New Member
 
Join Date: Jun 2021
Posts: 13
Rep Power: 5
anan12345 is on a distinguished road
Did you try using Fluent's expressions? If I remember correctly, you can define radius as (x**2+y**2) and write your expression directly into Fluent's GUI without ever needing to compile a UDF for it.
anan12345 is offline   Reply With Quote

Old   January 4, 2022, 09:35
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
It's a DEFINE_PROFILE condition. The manual has an example.

My hint would be to start with that example, and change the equation to yours. If this is giving you problems, please be more specific on which step is giving you problems.
__________________
"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   January 6, 2022, 06:37
Default
  #4
New Member
 
Alex
Join Date: Dec 2020
Posts: 15
Rep Power: 5
Kerouac is on a distinguished road
I solved the problemby myself.
The idea is that to write a normal udf for velocity inlet, as it was a complete circular cross section in 3D domain. The symmetry does not have influence on the profile, because the inlet flow field is simply symmetrized.
I will post the complete udf, for those which have a similar problem:

#include "udf.h"
#include "math.h"
DEFINE_PROFILE(inlet_y_velocity, thread, index)
{
real y[ND_ND]; /* this will hold the position vector */
real x;
real z;
real a;
face_t f;
begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/
{
F_CENTROID(y,f,thread);
x =y[1];
z =y[1];
a = pow((pow(x,2)+pow(z,2)),0.5);
F_PROFILE(f, thread, index) = -10.142387415545718*a*a*a+0.051610679345377*a*a-0.019652442143266*a+0.087031654863898;
}
end_f_loop(f, thread)
}

Best regards,
Kerouac
Kerouac is offline   Reply With Quote

Reply

Tags
udf and programming, velocity udf


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
static Pressure profile using udf at velocity inlet vivek123 Fluent UDF and Scheme Programming 0 September 22, 2021 15:44
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
UDF to avoid shock at wind tunnel inlet Goel FLUENT 0 June 20, 2021 18:24
UDF problem- time dependent temperature at inlet kaeran FLUENT 1 June 16, 2015 22:48
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 12:21


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