
[Sponsors] 
January 26, 2017, 18:49 
Compute mean velocity field and mean pressure field in runtime

#1 
Member
Join Date: Apr 2016
Posts: 32
Rep Power: 3 
Hi,
I was wondering if it is possible to use surface sampling to compute the mean velocity and pressure field on a cut plane. I want to compute the mean average on the desired plane during runtime of a 3D LES simulation so that later I could compare it to the mean velocity and pressure field obtained by a 2D RANS simulation. Is it possible to do it in OpenFoam? PS. I don't want to use fieldAverage function to obtain the mean fields in the whole 3D domain due to the numerical costs. Thanks. 

January 27, 2017, 04:05 

#2 
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 547
Rep Power: 18 
Hi there,
A Good Morning to you. You can have a look at this thread... should give you what you want...: average over cutting plane during runtime However, a cutting plane is by default infinite, and if the cutting plane cuts your geometry at multiple Locations, you will get inconsistent / unexpected results. To solve that, if you are using the "plus" Version (3.0+, 1606+, 1612+) Versions of OpenFOAM, have a look at this...: http://www.openfoam.com/versionv3.0...itTimeAndSpace The other option is to use the triSurfaceMesh sampling method, and define an STL surface on which to calculate the average. If the average you want to calculate can be calculated on a patch, that would be the easiest. You can get some more information about sampling here...: http://www.openfoam.com/documentatio...ide/sample.php Hope this helps. Regards, Philippose 

January 27, 2017, 09:06 

#3  
Member
Join Date: Apr 2016
Posts: 32
Rep Power: 3 
Quote:


January 27, 2017, 13:26 

#4 
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 547
Rep Power: 18 
Hello again,
What do you mean by "whole mean velocity"? And mean velocity over time in that, do you want a surface field which for each point does something like..: Code:
Umean(x,y) = sum(U(x,y)[t])/totalTime In the former case, the best option would be to use something like "swak4Foam"... maybe a swakExpression, with a sum accumulation. Information about swak4Foam can be found at: https://openfoamwiki.net/index.php/Contrib/swak4Foam Regards, Philippose 

January 27, 2017, 14:05 

#5 
Member
Join Date: Apr 2016
Posts: 32
Rep Power: 3 
Thanks again. This is exactly what I mean, a surface field for Mean velocity and pressure.


February 21, 2017, 13:23 

#6 
New Member
Daniel Rodriguez Calvete
Join Date: Mar 2012
Location: Ferrol (A Coruņa) Spain
Posts: 10
Rep Power: 7 
Hi there,
I am also interesting in knowing if there is some how to calculate a time average of a field for a given plane at run time. In my case I want to calculate the average on a plane in a field generated by a rotating impeller in a stirred tank using pimpleDyMFoam. I tried this code into controlDict, but it does not give a plane but a whole average field. Code:
Uplane { type expressionField; dimension [0 1 1 0 0 0 0]; fieldName "Uplane"; valueType surface; surfaceName testCuttingPlane; surface { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (0 0 0); normalVector (1 1 0); } interpolate true; } expression "U"; verbose true; autowrite true; outputControl timeStep; } fieldAverage1 { type fieldAverage; functionObjectLibs ("libfieldFunctionObjects.so"); resetOnRestart false; resetOnOutput false; // outputControl timeStep; outputInterval 100; fields ( Uplane { mean on; prime2Mean off; base time; } U { mean on; prime2Mean off; base time; } ); } Thank you in advance 

Tags 
mean velocity, openfoam, post processing, sampling 
Thread Tools  
Display Modes  

