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

Possibility of Location-dependent properties initialization

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2018, 16:22
Default Possibility of Location-dependent properties initialization
  #1
Member
 
Peter Maroul
Join Date: May 2018
Posts: 52
Rep Power: 8
Pmaroul is on a distinguished road
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
Pmaroul is offline   Reply With Quote

Old   September 7, 2018, 22:48
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
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)
    }
}
blackmask is offline   Reply With Quote

Old   September 8, 2018, 00:44
Default
  #3
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
LuckyTran is offline   Reply With Quote

Old   September 8, 2018, 03:44
Default
  #4
Member
 
Peter Maroul
Join Date: May 2018
Posts: 52
Rep Power: 8
Pmaroul is on a distinguished road
Excellent.

Thanks a lot for your kind answer.

P.Maroul
Pmaroul is offline   Reply With Quote

Reply

Tags
fluid properties, initialization, location-dependent


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
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


All times are GMT -4. The time now is 21:44.