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

3D UDF for rectangular domain inlet

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2020, 20:03
Default 3D UDF for rectangular domain inlet
  #1
New Member
 
AL AMEEN AHMED RUFAI
Join Date: Nov 2019
Posts: 2
Rep Power: 0
aar007 is on a distinguished road
Hi, I am trying to model a UDF for my wind tunnel inlet using power law.
1; when I try computing my inlet conditions from in reference value I get *nan* in velocity section
(#include "udf.h"

#define P 1./7. //power law n value 7//
#define uref 1.32 // m higeht of inlet//


DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND]; /* this will hold the position vector */
real z;
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z = x[2];
F_PROFILE(f, thread, position) = 40*pow(z/uref,P);
}
end_f_loop(f, thread)
}

2; I get the same issue and error when I try using the function expression.

uref [m s^-1] * (z / z_ref [m]) ** alpha3.my inlet is at x=-1 using magnitude and direction under velocity specification method


Last edited by aar007; March 31, 2020 at 20:06. Reason: additional information
aar007 is offline   Reply With Quote

Old   April 1, 2020, 04:10
Default Udf
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
The UDF is alright and you can use it. However, this cannot be used for initialization. DEFINE_PROFILE is not executed before initialization. You have to initialize by providing some value for the velocity.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 11, 2022, 08:06
Default
  #3
New Member
 
Ved prakash
Join Date: Sep 2019
Posts: 2
Rep Power: 0
ved prakash is on a distinguished road
Hi, have you found the solution?? I am also trying to use this expression. Please help me out.
ved prakash is offline   Reply With Quote

Old   May 11, 2022, 23:58
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
solution is written by vinerm one line above
ved prakash likes this.
__________________
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
Turbomachinery Mass imbalance sheaker CFX 12 September 5, 2019 09:09
Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity ozgeozge Fluent UDF and Scheme Programming 1 April 15, 2019 02:31
Fluent UDF wrong number of cells in parallel - correct in serial dralexpe Fluent UDF and Scheme Programming 7 May 17, 2018 09:26
Domain Imbalance HMR CFX 5 October 10, 2016 06:57
Reduced domain/ Pressure inlet to velocity inlet victoryv FLUENT 1 June 29, 2013 15:45


All times are GMT -4. The time now is 17:28.