|September 27, 2015, 17:59||
Identifying specific cell for energy source
Join Date: Sep 2015
Location: Russian Federation
Posts: 10Rep Power: 3
Hi everybody, I am new in Fluent and UDF programming and I have got some troubles trying to create a simple UDF code.
I am working with an energy source, whose position is time-dependent. Using simple functions, I determine the source position in x and y. But, I need to compare that position with the cell centroid.
Which Macro Access Data should I use to get (or identify that specific cell, that cointains my source position point)?
Knowing the source position, my code goes like:
w = x_c;
if (pow((w-SOURCE_X_POSITION),2)+pow((w-SOURCE_Y_POSITION),2) < pow(r,2))
double V = 3.1415*pow(r,2);
source = power/V;
dS[eqn] = 0;
source = 0;
dS[eqn] = 0;
Somehow, I need the program to identify which specifics cell has to be compared with the source position. So it's basically: Identifying cell, which contains the source position, comparing its centroid with the source position and calculating the source power.
Thanks in advance
|cell centroid, macros, source code, udf and programming|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Patches to compile OpenFOAM 2.2 on Mac OS X||gschaider||OpenFOAM Installation on Windows, Mac and other Unsupported Platforms||134||December 5, 2015 04:30|
|refineWallLayer Error||Yuby||OpenFOAM Meshing & Mesh Conversion||0||April 27, 2015 18:25|
|SparceImage v1.7.x Issue on MAC OS X||rcarmi||OpenFOAM Installation on Windows, Mac and other Unsupported Platforms||4||August 14, 2014 06:42|
|GPU Linear Solvers for OpenFOAM||gocarts||OpenFOAM Announcements from Other Sources||35||March 1, 2012 21:41|
|Warning 097-||AB||CD-adapco||6||November 15, 2004 05:41|