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

Computing flux across several patches

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2022, 06:49
Default Computing flux across several patches
  #1
New Member
 
Join Date: Jun 2022
Posts: 19
Rep Power: 4
TommyJ is on a distinguished road
Hello to all,

I have a unit square mesh with patches: left, right, top and bottom.

I would like to compute the sum of the fluxes across all patches.

How can I achieve this with a functionObject?
Code:
    leftVolumetricFlux  
    {
         type           surfaceFieldValue;
         libs           ("libfieldFunctionObjects.so");
         fields         (phi);
         writeFields    no;
         regionType     patch;
         name           left;  
         operation      sum;
    }



    rightVolumetricFlux  
    {
         type           surfaceFieldValue;
         libs           ("libfieldFunctionObjects.so");
         fields         (phi);
         writeFields    no;
         regionType     patch;
         name           right;  
         operation      sum;
    }


    topVolumetricFlux  
    {
         type           surfaceFieldValue;
         libs           ("libfieldFunctionObjects.so");
         fields         (phi);
         writeFields    no;
         regionType     patch;
         name           top;  
         operation      sum;
    }


    bottomVolumetricFlux  
    {
         type           surfaceFieldValue;
         libs           ("libfieldFunctionObjects.so");
         fields         (phi);
         writeFields    no;
         regionType     patch;
         name           bottom;  
         operation      sum;
    }
And then do the summation by hand? Is there a way to put everything in one FO?
TommyJ is offline   Reply With Quote

Old   October 18, 2022, 07:42
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Tommy,

If your are using ESI-OpenCFD branch, this should do the job:

Code:
volumetricFlux  
    {
         type           surfaceFieldValue;
         libs           ("libfieldFunctionObjects.so");
         fields         (phi);
         writeFields    no;
         regionType     patch;
         names          (left right top bottom);  
         operation      sum;
    }
Source: https://develop.openfoam.com/Develop...ceFieldValue.H

It depends on which OpenFOAM version you are using, I'm not sure this works in the OpenFOAM foundation branch.

Cheers,
Yann
TommyJ likes this.
Yann 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
Computing the flux at an arbitrary 2D surface andy_pr OpenFOAM Programming & Development 0 August 7, 2018 15:23
[Commercial meshers] fluentMeshToFoam: "fluent patch type shadow not recognised" preibie OpenFOAM Meshing & Mesh Conversion 28 March 29, 2017 05:56
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 09:00
Instability introduced by using mutRoughWallFunctions? AlexC OpenFOAM Running, Solving & CFD 1 March 18, 2014 15:14
Problem setting with chtmultiregionFoam Antonin OpenFOAM 10 April 24, 2012 10:50


All times are GMT -4. The time now is 23:49.