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

Field interpolation in mesh points code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2006, 09:21
Default I calculated field U and I nee
  #1
New Member
 
Jakub Zlamal
Join Date: Mar 2009
Posts: 1
Rep Power: 0
jzlam is on a distinguished road
I calculated field U and I need Ux,Uy,Uz in each point of mesh (together with mesh coordinates) like
1 x y z Ux Uy Uz
2 x y z Ux Uy Uz

to be able to import field to my program.

Can anyone give me code to do this? I am not succesfull to do it myself and I am little bit confused from C++ because I am programming in FORTRAN.

Thank for any advice

Jakub Zlamal
jzlam is offline   Reply With Quote

Old   December 14, 2010, 17:42
Default
  #2
nlc
Member
 
nlc's Avatar
 
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 61
Rep Power: 17
nlc is on a distinguished road
ave you tried something like this !

Code:
int main(int argc, char *argv[]) 
{ 

# include "setRootCase.H" 
# include "createTime.H" 
# include "createMesh.H" 
# include "createFields.H" 

  // Read  U field
  Info<< "Reading U field \n" << endl;
    volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

  pointField C = mesh.C()
  
  forAll(cell,U)
  {
  Info <<  C[cell] << U[Cell] << endl;
  }

  return(0); 
}
nlc is offline   Reply With Quote

Old   December 14, 2010, 17:48
Default
  #3
nlc
Member
 
nlc's Avatar
 
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 61
Rep Power: 17
nlc is on a distinguished road
or
Code:
  forAll(cell,U)
   {
   Info <<  cell 
        <<  C[cell].x() 
        <<  C[cell].y() 
        <<  C[cell].z() 
        << U[cell].x() 
        << U[cell].y() 
        << U[cell].z() 
        << endl;
   }
Regards
nlc 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
Interpolation between faces and points of a polyPatch hartinger OpenFOAM Running, Solving & CFD 12 March 7, 2016 14:08
2D Field Panel Method Source Code Shukla Main CFD Forum 3 January 20, 2011 13:51
Putting submesh field values into field on parent mesh helmut OpenFOAM Running, Solving & CFD 2 June 20, 2006 08:31
Mesh hard points on faces Ashton Peters FLUENT 4 March 15, 2005 16:43
Clustering points in Elliptic mesh Doctor Blade Main CFD Forum 3 October 16, 2004 12:01


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