CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

How to get the spacial poisiton

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2010, 15:59
Default How to get the spacial poisiton
  #1
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 19
benk is on a distinguished road
Is there an easy way to get the spacial position of a node?

For example, on a 2D mesh that's 1m x 1m, I need to multiply a diffusivity by its distance between the current location on the mesh and from the origin (ie. x=0,y=0,z=0).

So I need something like:

Code:
forAll(diffusivity, i) {
    diffusivityNew[i] = diffusivity*distance_x[i]*distance_y[i];
}
I'm not sure how to get the distance_x[i] and distance_y[i] parts.
benk 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
monitoring spacial variation of a quantity James FLUENT 1 January 10, 2008 10:45
udf with spacial and time variables hongxiao FLUENT 6 March 17, 2005 23:46
creat a spacial plane llunchun Phoenics 4 December 18, 2002 04:02


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