CFD Online Discussion Forums

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

HakikiCanakkaleli July 25, 2013 15: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 04: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 04: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 10: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 10: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 20: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


All times are GMT -4. The time now is 23:44.