# Time Average of Forces or Coefficient Values for Steady State Simulation

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 11, 2020, 22:04 Time Average of Forces or Coefficient Values for Steady State Simulation #1 New Member   Nian Join Date: Jun 2019 Posts: 9 Rep Power: 2 Hello, This might be a really basic question, but haven't found much information on it. I am currently using OpenFOAM 18.10, running a simulation at steady state for 500 time steps with simpleFoam, and output gives me forces and force coefficient values. But because of the nature of the geometry, the flow appears to be transient, and all of the force values would vary slightly for each of the time steps. So my question is, would there be any ways to generate a time averaged value for the force coefficients, say for example from time step 450-500 out of all the values? If so, what kind of code or function should I be adopting? Or would it also be possible to achieve in post processing? (Sorry if this question ends up being more suited to the post processing topic) Here's my very basic version of controlDict, not sure if this will be the place where I define these things: Code: ```FoamFile { version 2.0; format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application simpleFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 500; deltaT 1; writeControl timeStep; writeInterval 100; purgeWrite 0; writeFormat binary; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable true; functions { #include "streamLines" #include "cuttingPlane" #include "forceCoeffs" #include "forces" }``` I would really appreciate if someone could point me in the right direction, thank you! -Nian

 February 13, 2020, 05:31 #2 Senior Member   Tom Fahner Join Date: Mar 2009 Location: Breda, Netherlands Posts: 529 Rep Power: 18 Hi, I am not sure if this is already available in your version of OpenFOAM, but at least for v1912 there is the valueAverage functionObject: Code: ```valueAverage1 { type valueAverage; libs ("libfieldFunctionObjects.so"); writeToFile yes; log yes; functionObject forceCoeffs1; fields (Cm Cd Cl); window 0.5; }``` (The above code was copied from the documentation) The alternative would be to read the data from the outputfile with another program (I prefer python).

 February 13, 2020, 21:07 #3 New Member   Nian Join Date: Jun 2019 Posts: 9 Rep Power: 2 Hi, There seems to be only fieldAverage function in 18.10, but I appreciate you posting the documentation! I suppose post processing in another program would be the easiest in this case then, just wanted to check in case there is an easier way. Thank you! -Nian

 Tags drag coefficient, time average