bin/tools/RunFunctions: Added getSolver function for use with foamPostProcess

This commit is contained in:
Henry Weller
2022-08-10 09:37:10 +01:00
parent 19f984d58d
commit bfa40570ad
4 changed files with 14 additions and 5 deletions

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org # \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -49,6 +49,11 @@ getApplication()
foamDictionary -entry application -value system/controlDict foamDictionary -entry application -value system/controlDict
} }
getSolver()
{
foamDictionary -entry solver -value system/controlDict
}
runApplication() runApplication()
{ {
APP_RUN= APP_RUN=

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
@ -18,3 +18,5 @@ find 0 -mindepth 1 -maxdepth 1 \
! -name T \ ! -name T \
! -name U \ ! -name U \
-exec rm -rf {} \; -exec rm -rf {} \;
#------------------------------------------------------------------------------

View File

@ -1,10 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh runApplication blockMesh
runApplication topoSet runApplication topoSet
runApplication $(getApplication) runApplication $(getApplication)
runApplication foamPostProcess -solver fluid -latestTime runApplication foamPostProcess -solver $(getSolver) -latestTime
#------------------------------------------------------------------------------

View File

@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh runApplication blockMesh
runApplication foamRun runApplication foamRun
runApplication -s age foamPostProcess -solver incompressibleFluid -latestTime \ runApplication -s age foamPostProcess -solver $(getSolver) -latestTime \
-func "age(diffusion=true)" -func "age(diffusion=true)"
runApplication -s probes1 foamPostProcess -func probes1 -latestTime runApplication -s probes1 foamPostProcess -func probes1 -latestTime
runApplication -s probes2 foamPostProcess -func probes2 -latestTime runApplication -s probes2 foamPostProcess -func probes2 -latestTime