CFD Online Logo CFD Online URL
Home > Forums > General Forums > Main CFD Forum

Identifying specific cell for energy source

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 27, 2015, 17:59
Post Identifying specific cell for energy source
New Member
Mario Alberto
Join Date: Sep 2015
Location: Russian Federation
Posts: 10
Rep Power: 10
mrwts is on a distinguished road
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[1];
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;
return source;
end_c_loop(c, c_thread)

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
mrwts is offline   Reply With Quote


cell centroid, macros, source code, udf and programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
GPU Linear Solvers for OpenFOAM gocarts OpenFOAM Announcements from Other Sources 37 August 17, 2022 14:22
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
[] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 17:25
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
Warning 097- AB Siemens 6 November 15, 2004 04:41

All times are GMT -4. The time now is 00:49.