|
[Sponsors] |
Setting pressure value for specific cells, UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 29, 2005, 15:37 |
Setting pressure value for specific cells, UDF
|
#1 |
Guest
Posts: n/a
|
Hello, I am trying to control the pressure for few specific cells in the domain by a UDF but haven't been successful yet.
as I read in the UDF manual I have to use DEFINE_ADJUST for that. now the question is how I should assign a specific value for those cells. Here's the code I wrote but doesn't work yet. The code wants to assign the pressure value of 500 for a band of cells within the +- delta width in y direction and between x1 and x2 in x direction. Any hint is appreciated /************************************************** ********* / UDF for satisfying the specific boundary conditions at / the interface ************************************************** **********/ #include "udf.h" #define delta 0.0003 #define x1 0.0532 #define x2 0.4092 #define y1 0.00635 #define y2 0.121 DEFINE_ADJUST(interface_adjust,d) { Thread *t; real x[ND_ND]; cell_t c; C_CENTROID(x, c, t); if (x[0] <= x2 & x[0] >= x1) C_P(c,t) = 100; if (x[1] > y1 - delta & x[1] < y1) C_P(c,t) = 500; if (x[1] < y1 + delta & x[1] > y1) C_P(c,t) = 500; if (x[1] > y2 - delta & x[1] < y2) C_P(c,t) = 500; if (x[1] < y2 + delta & x[1] > y2) C_P(c,t) = 500; } |
|
August 30, 2005, 17:41 |
Re: Setting pressure value for specific cells, UDF
|
#2 |
Guest
Posts: n/a
|
i think you need to put a cell loop to change the values in the cells.
something like thread_loop_c(t,d) { begin_c_loop(c,t) your_code_here end_c_loop(c,t) } |
|
September 1, 2005, 19:59 |
Re: Setting pressure value for specific cells, UDF
|
#3 |
Guest
Posts: n/a
|
Thanks Alec, It was certainly useful
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
correct UDF code for unsteady pressure boundary | James W | FLUENT | 0 | November 2, 2005 12:38 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 01:32 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |
UDF: neighbour cells, upwind cells | Dmitriy Makarov | FLUENT | 0 | February 18, 2001 14:53 |
Hydrostatic pressure in 2-phase flow modeling (long) | DS & HB | Main CFD Forum | 0 | January 8, 2000 16:00 |