|
[Sponsors] |
October 22, 2005, 14:04 |
Geometrical dependent physical property
|
#1 |
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, 02:24 |
Re: Geometrical dependent physical property
|
#2 |
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, 09:38 |
Re: Geometrical dependent physical property
|
#3 |
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, 10:39 |
Re: Geometrical dependent physical property
|
#4 |
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, 13:08 |
Re: Geometrical dependent physical property
|
#5 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
Temperature dependent thermal property in CFX | Subhadeep | CFX | 5 | March 22, 2012 02:52 |
does physical property in fluent depend on P or just depend T only? | gsyuan | FLUENT | 0 | December 30, 2009 22:07 |
Temperature dependent property | kdarc | OpenFOAM Running, Solving & CFD | 3 | March 27, 2007 17:21 |
about physical property of liquid oxygen | Mark | FLUENT | 0 | July 30, 2001 06:32 |