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

create an output file only at the endTime

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 3, 2011, 05:53
Default create an output file only at the endTime
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 208
Rep Power: 8
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, 11:18
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 386
Rep Power: 10
marupio is on a distinguished road
I believe you're looking for:

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

Old   March 3, 2011, 11:29
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 208
Rep Power: 8
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, 04:15
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 912
Rep Power: 16
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

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
swak4foam building problem GGerber OpenFOAM 45 July 30, 2013 15:08
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
Compiling gmshFoam with OpenFOAM-1.5 BlGene Open Source Meshers: Gmsh, Netgen, CGNS, ... 10 August 6, 2009 04:26
Paraview command not found hardy OpenFOAM Paraview & paraFoam 7 September 18, 2008 04:59
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51


All times are GMT -4. The time now is 13:29.