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

How to use the X coordinate in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Lieven

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2012, 08:27
Default How to use the X coordinate in OpenFOAM
  #1
Member
 
Zifei Yin
Join Date: Sep 2012
Location: Shanghai & Ames
Posts: 33
Rep Power: 13
yzf1215 is on a distinguished road
I need to use the X coordinate of mesh points to calculate other parameter. How can I read it in source files.
yzf1215 is offline   Reply With Quote

Old   November 15, 2012, 08:54
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
const volScalarField& xCoord = mesh.C().component(vector::X);

should do the trick.
mm.abdollahzadeh and rapierrz like this.
Lieven is offline   Reply With Quote

Old   November 15, 2012, 09:23
Default
  #3
Member
 
Zifei Yin
Join Date: Sep 2012
Location: Shanghai & Ames
Posts: 33
Rep Power: 13
yzf1215 is on a distinguished road
Quote:
Originally Posted by Lieven View Post
const volScalarField& xCoord = mesh.C().component(vector::X);

should do the trick.
So, if I want to use scalar, I can just replace vector by scalar?
yzf1215 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
Comparison of axisymmetric case, Starccm+ and OpenFOAM linnemann OpenFOAM Running, Solving & CFD 12 June 16, 2011 05:43
[mesh manipulation] createPatch / cyclicGgi / OpenFoam 1.5-dev OFU OpenFOAM Meshing & Mesh Conversion 0 June 16, 2010 04:36
OpenFOAM 1.5.x package - CentOS 5.3 x86_64 linnemann OpenFOAM Installation 7 July 30, 2009 03:14
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
OpenFOAM Training and Workshop Zagreb 2628Jan2006 hjasak OpenFOAM 1 February 2, 2006 21:07


All times are GMT -4. The time now is 10:48.