ENH: support surfaceFieldValue on multiple faceZones or patches (#1874)

- additional "names" entry to specify a word/regex list of selections
  For example,
  {
      type    patch;
      name    inlets;
      names   ("inlet_[0-9].*" inlet);
  }

- if "names" exists AND contains a literal (non-regex) that can be used
  as a suitable value for "name", the "name" entry becomes optional.
  For example,
  {
      type    patch;
      names   ("inlet_[0-9].*" inlet);

      // inferred name = inlet
  }

- reduce some overhead in surfaceFieldValue

TUT: surfaceFieldValue on patches : reactingParcelFoam/verticalChannel
This commit is contained in:
Mark Olesen
2020-10-13 15:48:15 +02:00
parent f82af7cb2a
commit 6cf8151817
7 changed files with 374 additions and 167 deletions

View File

@ -3,15 +3,12 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# create mesh
runApplication blockMesh
restore0Dir
# initialise with potentialFoam solution
runApplication blockMesh
runApplication potentialFoam
# run the solver
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,16 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication potentialFoam
runApplication decomposePar
runParallel $(getApplication)
#------------------------------------------------------------------------------

View File

@ -53,7 +53,27 @@ maxDeltaT 1e-03;
functions
{
surfaceFieldValue1
avgInlets
{
type surfaceFieldValue;
libs (fieldFunctionObjects);
enabled yes;
writeControl writeTime;
log yes;
writeFields off;
surfaceFormat vtk;
regionType patch;
// name inlet;
names (inlet "inlet.*");
operation weightedAverage;
weightField phi;
fields
(
T
);
}
avgOutlets
{
type surfaceFieldValue;
libs (fieldFunctionObjects);

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
coeffs
{
n (2 2 1);
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -48,7 +48,7 @@ runTimeModifiable yes;
functions
{
surfaceFieldValue1
avgOutlets
{
type surfaceFieldValue;
libs (fieldFunctionObjects);