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

The operation in OpenFOAM: fvc::average

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 3, 2014, 16:37
Question The operation in OpenFOAM: fvc::average
  #1
Senior Member
 
Join Date: Jan 2013
Posts: 197
Rep Power: 4
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
openfoammaofnepo is offline   Reply With Quote

Old   April 3, 2014, 16:41
Default
  #2
Member
 
Join Date: Sep 2012
Posts: 48
Rep Power: 4
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".
Hiroshiman is offline   Reply With Quote

Old   April 3, 2014, 16:42
Default
  #3
Senior Member
 
Join Date: Jan 2013
Posts: 197
Rep Power: 4
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: 197
Rep Power: 4
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.
openfoammaofnepo is offline   Reply With Quote

Reply

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


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


All times are GMT -4. The time now is 20:21.