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

writeControl writing every time step despire writeInterval specifying otherwise

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 4 Post By ykanani
  • 4 Post By kaszt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2017, 21:21
Default writeControl writing every time step despire writeInterval specifying otherwise
  #1
New Member
 
Katherine
Join Date: Feb 2016
Posts: 20
Rep Power: 10
kaszt is on a distinguished road
I'm having an issue with OpenFOAM writing data every time step. I'm using pimpleFoam with a max Courant number of 5, so I'm trying to take advantage of adjusting the time step to meet this criteria and speed things up a bit. But the problem is that no matter what scalar value I set "writeInterval" to, OF writes data every time step. Here is my controlDict file:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     pimpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5; 

deltaT          0.01; 

writeControl    adjustableRunTime;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  12; 

writeCompression off;

timeFormat      general;

timePrecision   12;

runTimeModifiable true;

adjustTimeStep  yes;

maxCo           5; 

functions
{
    forces
    {
        type        forces;
        functionObjectLibs  ("libforces.so");
        writeControl   timeStep;
        writeInterval  1;
        patches     (fixedWalls);
        
        pName       p;
        UName       U;
      
        rho	    rhoInf; 
        rhoInf      1.205; 
        log         true;
        CofR        (0 0 0); // origin for moment calculation
        
        writeFields yes;
        
        binData
        {
            nBin    90; //output data into 20 bins
            direction   (1 0 0); // bin direction
            format  gnuplot;
            cumulative  yes;
        }
    }


    forceCoefficients
    {
        type        forceCoeffs;
        functionObjectLibs  ("libforces.so");
        writeControl   timeStep;
        writeInterval  1;
        patches     (fixedWalls);
        
        writeFields yes;
        
        log         true;
        patches     (fixedWalls); // on cyl only
        pName       p;
        UName       U;
        dragDir     (1 0 0);
        liftDir     (0 1 0);
        pitchAxis   (0 0 1);
        CofR        (0 0 0);
        magUInf     10; // free stream velocity; inlet condition!!
        lRef        1;
        Aref        0.79; // cross sectional area
    
        rho	    rhoInf;
        rhoInf      1; 
        origin      (0 0 0);
    
        coordinateRotation
        {
            type        EulerRotation
            degrees     true;
            rotation    (0 0 0);
        }
        
        binData
        {
            nBin    90; //output data into 20 bins
            direction   (1 0 0); // bin direction
            format  gnuplot;
            cumulative  yes;
        }
    }
}
// ************************************************************************* //
It is to my understanding from the documentation that OF will write data every (writeInterval)*(deltaT) of simulation time. However, this case writes every time step. Changing the writeInterval scalar doesn't change this, nor does changing the method of writeControl (I've tried using timeStep and runTime, and both yield the same result). I have neither the desire nor the space to write every time step, so any tips would be greatly appreciated!

NOTE: I am running OpenFOAM-v1706 released here with Ubuntu 16.04.
kaszt is offline   Reply With Quote

Old   September 6, 2017, 08:48
Default
  #2
Senior Member
 
sheaker's Avatar
 
Oskar
Join Date: Nov 2015
Location: Poland
Posts: 184
Rep Power: 11
sheaker is on a distinguished road
Hi.
There is endTime set to 5 while writeInterval set to 100. I would set writeInterval to 0.1 or something like that. Maybe this solve Your problem.
sheaker is offline   Reply With Quote

Old   September 6, 2017, 12:14
Default
  #3
Member
 
Yousef
Join Date: Feb 2015
Posts: 40
Rep Power: 11
ykanani is on a distinguished road
Hi,
When you select
Code:
 writeControl    adjustableRunTime;
Then the value of writeInterval is the simulation time itself. In this case, it is NOT the number of iterations.

So first, as Oskar said, reduce the writeIntervals to a value less than your endTime. Anyways, this should not be the main issue. Since with your current config no time step should be saved.


I think it has something to do with your functionObjects. Please first remove them and verify that write behavior is resolved. Then, try setting writeFields to No in your functionObjects.

Regards,
Jelmer, AshaEgreck, JM27 and 1 others like this.
ykanani is offline   Reply With Quote

Old   September 6, 2017, 15:22
Default
  #4
New Member
 
Katherine
Join Date: Feb 2016
Posts: 20
Rep Power: 10
kaszt is on a distinguished road
You are right Yousef; the problem was with my functionObjects. Removing them resolved the write behavior, and then including them and setting writeFields to "no" works as intended. Thank you both for your help!
kaszt is offline   Reply With Quote

Old   May 28, 2020, 05:56
Default writeControl writing every time step
  #5
Member
 
le
Join Date: Nov 2009
Location: seoul
Posts: 34
Rep Power: 17
fsifsi is on a distinguished road
Hello Alls,
I use OF1812
in system/control
....
writeControl adjustableRunTime;
writeInterval 0.1071;
.....
and system/forces
.....
writeControl timeStep ;
writeInterval 10;
.....
OF writes every time step even though I change value of " writeInterval 10; "
So, appreciated your comments !
fsifsi is offline   Reply With Quote

Old   May 28, 2020, 18:47
Default
  #6
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

- Could you please share the `controlDict` and `force*` file entirely?
- What does OF write out at each time-step? `force` FO information or something else?
- Have you double checked the log file if the `force` FO is written every time-step? May be the time-step is tiny, and you misinterpreted what is going on?

thanks
HPE is offline   Reply With Quote

Old   July 15, 2024, 00:13
Default
  #7
chc
New Member
 
Join Date: Nov 2023
Posts: 18
Rep Power: 3
chc is on a distinguished road
For anyone coming across this in the future, I was dealing with a similar issue. One way of controlling your probes is by including the “executeControl” and “executeInterval” settings. For some reason this helps write at the expected interval instead of some other case, though I have found issues trying to use non integer values when using writeTime as the control. timeStep seems to be a better option for that.
chc is offline   Reply With Quote

Reply

Tags
adjustable run time, openfoam v1706+, write control


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 06:49
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50


All times are GMT -4. The time now is 16:38.