CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How to get the spacial poisiton (https://www.cfd-online.com/Forums/openfoam/76053-how-get-spacial-poisiton.html)

benk May 12, 2010 14:59

How to get the spacial poisiton
 
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.


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