diff --git a/bin/foamEtcFile b/bin/foamEtcFile index 3d3d01864e44a54226e305c8546e67f7445b623f..5e21978b0e84ead7ab67df7cf522cfa5a0e7b047 100755 --- a/bin/foamEtcFile +++ b/bin/foamEtcFile @@ -34,7 +34,7 @@ # # For example, within the user ~/.OpenFOAM/<VER>/prefs.sh: # \code -# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \ +# foamPrefs=$($WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh) \ # && _foamSource $foamPrefs # \endcode # diff --git a/bin/foamPack b/bin/foamPack index e3d090e2f2914506741896acbd14606207b8d263..212d0d5e5a3d8fa3a2b1c27a300c2332be2038a8 100755 --- a/bin/foamPack +++ b/bin/foamPack @@ -119,7 +119,7 @@ else ( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar && echo "add in time-stamp and lnInclude directories" 1>&2 && - tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build `find -H $packDir -type d -name lnInclude` && + tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build $(find -H $packDir -type d -name lnInclude) && tar Af $packBase.tar $packBase.tar2 && echo "gzip tar file" 1>&2 && diff --git a/bin/foamRunTutorials b/bin/foamRunTutorials index 7aabb6c480035c410a04f94e1ad903b4f45a7275..dac6fc894fcf7316a6f314c05c48aca0ede8d5c1 100755 --- a/bin/foamRunTutorials +++ b/bin/foamRunTutorials @@ -71,8 +71,8 @@ then elif [ -d system ] then # Run normal case. - parentDir=`dirname $PWD` - application=`getApplication` + parentDir=$(dirname $PWD) + application=$(getApplication) runApplication blockMesh runApplication $application else diff --git a/etc/bashrc b/etc/bashrc index 3f5d04e83bf773635b3dedcefc2cf66cd16c6589..7eeb3c209aa67fd5619db1411cdc3cbf8ff00604 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | +# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -136,7 +136,7 @@ export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION . $WM_PROJECT_DIR/etc/config.sh/functions # Add in preset user or site preferences: -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile prefs.sh) # Evaluate command-line parameters and record settings for later # these can be used to set/unset values, or specify alternative pref files @@ -148,14 +148,14 @@ _foamEval $@ foamClean=$WM_PROJECT_DIR/bin/foamCleanPath #- Clean PATH -cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned" +cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned" #- Clean LD_LIBRARY_PATH -cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \ +cleaned=$($foamClean "$LD_LIBRARY_PATH" "$foamOldDirs") \ && LD_LIBRARY_PATH="$cleaned" #- Clean MANPATH -cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned" +cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned" export PATH LD_LIBRARY_PATH MANPATH @@ -168,35 +168,35 @@ _foamSource $WM_PROJECT_DIR/etc/config.sh/aliases # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools` +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/vtk) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools) -##_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW` +##_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/FFTW) # Clean environment paths again. Only remove duplicates # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #- Clean PATH -cleaned=`$foamClean "$PATH"` && PATH="$cleaned" +cleaned=$($foamClean "$PATH") && PATH="$cleaned" #- Clean LD_LIBRARY_PATH -cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned" +cleaned=$($foamClean "$LD_LIBRARY_PATH") && LD_LIBRARY_PATH="$cleaned" #- Clean MANPATH (trailing ':' to find system pages) -cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned" +cleaned=$($foamClean "$MANPATH") && MANPATH="${cleaned}:" export PATH LD_LIBRARY_PATH MANPATH #- Clean LD_PRELOAD if [ -n "$LD_PRELOAD" ] then - cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned" + cleaned=$($foamClean "$LD_PRELOAD") && LD_PRELOAD="$cleaned" export LD_PRELOAD fi diff --git a/etc/config.csh/ensight b/etc/config.csh/ensight index 44f8a42ddf0b4bdafad5a527096a6310c9049384..1eb65ffc1d6d6c0a6a11e8de466c411804f02145 100644 --- a/etc/config.csh/ensight +++ b/etc/config.csh/ensight @@ -38,9 +38,7 @@ endif if ( -r $CEI_HOME ) then # Special treatment for 32bit OpenFOAM and 64bit Ensight - if ($WM_ARCH == linux && `uname -m` == x86_64) then - setenv CEI_ARCH linux_2.6_32 - endif + if ($WM_ARCH-`uname -m` == linux-x86_64) setenv CEI_ARCH linux_2.6_32 # Add to path setenv PATH ${CEI_HOME}/bin:${PATH} diff --git a/etc/config.csh/settings b/etc/config.csh/settings index 659b4c5ae22ae09995ba6f7f1f20558060f421e5..74da787d227539bfd3e34cd4acbfe4a0f03b18d5 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -75,7 +75,7 @@ case Linux: breaksw default: - echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64" + echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64" breaksw endsw @@ -124,11 +124,13 @@ case SunOS: setenv WM_LDFLAGS '-mabi=64 -G0' breaksw -default: - echo - echo "Your '$WM_ARCH' operating system is not supported by this release" - echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.com" - echo +default: # An unsupported operating system + /bin/cat <<USAGE + +Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release. +For further assistance, please contact www.OpenFOAM.com + +USAGE breaksw endsw @@ -230,7 +232,7 @@ case ThirdParty: # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then - cat << GCC_NOT_FOUND + /bin/cat << GCC_NOT_FOUND =============================================================================== Warning in $WM_PROJECT_DIR/etc/config.csh/settings: Cannot find '$WM_COMPILER' compiler installation @@ -272,7 +274,7 @@ GCC_NOT_FOUND # Check that the compiler directory can be found if ( ! -d "$clangDir" ) then - cat << CLANG_NOT_FOUND + /bin/cat << CLANG_NOT_FOUND =============================================================================== Warning in $WM_PROJECT_DIR/etc/config.csh/settings: Cannot find '$WM_COMPILER' compiler installation diff --git a/etc/config.sh/ensight b/etc/config.sh/ensight index 616adfdc799c6ed02179e1fd15eb27acb079e283..ec7566a80a1858f20d841fa244e989c6808b38ac 100644 --- a/etc/config.sh/ensight +++ b/etc/config.sh/ensight @@ -31,22 +31,16 @@ #------------------------------------------------------------------------------ # Fallback value -if [ ! -d "$CEI_HOME" ] -then - export CEI_HOME=/usr/local/ensight/CEI -fi +[ -d "$CEI_HOME" ] || export CEI_HOME=/usr/local/ensight/CEI if [ -r $CEI_HOME ] then # Special treatment for 32bit OpenFOAM and 64bit Ensight - if [ "$WM_ARCH" = linux -a `uname -m` = x86_64 ] - then - export CEI_ARCH=linux_2.6_32 - fi + [ "$WM_ARCH-$(uname -m)" = linux-x86_64 ] && export CEI_ARCH=linux_2.6_32 # Add to path if required - if [ "$CEI_HOME/bin/ensight" != "`which ensight 2>/dev/null`" ] + if [ "$CEI_HOME/bin/ensight" != "$(command -v ensight)" ] then export PATH=$CEI_HOME/bin:$PATH fi diff --git a/etc/config.sh/functions b/etc/config.sh/functions index b31e670ca71d56fafb8bfb31798cb67341de295f..20b30f697d340ccfe8297427f1b814e67c753bb9 100644 --- a/etc/config.sh/functions +++ b/etc/config.sh/functions @@ -73,7 +73,7 @@ then then _foamSource "$1" else - _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"` + _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile -silent "$1") fi ;; esac diff --git a/etc/config.sh/mpi b/etc/config.sh/mpi index 757aef05ee2e8903698569980f25b2a85b2227f0..8f01dc20facb84f23b3c76865f8d9bd0afad3c28 100644 --- a/etc/config.sh/mpi +++ b/etc/config.sh/mpi @@ -43,7 +43,7 @@ SYSTEMOPENMPI) unset OPAL_PREFIX fi - libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'` + libDir=$(mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/') # Bit of a hack: strip off 'lib' and hope this is the path to openmpi # include files and libraries. @@ -56,7 +56,7 @@ SYSTEMOPENMPI) OPENMPI) export FOAM_MPI=openmpi-1.10.4 # Optional configuration tweaks: - _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi` + _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi) export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI @@ -159,7 +159,7 @@ HPMPI) _foamAddPath $MPI_ARCH_PATH/bin - case `uname -m` in + case $(uname -m) in i686) _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32 ;; @@ -171,7 +171,7 @@ HPMPI) _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64 ;; *) - echo Unknown processor type `uname -m` 1>&2 + echo Unknown processor type $(uname -m) 1>&2 ;; esac ;; diff --git a/etc/config.sh/settings b/etc/config.sh/settings index 4e457c15c0022356bcf923c4da0ed1d1bccbf097..f395db6207bcbcd06b52cb4703876e99dfdeaf86 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -31,21 +31,21 @@ #------------------------------------------------------------------------------ # Set environment variables according to system type -export WM_ARCH=`uname -s` +export WM_ARCH=$(uname -s) case "$WM_ARCH" in Linux) WM_ARCH=linux # Compiler specifics - case `uname -m` in - i686) - export WM_ARCH_OPTION=32 - export WM_CC='gcc' - export WM_CXX='g++' - export WM_CFLAGS='-fPIC' - export WM_CXXFLAGS='-fPIC -std=c++0x' - export WM_LDFLAGS= + case $(uname -m) in + i686) + export WM_ARCH_OPTION=32 + export WM_CC='gcc' + export WM_CXX='g++' + export WM_CFLAGS='-fPIC' + export WM_CXXFLAGS='-fPIC -std=c++0x' + export WM_LDFLAGS= ;; x86_64) @@ -68,8 +68,7 @@ Linux) export WM_LDFLAGS='-m64' ;; *) - echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"\ - 1>&2 + echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64" 1>&2 ;; esac ;; @@ -111,7 +110,7 @@ Linux) ;; *) - echo Unknown processor type `uname -m` for Linux 1>&2 + echo Unknown processor type $(uname -m) for Linux 1>&2 ;; esac ;; @@ -127,11 +126,11 @@ SunOS) export WM_LDFLAGS='-mabi=64 -G0' ;; -*) # An unsupported operating system +*) # An unsupported operating system /bin/cat <<USAGE 1>&2 - Your "$WM_ARCH" operating system is not supported by this release - of OpenFOAM. For further assistance, please contact www.OpenFOAM.com +Your "$WM_ARCH" operating system is unsupported by this OpenFOAM release. +For further assistance, please contact www.OpenFOAM.com USAGE ;; @@ -212,7 +211,7 @@ unset GMP_ARCH_PATH MPFR_ARCH_PATH # Load configured compiler versions, regardless of the compiler type # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler` +_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/compiler) case "$WM_COMPILER_TYPE" in system) @@ -227,7 +226,7 @@ OpenFOAM | ThirdParty) mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system} # Check that the compiler directory can be found - [ -d "$gccDir" ] || cat << GCC_NOT_FOUND 1>&2 + [ -d "$gccDir" ] || /bin/cat << GCC_NOT_FOUND 1>&2 =============================================================================== Warning in $WM_PROJECT_DIR/etc/config.sh/settings: Cannot find '$WM_COMPILER' compiler installation @@ -272,7 +271,7 @@ GCC_NOT_FOUND clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version # Check that the compiler directory can be found - [ -d "$clangDir" ] || cat << CLANG_NOT_FOUND 1>&2 + [ -d "$clangDir" ] || /bin/cat << CLANG_NOT_FOUND 1>&2 =============================================================================== Warning in $WM_PROJECT_DIR/etc/config.sh/settings: Cannot find '$WM_COMPILER' compiler installation diff --git a/etc/config.sh/unset b/etc/config.sh/unset index a636b94a816e0cb8401b97b4797da109834dd928..2fa155d8c79afced56ef1350b001044510d59a23 100644 --- a/etc/config.sh/unset +++ b/etc/config.sh/unset @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM. @@ -143,9 +143,9 @@ unset SCOTCH_ARCH_PATH if [ -n "$foamClean" ] then - cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned" - cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleaned" - cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned" + cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned" + cleaned=$($foamClean "$LD_LIBRARY_PATH" "$foamOldDirs") && LD_LIBRARY_PATH="$cleaned" + cleaned=$($foamClean "$MANPATH" "$foamOldDirs") && MANPATH="$cleaned" fi @@ -153,7 +153,6 @@ fi [ -n "$MANPATH" ] || unset MANPATH [ -n "$LD_PRELOAD" ] || unset LD_PRELOAD - unset cleaned foamClean foamOldDirs diff --git a/etc/cshrc b/etc/cshrc index d5f315ee1628761c4b0c2aed36e6c0b70c5c0ccf..0352fe8a6dab67b916efe04fd9178eefd6879d77 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -234,8 +234,8 @@ set cleaned=`$foamClean "$LD_LIBRARY_PATH"` if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned #- Clean MANPATH (trailing ':' to find system pages) -set cleaned=`$foamClean "$MANPATH"`: -if ( $status == 0 ) setenv MANPATH "$cleaned" +set cleaned=`$foamClean "$MANPATH"` +if ( $status == 0 ) setenv MANPATH "${cleaned}:" #- Clean LD_PRELOAD if ( $?LD_PRELOAD ) then diff --git a/etc/templates/axisymmetricJet/Allrun b/etc/templates/axisymmetricJet/Allrun index 411484a5bf9b74786d5eb16f983952d8888469e1..c5a0b2cea66f21e7f8bf51b25c16d98ddd1b663d 100755 --- a/etc/templates/axisymmetricJet/Allrun +++ b/etc/templates/axisymmetricJet/Allrun @@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -application=`getApplication` - runApplication blockMesh runApplication extrudeMesh -runApplication $application +runApplication $(getApplication) #------------------------------------------------------------------------------ diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/sampleCone b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/sampleCone index e201d5bdc02c4ea4f9ad0598664cfd82d13aa101..a07cffaf68b108628407099ad23f1aa12d2de81f 100755 --- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/sampleCone +++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/sampleCone @@ -44,9 +44,9 @@ done sample $timeOpt SDIR=sets -LSDIR=`ls $SDIR | head -1` -EXAMPLE_FILE=`ls -1 $SDIR/${LSDIR}/* | head -1` -FS=`basename $EXAMPLE_FILE | cut -d_ -f2-` +LSDIR=$(ls $SDIR | head -1) +EXAMPLE_FILE=$(ls -1 $SDIR/${LSDIR}/* | head -1) +FS=$(basename $EXAMPLE_FILE | cut -d_ -f2-) for d in $SDIR/* do diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs index 5566e9f677dab912e93d27a40c2f84d74942fd49..6874fa26efa2926d76753d5546171e9d0634c717 100755 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs @@ -95,7 +95,7 @@ then fi # paths to data -LATESTTIME=`ls $SETSDIR` +LATESTTIME=$(ls $SETSDIR) OFDATAROOT=$SETSDIR/$LATESTTIME EXPTDATAROOT=./exptData diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/externalSolver b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/externalSolver index 201bc166822609975480c46a439c6744dd16ba14..040a5a5d66bf04e8118da252550e94f2cb9110a6 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/externalSolver +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/externalSolver @@ -82,7 +82,7 @@ do break elif [ -s $lockFile ] then - log "found lock file ${lockFile} containing '$(cat $lockFile)' - waiting" + log "found lock file ${lockFile} containing '$(< $lockFile)' - waiting" else log "found lock file ${lockFile} - waiting" fi diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun index 02e0ed608538f12b061fb917854f4acfde552d11..ae838574d94b66b83047789abd45c0f81afd9b56 100755 --- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun +++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/Allrun @@ -25,8 +25,8 @@ do if [ -e logs/yPlus_0 ] then - yPlus=`awk < logs/yPlus_0 'END{print $2}'` - uPlus=`awk < logs/uPlus_0 'END{print $2}'` + yPlus=$(awk < logs/yPlus_0 'END{print $2}') + uPlus=$(awk < logs/uPlus_0 'END{print $2}') echo "$yPlus $uPlus" >> yPlus_vs_uPlus fi diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles index 0a651b82d41779e8f81f157a7525ec7b5552a130..be3c7aded10f3d84c81c4ce03fc796375f9b1033 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles @@ -1,5 +1,5 @@ #!/bin/sh -#--------------------------------*- C++ -*------------------------------------# +#-----------------------------------------------------------------------------# # ========= | # # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # # \\ / O peration | Version: plus # @@ -77,80 +77,80 @@ for xi in $(seq 1 1 $nx); do # side 1 side=1 - x1=`echo $x $tol | awk '{print $1 - $2}'` - x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'` - y1=`echo $y $tol | awk '{print $1 - $2}'` - y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'` - z1=`echo $z $l $tol | awk '{print $1 + $2 - $3}'` - z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'` + x1=$(echo $x $tol | awk '{print $1 - $2}') + x2=$(echo $x $l $tol | awk '{print $1 + $2 + $3}') + y1=$(echo $y $tol | awk '{print $1 - $2}') + y2=$(echo $y $l $tol | awk '{print $1 + $2 + $3}') + z1=$(echo $z $l $tol | awk '{print $1 + $2 - $3}') + z2=$(echo $z $l $tol | awk '{print $1 + $2 + $3}') addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 # side 2 side=2 - x1=`echo $x $l $tol | awk '{print $1 + $2 - $3}'` - x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'` - y1=`echo $y $tol | awk '{print $1 - $2}'` - y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'` - z1=`echo $z $tol | awk '{print $1 - $2}'` - z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'` + x1=$(echo $x $l $tol | awk '{print $1 + $2 - $3}') + x2=$(echo $x $l $tol | awk '{print $1 + $2 + $3}') + y1=$(echo $y $tol | awk '{print $1 - $2}') + y2=$(echo $y $l $tol | awk '{print $1 + $2 + $3}') + z1=$(echo $z $tol | awk '{print $1 - $2}') + z2=$(echo $z $l $tol | awk '{print $1 + $2 + $3}') addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 # side 3 side=3 - x1=`echo $x $tol | awk '{print $1 - $2}'` - x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'` - y1=`echo $y $tol | awk '{print $1 - $2}'` - y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'` - z1=`echo $z $tol | awk '{print $1 - $2}'` - z2=`echo $z $tol | awk '{print $1 + $2}'` + x1=$(echo $x $tol | awk '{print $1 - $2}') + x2=$(echo $x $l $tol | awk '{print $1 + $2 + $3}') + y1=$(echo $y $tol | awk '{print $1 - $2}') + y2=$(echo $y $l $tol | awk '{print $1 + $2 + $3}') + z1=$(echo $z $tol | awk '{print $1 - $2}') + z2=$(echo $z $tol | awk '{print $1 + $2}') addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 # side 4 side=4 - x1=`echo $x $tol | awk '{print $1 - $2}'` - x2=`echo $x $tol | awk '{print $1 + $2}'` - y1=`echo $y $tol | awk '{print $1 - $2}'` - y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'` - z1=`echo $z $tol | awk '{print $1 - $2}'` - z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'` + x1=$(echo $x $tol | awk '{print $1 - $2}') + x2=$(echo $x $tol | awk '{print $1 + $2}') + y1=$(echo $y $tol | awk '{print $1 - $2}') + y2=$(echo $y $l $tol | awk '{print $1 + $2 + $3}') + z1=$(echo $z $tol | awk '{print $1 - $2}') + z2=$(echo $z $l $tol | awk '{print $1 + $2 + $3}') addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 # side 5 side=5 - x1=`echo $x $tol | awk '{print $1 - $2}'` - x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'` - y1=`echo $y $l $tol | awk '{print $1 + $2 - $3}'` - y2=`echo $y $l $tol | awk '{print $1 + $2 + $3}'` - z1=`echo $z $tol | awk '{print $1 - $2}'` - z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'` + x1=$(echo $x $tol | awk '{print $1 - $2}') + x2=$(echo $x $l $tol | awk '{print $1 + $2 + $3}') + y1=$(echo $y $l $tol | awk '{print $1 + $2 - $3}') + y2=$(echo $y $l $tol | awk '{print $1 + $2 + $3}') + z1=$(echo $z $tol | awk '{print $1 - $2}') + z2=$(echo $z $l $tol | awk '{print $1 + $2 + $3}') addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 # side 6 side=6 - x1=`echo $x $tol | awk '{print $1 - $2}'` - x2=`echo $x $l $tol | awk '{print $1 + $2 + $3}'` - y1=`echo $y $tol | awk '{print $1 - $2}'` - y2=`echo $y $tol | awk '{print $1 + $2}'` - z1=`echo $z $tol | awk '{print $1 - $2}'` - z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'` + x1=$(echo $x $tol | awk '{print $1 - $2}') + x2=$(echo $x $l $tol | awk '{print $1 + $2 + $3}') + y1=$(echo $y $tol | awk '{print $1 - $2}') + y2=$(echo $y $tol | awk '{print $1 + $2}') + z1=$(echo $z $tol | awk '{print $1 - $2}') + z2=$(echo $z $l $tol | awk '{print $1 + $2 + $3}') addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 n=$((n+1)) - z=`echo $z $offset | awk '{print $1 + $2}'` + z=$(echo $z $offset | awk '{print $1 + $2}') done - y=`echo $y $offset | awk '{print $1 + $2}'` + y=$(echo $y $offset | awk '{print $1 + $2}') done - x=`echo $x $offset | awk '{print $1 + $2}'` + x=$(echo $x $offset | awk '{print $1 + $2}') done echo "cellSet cubeFacesCells new faceToCell cubeFaceSet owner" >> $tmpSetSet echo "faceZoneSet cubeFaces new setsToFaceZone cubeFaceSet cubeFacesCells" >> $tmpSetSet echo "processing floor" -floorMax=`echo 1 $tol | awk '{print $1 + $2}'` +floorMax=$(echo 1 $tol | awk '{print $1 + $2}') createSetsAndZone Floor -$tol $floorMax -$tol $floorMax -$tol $tol echo "cellSet floorCells new faceToCell FloorFaces owner" >> $tmpSetSet echo "faceZoneSet floorFaces new setsToFaceZone FloorFaces floorCells" >> $tmpSetSet diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh b/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh index f476661eb3ffd3867f9ab40b15f98cac9e19b318..92d09ceaef7d283af701b4c15459f06814ae3ad1 100755 --- a/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh +++ b/tutorials/multiphase/interFoam/RAS/waterChannel/Allmesh @@ -4,17 +4,14 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -application=$(getApplication) - runApplication blockMesh echo "Creating channel" -i=1 -while [ "$i" -lt 3 ] ; do +for i in 1 2 +do cp system/extrudeMeshDict.${i} system/extrudeMeshDict echo "Running extrudeMesh, instance" ${i} extrudeMesh > log.extrudeMesh.${i} - i=`expr $i + 1` done #------------------------------------------------------------------------------