|
[Sponsors] |
October 18, 2022, 06:49 |
Computing flux across several patches
|
#1 |
New Member
Join Date: Jun 2022
Posts: 19
Rep Power: 4 |
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; } |
|
October 18, 2022, 07:42 |
|
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29 |
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; } It depends on which OpenFOAM version you are using, I'm not sure this works in the OpenFOAM foundation branch. Cheers, Yann |
|
|
|
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 |