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

How to loop the outer cells of the volume cell zone?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2017, 06:28
Default How to get cell adjacent to another thread?
  #1
New Member
 
Gene
Join Date: Mar 2017
Posts: 13
Rep Power: 9
gzsakuraz is on a distinguished road
Hi,
I have been working for several days. I have 3 cell zones.
their arrangement: surface(ID=42)/volume(ID=60)/volume
The problem is I want to get face area(that point to surface) and volume of the cells that ONLY adjacent to surface(ID=42).
Here is my effort. So I started with looping all faces in ID=42 which is the surface and check whether c1 has thread number equal to 60.


Please help me

#include "udf.h"
#include "mem.h"
DEFINE_EXECUTE_AT_END(execute_at_end){
Domain *d;
face_t f, f0;
cell_t c, c1;
Thread *t, *t1, *ct;
int Zone_ID = 42; /* ice outer = 42 */
d = Get_Domain(1);
real A[], area=0;
/* Loop over all faces on ice outer(surface) */
t = Lookup_Thread(d, Zone_ID);
begin_f_loop(f,t)
{
/* c0 and t0 identify the adjacent cell */
t1 = THREAD_T1(t); //return number of thread (ice layer = 60)
if (t1==60){
c1 = F_C1(f, t0); //return cell index of opposite thread to 42 which is 60
F_AREA(A,f,t);//area vector on the surface
area = NV_MAG(A);//magnitude of the area
}
end_f_loop(f,t)
}
}

Last edited by gzsakuraz; April 12, 2017 at 08:36.
gzsakuraz is offline   Reply With Quote

Old   April 12, 2017, 14:46
Default
  #2
New Member
 
Swapnil Chavanda
Join Date: Jan 2017
Location: Pune
Posts: 19
Rep Power: 9
swpnl9282@gmail.com is on a distinguished road
I think you are doing in right way

Sent from my Moto G (4) using CFD Online Forum mobile app
swpnl9282@gmail.com is offline   Reply With Quote

Reply


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 11:58
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 11:52
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 20:43
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14


All times are GMT -4. The time now is 19:32.