Averaging in channelFoam
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? |
Quote:
|
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. |
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 |
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 |
Quote:
Thank you very much for your help! Regards, Steven |
All times are GMT -4. The time now is 14:45. |