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 . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if isTest $@ if isTest "$@"
then then
# Reset the controlDict # Reset the controlDict
if [ -f system/controlDict.orig ] if [ -f system/controlDict.orig ]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ runApplication chemkinToFoam \
runApplication blockMesh runApplication blockMesh
runApplication setFields runApplication setFields
if isTest $@ if isTest "$@"
then then
# Test without chemistry # Test without chemistry
foamDictionary constant/chemistryProperties -entry chemistry -set off 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 with the plenum modelled by a boundary condition
run modelled run modelled
if notTest $@ if notTest "$@"
then then
# Plot a comparison of the pressure in the neck # Plot a comparison of the pressure in the neck
cat << EOF | gnuplot -persist cat << EOF | gnuplot -persist

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -92,7 +92,7 @@ PLT_CP
} }
if notTest $@ if notTest "$@"
then then
# Create validation plots # 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 . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
if notTest $@ if notTest "$@"
then then
models=" models="
kOmegaSST kOmegaSST

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication blockMesh runApplication blockMesh
runApplication $(getApplication) runApplication $(getApplication)
if notTest $@ if notTest "$@"
then then
foamDictionary system/controlDict -entry endTime -set 5 foamDictionary system/controlDict -entry endTime -set 5
foamDictionary 2/T.liquid -entry boundaryField/wall2/q -set 'uniform 1e5' 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 cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
params=$@ # Save the line plot
unset savePlots
if notTest "$@"
then
savePlots=true
fi
runApplication blockMesh runApplication blockMesh
cat system/schemesToTest | while read scheme while read -r scheme
do do
echo "Updating fvSchemes to use $scheme" echo "Updating fvSchemes to use $scheme"
sed "s/DIVSCHEME/$scheme/g" system/fvSchemes.template > system/fvSchemes sed "s/DIVSCHEME/$scheme/g" system/fvSchemes.template > system/fvSchemes
# Create a sanitised name for the scheme - remove 'special' characters # 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 then
# Save the line plot # 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 fi
done done < system/schemesToTest
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

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

View File

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