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

Data minning on an arbitrary zone...

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 10, 2010, 22:43
Default Data minning on an arbitrary zone...
  #1
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 42
Rep Power: 7
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, 10:28
Default
  #2
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 42
Rep Power: 7
gary7 is on a distinguished road
any help? idea? suggestion?
gary7 is offline   Reply With Quote

Old   July 15, 2010, 21:14
Default
  #3
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 106
Rep Power: 7
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, 13:07
Default
  #4
Member
 
Kasra
Join Date: Jun 2010
Location: USA
Posts: 42
Rep Power: 7
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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
StitchMesh on two patches anita OpenFOAM Native Meshers: blockMesh 31 April 4, 2013 11:51
Fluent3DMeshToFoam simvun OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 48 May 14, 2012 05:20
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 01: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 19:57.