|
[Sponsors] |
September 30, 2010, 09:10 |
Averaging in channelFoam
|
#1 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 15 |
Dear Foamers,
I am trying to start the averaging after a certain time in my simulation. Acoording to the wiki this should be possible using the keyword "after":http://openfoamwiki.net/index.php/Co...unctionObjects However, I can not get it to work. Here is my function in the controlDict file: functions { fieldAverage1 { type fieldAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); cleanRestart true; enabled true; outputControl outputTime; after 5/1.8e-4;//5 non-dimensional time-units for Retau=180 fields ( U { mean on; prime2Mean on; base time; } p { mean on; prime2Mean on; base time; } ); } } I have tried various different syntaxes for the keyword after but every time the program starts to average immidiately. Does anyone have an idea about how to use the keyword "after" correctly? |
|
September 30, 2010, 14:33 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
October 1, 2010, 07:53 |
|
#3 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 15 |
Ok, thanks.
I'm now trying to rebuild the library for fieldAverage so that it can use this functionality. I will look in the simplefunction objects which function has this feature and rebuild it using that as an example. |
|
October 4, 2010, 10:05 |
|
#4 | |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 15 |
Quote:
Ok, I got it working. Mainly thanks to your source-code for simpleFunctionObject. So thank you for that. I have another question, how do you control the calling of the member functions from the channelFoam? In the comments you give some information about the calling of "start" and "execute". But for the fieldAverage function the channelFoam calls the "constructor", but also "execute" and "write". How can you manipulate this? For instance add a new member function to the class which is called from the solver? Testing the "libsampling.so" library it appears that the "execute" function is not called by the solver, but only the "write" function. Thanks in advance, Regards, Steven Last edited by stevenvanharen; October 5, 2010 at 06:24. |
||
October 5, 2010, 12:41 |
|
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Just a pointer for further research: http://foam.sourceforge.net/doc/Doxy...2ab372ca5c257b execute of all functionObjects get called whenever the time is increased. write is not in the interface of the functionObject http://foam.sourceforge.net/doc/Doxy...ionObject.html but a speciality of the simpleFunctionObjects You can add any member function to your subclass, but only those in the standard-interface will be called at special times. So your own methods must be called from one of those. Not much you can do about it without rewritting the Time-class (which I wouldn'T advise) Bernhard |
||
October 6, 2010, 08:04 |
|
#6 | |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 15 |
Quote:
Thank you very much for your help! Regards, Steven |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
different between the various averaging | huwei | CFX | 3 | February 22, 2015 13:09 |
When to use mass flow averaging | cspectre | CFX | 2 | December 6, 2009 05:30 |
Averaging LES | iko | FLUENT | 3 | July 3, 2008 05:55 |
Laplacian-weighted averaging | Ruben | Main CFD Forum | 0 | August 21, 2005 20:46 |
Start of averaging in LES | fab | Main CFD Forum | 2 | June 16, 2005 04:53 |