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

surfaceFieldValue per patch?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By sudo_rm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2022, 02:17
Default surfaceFieldValue per patch?
  #1
New Member
 
chris
Join Date: Feb 2011
Posts: 6
Rep Power: 15
yossarian88 is on a distinguished road
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
yossarian88 is offline   Reply With Quote

Old   August 2, 2022, 06:09
Default
  #2
New Member
 
Join Date: Jul 2022
Posts: 6
Rep Power: 4
sudo_rm is on a distinguished road
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
If your patch names look something like "patch1, patch2, ...,patch100", it should be easy to define the list. If your patch names are inconsistent you could read them from the boundary file and write them to the list (again with foamDictionary).

There is probably an easier way but this should work.
saladbowl likes this.
sudo_rm is offline   Reply With Quote

Reply

Tags
area average, patch, surfacefieldvalue


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
[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


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