diff --git a/etc/caseDicts/postProcessing/flowRate/volFlowRateSurface b/etc/caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface similarity index 87% rename from etc/caseDicts/postProcessing/flowRate/volFlowRateSurface rename to etc/caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface index 20e40b6bea..eea56ae1af 100644 --- a/etc/caseDicts/postProcessing/flowRate/volFlowRateSurface +++ b/etc/caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface @@ -13,8 +13,8 @@ Description \*---------------------------------------------------------------------------*/ -triSurface ; +name ; -#includeEtc "caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg" +#includeEtc "caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface.cfg" // ************************************************************************* // diff --git a/etc/caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg b/etc/caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface.cfg similarity index 86% rename from etc/caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg rename to etc/caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface.cfg index 1abafdfcfb..c42101c141 100644 --- a/etc/caseDicts/postProcessing/flowRate/volFlowRateSurface.cfg +++ b/etc/caseDicts/postProcessing/flowRate/volumetricFlowRateTriSurface.cfg @@ -6,7 +6,7 @@ \\/ M anipulation | \*---------------------------------------------------------------------------*/ -#includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg" +#includeEtc "caseDicts/postProcessing/surfaceFieldValue/triSurfaceRegion.cfg" fields (U); operation areaNormalIntegrate; diff --git a/etc/caseDicts/postProcessing/surfaceFieldValue/triSurfaceRegion.cfg b/etc/caseDicts/postProcessing/surfaceFieldValue/triSurfaceRegion.cfg index bec4dde416..337849d690 100644 --- a/etc/caseDicts/postProcessing/surfaceFieldValue/triSurfaceRegion.cfg +++ b/etc/caseDicts/postProcessing/surfaceFieldValue/triSurfaceRegion.cfg @@ -13,7 +13,7 @@ regionType sampledSurface; sampledSurfaceDict { type triSurfaceMesh; - surface $triSurface; + surface $name; source cells; interpolate true; } diff --git a/etc/config.sh/bash_completion b/etc/config.sh/bash_completion index 8e1c802f0d..d6151a0ef6 100644 --- a/etc/config.sh/bash_completion +++ b/etc/config.sh/bash_completion @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | Website: https://openfoam.org -# \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -307,6 +307,31 @@ _buoyantPimpleFoam_ () } complete -o filenames -o nospace -F _buoyantPimpleFoam_ buoyantPimpleFoam +_buoyantReactingFoam_ () +{ + local cur="${COMP_WORDS[COMP_CWORD]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" + local line=${COMP_LINE} + local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") + + opts="-case -doc -fileHandler -help -hostRoots -libs -listFunctionObjects -listFvOptions -listMomentumTransportModels -listScalarBCs -listSwitches -listVectorBCs -noFunctionObjects -parallel -postProcess -roots -srcDoc" + for o in $used ; do opts="${opts/$o/}" ; done + extra="" + + [ "$COMP_CWORD" = 1 ] || \ + case "$prev" in + -case) + opts="" ; extra="-d" ;; + -fileHandler) + opts="uncollated collated masterUncollated" ; extra="" ;; + -hostRoots|-libs|-roots) + opts="" ; extra="" ;; + *) ;; + esac + COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) ) +} +complete -o filenames -o nospace -F _buoyantReactingFoam_ buoyantReactingFoam + _buoyantReactingParticleFoam_ () { local cur="${COMP_WORDS[COMP_CWORD]}" @@ -1156,7 +1181,7 @@ _extrudeMesh_ () local line=${COMP_LINE} local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - opts="-case -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -region -roots -srcDoc" + opts="-case -dict -doc -fileHandler -help -hostRoots -libs -noFunctionObjects -parallel -region -roots -srcDoc" for o in $used ; do opts="${opts/$o/}" ; done extra="" @@ -1164,6 +1189,8 @@ _extrudeMesh_ () case "$prev" in -case) opts="" ; extra="-d" ;; + -dict) + opts="" ; extra="-d -f" ;; -fileHandler) opts="uncollated collated masterUncollated" ; extra="" ;; -hostRoots|-libs|-region|-roots) @@ -3104,7 +3131,7 @@ _reconstructParMesh_ () local line=${COMP_LINE} local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - opts="-allRegions -case -cellDist -constant -doc -fileHandler -fullMatch -help -latestTime -libs -mergeTol -noFunctionObjects -noZero -region -srcDoc -time -withZero" + opts="-allRegions -case -cellDist -constant -doc -fileHandler -help -latestTime -libs -noFunctionObjects -noZero -region -srcDoc -time -withZero" for o in $used ; do opts="${opts/$o/}" ; done extra="" @@ -3116,7 +3143,7 @@ _reconstructParMesh_ () opts="uncollated collated masterUncollated" ; extra="" ;; -time) opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;; - -libs|-mergeTol|-region) + -libs|-region) opts="" ; extra="" ;; *) ;; esac @@ -3131,7 +3158,7 @@ _redistributePar_ () local line=${COMP_LINE} local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -mergeTol -noFunctionObjects -noZero -overwrite -parallel -region -roots -srcDoc -time" + opts="-case -constant -doc -fileHandler -help -hostRoots -latestTime -libs -noFunctionObjects -noZero -overwrite -parallel -region -roots -srcDoc -time" for o in $used ; do opts="${opts/$o/}" ; done extra="" @@ -3143,7 +3170,7 @@ _redistributePar_ () opts="uncollated collated masterUncollated" ; extra="" ;; -time) opts="$(foamListTimes -withZero 2> /dev/null)" ; extra="" ;; - -hostRoots|-libs|-mergeTol|-region|-roots) + -hostRoots|-libs|-region|-roots) opts="" ; extra="" ;; *) ;; esac @@ -3405,56 +3432,6 @@ _rhoPorousSimpleFoam_ () } complete -o filenames -o nospace -F _rhoPorousSimpleFoam_ rhoPorousSimpleFoam -_rhoReactingBuoyantFoam_ () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - local line=${COMP_LINE} - local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - - opts="-case -doc -fileHandler -help -hostRoots -libs -listFunctionObjects -listFvOptions -listMomentumTransportModels -listScalarBCs -listSwitches -listVectorBCs -noFunctionObjects -parallel -postProcess -roots -srcDoc" - for o in $used ; do opts="${opts/$o/}" ; done - extra="" - - [ "$COMP_CWORD" = 1 ] || \ - case "$prev" in - -case) - opts="" ; extra="-d" ;; - -fileHandler) - opts="uncollated collated masterUncollated" ; extra="" ;; - -hostRoots|-libs|-roots) - opts="" ; extra="" ;; - *) ;; - esac - COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) ) -} -complete -o filenames -o nospace -F _rhoReactingBuoyantFoam_ rhoReactingBuoyantFoam - -_rhoReactingFoam_ () -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - local line=${COMP_LINE} - local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - - opts="-case -doc -fileHandler -help -hostRoots -libs -listFunctionObjects -listFvOptions -listMomentumTransportModels -listScalarBCs -listSwitches -listVectorBCs -noFunctionObjects -parallel -postProcess -roots -srcDoc" - for o in $used ; do opts="${opts/$o/}" ; done - extra="" - - [ "$COMP_CWORD" = 1 ] || \ - case "$prev" in - -case) - opts="" ; extra="-d" ;; - -fileHandler) - opts="uncollated collated masterUncollated" ; extra="" ;; - -hostRoots|-libs|-roots) - opts="" ; extra="" ;; - *) ;; - esac - COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) ) -} -complete -o filenames -o nospace -F _rhoReactingFoam_ rhoReactingFoam - _rhoSimpleFoam_ () { local cur="${COMP_WORDS[COMP_CWORD]}" @@ -4496,7 +4473,7 @@ _surfaceMeshConvert_ () local line=${COMP_LINE} local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - opts="-case -clean -dict -doc -fileHandler -from -help -libs -noFunctionObjects -scaleIn -scaleOut -srcDoc -to -tri" + opts="-case -clean -doc -fileHandler -from -help -libs -noFunctionObjects -scaleIn -scaleOut -srcDoc -to -tri" for o in $used ; do opts="${opts/$o/}" ; done extra="-d -f" @@ -4504,8 +4481,6 @@ _surfaceMeshConvert_ () case "$prev" in -case) opts="" ; extra="-d" ;; - -dict) - opts="" ; extra="-d -f" ;; -fileHandler) opts="uncollated collated masterUncollated" ; extra="" ;; -from|-libs|-scaleIn|-scaleOut|-to) @@ -4513,7 +4488,7 @@ _surfaceMeshConvert_ () -*) ;; *) case "${COMP_WORDS[COMP_CWORD-2]}" in - -from|-libs|-scaleIn|-scaleOut|-to|-case|-dict|-fileHandler) ;; + -from|-libs|-scaleIn|-scaleOut|-to|-case|-fileHandler) ;; *) opts=""; extra="" ;; esac ;; @@ -4556,7 +4531,7 @@ _surfaceMeshExport_ () local line=${COMP_LINE} local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - opts="-case -clean -dict -doc -fileHandler -from -help -libs -name -noFunctionObjects -scaleIn -scaleOut -srcDoc -to" + opts="-case -clean -doc -fileHandler -from -help -libs -name -noFunctionObjects -scaleIn -scaleOut -srcDoc -to" for o in $used ; do opts="${opts/$o/}" ; done extra="" @@ -4564,8 +4539,6 @@ _surfaceMeshExport_ () case "$prev" in -case) opts="" ; extra="-d" ;; - -dict) - opts="" ; extra="-d -f" ;; -fileHandler) opts="uncollated collated masterUncollated" ; extra="" ;; -from|-libs|-name|-scaleIn|-scaleOut|-to) @@ -4583,7 +4556,7 @@ _surfaceMeshImport_ () local line=${COMP_LINE} local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") - opts="-case -clean -dict -doc -fileHandler -from -help -libs -name -noFunctionObjects -scaleIn -scaleOut -srcDoc -to" + opts="-case -clean -doc -fileHandler -from -help -libs -name -noFunctionObjects -scaleIn -scaleOut -srcDoc -to" for o in $used ; do opts="${opts/$o/}" ; done extra="-d -f" @@ -4591,8 +4564,6 @@ _surfaceMeshImport_ () case "$prev" in -case) opts="" ; extra="-d" ;; - -dict) - opts="" ; extra="-d -f" ;; -fileHandler) opts="uncollated collated masterUncollated" ; extra="" ;; -from|-libs|-name|-scaleIn|-scaleOut|-to) @@ -4600,7 +4571,7 @@ _surfaceMeshImport_ () -*) ;; *) case "${COMP_WORDS[COMP_CWORD-2]}" in - -from|-libs|-name|-scaleIn|-scaleOut|-to|-case|-dict|-fileHandler) ;; + -from|-libs|-name|-scaleIn|-scaleOut|-to|-case|-fileHandler) ;; *) opts=""; extra="" ;; esac ;; @@ -5873,6 +5844,44 @@ _reactingTwoPhaseEulerFoam_ () } complete -o filenames -o nospace -F _reactingTwoPhaseEulerFoam_ reactingTwoPhaseEulerFoam +_rhoReactingBuoyantFoam_ () +{ + local cur="${COMP_WORDS[COMP_CWORD]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" + local line=${COMP_LINE} + local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") + + opts="" + for o in $used ; do opts="${opts/$o/}" ; done + extra="" + + [ "$COMP_CWORD" = 1 ] || \ + case "$prev" in + *) ;; + esac + COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) ) +} +complete -o filenames -o nospace -F _rhoReactingBuoyantFoam_ rhoReactingBuoyantFoam + +_rhoReactingFoam_ () +{ + local cur="${COMP_WORDS[COMP_CWORD]}" + local prev="${COMP_WORDS[COMP_CWORD-1]}" + local line=${COMP_LINE} + local used=$(echo "$line" | grep -oE "\-[a-zA-Z]+ ") + + opts="" + for o in $used ; do opts="${opts/$o/}" ; done + extra="" + + [ "$COMP_CWORD" = 1 ] || \ + case "$prev" in + *) ;; + esac + COMPREPLY=( $(compgen -W "${opts}" $extra -- ${cur}) ) +} +complete -o filenames -o nospace -F _rhoReactingFoam_ rhoReactingFoam + _simpleReactingParcelFoam_ () { local cur="${COMP_WORDS[COMP_CWORD]}" diff --git a/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H b/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H index 6cb1e703ed..479e10e02d 100644 --- a/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H +++ b/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,8 @@ public: //- Destructor - ~objectFunction1(); + ~objectFunction1() + {} // Member Functions diff --git a/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1Templates.C b/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1Templates.C index 3059f85d69..ee67d45f29 100644 --- a/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1Templates.C +++ b/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1Templates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,12 +78,6 @@ Foam::autoPtr Foam::objectFunction1::New } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::objectFunction1::~objectFunction1() -{} - - // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // template diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C index 4c43b12b6d..0103e844fa 100644 --- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C +++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -426,23 +426,24 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::initialise const dictionary& dict ) { - dict.lookup("name") >> regionName_; - switch (regionType_) { case regionTypes::faceZone: { + dict.lookup("name") >> regionName_; setFaceZoneFaces(); break; } case regionTypes::patch: { + dict.lookup("name") >> regionName_; setPatchFaces(); break; } case regionTypes::sampledSurface: { sampledSurfaceFaces(dict); + regionName_ = surfacePtr_().name(); break; } default: diff --git a/tutorials/incompressible/pimpleFoam/RAS/impeller/constant/triSurface/surface0.stl.gz b/tutorials/incompressible/pimpleFoam/RAS/impeller/constant/triSurface/surface0.stl.gz new file mode 100644 index 0000000000..2e17a4d6f8 Binary files /dev/null and b/tutorials/incompressible/pimpleFoam/RAS/impeller/constant/triSurface/surface0.stl.gz differ diff --git a/tutorials/incompressible/pimpleFoam/RAS/impeller/constant/triSurface/surface1.stl.gz b/tutorials/incompressible/pimpleFoam/RAS/impeller/constant/triSurface/surface1.stl.gz new file mode 100644 index 0000000000..79ef60e03e Binary files /dev/null and b/tutorials/incompressible/pimpleFoam/RAS/impeller/constant/triSurface/surface1.stl.gz differ diff --git a/tutorials/incompressible/pimpleFoam/RAS/impeller/system/controlDict b/tutorials/incompressible/pimpleFoam/RAS/impeller/system/controlDict index c800ec51e9..3c0698186d 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/impeller/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/RAS/impeller/system/controlDict @@ -49,5 +49,12 @@ adjustTimeStep yes; maxCo 1.0; +functions +{ + #includeFunc "flowRatePatch(name=inlet)" + #includeFunc "flowRatePatch(name=outlet)" + #includeFunc "volumetricFlowRateTriSurface(name=surface0.stl)" + #includeFunc "volumetricFlowRateTriSurface(name=surface1.stl)" +} // ************************************************************************* //