CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Solely changing writeInterval's value affects the results -pimpleDyMFoam - AMI (https://www.cfd-online.com/Forums/openfoam-solving/121316-solely-changing-writeintervals-value-affects-results-pimpledymfoam-ami.html)

HakikiCanakkaleli July 25, 2013 14:52

Solely changing writeInterval's value affects the results -pimpleDyMFoam - AMI
 
Hi

== 1 ==

In short, the question is that:

Can specifying different values for "writeInterval" under the controlDict affect the final simulation results or not?

== 2 ==

There are 2 cases which are identical and are run at the same workstations with the same number of parallelized sub-domains. The cases are empty (i.e. no wall inside) rectangular domains wherein there are a circular rotating domain from the inlet to the outlet and the surrounding stationary domain. The inlet velocity is constant, uniform and axial only.

The only difference is the value of writeInterval.

1. Case:

Code:

startTime      0;

stopAt          endTime;

endTime        20;

deltaT          1e-5;

writeControl    adjustableRunTime;

writeInterval  1;

2. Case

Code:

startTime      0;

stopAt          endTime;

endTime        20;

deltaT          1e-5;

writeControl    adjustableRunTime;

writeInterval  0.01;

== 3 ==

Although the 2. case gives the expected constant axial speed unchanged, in the 1. case the axial velocity does increase/decrease at least 30% at certain regions (mostly inside the rotating domain).

== 4 ==

If solely changing writeInterval's value is said to be impossible to cause this, I will upload all the cases and detail all the required info.

Any help will be highly appreciated.

Many thanks in advance.

tomf July 26, 2013 03:34

Hi,

The first thing that comes to mind is the question whether you limit the time step to a fixed Courant number? If so, the time step can vary during the simulation and the variation is such that the writeInterval should be matched exactly. So if you reduce the writeInterval it can be that the time steps are smaller and you do not solve exactly the same case.

Regards,
Tom

alexeym July 26, 2013 03:41

Quote:

Originally Posted by HakikiCanakkaleli (Post 442012)
Hi

== 1 ==

In short, the question is that:

Can specifying different values for "writeInterval" under the controlDict affect the final simulation results or not?

Basically if you send shorter writeInterval you get smaller time-step. Usually OpenFOAM would like to make at least 5 steps between writes (i.e. if write interval is 1, max time step is 0.2). If your solutions is not fully converged bigger times steps can lead to different solution. There's an option maxDeltaT which can limit time step.

HakikiCanakkaleli July 26, 2013 09:08

Hi,

I will re-run the cases accordingly and will mention what has been changed under this thread.

Many thanks for your answers.

HakikiCanakkaleli July 27, 2013 09:30

I confirm that I made a mistake in setting-up the identical(!) cases. Literally the previous cases were not identical.

== 1 ==

In the previous cases, the time-step of both cases had been adjusted during the run supposedly due to

Code:

adjustTimeStep  yes;
== 2 ==

In the new cases, I set up the controlDict as:

Code:

application    pimpleDyMFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        20;

deltaT          0.001;

writeControl    runTime;

writeInterval  1;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

adjustTimeStep  no;

Now, everything is the same.

== 3 ==
Further, this showed me the relative importance of the time-step setting in the problem whilst the results can be affected anyways.

Many thanks for your help pointing out exactly where I was wrong.

musahossein November 28, 2014 19:00

difference between timeStep and clockTime
 
Dear all:

I am running OpenFOAM 2.2.1, sloshingTank2D. I would like to have output at every 0.02 seconds. Can anyone tell me the advantage of using timeStep vs clockTime? It appears that both of them depend on the writeInterval to determine when to write data. If writeInterval is a real number such as 0.02, one would expect the write to occur every 0.020000000000 seconds of time. But I have seen that does not quite happen. There are instances where OpenFOAM will write the results at 0.01999999 seconds.

Any suggestions will be greatly appreciated.

Thanks

musahossein November 29, 2014 11:07

writeInterval in OpenFOAM does not always write at the desired time
 
Quote:

Originally Posted by HakikiCanakkaleli (Post 442319)
I confirm that I made a mistake in setting-up the identical(!) cases. Literally the previous cases were not identical.

== 1 ==

In the previous cases, the time-step of both cases had been adjusted during the run supposedly due to

Code:

adjustTimeStep  yes;
== 2 ==

In the new cases, I set up the controlDict as:

Code:

application    pimpleDyMFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        20;

deltaT          0.001;

writeControl    runTime;

writeInterval  1;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

adjustTimeStep  no;

Now, everything is the same.

== 3 ==
Further, this showed me the relative importance of the time-step setting in the problem whilst the results can be affected anyways.

Many thanks for your help pointing out exactly where I was wrong.

I was wondering if you have had any problems whith OpenFOAM when running forcing write to occur at runTime, which defaults to the writeInterval variable. I am running OpenFOAM coupled with another code, where the code generates a displacement file, consisting of two lines of data (start time, start displacement, end time, end displacement) and sends to OpenFOAM to get pressure forces. The problem I have come across is that even though I set writeInterval to 0.02 seconds of simulated time, if the start and end times are multiples of 0.02 (eg, 0.02 to 0.04; 0.04-0.06 etc), OpenFOAM will, every once in a while generate a file with a time stamp of say 0.079999. I have gotten around this problem by increasing the timePrecision variable in controlDict to 7 (default is 6), and it seems to have corrected the problem. I am not sure whether this is a temporary fix or not.
Looking forward to your thoughts on this.
Thanks

masb January 9, 2024 02:54

How to change writeInterval values preserving the results?
 
Hi,

I would be grateful for your assistance.
Could you guide me on modifying the writeInterval values in the controlDict below from 0.25 to 10 without compromising the integrity of the results? Many thanks.

application buoyantPimpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 120;

deltaT 0.001;

writeControl adjustableRunTime;

writeInterval 0.25;

purgeWrite 10;

writeFormat binary;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 5;


All times are GMT -4. The time now is 18:00.