|
[Sponsors] |
Not continuous averaging when restarting a calculation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 19, 2013, 05:22 |
Not continuous averaging when restarting a calculation
|
#1 |
New Member
nicolas
Join Date: Oct 2009
Posts: 24
Rep Power: 17 |
Hi to all,
I am using the fieldAverage function to calculate average quantities. I am using an updated version of OpenFOAM 2.2.x with the necessary fixes for the restarting to work, since there was a bug in the code (see http://www.openfoam.org/mantisbt/view.php?id=854). Restarting works just fine, my problem is that when I restart from a previous calculation, it seems that the averaging is not continuous as it should be. In order to look at the time evolution of a mean value I am using the probeFunction. I can reproduce my problem using the cavity tutorial. I start averaging from the beginning up to 0.5 sec of simulation time. Then I restart the simulation for another 0.5 sec. Below are the functions objects used at the end of the controlDict: Code:
functions { fieldAverage1 { type fieldAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); enabled true; outputControl outputTime; resetOnOutput false; resetOnRestart false; fields ( p { mean on; prime2Mean off; base time; } ); } probesP { type probes; functionObjectLibs ("libsampling.so"); probeLocations ( (0.05 0.05 0.0) ); fields ( p pMean ); } } Am I doing something wrong with the flags that I am using, or is this a bug? Thanks, Nicolas |
|
June 19, 2013, 11:31 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
Did you cross-check with calculating the running mean of the sampled pressure itself?
|
|
June 20, 2013, 04:04 |
|
#3 |
New Member
nicolas
Join Date: Oct 2009
Posts: 24
Rep Power: 17 |
I have attached another figure showing the calculated running average of pressure, based on the values of pressure taken from the probe.
As you can see in the calculated running average there is no discontinuity. However, I can reproduce the discontinuity of pMean shown from the probes values, if I restart the averaging in my calculations, at t=0.5. To me it is clear, that openFoam restarts the averaging of pMean that is written in the probes. My question is why, since I am telling it not to. Code:
resetOnRestart false; resetOnOutput false; |
|
July 6, 2013, 22:59 |
|
#4 |
New Member
Hiroki Ono
Join Date: Jul 2013
Posts: 2
Rep Power: 0 |
I encountered the same problem. I noticed that issue by using Prime2Mean option. Prime2Mean value was always reseted to 0 when restarting.
I can reproduce my problem using the pisoFoam/pitzDaily tutorial like Nik done. I start averaging from the beginning up to 0.4 sec . Then I restart the simulation for another 0.4 sec. When I use 2.2.0, this problem has not appeared. but in 2.2.x (latest), it comes. I found that Foam::fieldAverage::initialize() function was not loaded in Foam::fieldAverage::read() in 2.2.x. and it will be loaded at 1st time call of Foam::fieldAverage::calcAverage(). https://github.com/OpenFOAM/OpenFOAM...fieldAverage.C https://github.com/OpenFOAM/OpenFOAM...fieldAverage.C So, mean and P2Mean values will reset after calculation started. I thought call of initialize() must be in Foam::fieldAverage::read(). I have tested to fix them with changing code as shown below. Code:
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::fieldAverageFixed::read(const dictionary& dict) { if (active_) { initialised_ = false; dict.readIfPresent("resetOnRestart", resetOnRestart_); dict.readIfPresent("resetOnOutput", resetOnOutput_); dict.lookup("fields") >> faItems_; readAveragingProperties(); } if (!initialised_) { initialize(); } } void Foam::fieldAverageFixed::execute() { if (active_) { calcAverages(); } } But I don't know whether it is truly correct or not. Please check and post if something is wrong. Last edited by h.ono; July 6, 2013 at 23:19. Reason: mistake |
|
July 23, 2013, 08:43 |
|
#5 |
New Member
nicolas
Join Date: Oct 2009
Posts: 24
Rep Power: 17 |
Dear Hiroki Ono,
thank you very much for the reply and suggested fix. Sorry for the late response but I had reported this bug to OpenFOAM and I was waiting for an official answer. I just got a reply that the issue has been fixed in the new version of 2.2.x. I guess based on your fix. This thread is located at: http://www.cfd-online.com/Forums/ope...-new-post.html Regards, Nicolas |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Starting field averaging using libFunctionObject after certain time | eelcovv | OpenFOAM Programming & Development | 25 | December 7, 2015 23:28 |
MRF and Heat transfer calculation | Susan YU | FLUENT | 0 | June 2, 2010 09:46 |
Nusselt averaging in Unsteady calculation | elyyan | FLUENT | 0 | August 7, 2006 14:48 |
unsteady calculation and Nusselt averaging | elyyan | FLUENT | 0 | August 4, 2006 15:32 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |