mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
97
bin/paraFoam
97
bin/paraFoam
@ -37,7 +37,7 @@ usage() {
|
|||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
Usage: ${0##*/} [OPTION]
|
Usage: ${0##*/} [OPTION] [PARAVIEW_OPTION]
|
||||||
options:
|
options:
|
||||||
-block use blockMesh reader (uses .blockMesh extension)
|
-block use blockMesh reader (uses .blockMesh extension)
|
||||||
-builtin use VTK builtin OpenFOAM reader (uses .foam extension)
|
-builtin use VTK builtin OpenFOAM reader (uses .foam extension)
|
||||||
@ -47,6 +47,9 @@ options:
|
|||||||
-touchAll create .blockMesh, .OpenFOAM files (and for all regions)
|
-touchAll create .blockMesh, .OpenFOAM files (and for all regions)
|
||||||
-help print the usage
|
-help print the usage
|
||||||
|
|
||||||
|
|
||||||
|
paraview options start with a double dashes
|
||||||
|
|
||||||
* start paraview $ParaView_VERSION with the OpenFOAM libraries
|
* start paraview $ParaView_VERSION with the OpenFOAM libraries
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
@ -57,7 +60,7 @@ USAGE
|
|||||||
# to clean up
|
# to clean up
|
||||||
unset FOAM_ABORT
|
unset FOAM_ABORT
|
||||||
|
|
||||||
unset regionName touchOpt
|
unset regionName optTouch
|
||||||
|
|
||||||
# reader extension
|
# reader extension
|
||||||
extension=OpenFOAM
|
extension=OpenFOAM
|
||||||
@ -88,19 +91,48 @@ do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-touch)
|
-touch)
|
||||||
touchOpt=true
|
optTouch=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-touchAll)
|
-touchAll)
|
||||||
touchOpt=all
|
optTouch=all
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
break # stop here, treat balance as paraview options
|
||||||
|
;;
|
||||||
|
--*)
|
||||||
|
break # stop here, treat this and balance as paraview options
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage "unknown option/argument: '$*'"
|
usage "unknown option/argument: '$*'"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# check for --data=... argument
|
||||||
|
#
|
||||||
|
hasDataArg()
|
||||||
|
{
|
||||||
|
hasData=false
|
||||||
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
(--data=*)
|
||||||
|
hasData=true
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
hasDataArg $@
|
||||||
|
|
||||||
|
|
||||||
# get a sensible caseName from the directory name
|
# get a sensible caseName from the directory name
|
||||||
caseName=${PWD##*/}
|
caseName=${PWD##*/}
|
||||||
caseFile="$caseName.$extension"
|
caseFile="$caseName.$extension"
|
||||||
@ -112,7 +144,7 @@ then
|
|||||||
fvControls="$fvControls/$regionName"
|
fvControls="$fvControls/$regionName"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${touchOpt:-false}" in
|
case "${optTouch:-false}" in
|
||||||
all)
|
all)
|
||||||
extension=OpenFOAM
|
extension=OpenFOAM
|
||||||
if [ -f constant/polyMesh/blockMeshDict ]
|
if [ -f constant/polyMesh/blockMeshDict ]
|
||||||
@ -149,33 +181,56 @@ case "$caseName" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
#
|
if [ "${hasData:-false}" = true ]
|
||||||
# check existence of essential files
|
then
|
||||||
#
|
|
||||||
case $extension in
|
# has --data=.., send directly to paraview
|
||||||
blockMesh)
|
exec paraview "$@"
|
||||||
for check in system/controlDict constant/polyMesh/blockMeshDict
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# check existence of essential files
|
||||||
|
warn="WARN file does not exist:"
|
||||||
|
case $extension in
|
||||||
|
blockMesh)
|
||||||
|
for check in \
|
||||||
|
system/controlDict \
|
||||||
|
constant/polyMesh/blockMeshDict \
|
||||||
|
;
|
||||||
do
|
do
|
||||||
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
|
[ -s "$parentDir/$check" ] || {
|
||||||
|
[ -n "$warn" ] && echo "$warn" 1>&2
|
||||||
|
echo " $parentDir/$check" 1>&2
|
||||||
|
unset warn
|
||||||
|
}
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
builtin | OpenFOAM)
|
builtin | OpenFOAM)
|
||||||
for check in system/controlDict $fvControls/fvSchemes $fvControls/fvSolution
|
for check in \
|
||||||
|
system/controlDict \
|
||||||
|
$fvControls/fvSchemes \
|
||||||
|
$fvControls/fvSolution \
|
||||||
|
;
|
||||||
do
|
do
|
||||||
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
|
[ -s "$parentDir/$check" ] || {
|
||||||
|
[ -n "$warn" ] && echo "$warn" 1>&2
|
||||||
|
echo " $parentDir/$check" 1>&2
|
||||||
|
unset warn
|
||||||
|
}
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# only create/remove caseFile if it didn't already exist
|
||||||
# only create/remove caseFile if it didn't already exist
|
[ -e $caseFile ] || {
|
||||||
[ -e $caseFile ] || {
|
|
||||||
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
|
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
|
||||||
touch "$caseFile"
|
touch "$caseFile"
|
||||||
echo "created temporary '$caseFile'"
|
echo "created temporary '$caseFile'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paraview --data="$caseFile" "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
paraview --data="$caseFile"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -120,7 +120,12 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
|||||||
# Location of site-specific templates etc
|
# Location of site-specific templates etc
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
||||||
unset WM_PROJECT_SITE
|
if [ -d "$WM_PROJECT_SITE" ]
|
||||||
|
then
|
||||||
|
export WM_PROJECT_SITE
|
||||||
|
else
|
||||||
|
unset WM_PROJECT_SITE
|
||||||
|
fi
|
||||||
|
|
||||||
# Location of user files
|
# Location of user files
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -200,7 +205,7 @@ export PATH LD_LIBRARY_PATH MANPATH
|
|||||||
|
|
||||||
# Source project setup files
|
# Source project setup files
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource $WM_PROJECT_DIR/etc/settings.sh
|
_foamSource $WM_PROJECT_DIR/etc/config/settings.sh
|
||||||
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh
|
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,6 @@ The main OpenFOAM settings are located in the parent etc/ directory
|
|||||||
* bashrc, cshrc
|
* bashrc, cshrc
|
||||||
entry point for sourcing
|
entry point for sourcing
|
||||||
|
|
||||||
* settings.csh, settings.sh
|
|
||||||
core settings
|
|
||||||
|
|
||||||
* prefs.csh, prefs.sh
|
* prefs.csh, prefs.sh
|
||||||
these files are untracked and can be used for some site-defined
|
these files are untracked and can be used for some site-defined
|
||||||
settings
|
settings
|
||||||
@ -14,6 +11,9 @@ The main OpenFOAM settings are located in the parent etc/ directory
|
|||||||
The etc/config/ directory contains various configuration files in
|
The etc/config/ directory contains various configuration files in
|
||||||
sh/csh variants:
|
sh/csh variants:
|
||||||
|
|
||||||
|
* settings.csh, settings.sh
|
||||||
|
core settings
|
||||||
|
|
||||||
* aliases.csh, aliases.sh
|
* aliases.csh, aliases.sh
|
||||||
aliases for interactive shells
|
aliases for interactive shells
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
||||||
# Sourced from OpenFOAM-<VERSION>/etc/settings.csh
|
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.csh
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
|
||||||
# Sourced from OpenFOAM-<VERSION>/etc/settings.sh
|
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.sh
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning openmpi settings for OpenFOAM
|
# Example of fine tuning openmpi settings for OpenFOAM
|
||||||
# Sourced from OpenFOAM-<VERSION>/etc/settings.csh
|
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.csh
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Example of fine tuning openmpi settings for OpenFOAM
|
# Example of fine tuning openmpi settings for OpenFOAM
|
||||||
# Sourced from OpenFOAM-<VERSION>/etc/settings.sh
|
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.sh
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/settings.csh
|
# etc/config/settings.csh
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Startup file for OpenFOAM
|
# Startup file for OpenFOAM
|
||||||
@ -193,7 +193,7 @@ unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
if ( ! $?foamCompiler ) then
|
if ( ! $?foamCompiler ) then
|
||||||
set foamCompiler=system
|
set foamCompiler=system
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||||
echo " foamCompiler not set, using '$foamCompiler'"
|
echo " foamCompiler not set, using '$foamCompiler'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ case ThirdParty:
|
|||||||
breaksw
|
breaksw
|
||||||
default:
|
default:
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||||
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
|
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
|
||||||
echo " Please check your settings"
|
echo " Please check your settings"
|
||||||
echo
|
echo
|
||||||
@ -262,7 +262,7 @@ case ThirdParty:
|
|||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
if ( ! -d "$gccDir" ) then
|
if ( ! -d "$gccDir" ) then
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||||
echo " Cannot find $gccDir installation."
|
echo " Cannot find $gccDir installation."
|
||||||
echo " Please install this compiler version or if you wish to use the system compiler,"
|
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||||
echo " change the 'foamCompiler' setting to 'system'"
|
echo " change the 'foamCompiler' setting to 'system'"
|
||||||
@ -302,7 +302,7 @@ case ThirdParty:
|
|||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
if ( ! -d "$clangDir" ) then
|
if ( ! -d "$clangDir" ) then
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
|
||||||
echo " Cannot find $clangDir installation."
|
echo " Cannot find $clangDir installation."
|
||||||
echo " Please install this compiler version or if you wish to use the system compiler,"
|
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||||
echo " change the 'foamCompiler' setting to 'system'"
|
echo " change the 'foamCompiler' setting to 'system'"
|
||||||
@ -22,7 +22,7 @@
|
|||||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# File
|
# File
|
||||||
# etc/settings.sh
|
# etc/config/settings.sh
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Startup file for OpenFOAM
|
# Startup file for OpenFOAM
|
||||||
@ -215,7 +215,7 @@ unset MPFR_ARCH_PATH GMP_ARCH_PATH
|
|||||||
if [ -z "$foamCompiler" ]
|
if [ -z "$foamCompiler" ]
|
||||||
then
|
then
|
||||||
foamCompiler=system
|
foamCompiler=system
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" 1>&2
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2
|
||||||
echo " foamCompiler not set, using '$foamCompiler'" 1>&2
|
echo " foamCompiler not set, using '$foamCompiler'" 1>&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ OpenFOAM | ThirdParty)
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:"
|
||||||
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
|
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
|
||||||
echo " Please check your settings"
|
echo " Please check your settings"
|
||||||
echo
|
echo
|
||||||
@ -278,7 +278,7 @@ OpenFOAM | ThirdParty)
|
|||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$gccDir" ] || {
|
[ -d "$gccDir" ] || {
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:"
|
||||||
echo " Cannot find $gccDir installation."
|
echo " Cannot find $gccDir installation."
|
||||||
echo " Please install this compiler version or if you wish to use the system compiler,"
|
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||||
echo " change the 'foamCompiler' setting to 'system'"
|
echo " change the 'foamCompiler' setting to 'system'"
|
||||||
@ -322,7 +322,7 @@ OpenFOAM | ThirdParty)
|
|||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$clangDir" ] || {
|
[ -d "$clangDir" ] || {
|
||||||
echo
|
echo
|
||||||
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
|
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:"
|
||||||
echo " Cannot find $clangDir installation."
|
echo " Cannot find $clangDir installation."
|
||||||
echo " Please install this compiler version or if you wish to use the system compiler,"
|
echo " Please install this compiler version or if you wish to use the system compiler,"
|
||||||
echo " change the 'foamCompiler' setting to 'system'"
|
echo " change the 'foamCompiler' setting to 'system'"
|
||||||
12
etc/cshrc
12
etc/cshrc
@ -107,9 +107,6 @@ if ( $?WM_PROJECT_INST_DIR ) then
|
|||||||
set foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
|
set foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if ( $?WM_PROJECT_SITE ) then
|
|
||||||
set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Location of installation
|
# Location of installation
|
||||||
@ -124,7 +121,12 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
|
|||||||
# Location of site-specific templates etc
|
# Location of site-specific templates etc
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
# unset is equivalent to $WM_PROJECT_INST_DIR/site
|
||||||
unsetenv WM_PROJECT_SITE
|
if ( $?WM_PROJECT_SITE ) then
|
||||||
|
set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
|
||||||
|
if ( ! -d "$WM_PROJECT_SITE" ) unsetenv WM_PROJECT_SITE
|
||||||
|
else
|
||||||
|
unsetenv WM_PROJECT_SITE
|
||||||
|
endif
|
||||||
|
|
||||||
# Location of user files
|
# Location of user files
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -194,7 +196,7 @@ if ( $status == 0 ) setenv MANPATH $cleaned
|
|||||||
|
|
||||||
# Source project setup files
|
# Source project setup files
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
_foamSource $WM_PROJECT_DIR/etc/settings.csh
|
_foamSource $WM_PROJECT_DIR/etc/config/settings.csh
|
||||||
_foamSource $WM_PROJECT_DIR/etc/config/aliases.csh
|
_foamSource $WM_PROJECT_DIR/etc/config/aliases.csh
|
||||||
|
|
||||||
# Source user setup files for optional packages
|
# Source user setup files for optional packages
|
||||||
|
|||||||
@ -414,11 +414,11 @@ Foam::argList::argList
|
|||||||
(
|
(
|
||||||
(
|
(
|
||||||
validOptions.found(optionName)
|
validOptions.found(optionName)
|
||||||
&& validOptions[optionName] != ""
|
&& !validOptions[optionName].empty()
|
||||||
)
|
)
|
||||||
|| (
|
|| (
|
||||||
validParOptions.found(optionName)
|
validParOptions.found(optionName)
|
||||||
&& validParOptions[optionName] != ""
|
&& !validParOptions[optionName].empty()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -833,6 +833,116 @@ Foam::argList::~argList()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::argList::setOption(const word& opt, const string& param)
|
||||||
|
{
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
// only allow valid options
|
||||||
|
if (validOptions.found(opt))
|
||||||
|
{
|
||||||
|
// some options are to be protected
|
||||||
|
if
|
||||||
|
(
|
||||||
|
opt == "case"
|
||||||
|
|| opt == "parallel"
|
||||||
|
|| opt == "roots"
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalError
|
||||||
|
<<"used argList::setOption on a protected option: '"
|
||||||
|
<< opt << "'" << endl;
|
||||||
|
FatalError.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (validOptions[opt].empty())
|
||||||
|
{
|
||||||
|
// bool option
|
||||||
|
if (!param.empty())
|
||||||
|
{
|
||||||
|
// disallow change of type
|
||||||
|
FatalError
|
||||||
|
<<"used argList::setOption to change bool to non-bool: '"
|
||||||
|
<< opt << "'" << endl;
|
||||||
|
FatalError.exit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// did not previously exist
|
||||||
|
changed = !options_.found(opt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// non-bool option
|
||||||
|
if (param.empty())
|
||||||
|
{
|
||||||
|
// disallow change of type
|
||||||
|
FatalError
|
||||||
|
<<"used argList::setOption to change non-bool to bool: '"
|
||||||
|
<< opt << "'" << endl;
|
||||||
|
FatalError.exit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// existing value needs changing, or did not previously exist
|
||||||
|
changed = options_.found(opt) ? options_[opt] != param : true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalError
|
||||||
|
<<"used argList::setOption on an invalid option: '"
|
||||||
|
<< opt << "'" << nl << "allowed are the following:"
|
||||||
|
<< validOptions << endl;
|
||||||
|
FatalError.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// set/change the option as required
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
options_.set(opt, param);
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::argList::unsetOption(const word& opt)
|
||||||
|
{
|
||||||
|
// only allow valid options
|
||||||
|
if (validOptions.found(opt))
|
||||||
|
{
|
||||||
|
// some options are to be protected
|
||||||
|
if
|
||||||
|
(
|
||||||
|
opt == "case"
|
||||||
|
|| opt == "parallel"
|
||||||
|
|| opt == "roots"
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalError
|
||||||
|
<<"used argList::unsetOption on a protected option: '"
|
||||||
|
<< opt << "'" << endl;
|
||||||
|
FatalError.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove the option, return true if state changed
|
||||||
|
return options_.erase(opt);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalError
|
||||||
|
<<"used argList::unsetOption on an invalid option: '"
|
||||||
|
<< opt << "'" << nl << "allowed are the following:"
|
||||||
|
<< validOptions << endl;
|
||||||
|
FatalError.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::argList::printNotes() const
|
void Foam::argList::printNotes() const
|
||||||
{
|
{
|
||||||
// output notes directly - no automatic text wrapping
|
// output notes directly - no automatic text wrapping
|
||||||
|
|||||||
@ -334,6 +334,19 @@ public:
|
|||||||
static void noParallel();
|
static void noParallel();
|
||||||
|
|
||||||
|
|
||||||
|
//- Set option directly (use with caution)
|
||||||
|
// An option with an empty param is a bool option.
|
||||||
|
// Not all valid options can also be set: eg, -case, -roots, ...
|
||||||
|
// Return true if the existing option value needed changing,
|
||||||
|
// or if the option did not previously exist.
|
||||||
|
bool setOption(const word& opt, const string& param = "");
|
||||||
|
|
||||||
|
//- Unset option directly (use with caution)
|
||||||
|
// Not all valid options can also be unset: eg, -case, -roots ...
|
||||||
|
// Return true if the option existed before being unset.
|
||||||
|
bool unsetOption(const word& opt);
|
||||||
|
|
||||||
|
|
||||||
// Print
|
// Print
|
||||||
|
|
||||||
//- Print notes (if any)
|
//- Print notes (if any)
|
||||||
|
|||||||
@ -399,7 +399,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
|
|||||||
*max
|
*max
|
||||||
(
|
(
|
||||||
dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0),
|
dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0),
|
||||||
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))
|
zetaTilda2_*kappa_*S2*sqr(L/Lvk2(S2))
|
||||||
- 2.0/alphaPhi_*k_*grad_omega_k
|
- 2.0/alphaPhi_*k_*grad_omega_k
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -27,22 +27,12 @@ Class
|
|||||||
Description
|
Description
|
||||||
kOmegaSSTSAS LES turbulence model for incompressible flows
|
kOmegaSSTSAS LES turbulence model for incompressible flows
|
||||||
|
|
||||||
References:
|
|
||||||
Evaluation of the SST-SAS model: Channel flow, asymmetric diffuser and axi-
|
|
||||||
symmetric hill
|
|
||||||
European Conference on Computational Fluid Dynamics
|
|
||||||
ECCOMAS CFD 2006
|
|
||||||
Lars Davison
|
|
||||||
|
|
||||||
A Scale-Adaptive Simulation Model using Two-Equation Models
|
|
||||||
AIAA 2005-1095
|
|
||||||
F. R. Menter and Y. Egorov
|
|
||||||
|
|
||||||
DESider A European Effort on Hybrid RANS-LES Modelling:
|
DESider A European Effort on Hybrid RANS-LES Modelling:
|
||||||
Results of the European-Union Funded Project, 2004 - 2007
|
Results of the European-Union Funded Project, 2004 - 2007
|
||||||
(Notes on Numerical Fluid Mechanics and Multidisciplinary Design).
|
(Notes on Numerical Fluid Mechanics and Multidisciplinary Design).
|
||||||
Chapter 8 Formulation of the Scale-Adaptive Simulation (SAS) Model during
|
Chapter 8 Formulation of the Scale-Adaptive Simulation (SAS) Model during
|
||||||
the DESIDER Project.
|
the DESIDER Project. Published in Springer-Verlag Berlin Heidelberg 2009.
|
||||||
F. R. Menter and Y. Egorov.
|
F. R. Menter and Y. Egorov.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
|
|||||||
Reference in New Issue
Block a user