|
[Sponsors] |
UDF for upper wall velocity lid-driven cavity |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 28, 2018, 16:24 |
UDF for upper wall velocity lid-driven cavity
|
#1 |
New Member
Erdem
Join Date: Aug 2014
Posts: 3
Rep Power: 12 |
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. |
|
March 28, 2018, 21:59 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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 |
|
March 29, 2018, 12:15 |
|
#3 |
New Member
Erdem
Join Date: Aug 2014
Posts: 3
Rep Power: 12 |
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
|
|
Tags |
lid driven cavity, udf |
|
|
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 |