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

writeTimeIndex_ (or equivalent) possibly not updated for function objects

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 11, 2021, 20:02
Default writeTimeIndex_ (or equivalent) possibly not updated for function objects
  #1
New Member
 
Juan Salazar
Join Date: Jun 2019
Posts: 19
Rep Power: 6
saladbowl is on a distinguished road
Version: v2012

I was running a simulation with the setting

Code:
writeControl    adjustableRunTime;
adjustTimeStep yes;
writeInterval   .001;
runTimeModifiable yes;
in the main section of controlDict and

Code:
writeControl adjustableRunTime;
writeInterval   .001;
executeControl  adjustableRunTime;
executeInterval .001;
in all of my functionObjects in controlDict. Everything was working as expected. I then let the simulation run until a time of 0.008. I made some modifications to solver settings and restarted the simulation. Just after the simulation reached the runTime of 0.011, I edited controlDict and replaced all the intervals from 0.001 to 0.01.

I was expecting another write at 0.02, but this occurred at 0.018=0.008+0.01. So I decided to take a look at the code, and surely enough, I found the following in TimeIO.C

Code:
    if (oldWriteInterval != writeInterval_)
    {
        switch (writeControl_)
        {
            case wcRunTime:
            case wcAdjustableRunTime:
                // Recalculate writeTimeIndex_ to be in units of current
                // writeInterval.
                writeTimeIndex_ = label
                (
                    writeTimeIndex_
                  * oldWriteInterval
                  / writeInterval_
                );
            break;

            default:
            break;
        }
    }
Following this code, it seems that OpenFOAM did exactly as told (as always). However, all my function objects stopped outputting results after I changed writeInterval and executeInterval from 0.001 to 0.01.The last write operation in the postProcessing files is for 0.011. Is writeTimeIndex also used by writing routines for function objects? Is this the expected behaviour? I would like to know if this is just some misunderstanding on my behalf. It seems the writeTimeIndex should also be updated for anything that writes, but this does not seem to be the case for the function objects.
saladbowl is offline   Reply With Quote

Reply

Tags
functionobjects, io functions, update, writetimeindex


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
Run function objects on final time b.simpson OpenFOAM Post-Processing 3 September 19, 2022 20:09


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