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

How to use the X coordinate in OpenFOAM

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

Like Tree1Likes
  • 1 Post By Lieven

Reply
 
LinkBack Thread Tools Display Modes
Old   November 15, 2012, 09: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: 4
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, 09:54
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 13
Lieven will become famous soon enough
const volScalarField& xCoord = mesh.C().component(vector::X);

should do the trick.
mm.abdollahzadeh likes this.
Lieven is offline   Reply With Quote

Old   November 15, 2012, 10:23
Default
  #3
Member
 
Zifei Yin
Join Date: Sep 2012
Location: Shanghai & Ames
Posts: 33
Rep Power: 4
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

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
Comparison of axisymmetric case, Starccm+ and OpenFOAM linnemann OpenFOAM Running, Solving & CFD 12 June 16, 2011 05:43
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 22:07


All times are GMT -4. The time now is 19:51.