CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Compute mean velocity field and mean pressure field in runtime

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

Like Tree3Likes
  • 1 Post By philippose
  • 1 Post By Eman.
  • 1 Post By philippose

Reply
 
LinkBack Thread Tools Display Modes
Old   January 26, 2017, 18:49
Default Compute mean velocity field and mean pressure field in runtime
  #1
Member
 
Join Date: Apr 2016
Posts: 32
Rep Power: 3
Eman. is on a distinguished road
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.
Eman. is offline   Reply With Quote

Old   January 27, 2017, 04:05
Default
  #2
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 547
Rep Power: 18
philippose will become famous soon enough
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/version-v3.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
Eman. likes this.
philippose is offline   Reply With Quote

Old   January 27, 2017, 09:06
Default
  #3
Member
 
Join Date: Apr 2016
Posts: 32
Rep Power: 3
Eman. is on a distinguished road
Quote:
Originally Posted by philippose View Post
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/version-v3.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
Thanks for your detailed answer, but the first code you provided gives the spatial average over the cut plane(planar average) in different time steps. I need a code that gives the whole mean velocity and pressure fields on the specified plane.
student666 likes this.
Eman. is offline   Reply With Quote

Old   January 27, 2017, 13:26
Default
  #4
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 547
Rep Power: 18
philippose will become famous soon enough
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
Or are you looking for a single value which is a mean of the velocity (that would be spatial average)?

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
Eman. likes this.
philippose is offline   Reply With Quote

Old   January 27, 2017, 14:05
Default
  #5
Member
 
Join Date: Apr 2016
Posts: 32
Rep Power: 3
Eman. is on a distinguished road
Quote:
Originally Posted by philippose View Post
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
Thanks again. This is exactly what I mean, a surface field for Mean velocity and pressure.
Eman. is offline   Reply With Quote

Old   February 21, 2017, 13:23
Default
  #6
New Member
 
Daniel Rodriguez Calvete
Join Date: Mar 2012
Location: Ferrol (A Coruņa) Spain
Posts: 10
Rep Power: 7
DanielRCalvete is on a distinguished road
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;

            }

        );
    }
Someone can help me?, I really need this tool.

Thank you in advance
DanielRCalvete is offline   Reply With Quote

Reply

Tags
mean velocity, openfoam, post processing, sampling

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 00:22.