|
[Sponsors] |
Possibility of Location-dependent properties initialization |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 7, 2018, 16:22 |
Possibility of Location-dependent properties initialization
|
#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 |
|
September 7, 2018, 22:48 |
|
#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) } } |
|
September 8, 2018, 00:44 |
|
#3 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
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.
|
|
September 8, 2018, 03:44 |
|
#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 |
|
|
Similar Threads | ||||
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 05:19 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |
Two-Phase Buoyant Flow Issue | Miguel Baritto | CFX | 4 | August 31, 2006 13:02 |
properties at specified location in Expression | Atit | CFX | 0 | April 3, 2006 16:22 |
UDF: source term dependent on location | Vladimir Krejci | FLUENT | 0 | April 2, 2003 09:38 |