TUT: verificationAndValidation Allrun uses bash

STYLE: double-quote "$@" for isTest/notTest
This commit is contained in:
Mark Olesen 2020-03-30 21:14:29 +02:00
parent 8a4ea197cd
commit 9b1c0786ce
36 changed files with 50 additions and 43 deletions

View File

@ -3,7 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
if isTest $@
if isTest "$@"
then
# Reset the controlDict
if [ -f system/controlDict.orig ]

View File

@ -24,7 +24,7 @@ setCombustionProperties()
# Do moriyoshiHomogeneous
( cd moriyoshiHomogeneous && foamRunTutorials )
if notTest $@
if notTest "$@"
then
# Clone case for second phase
cloneCase moriyoshiHomogeneous moriyoshiHomogeneousPart2

View File

@ -9,7 +9,7 @@ runApplication chemkinToFoam \
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
(cd validation && ./Allrun $*)
fi

View File

@ -5,7 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
(cd validation && ./Allrun $*)
fi

View File

@ -5,7 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
(cd validation && ./Allrun $*)
fi

View File

@ -5,7 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
(cd validation && ./Allrun $*)
fi

View File

@ -5,7 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
(cd validation && ./Allrun $*)
fi

View File

@ -21,7 +21,7 @@ runParallel $(getApplication)
paraFoam -touch
paraFoam -touch -region panelRegion
if notTest $@
if notTest "$@"
then
(cd validation && ./createGraphs)
fi

View File

@ -15,7 +15,7 @@ runApplication chemkinToFoam \
runApplication blockMesh
runApplication setFields
if isTest $@
if isTest "$@"
then
# Test without chemistry
foamDictionary constant/chemistryProperties -entry chemistry -set off

View File

@ -29,7 +29,7 @@ run resolved
# Run with the plenum modelled by a boundary condition
run modelled
if notTest $@
if notTest "$@"
then
# Plot a comparison of the pressure in the neck
cat << EOF | gnuplot -persist

View File

@ -27,7 +27,7 @@ setDecompressionTankFine()
# Do decompressionTank
( cd decompressionTank && foamRunTutorials )
if notTest $@
if notTest "$@"
then
# Clone case
cloneCase decompressionTank decompressionTankFine

View File

@ -7,7 +7,7 @@ runApplication blockMesh
runApplication $(getApplication)
runApplication -s sample postProcess -latestTime -func sample
if notTest $@
if notTest "$@"
then
runApplication validation/createGraphs
fi

View File

@ -3,7 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
if notTest $@
if notTest "$@"
then
foamRunTutorials -skipFirst
else

View File

@ -33,7 +33,7 @@ do
rm -rf logs
done
if notTest $@
if notTest "$@"
then
# create validation plot

View File

@ -75,7 +75,7 @@ copyParallelPointDisplacement()
# Do steady-state case
(cd steady && foamRunTutorials)
if notTest $@
if notTest "$@"
then
latestTime=$(\cd steady && foamListTimes -noZero -latestTime -processor)

View File

@ -52,7 +52,7 @@ linkParallelCase()
# Do steady-state case
(cd steady && ./Allrun.pre)
if notTest $@
if notTest "$@"
then
# Copy/link the steady-state case to movement
linkParallelCase steady movement

View File

@ -26,7 +26,7 @@ runApplication blockMesh
runApplication decomposePar
runParallel $(getApplication)
if notTest $@
if notTest "$@"
then
# create validation plot

View File

@ -14,7 +14,7 @@ runParallel $(getApplication)
# Run noise tool for both point and surface
if notTest $@
if notTest "$@"
then
runParallel -s point noise -dict system/noiseDict-point

View File

@ -10,7 +10,7 @@ Stokes
"
endTime=2
if notTest $@
if notTest "$@"
then
endTime=25
fi

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit # Run from this directory
# Do the Spalart-Allmaras steady-state case
(cd motorBike && foamRunTutorials)
if notTest $@
if notTest "$@"
then
# Clone the steady-state case to the LES case
cloneParallelCase motorBike motorBikeLES

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication blockMesh
runApplication simpleFoam
if notTest $@
if notTest "$@"
then
# Create validation plots

View File

@ -47,7 +47,7 @@ extractVal()
}
# Possibly disable for test: if notTest $@
# Possibly disable for test: if notTest "$@"
if :
then

View File

@ -92,7 +92,7 @@ PLT_CP
}
if notTest $@
if notTest "$@"
then
# Create validation plots

View File

@ -3,7 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
if notTest $@
if notTest "$@"
then
models="
kOmegaSST

View File

@ -10,7 +10,7 @@ cd "${0%/*}" || exit # Run from this directory
( cd blob && ./Allrun $* )
( cd simpleShapes && ./Allrun $* )
if notTest $@
if notTest "$@"
then
( cd flange && ./Allrun $* )
( cd mixerVessel && ./Allrun $* )

View File

@ -26,7 +26,7 @@ setDamBreakFine ()
(cd damBreak && foamRunTutorials)
if notTest $@
if notTest "$@"
then
# Clone case
cloneCase damBreak damBreakFine

View File

@ -25,7 +25,7 @@ setDamBreakFine ()
# Do damBreak
(cd damBreak && foamRunTutorials)
if notTest $@
if notTest "$@"
then
# Clone case
cloneCase damBreak damBreakFine

View File

@ -5,7 +5,7 @@ cd "${0%/*}" || exit # Run from this directory
(cd eulerianInjection && ./Allrun $*)
if notTest $@
if notTest "$@"
then
# Note: particle data only available if running complete case
(cd lagrangianParticleInjection && ./Allrun $*)

View File

@ -8,7 +8,7 @@ application=$(getApplication)
runApplication blockMesh
runApplication $application
if notTest $@
if notTest "$@"
then
foamDictionary system/controlDict -entry endTime -set 4
foamDictionary system/controlDict -entry startTime -set 0.5

View File

@ -8,7 +8,7 @@ application=$(getApplication)
runApplication blockMesh
runApplication $application
if notTest $@
if notTest "$@"
then
foamDictionary system/controlDict -entry endTime -set 4
foamDictionary system/controlDict -entry startTime -set 0.5

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication blockMesh
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
foamDictionary system/controlDict -entry endTime -set 4
foamDictionary 2/T.liquid -entry boundaryField/wall2/q -set 'uniform 1e5'

View File

@ -8,7 +8,7 @@ application=$(getApplication)
runApplication blockMesh
runApplication $application
if notTest $@
if notTest "$@"
then
foamDictionary system/controlDict -entry endTime -set 4
foamDictionary system/controlDict -entry startTime -set 0.5

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication blockMesh
runApplication $(getApplication)
if notTest $@
if notTest "$@"
then
foamDictionary system/controlDict -entry endTime -set 5
foamDictionary 2/T.liquid -entry boundaryField/wall2/q -set 'uniform 1e5'

View File

@ -1,27 +1,34 @@
#!/bin/sh
#!/bin/bash
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
params=$@
# Save the line plot
unset savePlots
if notTest "$@"
then
savePlots=true
fi
runApplication blockMesh
cat system/schemesToTest | while read scheme
while read -r scheme
do
echo "Updating fvSchemes to use $scheme"
sed "s/DIVSCHEME/$scheme/g" system/fvSchemes.template > system/fvSchemes
# Create a sanitised name for the scheme - remove 'special' characters
schemeTag=$(sed -e 's# #_#g#' -e 's#(##g' -e 's#)##g' -e 's#\.##g' <<< "$scheme")
schemeTag=$(sed -e 's# #_#g#' -e 's#[.()]##g' <<< "$scheme")
runApplication -s ${schemeTag} scalarTransportFoam
runApplication -s "${schemeTag}" scalarTransportFoam
if notTest $params
if [ "$savePlots" = true ]
then
# Save the line plot
mv postProcessing/sample1/100/line1_T.xy line1_T_${schemeTag}.xy
mv postProcessing/sample1/100/line1_T.xy line1_T_"${schemeTag}".xy
fi
done
done < system/schemesToTest
#------------------------------------------------------------------------------

View File

@ -71,7 +71,7 @@ GNUPLOT
}
if notTest $@
if notTest "$@"
then
# Create validation plots

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit # Run from this directory
endTime=10
\cp system/controlDict.template system/controlDict
if notTest $@
if notTest "$@"
then
endTime=85
fi