|
[Sponsors] |
Possibility of Location-dependent properties initialization |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Peter Maroul
Join Date: May 2018
Posts: 52
Rep Power: 8 ![]() |
Hello all.
Is it possible to initialize some fluid flow properties as functions in terms of geometric location in FLUENT ANSYS? For example: Rho (x,y)= 2x+3y+100 How can I initialize above expression in Fluent? Thx in advance for any kind answer. P.Maroul |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
|
Yes, you can use the following code, which is adapted from the fluent UDF manual.
Code:
#include "udf.h" DEFINE_INIT(my_init_func, d) { cell_t c; Thread *t; real xc[ND_ND]; thread_loop_c(t,d) { begin_c_loop_all(c,t) { C_CENTROID(xc,c,t); C_R(c, t) = 2.0*xc[0] + 3.0*xc[1] + 100; } end_c_loop_all(c,t) } } |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,728
Rep Power: 66 ![]() ![]() ![]() |
Another way without a udf is to use custom field functions. You cannot apply formulas to primitive fields directly. However, you can create a dummy custom field. Then use the patch feature to patch each primitive variable with this custom field (initialize the fields with anything and overwrite them using the patch). This way you don't need to deal with any udf's.
|
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Peter Maroul
Join Date: May 2018
Posts: 52
Rep Power: 8 ![]() |
Excellent.
Thanks a lot for your kind answer. P.Maroul |
|
![]() |
![]() |
![]() |
Tags |
fluid properties, initialization, location-dependent |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to incorporate temperature dependent thermophysical properties in fluent. | CANDY | Fluent UDF and Scheme Programming | 4 | October 22, 2012 04:19 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |
Two-Phase Buoyant Flow Issue | Miguel Baritto | CFX | 4 | August 31, 2006 12:02 |
properties at specified location in Expression | Atit | CFX | 0 | April 3, 2006 15:22 |
UDF: source term dependent on location | Vladimir Krejci | FLUENT | 0 | April 2, 2003 08:38 |