|
[Sponsors] |
July 15, 2022, 02:17 |
surfaceFieldValue per patch?
|
#1 |
New Member
chris
Join Date: Feb 2011
Posts: 6
Rep Power: 15 |
Hello,
I have a case with many (hundreds) of patches that I would like to report values for (as an area average, for example). What would be the best way to do this? I know I can use a surfaceFieldValue with a regexp for the patches, but it averages all the patches together rather than reporting them independently. Does anyone have any clever ideas? I can't feasibly make a function object for each patch, and I'm trying to build an efficient workflow here for future cases. I can resort to probing values at points, but that causes other issues and won't be as accurate. Last edited by yossarian88; July 15, 2022 at 02:18. Reason: typo |
|
August 2, 2022, 06:09 |
|
#2 |
New Member
Join Date: Jul 2022
Posts: 6
Rep Power: 4 |
Hi,
You could use a bash script with the "foamDictionary" command to automatically set the patch names and run the surfaceFieldValue function. Code:
#!/bin/bash # Define list of patches yourListOfPatches=("patch1",..."patch100") # # Loop through patches for i in ${!yourListOfPatches[@]}; do #Set patch name in "surfaceFieldValue" dict (not exact syntax) foamDictionary system/surfaceFieldValue -entry surfaceFieldValue1.name -set "${yourListOfPatches[$i]}" # Run sample dict simpleFoam -postProcess -func sample There is probably an easier way but this should work. |
|
Tags |
area average, patch, surfacefieldvalue |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OLAFLOW] The OLAFLOW Thread | Phicau | OpenFOAM Community Contributions | 459 | September 12, 2024 12:47 |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 114 | August 23, 2023 06:37 |
steadyUniversalMRFFoam Tutorial fails in MixingPlane | HenrikJohansson | OpenFOAM Bugs | 0 | February 14, 2019 05:48 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |