CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

The operation in OpenFOAM: fvc::average

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By openfoammaofnepo
  • 2 Post By Hiroshiman
  • 2 Post By openfoammaofnepo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2014, 16:37
Question The operation in OpenFOAM: fvc::average
  #1
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
Dear All,

The following operation is used for average:

Code:
fvc::average
But does anybody know how it is defined in Openfoam? I mean what is it based for the averaging operations? Where is it defined in OF?

Thanks.

OFFO
Gang Wang and ali moeni like this.
openfoammaofnepo is offline   Reply With Quote

Old   April 3, 2014, 16:41
Default
  #2
Member
 
Join Date: Sep 2012
Posts: 51
Rep Power: 13
Hiroshiman is on a distinguished road
You can find the definition in :
src/finiteVolume/finiteVolume/fvc/fvcAverage.* It's defined as "Area-weighted average a surfaceField creating a volField".
Bali and ali moeni like this.
Hiroshiman is offline   Reply With Quote

Old   April 3, 2014, 16:42
Default
  #3
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
OK, thank you for your help!
openfoammaofnepo is offline   Reply With Quote

Old   April 12, 2014, 08:37
Default
  #4
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
Quote:
Originally Posted by Hiroshiman View Post
You can find the definition in :
src/finiteVolume/finiteVolume/fvc/fvcAverage.* It's defined as "Area-weighted average a surfaceField creating a volField".
Hi,

In the source files you cited, there are following lines:

Code:
    GeometricField<Type, fvPatchField, volMesh>& av = taverage();

    av.internalField() =
    (
        surfaceSum(mesh.magSf()*ssf)/surfaceSum(mesh.magSf())
    )().internalField();

    typename GeometricField<Type, fvPatchField, volMesh>::
    GeometricBoundaryField& bav = av.boundaryField();

    forAll(bav, patchi)
    {
        bav[patchi] = ssf.boundaryField()[patchi];
    }

    av.correctBoundaryConditions();
If I am not making a mistake, then, for each cell, this kind of average is performed on the faces belonging one cell (e.g. 4 faces for tetrahedrons). Thus each cell will have a local averaged value. Thus fvc::average is not global.
Gang Wang and ali moeni like this.
openfoammaofnepo is offline   Reply With Quote

Old   March 27, 2024, 22:33
Default
  #5
Member
 
Gang Wang
Join Date: Oct 2019
Location: China
Posts: 64
Rep Power: 7
Gang Wang is on a distinguished road
Quote:
Originally Posted by openfoammaofnepo View Post
Hi,

In the source files you cited, there are following lines:

Code:
    GeometricField<Type, fvPatchField, volMesh>& av = taverage();

    av.internalField() =
    (
        surfaceSum(mesh.magSf()*ssf)/surfaceSum(mesh.magSf())
    )().internalField();

    typename GeometricField<Type, fvPatchField, volMesh>::
    GeometricBoundaryField& bav = av.boundaryField();

    forAll(bav, patchi)
    {
        bav[patchi] = ssf.boundaryField()[patchi];
    }

    av.correctBoundaryConditions();
If I am not making a mistake, then, for each cell, this kind of average is performed on the faces belonging one cell (e.g. 4 faces for tetrahedrons). Thus each cell will have a local averaged value. Thus fvc::average is not global.
Hi,

I totally agree with you that fvc::average is somewhat performing the averaging on each cell, but as you claimed, how to get the average value from a global scale of the whole computational domain?

Kindly regards,
Gang
Gang Wang is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM - Validation of Results Ahmed OpenFOAM Running, Solving & CFD 10 May 13, 2018 18:28
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36
ESI-OpenCFD Releases OpenFOAM v2.2.0 opencfd OpenFOAM Announcements from ESI-OpenCFD 13 March 30, 2013 16:52
OpenFOAM Foundation Releases OpenFOAMŪ Version 2.1.1 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 May 31, 2012 09:07
Summer School on Numerical Modelling and OpenFOAM hjasak OpenFOAM 5 October 12, 2008 13:14


All times are GMT -4. The time now is 18:55.