|
[Sponsors] |
Open a file at first time step to write data in it(and restart) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 8, 2022, 21:08 |
Open a file at first time step to write data in it(and restart)
|
#1 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Hello everyone
How can I open a file only at first time step and write my data there? The problem is that, I need to restart the code, and when I restart the code, it opens a new file and write from "restartTime" there and I loose the transient data until "restartTime". I want to use "if"; Code:
label curTimeIndex = mesh.time().timeIndex(); if(curTimeIndex == 1) { ofstream myfile1; myfile1.open ("kineticEnergyFFD.txt"); } Code:
postprocessingFFD.H:731:3: error: ‘myfile1’ was not declared in this scope myfile1 << runTime.timeName() << " " << avekineticEnergy0 << " " << minkineticEnergyNew << " " << maxkineticEnergyNew << Farzad |
|
Tags |
data file, first time step, openfoam, restart |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 12:46 |