# Geometrical dependent physical property

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 22, 2005, 13:04 Geometrical dependent physical property #1 Jiri Novak Guest   Posts: n/a Hi folks, i concern with modeling the 3D laminar flow of viscous media. Recently, I try to simulate the local source of bubbles in the liquid. I don't need to take into effect the momentum transfer but only have to specify the density decrease in the liquid media in bubbling region (function of geometry, bubble volume fraction and temperature in general). I would most likely not to split the model in Gambit into 2 regions but spcify the density - material property as a function of position, temperature and bubble volume fraction. My developed UDF doesn't work so far. Can anyone help? #include udf.h // LINEAR TEMPERATURE DENSITY DEPENDENCY ro = A + B*T #define A 1300 // coef A #define B -0.2 // coef B*T // DEFINITION OF THE REGION COORDINATES IN WHICH BUBBLES TAKE PLACE #define X1 0.24 #define X2 0.37 #define Y1 0.0 #define Y2 0.25 #define Z1 -0.5 #define Z2 0.5 // BUBBLE VOLUME FRACTION #define BVF 0.25 DEFINE_PROPERTY (density,c,t,i) { cell_t c, real xc[ND_ND]; real ro; real T = C_T(c,t); begin_c_loop(c,t) { C_CENTROID(xc,c,t) if ((xc[0] > X1) && (xc[0]lessthan X2)) { if ((xc[1]> Y1) && (xc[1]lessthan Y2)) { if ((xc[2]> Z1) && (xc[2]lessthan Z2)) { ro = (A + B*T)*(1 - BVF); }}}//ro IN BUBBLE REGION else { ro = (A + B*T); }ro ELSEWHERE } end_c_loop(c,t) return ro; } for the web security reason i must use "lessthen" tag inspite of apropriate symbol here... regards Jirka

 October 24, 2005, 01:24 Re: Geometrical dependent physical property #2 RoM Guest   Posts: n/a Erase the loop. Fluent will call this udf for each cell so the loop is not neccessary. RoM

 October 24, 2005, 08:38 Re: Geometrical dependent physical property #3 Jiri Novak Guest   Posts: n/a I need to setup different density in diferent regions of model. I don't want to split the model in Gambit, becouse it's time demanding. I have an idea of geometricaly dependent density defined by UDF. However, this code doesn't work yet. Can anyone tell me why? Is it even possible to determine physical property by means of geometry in Fluent? #include "udf.h" DEFINE_PROPERTY(density,c,t,position) { cell_t c; real xc[ND_ND]; real ro; real T = C_T(c,t); C_CENTROID (xc,c,t); if (xc[0]>=0.631 && xc[0]<= 1.262) { ro = (1206.2 - 0.1245*T)*0.5; } else { ro = (1206.2 - 0.1245*T); } return ro; }

 October 24, 2005, 09:39 Re: Geometrical dependent physical property #4 RoM Guest   Posts: n/a 1. Dont redefine c inside your function since its passed by the solver. 2. The macro definition for DEFINE_PROPERTY is DEFINE_PROPERTY(name,c,t). The position statement is too much. The correct udf should look like this #include "udf.h" DEFINE_PROPERTY(density,c,t) { real xc[ND_ND]; real ro; real T = C_T(c,t); C_CENTROID (xc,c,t); if (xc[0]>=0.631 && xc[0]<= 1.262) ro = (1206.2 - 0.1245*T)*0.5; else ro = (1206.2 - 0.1245*T); return ro; } Also you should be aware, that this definition will cause some steep density gradients at the edges of you geometry which could lead to numerical instabilities. RoM

 October 24, 2005, 12:08 Re: Geometrical dependent physical property #5 Jiri Novak Guest   Posts: n/a Thanks You a lot, it's working now. Well, it only requires knowledge from C langueage basic course which i unlucky haven't been attending. Bye

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36 Subhadeep CFX 5 March 22, 2012 02:52 gsyuan FLUENT 0 December 30, 2009 22:07 kdarc OpenFOAM Running, Solving & CFD 3 March 27, 2007 16:21 Mark FLUENT 0 July 30, 2001 05:32

All times are GMT -4. The time now is 23:37.