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

Data minning on an arbitrary zone...

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2010, 23:43
Default Data minning on an arbitrary zone...
  #1
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16
gary7 is on a distinguished road
Hi everybody, I'm trying to get data on a surface in the field which I define it as a new surface...does anybody know
how I can get the flow field variables like velocity u, v, w on the specified surface and save them in file?
And what if the surface is not coincident with that cell nodes or cell centers? can I still get the data on the corresponding node projection on the surface?

I really appreciate any help,
gary7 is offline   Reply With Quote

Old   July 15, 2010, 11:28
Default
  #2
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16
gary7 is on a distinguished road
any help? idea? suggestion?
gary7 is offline   Reply With Quote

Old   July 15, 2010, 22:14
Default
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by gary7 View Post
Hi everybody, I'm trying to get data on a surface in the field which I define it as a new surface...does anybody know
how I can get the flow field variables like velocity u, v, w on the specified surface and save them in file?
And what if the surface is not coincident with that cell nodes or cell centers? can I still get the data on the corresponding node projection on the surface?

I really appreciate any help,
Resolution:
/************************************************** ***************************
* Udf to retrieve the cells and thread (and subsequently all other variables)
* through which a surface, created for postprocessing, passes
* Written by Suman Basu of Fluent India
************************************************** **************************/
#include "udf.h"
#include "surf.h"
#define SURFID 4 /*this is the id of the surface of interest
could be checked from Surface->Manage GUI panel*/
DEFINE_ON_DEMAND(loop_over_surface)
{
int phase_domain_index;
real x[ND_ND];
cell_t cell;
CX_Cell_Id c;
Surface surf=SurfaceList[SURFID];
int i;
Thread *cell_thread;
FILE *fp;
fp=fopen("store.dat","a");
Message("%d",surf.np);
for(i=0;i<surf.np;i++)
{
c=surf.points[i].cell;
cell=RP_CELL(&c);
cell_thread=RP_THREAD(&c);
C_CENTROID(x,cell,cell_thread);
/*writes the X and Y coordinates of the cell centroid and cell index in the file*/
fprintf(fp,"%g %g %d\n",x[0],x[1],cell);
}
fclose(fp);
}
gearboy is offline   Reply With Quote

Old   July 26, 2010, 14:07
Default
  #4
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 44
Rep Power: 16
gary7 is on a distinguished road
Thank you so much gearboy. It's perfect. This code returns the values on the centers of the cells through which the surface has passed. Since the surface is not necessarily passing through the cell centers but do you know how I can obtain the flow variables on the surface?
By the UDF you provided it is possible to obtain the cells through which the surface is passing do you know how the cell nodes coordinate can be obtained?
I mean by knowing the cell index and thread how I can find the coordinates of its nodes?

Thank you in advance,
gary7 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
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 16:33
[blockMesh] StitchMesh on two patches anita OpenFOAM Meshing & Mesh Conversion 31 April 4, 2013 12:51
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 02:08
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27
Sliding mesh error Karl Kevala FLUENT 4 February 21, 2001 16:52


All times are GMT -4. The time now is 18:26.