Commit 5c600fee authored by mattijs's avatar mattijs
Browse files

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

parents d01adb74 26a718ac
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -121,9 +121,8 @@ PDRkEpsilon::PDRkEpsilon
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
autoCreateK("k", mesh_)
),
epsilon_
(
IOobject
......@@ -134,9 +133,8 @@ PDRkEpsilon::PDRkEpsilon
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh_
autoCreateEpsilon("epsilon", mesh_)
),
mut_
(
IOobject
......@@ -147,9 +145,8 @@ PDRkEpsilon::PDRkEpsilon
IOobject::NO_READ,
IOobject::NO_WRITE
),
Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_)
autoCreateMut("mut", mesh_)
),
alphat_
(
IOobject
......@@ -163,7 +160,9 @@ PDRkEpsilon::PDRkEpsilon
autoCreateAlphat("alphat", mesh_)
)
{
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(epsilon_, epsilonMin_);
mut_ = Cmu_*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
......@@ -250,7 +249,7 @@ void PDRkEpsilon::correct()
if (!turbulence_)
{
// Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
// Re-calculate thermal diffusivity
......@@ -302,7 +301,7 @@ void PDRkEpsilon::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
......@@ -320,7 +319,7 @@ void PDRkEpsilon::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
......
......@@ -5,8 +5,8 @@ if (turbulence)
y.correct();
}
dimensionedScalar k0("k0", k.dimensions(), SMALL);
dimensionedScalar epsilon0("epsilon0", epsilon.dimensions(), SMALL);
dimensionedScalar kMin("kMin", k.dimensions(), SMALL);
dimensionedScalar epsilonMin("epsilonMin", epsilon.dimensions(), SMALL);
volScalarField divU = fvc::div(phi/fvc::interpolate(rho));
......@@ -15,7 +15,7 @@ if (turbulence)
tgradU.clear();
volScalarField Gcoef =
Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilon0);
Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin);
#include "wallFunctions.H"
......@@ -40,7 +40,7 @@ if (turbulence)
epsEqn.relax();
epsEqn.solve();
bound(epsilon, epsilon0);
bound(epsilon, epsilonMin);
// Turbulent kinetic energy equation
......@@ -60,11 +60,13 @@ if (turbulence)
- fvm::Sp(rho*epsilon/k, k)
);
bound(k, k0);
//FIXME: why no kEqn.relax()?
bound(k, kMin);
//- Re-calculate viscosity
mut = rho*Cmu*sqr(k)/(epsilon + epsilon0);
mut = rho*Cmu*sqr(k)/(epsilon + epsilonMin);
#include "wallViscosity.H"
}
......
......@@ -30,7 +30,7 @@
# Locate user/group/shipped file with semantics similar to the
# ~OpenFOAM/fileName expansion.
#
# The -mode option can be used to allow chaining from
# The -mode option can be used to allow chaining from
# personal settings to site-wide settings.
#
# For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
......@@ -119,27 +119,27 @@ nArgs=$#
fileName="$1"
# Define the various places to be searched:
files=""
unset dirList
case "$mode" in
*u*) # user
files="$files $HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION"
files="$files $HOME/.${WM_PROJECT:-OpenFOAM}"
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION"
dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}"
;;
esac
case "$mode" in
*g*) # group
files="$files $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION"
files="$files $WM_PROJECT_INST_DIR/site"
dirList="$dirList $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION"
dirList="$dirList $WM_PROJECT_INST_DIR/site"
;;
esac
case "$mode" in
*o*) # other
files="$files $WM_PROJECT_DIR/etc"
dirList="$dirList $WM_PROJECT_DIR/etc"
;;
esac
set -- $files
set -- $dirList
#
......
......@@ -34,72 +34,73 @@
# Base settings
FOAM_VERSION=1.6
SUPPLIED_VERSION_GCC=4.3.3
MIN_VERSION_GCC=4.3.1
SUPPLIED_VERSION_GCC=4.4.3
MIN_VERSION_GCC=4.3.3
# General
WIDTH=20
# Global variables
FATALERROR=0
CRITICALERROR=0
SSHRSHOK=0
fatalError=0
criticalError=0
# System variables
HOST_NAME=`uname -n`
OS=`uname -s`
HOST=`uname -n`
OSTYPE=`uname -s`
USER_NAME=$LOGNAME
if [ ! -n $USER_NAME ]; then
USER_NAME=$USER
fi
: ${USER_NAME:=$USER}
# which OpenFOAM application to test for the Version
foamTestApp=icoFoam
#==============================================================================
# HELPER FUNCTIONS
#==============================================================================
hline () {
hline()
{
echo "-------------------------------------------------------------------------------"
}
expenv () {
eval "echo $1"
}
heading () {
echo ""
echo ""
heading()
{
echo
echo
echo "$1"
}
lenBase () {
lenBase()
{
echo $1 | tr -d " " | wc -m | tr -d " "
}
length () {
length()
{
NOCHAR=`lenBase $1`
NOCHAR=`expr $NOCHAR - 1`
if [ $NOCHAR -eq -1 ]; then
NOCHAR=0
fi
[ $NOCHAR -ge 0 ] || NOCHAR=0
echo $NOCHAR
}
stringLength () {
stringLength()
{
echo $1 | wc -m | tr -d " "
}
fixlen () {
fixlen()
{
WORD=$1
ONELEN=`stringLength $1`
LDIFF=`expr $ONELEN - $2`
if [ $LDIFF -le 1 ]; then
while [ $LDIFF -lt 0 ] ; do
if [ $LDIFF -le 1 ]
then
while [ $LDIFF -lt 0 ]
do
WORD="$WORD "
LDIFF=`expr $LDIFF + 1`
done
......@@ -112,33 +113,34 @@ fixlen () {
}
reportEnv () {
reportEnv()
{
EXP_ENV=`eval "echo $1"`
EXP_PATH=`eval "echo $2"`
CRIT="$3"
EXISTS=" no "
ON_PATH=""
if [ `length $EXP_ENV` -gt 0 ] ; then
case $OS in
if [ `length $EXP_ENV` -gt 0 ]
then
case "$OSTYPE" in
SunOS)
if /usr/bin/test -e $EXP_ENV ; then
if /usr/bin/test -e $EXP_ENV
then
EXISTS=" yes "
if [ "$2" != noPath ]; then
if [ "$2" != noPath ]
then
ON_PATH=" no "
OLD_IFS=$IFS
oldIFS=$IFS
IFS=':'
for e in $EXP_PATH
do
if \
[ \
"$e" = "$EXP_ENV" \
-o "$e" = "${EXP_ENV}/bin" \
-o "${EXP_ENV}/lib" = "$e" \
] ; then
case "$e" in
"$EXP_ENV" | "$EXP_ENV/bin" | "$EXP_ENV/lib")
ON_PATH="yes "
fi
;;
esac
done
IFS=$OLD_IFS
IFS=$oldIFS
else
CRIT=" $3"
fi
......@@ -148,24 +150,23 @@ reportEnv () {
echo "`fixlen "$1" 21` `fixlen "$EXP_ENV" 40` $EXISTS $ON_PATH $CRIT"
;;
*)
if [ -e "$EXP_ENV" ] ; then
if [ -e "$EXP_ENV" ]
then
EXISTS=" yes "
if [ "$2" != noPath ]; then
if [ "$2" != noPath ]
then
ON_PATH=" no "
OLD_IFS=$IFS
oldIFS=$IFS
IFS=':'
for e in $EXP_PATH
do
if \
[ \
"$e" = "$EXP_ENV" \
-o "$e" = "${EXP_ENV}/bin" \
-o "${EXP_ENV}/lib" = "$e" \
] ; then
case "$e" in
"$EXP_ENV" | "$EXP_ENV/bin" | "$EXP_ENV/lib")
ON_PATH="yes "
fi
;;
esac
done
IFS=$OLD_IFS
IFS=$oldIFS
else
CRIT=" $3"
fi
......@@ -180,11 +181,13 @@ reportEnv () {
fi
ERROR="false"
if [ "$EXISTS" = no ] || [ "$ON_PATH" = no ]; then
if [ "$EXISTS" = no ] || [ "$ON_PATH" = no ]
then
ERROR="true"
fi
if [ "$3" = yes ] && [ "$ERROR" = true ]; then
CRITICALERROR=`expr $CRITICALERROR + 1`
if [ "$3" = yes ] && [ "$ERROR" = true ]
then
criticalError=`expr $criticalError + 1`
echo "WARNING: CRITICAL ERROR"
echo
fi
......@@ -192,197 +195,111 @@ reportEnv () {
}
findExec() {
OLD_IFS=$IFS
findExec()
{
oldIFS=$IFS
IFS=':'
for d in $1
do
case $OS in
case "$OSTYPE" in
SunOS)
if /usr/bin/test ! -d "$d/$2" -a -x "$d/$2" ; then
IFS=$OLD_IFS
if /usr/bin/test ! -d "$d/$2" -a -x "$d/$2"
then
IFS=$oldIFS
echo "$d/$2"
return 0
fi
;;
*)
if [ ! -d "$d/$2" -a -x "$d/$2" ]; then
IFS=$OLD_IFS
if [ ! -d "$d/$2" -a -x "$d/$2" ]
then
IFS=$oldIFS
echo "$d/$2"
return 0
fi
;;
esac
done
IFS=$OLD_IFS
IFS=$oldIFS
return 1
}
reportExecutable () {
reportExecutable()
{
APP_PATH=""
APP_PATH=`findExec $PATH $1`
APP_SPEC="$2"
if [ ! -n $APP_PATH ];then
if [ ! -n $APP_PATH ]
then
echo "`fixlen "$1" 9`" "*** not installed ***"
VERSION=""
case $1 in
icoFoam)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
gcc)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
tar) ;;
gtar) ;;
gzip) ;;
dx) ;;
case "$1" in
gcc | $foamTestApp)
echo " CRITICAL ERROR"
criticalError=`expr $criticalError + 1`
;;
esac
echo
return 1
fi
case $1 in
icoFoam)
VERSION=`$1 2>&1 \
| \grep ' Version:' \
| sed -e 's/.*Version:/Version:/' \
| cut -d" " -f3`
;;
gcc)
VERSION=`$1 -v 2>&1 \
| grep 'gcc version' \
| cut -d" " -f3`
if [ ! "$VERSION" = "$SUPPLIED_VERSION_GCC" ]; then
echo "WARNING: gcc version does not match gcc supplied" \
"with this release of OpenFOAM"
echo " Supplied version: $SUPPLIED_VERSION_GCC"
echo " User version : $VERSION"
echo " Minimum required: $MIN_VERSION_GCC"
echo ""
fi
;;
gtar)
VERSION=`$APP_PATH --version | head -1`
;;
tar)
VERSION=`$APP_PATH --version | head -1 | cut -d" " -f4`
case "$1" in
$foamTestApp)
VERSION=`$1 -case /dev/null 2>&1 \
| sed -ne 's/^.*Version: *\([^ ][^ ]*\).*/\1/p'`
;;
gcc)
VERSION=`$1 -v 2>&1 \
| sed -ne 's/^gcc version \([0-9][0-9.]*\).*/\1/p' `
if [ "$VERSION" != "$SUPPLIED_VERSION_GCC" ]
then
echo "WARNING: gcc version does not match gcc supplied" \
"with this release of OpenFOAM"
echo " Supplied version: $SUPPLIED_VERSION_GCC"
echo " User version : $VERSION"
echo " Minimum required: $MIN_VERSION_GCC"
echo ""
fi
;;
gtar)
VERSION=`$APP_PATH --version | head -1`
;;
tar)
VERSION=`$APP_PATH --version | head -1 | cut -d" " -f4`
;;
gzip)
case "$OSTYPE" in
SunOS)
VERSION=`$1 --version 2>&1 | grep gzip | cut -d" " -f2`
;;
gzip)
case $OS in
SunOS)
VERSION=`$1 --version 2>&1 | grep gzip | cut -d" " -f2`
;;
*)
VERSION=`$1 --version | head -1 | cut -d" " -f2`
;;
esac
*)
VERSION=`$1 --version | head -1 | cut -d" " -f2`
;;
esac
;;
esac
if [ "$APP_PATH" = "$APP_SPEC" ] || [ ! "$2" ]; then
if [ "$APP_PATH" = "$APP_SPEC" ] || [ ! "$2" ]
then
echo "`fixlen "$1" 9` `fixlen "$VERSION" 10` `fixlen "$APP_PATH" 58`"
else
echo "`fixlen "$1" 9` `fixlen "$VERSION" 10`"
echo "WARNING: Conflicting installations:"
echo " OpenFOAM settings : $APP_SPEC"
echo " current path : $APP_PATH"
case $1 in
icoFoam)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
gcc)
echo " CRITICAL ERROR"
CRITICALERROR=`expr $CRITICALERROR + 1`
;;
gtar) ;;
gzip) ;;
dx) ;;
case "$1" in
gcc | $foamTestApp)
echo " CRITICAL ERROR"
criticalError=`expr $criticalError + 1`
;;
esac
echo ""
fi
}
pingTest () {
RESULT=""
case $OS in
SunOS)
PINGTEST=`/usr/sbin/ping $1 2>&1`
if [ "`echo $PINGTEST | grep alive`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep 'unknown host'`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
fi
;;
*)
PINGTEST=`/bin/ping -w 3 -c 1 $1 2>&1`
if [ "`echo $PINGTEST | grep '1 received'`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep 'unknown host'`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
fi
;;
esac
echo "`fixlen "Pinging_$1" 25` `fixlen "$RESULT" 45` `fixlen "$2" 5`"
if [ "$2" = yes ] && [ "$RESULT" != Successful ]; then
CRITICALERROR=`expr $CRITICALERROR + 1`
echo "WARNING: CRITICAL ERROR"
echo
fi
}
telnetPortTest () {
telnet -e A $1 $2 <<EOF
A
quit
EOF
}
checkTelnetPort () {
if [ -x "/usr/bin/telnet" ] || [ -x "/bin/telnet" ] ; then
RESULT=`telnetPortTest $1 $2 2>&1 | egrep "onnect.* [t|r]"`
if [ "`echo $RESULT | grep 'Connected to'`" ] ; then
RESULT='Successful'
elif [ "`echo $RESULT | grep 'Connection refused'`" ] ; then
RESULT='Unsuccessful_connection_refused*'
else
RESULT="Not_active*"
fi
else
RESULT='No_telnet_installed:_cannot_check*'
fi
}
checkRsh () {
checkTelnetPort $HOST_NAME 222
echo "`fixlen "Test_rsh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != Successful ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
}
checkSsh () {
checkTelnetPort $HOST_NAME 22
echo "`fixlen "Test_ssh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != Successful ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
}