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

Write scalar in file in every timeFolder

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   September 19, 2013, 09:48
Default Write scalar in file in every timeFolder
  #1
Member
 
Martin
Join Date: Aug 2010
Location: Germany
Posts: 55
Rep Power: 15
RugbyGandalf is on a distinguished road
Dear Foam-Community,

i'd like to calculate the surface-area of the inlet-patch for a moving domain for every time step and write out the calculated value in a file in each time-folder.

For now i have the following code:

Code:
label inletPatchID = mesh.boundaryMesh().findPatchID("inlet"); 
    std::ofstream file("inlet_area.txt");
    file << gSum(mesh.magSf().boundaryField()[inletPatchID]) << std::endl;
    file.close();
But it only gives out a file in the case-directory (and overwrites it???)

Does anyone has any idea how to solve this?

Regards,
Martin
RugbyGandalf is offline   Reply With Quote

 


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
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 10:03
[Helyx OS] Helyx-OS (GUI for SnappyHexMesh elvis OpenFOAM Community Contributions 210 January 30, 2017 18:57
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


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