Dear OpenFoam users
Can so
Dear OpenFoam users
Can somebody explain what does runTime.write() does. I tried to look for the write() member function in Time.H but couldn't find any. Where can i find the corresponding peace of code !!!!!! Any help is greatly appreciated With Best Regards Jaswinder |
Hi Jaswinder,
Did you use d
Hi Jaswinder,
Did you use doxygen? Maybe you can find something on: http://foam.sourceforge.net/doc/Doxy...e-members.html Regards, Martin |
Not too difficult. runTime is
Not too difficult. runTime is class type Time:
db/Time/Time.H which is derived from objectRegistry, which is in turn derived from regIOobject: db/objectRegistry/objectRegistry.H db/regIOobject/regIOobject.H regIOobject has got a fiunction called write() and a virtual function writeObject: //- Write using given format, version and compression virtual bool writeObject ( IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp ) const; //- Write using setting from DB virtual bool write() const; Clearly, write is just a wrapper around writeData. This one is over-ridden for objectRegistry and reads: bool objectRegistry::writeObject ( IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp ) const { bool ok = true; for (const_iterator iter = begin(); iter != end(); ++iter) { if (objectRegistry::debug) { Pout<< "objectRegistry::write() : " << "Considering writing object " <<>name() <<>writeOpt() << endl; if (iter()->writeOpt() != NO_WRITE) { ok = iter()->writeObject(fmt, ver, cmp) && ok; } } return ok; }} Thus: loop over all objects registred in the object registry and offer them to write themselves. Each object will decide if it wants to do so, based on the settings, eg. NO_WRITE or AUTO_WRITE. Clear? Hrv |
Thanks Hrv
It couldn't be
Thanks Hrv
It couldn't be explained any better :-). Answer from the source itself is ought to be clear. Thanks Regards Jaswinder |
hi,
i would appreciate it i
hi,
i would appreciate it if somebody could explain how the lagrangian data is writen. i could not find the place where dieselspray or cloud are included into the "objectRegistry" so that their data is written. thanks in advance stephan |
write dataFile
Hi at all,
I have a problem with using runTime.write(). I like to write a dataFile only at every writeInterval. The data File contains the position of a flame at every time step. In order to avoid gaps or repetitions in the data-file after a stop in the simulation, the data-file should only be written when the rest of the data is stored to. I tried it with if(runTime.write()) { myStream<<...... } but this does not work right. Is there anybody how knows what to do? Thanks a lot in advance, Victor |
ok, it seems that runTime.write() is the problem! Sorry!
|
Hi all!
I'd like to create files every writeInterval (and which have the name of the corresponding writeInterval). I think I have to use runTime.write() or ofstream, but on this last case, it needs a const char argument (impossible to change/increment the file name). Anybody have any ideas on how to solve this? Thanks a lot in advance! Maxime |
Hi Maxime,
you can use Code:
if (runTime.outputTime()) When you want to write a volVectorField or volScalarField, the time steps path name is added automatically, so you get your data in different directories, but with the same file name: Code:
// write pressure in [Bar]: Code:
fileName casePath = cwd(); Code:
{ Code:
OFstream *myStreamPtr = NULL; |
Hi Martin,
I want to implement a transient boundary conditions, hence I need boundaryData file under constant. However, the problem is the property that I want to vary with time is dimensionedScalar (No_Read in CreateFields.H) instead of volScalarField. What can I do to implement this? What Q value should I put in the constant/transportProperties. I have tried to put this in the solver, but doesn't work. if (runTime.value() > 500) { Q = 600; } else { Q = 0; } Suggestions will be very much appreciated. Thanks in advance. Robert |
Timw Varying B.C.
Hi Robert
There is some timeVarying... boundary condition in src/finiteVolume/fields/fvPatchFields/derived. May be one of them be useful for you. Best regards Good luck Ata |
hi
what is writeinterval??? |
All times are GMT -4. The time now is 15:44. |