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

Accessing Velocity Components

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2011, 17:47
Default Accessing Velocity Components
  #1
Member
 
Join Date: Sep 2010
Posts: 36
Rep Power: 15
anfho is on a distinguished road
Dear All,

How can I access the components of volVecorField U ?

Meaning: u, v, w component.

Thanks for the help.
Andreas
anfho is offline   Reply With Quote

Old   June 30, 2011, 19:21
Default
  #2
Member
 
Join Date: Sep 2010
Posts: 36
Rep Power: 15
anfho is on a distinguished road
I've been doing trial and error for a while, but at the end it wasn't as complicated as I thought, if I do:

Code:
      double lesCllCtrDomSze  = U.size();
      double ules[lesCllCtrDomSze];
      double vles[lesCllCtrDomSze];
      double wles[lesCllCtrDomSze];
      OFstream uvw_velocities ( "uvw_velocities" );
      for(int i=0; i<lesCllCtrDomSze; i++)
      {
        Vector<double> Uvector = U[i];
        ules[i] = Uvector.x();
        vles[i] = Uvector.y();
        wles[i] = Uvector.z();

        uvw_velocities <<ules[i]<<", " <<vles[i]<<", " <<wles[i] <<endl;
      }
everything works perfectly fine.

This link was helpful:
http://www.cfd-online.com/Forums/ope...ell-label.html
anfho 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
Results of CFX Simulations Sof_70_Usthb CFX 3 July 9, 2011 06:15
Emergency:UDF for a time dependent parabolic velocity zumaqiong Fluent UDF and Scheme Programming 12 March 25, 2010 12:00
Velocity Components in foamDataToFluent flavio_pergolesi OpenFOAM Post-Processing 1 November 9, 2009 09:27
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 02:15
How to specify velocity components in UDF Ynot FLUENT 1 March 11, 2006 13:53


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