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

create an output file only at the endTime

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2011, 06:53
Default create an output file only at the endTime
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi!

I would like to create an output file at my last time step. I wondered if an command similar to
Code:
    if (runTime.outputTime())
    {
          logFile << balbalbalblalba << endl;
    }
exist for the last time step ?

Any help would be appreciated.

Best regards,
Cyp
Cyp is offline   Reply With Quote

Old   March 3, 2011, 12:18
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
I believe you're looking for:

Code:
if (runTime.end())
marupio is offline   Reply With Quote

Old   March 3, 2011, 12:29
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Hi Marupio!

Thank you for your answer. I tried your suggestion but nothing is written inside my output file...
Cyp is offline   Reply With Quote

Old   March 4, 2011, 05:15
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
You could also put your write command behind the time loop:

Code:
while (runTime.run())
{
        [...]
}
logfile << STUFF;
Of course you will only be able to output variables that were defined outside the time loop brackets, e.g. in createFields.H.
akidess 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
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 14:06
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 BlGene OpenFOAM Meshing & Mesh Conversion 10 August 6, 2009 05:26
[OpenFOAM] Paraview command not found hardy ParaView 7 September 18, 2008 05:59
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 21:51


All times are GMT -4. The time now is 15:09.