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

UDF for upper wall velocity lid-driven cavity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2018, 16:24
Default UDF for upper wall velocity lid-driven cavity
  #1
New Member
 
Erdem
Join Date: Aug 2014
Posts: 3
Rep Power: 12
piri is on a distinguished road
Hello,
I am trying to give a position depended velocity to lid-driven cavity, top wall. My coordinate system is x-y and top wall is located at y=top.

I know all the procedure about loading the udf etc. but for some reason my udf is not working.

#include "udf.h"
DEFINE_PROFILE(top_x_velocity, thread, position)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,thread)
{ F_CENTROID(x-coord, f, thread);
y = x-coord[1];
F_PROFILE(f, thread, position) = y*3+5;
}
end_f_loop(f, thread)
}

+5 part is working but not the y*3. My idea is to have the cavity from -1 to 1 and have a top wall velocity (x^2-1)^2 so on the corners there won't be any singularity.
piri is offline   Reply With Quote

Old   March 28, 2018, 21:59
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
you have define x variable ( real x[ND_ND] ), but use x-coord later. Why? This is mistake
Read console output after compiling your code to avoid such mistakes

Best regards
AlexanderZ is offline   Reply With Quote

Old   March 29, 2018, 12:15
Default
  #3
New Member
 
Erdem
Join Date: Aug 2014
Posts: 3
Rep Power: 12
piri is on a distinguished road
Yes, you are right. I was doing exactly what you mentioned because initially, I used only x there. But in Fluent it was reported y-coord x-coord. I thought that was the mistake but it is not. For some reason I get 5 from F_PROFILE(f, thread, position) = y*3+5; not the y*3 which should be x position*3 @ the top wall. As I mentioned in the main post I want to avoid the singularity at the corners for scientific reasons. I
piri is offline   Reply With Quote

Reply

Tags
lid driven cavity, 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
Methods to optimize the performance of simpleFoam solver for lid driven cavity case Sumeet Patil OpenFOAM 0 October 15, 2016 06:06
lid driven cavity varying results yasmil OpenFOAM Running, Solving & CFD 2 October 6, 2016 22:42
Lid driven cavity- Moving wall BC.!!! Vino SU2 1 September 25, 2014 11:50
Lid Driven Cavity velocity profiles new_at_this Main CFD Forum 0 December 22, 2011 17:04
Lid Driven Cavity using Ghost Cell Method and in C++ illuminati5288 Main CFD Forum 0 August 12, 2011 23:05


All times are GMT -4. The time now is 00:19.