Commit bf062453 authored by mattijs's avatar mattijs
Browse files

Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

parents 00760b73 f26b0d60
......@@ -37,7 +37,7 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: ${0##*/} [OPTION]
Usage: ${0##*/} [OPTION] [PARAVIEW_OPTION]
options:
-block use blockMesh reader (uses .blockMesh extension)
-builtin use VTK builtin OpenFOAM reader (uses .foam extension)
......@@ -47,6 +47,9 @@ options:
-touchAll create .blockMesh, .OpenFOAM files (and for all regions)
-help print the usage
paraview options start with a double dashes
* start paraview $ParaView_VERSION with the OpenFOAM libraries
USAGE
......@@ -57,7 +60,7 @@ USAGE
# to clean up
unset FOAM_ABORT
unset regionName touchOpt
unset regionName optTouch
# reader extension
extension=OpenFOAM
......@@ -88,12 +91,19 @@ do
shift 2
;;
-touch)
touchOpt=true
optTouch=true
shift
;;
-touchAll)
touchOpt=all
optTouch=all
shift
;;
--)
shift
break # stop here, treat balance as paraview options
;;
--*)
break # stop here, treat this and balance as paraview options
;;
*)
usage "unknown option/argument: '$*'"
......@@ -101,6 +111,28 @@ do
esac
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
caseName=${PWD##*/}
caseFile="$caseName.$extension"
......@@ -112,7 +144,7 @@ then
fvControls="$fvControls/$regionName"
fi
case "${touchOpt:-false}" in
case "${optTouch:-false}" in
all)
extension=OpenFOAM
if [ -f constant/polyMesh/blockMeshDict ]
......@@ -149,33 +181,56 @@ case "$caseName" in
esac
#
# check existence of essential files
#
case $extension in
blockMesh)
for check in system/controlDict constant/polyMesh/blockMeshDict
do
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
done
;;
if [ "${hasData:-false}" = true ]
then
builtin | OpenFOAM)
for check in system/controlDict $fvControls/fvSchemes $fvControls/fvSolution
do
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
done
;;
esac
# has --data=.., send directly to paraview
exec paraview "$@"
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
[ -s "$parentDir/$check" ] || {
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
builtin | OpenFOAM)
for check in \
system/controlDict \
$fvControls/fvSchemes \
$fvControls/fvSolution \
;
do
[ -s "$parentDir/$check" ] || {
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
esac
# only create/remove caseFile if it didn't already exist
[ -e $caseFile ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$caseFile"
echo "created temporary '$caseFile'"
}
# only create/remove caseFile if it didn't already exist
[ -e $caseFile ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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
# ~~~~~~~~~~~~~~~~~~~~~~
......@@ -200,7 +205,7 @@ export PATH LD_LIBRARY_PATH MANPATH
# 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
......
......@@ -3,9 +3,6 @@ The main OpenFOAM settings are located in the parent etc/ directory
* bashrc, cshrc
entry point for sourcing
* settings.csh, settings.sh
core settings
* prefs.csh, prefs.sh
these files are untracked and can be used for some site-defined
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
sh/csh variants:
* settings.csh, settings.sh
core settings
* aliases.csh, aliases.sh
aliases for interactive shells
......
......@@ -26,7 +26,7 @@
#
# Description
# 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
# 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
# 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
# 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/>.
#
# File
# etc/settings.csh
# etc/config/settings.csh
#
# Description
# Startup file for OpenFOAM
......@@ -193,7 +193,7 @@ unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?foamCompiler ) then
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'"
endif
......@@ -241,7 +241,7 @@ case ThirdParty:
breaksw
default:
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 " Please check your settings"
echo
......@@ -262,7 +262,7 @@ case ThirdParty:
# Check that the compiler directory can be found
if ( ! -d "$gccDir" ) then
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 " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'foamCompiler' setting to 'system'"
......@@ -302,7 +302,7 @@ case ThirdParty:
# Check that the compiler directory can be found
if ( ! -d "$clangDir" ) then
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 " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'foamCompiler' setting to 'system'"
......
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/settings.sh
# etc/config/settings.sh
#
# Description
# Startup file for OpenFOAM
......@@ -215,7 +215,7 @@ unset MPFR_ARCH_PATH GMP_ARCH_PATH
if [ -z "$foamCompiler" ]
then
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
fi
......@@ -258,7 +258,7 @@ OpenFOAM | ThirdParty)
;;
*)
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 " Please check your settings"
echo
......@@ -278,7 +278,7 @@ OpenFOAM | ThirdParty)
# Check that the compiler directory can be found
[ -d "$gccDir" ] || {
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 " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'foamCompiler' setting to 'system'"
......@@ -322,7 +322,7 @@ OpenFOAM | ThirdParty)
# Check that the compiler directory can be found
[ -d "$clangDir" ] || {
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 " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'foamCompiler' setting to 'system'"
......
......@@ -107,9 +107,6 @@ if ( $?WM_PROJECT_INST_DIR ) then
set foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
endif
endif
if ( $?WM_PROJECT_SITE ) then
set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
endif
# 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
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 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
# ~~~~~~~~~~~~~~~~~~~~~~
......@@ -194,7 +196,7 @@ if ( $status == 0 ) setenv MANPATH $cleaned
# 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
# Source user setup files for optional packages
......
......@@ -414,11 +414,11 @@ Foam::argList::argList
(
(
validOptions.found(optionName)
&& validOptions[optionName] != ""
&& !validOptions[optionName].empty()
)
|| (
validParOptions.found(optionName)
&& validParOptions[optionName] != ""
&& !validParOptions[optionName].empty()
)
)
{
......@@ -833,6 +833,116 @@ Foam::argList::~argList()
// * * * * * * * * * * * * * * * 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
{
// output notes directly - no automatic text wrapping
......
......@@ -334,6 +334,19 @@ public:
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 notes (if any)
......
......@@ -399,7 +399,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
*max
(
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
)
);
......
......@@ -27,22 +27,12 @@ Class
Description
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:
Results of the European-Union Funded Project, 2004 - 2007
(Notes on Numerical Fluid Mechanics and Multidisciplinary Design).
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.
SourceFiles
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment