Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2010-03-26 16:27:11 +00:00
103 changed files with 1571 additions and 940 deletions

4
.gitignore vendored
View File

@ -75,4 +75,8 @@ doc/[Dd]oxygen/man
# ignore .tags in the main directory
/.tags
# ignore eclipse project files in the main directory
/.cproject
/.project
# end-of-file

View File

@ -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_;

View File

@ -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"
}

View File

@ -327,14 +327,17 @@ meshQualityControls
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum tet volume. Is absolute volume of the tet formed by the
// face-centre decomposition triangle and the cell centre.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minTetVol 1e-20;
//- Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -159,6 +159,25 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry)
}
}
{
faceSet faces(mesh, "wrongOrientedTriangleFaces", mesh.nFaces()/100 + 1);
if (mesh.checkFaceTets(true, 0, &faces))
{
noFailedChecks++;
label nFaces = returnReduce(faces.size(), sumOp<label>());
if (nFaces > 0)
{
Info<< " <<Writing " << nFaces
<< " faces with incorrectly orientated triangles to set "
<< faces.name() << endl;
faces.instance() = mesh.pointsInstance();
faces.write();
}
}
}
{
faceSet faces(mesh, "skewFaces", mesh.nFaces()/100 + 1);
if (mesh.checkFaceSkewness(true, &faces))

View File

@ -22,6 +22,9 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
splitMeshRegions
Description
Splits mesh into multiple regions.
@ -32,6 +35,7 @@ Description
- any face inbetween differing cellZones (-cellZones)
Output is:
- volScalarField with regions as different scalars (-detectOnly) or
- mesh with multiple regions or
- mesh with cells put into cellZones (-makeCellZones)
@ -47,7 +51,13 @@ Description
- useCellZonesOnly does not do a walk and uses the cellZones only. Use
this if you don't mind having disconnected domains in a single region.
This option requires all cells to be in one (and one only) cellZone.
- writes maps like decomposePar back to original mesh:
- pointRegionAddressing : for every point in this region the point in
the original mesh
- cellRegionAddressing : ,, cell ,, cell ,,
- faceRegionAddressing : ,, face ,, face in
the original mesh + 'turning index'. For a face in the same orientation
this is the original facelabel+1, for a turned face this is -facelabel-1
\*---------------------------------------------------------------------------*/
#include "SortableList.H"

View File

@ -334,6 +334,14 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PtrList<surfaceScalarField> surfaceScalarFields;
readFields(mesh, objects, surfaceScalarFields);
PtrList<surfaceVectorField> surfaceVectorFields;
readFields(mesh, objects, surfaceVectorFields);
PtrList<surfaceSphericalTensorField> surfaceSphericalTensorFields;
readFields(mesh, objects, surfaceSphericalTensorFields);
PtrList<surfaceSymmTensorField> surfaceSymmTensorFields;
readFields(mesh, objects, surfaceSymmTensorFields);
PtrList<surfaceTensorField> surfaceTensorFields;
readFields(mesh, objects, surfaceTensorFields);
// Construct the point fields
@ -619,6 +627,10 @@ int main(int argc, char *argv[])
|| volSymmTensorFields.size()
|| volTensorFields.size()
|| surfaceScalarFields.size()
|| surfaceVectorFields.size()
|| surfaceSphericalTensorFields.size()
|| surfaceSymmTensorFields.size()
|| surfaceTensorFields.size()
)
{
labelIOList faceProcAddressing
@ -650,6 +662,10 @@ int main(int argc, char *argv[])
fieldDecomposer.decomposeFields(volTensorFields);
fieldDecomposer.decomposeFields(surfaceScalarFields);
fieldDecomposer.decomposeFields(surfaceVectorFields);
fieldDecomposer.decomposeFields(surfaceSphericalTensorFields);
fieldDecomposer.decomposeFields(surfaceSymmTensorFields);
fieldDecomposer.decomposeFields(surfaceTensorFields);
}

View File

@ -191,6 +191,10 @@ int main(int argc, char *argv[])
|| objects.lookupClass(volSymmTensorField::typeName).size()
|| objects.lookupClass(volTensorField::typeName).size()
|| objects.lookupClass(surfaceScalarField::typeName).size()
|| objects.lookupClass(surfaceVectorField::typeName).size()
|| objects.lookupClass(surfaceSphericalTensorField::typeName).size()
|| objects.lookupClass(surfaceSymmTensorField::typeName).size()
|| objects.lookupClass(surfaceTensorField::typeName).size()
)
{
Info<< "Reconstructing FV fields" << nl << endl;
@ -235,6 +239,26 @@ int main(int argc, char *argv[])
objects,
selectedFields
);
fvReconstructor.reconstructFvSurfaceFields<vector>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvSurfaceFields<sphericalTensor>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvSurfaceFields<symmTensor>
(
objects,
selectedFields
);
fvReconstructor.reconstructFvSurfaceFields<tensor>
(
objects,
selectedFields
);
}
else
{

View File

@ -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
#

View File

@ -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`
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`
;;
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`
;;
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
}
checkOpenFOAMEnvironment() {
checkOpenFOAMEnvironment()
{
[ -d "$WM_PROJECT_INST_DIR" ] && [ -d "$WM_THIRD_PARTY_DIR" ] || {
echo ""
echo "FATAL ERROR: OpenFOAM environment not configured."
@ -396,54 +313,50 @@ checkOpenFOAMEnvironment() {
}
checkUserShell() {
checkUserShell()
{
echo "`fixlen Shell: $WIDTH` ${SHELL##*/}"
case $SHELL in
*/csh | */tcsh)
# USER_CONFIG_TYPE="cshrc"
echo "`fixlen "Shell:" $WIDTH` ${SHELL##*/}"
;;
*/bash | */ksh)
# USER_CONFIG_TYPE="bashrc"
echo "`fixlen "Shell:" $WIDTH` ${SHELL##*/}"
;;
*)
# USER_CONFIG_TYPE=""
echo "`fixlen "Shell:" $WIDTH` ${SHELL##*/}"
echo "FATAL ERROR: Cannot identify the shell you are running."
echo " OpenFOAM ${FOAM_VERSION} is compatible with "
echo " csh, tcsh, ksh and bash."
echo
FATALERROR=`expr $FATALERROR + 1`;;
*/csh | */tcsh | */bash | */ksh)
;;
*)
echo "FATAL ERROR: Cannot identify the shell you are running."
echo " OpenFOAM ${FOAM_VERSION} is compatible with "
echo " csh, tcsh, ksh and bash."
echo
fatalError=`expr $fatalError + 1`
;;
esac
}
checkHostName() {
if [ ! "$HOST_NAME" ]; then
echo "`fixlen "Host:" $WIDTH` ${HOST_NAME}"
checkHostName()
{
echo "`fixlen Host: $WIDTH` $HOST"
if [ ! "$HOST" ]
then
echo "FATAL ERROR: Cannot stat hostname."
echo " Contact your system administrator, "
echo " OpenFOAM ${FOAM_VERSION} needs a valid "
echo " hostname to function."
echo
FATALERROR=`expr $FATALERROR + 1`
else
echo "`fixlen "Host:" $WIDTH` ${HOST_NAME}"
fatalError=`expr $fatalError + 1`
fi
}
checkOS () {
case "$OS" in
checkOS()
{
case "$OSTYPE" in
Linux | LinuxAMD64 | SunOS )
echo "`fixlen "OS:" $WIDTH` ${OS} version $(uname -r)"
echo "`fixlen OS: $WIDTH` $OSTYPE version $(uname -r)"
;;
*)
echo "FATAL ERROR: Incompatible operating system \"$OS\"."
echo " OpenFOAM ${FOAM_VERSION} is currently "
echo "FATAL ERROR: Incompatible operating system \"$OSTYPE\"."
echo " OpenFOAM $FOAM_VERSION is currently "
echo " available for Linux and SunOS only."
echo
FATALERROR=`expr $FATALERROR + 1`
fatalError=`expr $fatalError + 1`
;;
esac
}
@ -466,8 +379,8 @@ hline
#------------------------------------------------------------------------------
heading "Checking main OpenFOAM env variables..."
COL1=`fixlen "Environment_variable" 21`
COL2=`fixlen "Set_to_file_or_directory" 40`
COL1=`fixlen Environment_variable 21`
COL2=`fixlen Set_to_file_or_directory 40`
COL3="Valid"
COL4="Path"
COL5="Crit"
@ -505,20 +418,21 @@ hline
#------------------------------------------------------------------------------
heading "Third party software"
COL1=`fixlen "Software" 9`
COL2=`fixlen "Version" 10`
COL3=`fixlen "Location" 10`
COL1=`fixlen Software 9`
COL2=`fixlen Version 10`
COL3=`fixlen Location 10`
hline
echo "$COL1 $COL2 $COL3"
hline
reportExecutable gcc "${WM_COMPILER_DIR}/bin/gcc"
reportExecutable gcc
reportExecutable gzip
if [ "$OS" = Linux ] ; then
if [ "$OSTYPE" = Linux ]
then
reportExecutable tar
else
reportExecutable gtar
fi
reportExecutable icoFoam "${FOAM_APPBIN}/icoFoam"
reportExecutable $foamTestApp "$FOAM_APPBIN/$foamTestApp"
hline
@ -526,27 +440,28 @@ hline
heading "Summary"
hline
if [ $FATALERROR -gt 0 ] ; then
echo "The system test has evoked $FATALERROR fatal error(s)."
if [ $fatalError -gt 0 ]
then
echo "The system test has evoked $fatalError fatal error(s)."
else
echo "Base configuration ok."
fi
echo ""
if [ $CRITICALERROR -gt 0 ]; then
echo "The foam installation contains $CRITICALERROR critical error(s)."
if [ $criticalError -gt 0 ]
then
echo "The foam installation contains $criticalError critical error(s)."
else
echo "Critical systems ok."
fi
echo ""
if [ $CRITICALERROR -gt 0 ] || [ $FATALERROR -gt 0 ]; then
echo "Review the output for warning messages and consult "
echo "the installation guide for trouble shooting."
if [ $criticalError -gt 0 ] || [ $fatalError -gt 0 ]
then
echo
echo "Review the output for warning messages and consult"
echo "the installation guide for troubleshooting."
fi
echo ""
echo "done."
echo ""
echo
echo Done
echo
exit 0

View File

@ -46,7 +46,7 @@ if [ $# = 0 -a -f "./Allrun" ]
then
# Specialised script.
./Allrun
elif [ -d "./system" ]
elif [ -d system ]
then
# Normal case.
parentDir=`dirname $PWD`
@ -55,19 +55,19 @@ then
runApplication $application
else
# Loop over sub-directories and compile any applications
for case in *
for caseName in *
do
if [ -d $case -a -d "$case/Make" ]
if [ -d $caseName -a -d "$caseName/Make" ]
then
(compileApplication $case)
( compileApplication $caseName )
fi
done
# Recurse to subdirectories
for case in *
for caseName in *
do
if [ -d $case ]
if [ -d $caseName ]
then
(cd $case && $thisScript)
( cd $caseName && $thisScript )
fi
done
fi

View File

@ -38,31 +38,32 @@ FOAM_VERSION=1.6
HLINE="-----------------------------------------------------------------------"
WIDTH=16
unset FATALERROR
unset fatalError
# FUNCTIONS
# ~~~~~~~~~
heading () {
echo ""
heading()
{
echo
echo "$1"
echo "$HLINE"
}
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
}
fixlen () {
fixlen()
{
WORD=$1
ONELEN=$(length "$1")
LDIFF=$(expr $ONELEN - $2)
@ -86,48 +87,43 @@ fixlen () {
heading "Checking basic system..."
# check shell
echo "$(fixlen "Shell:" $WIDTH) $SHELL"
echo "$(fixlen Shell: $WIDTH) $SHELL"
case "$SHELL" in
*/csh | */tcsh)
USER_CONFIG_TYPE=cshrc
;;
*/bash | */ksh)
USER_CONFIG_TYPE=bashrc
*/csh | */tcsh | */bash | */ksh)
;;
*)
USER_CONFIG_TYPE=""
echo "FATALERROR: Cannot identify the current shell."
echo " OpenFOAM ${FOAM_VERSION} is compatible"
echo " with csh, tcsh, ksh and bash."
echo "ERROR: Cannot identify the current shell."
echo " OpenFOAM $FOAM_VERSION is compatible"
echo " with csh, tcsh, ksh and bash."
echo
FATALERROR=yes
fatalError=true
;;
esac
# check hostname
HOST=$(uname -n)
echo "$(fixlen "Host:" $WIDTH) $HOST"
echo "$(fixlen Host: $WIDTH) $HOST"
if [ $(length $HOST) -eq 0 ]
then
echo "FATALERROR: Cannot stat hostname."
echo " OpenFOAM ${FOAM_VERSION} needs a valid hostname to function."
echo " Contact your system administrator. "
echo "ERROR: Cannot stat hostname."
echo " OpenFOAM $FOAM_VERSION needs a valid hostname to function."
echo " Contact your system administrator. "
echo
FATALERROR=yes
fatalError=true
fi
# check os
OS=$(uname -s)
case "$OS" in
OSTYPE=$(uname -s)
case "$OSTYPE" in
Linux | LinuxAMD64 | SunOS )
echo "$(fixlen "OS:" $WIDTH) ${OS} version $(uname -r)"
echo "$(fixlen OS: $WIDTH) $OSTYPE version $(uname -r)"
;;
*)
echo "FATALERROR: Incompatible operating system \"$OS\"."
echo " OpenFOAM ${FOAM_VERSION} is currently available for "
echo " Linux, LinuxAMD64 and SunOS only."
echo "ERROR: Incompatible operating system \"$OSTYPE\"."
echo " OpenFOAM $FOAM_VERSION is currently available for "
echo " Linux, LinuxAMD64 and SunOS only."
echo
FATALERROR=yes
fatalError=true
;;
esac
@ -139,20 +135,20 @@ then
USER_NAME=$USER
fi
echo "$(fixlen "User:" $WIDTH) ${USER_NAME}"
echo "$(fixlen User: $WIDTH) ${USER_NAME}"
if [ $(length $USER_NAME) -eq 0 ]
then
echo "FATALERROR: Cannot stat user name ${USER_NAME}."
echo " OpenFOAM ${FOAM_VERSION} needs a valid user name."
echo " Contact your system administrator. "
echo ""
FATALERROR=yes
echo "ERROR: Cannot stat user name $USER_NAME."
echo " OpenFOAM $FOAM_VERSION needs a valid user name."
echo " Contact your system administrator. "
echo
fatalError=true
fi
echo ""
echo ""
if [ -n "$FATALERROR" ]
echo
echo
if [ "$fatalError" = true ]
then
echo "System check: FAIL"
echo "=================="

View File

@ -45,12 +45,12 @@ for cmd in etags ectags
do
type $cmd >/dev/null 2>&1 || {
echo "${0##*/} cannot build tag files: '$cmd' command not found"
exit
exit 1
}
done
cd $WM_PROJECT_DIR || exit
cd $WM_PROJECT_DIR || exit 1
mkdir .tags 2>/dev/null

View File

@ -49,7 +49,7 @@ do
echo "removing all *~ files: $i"
find $i \( -name '*~' -o -name '.*~' \) -print | xargs -t rm 2>/dev/null
else
echo "no directory: $i" 1>&2
echo "no directory: $i" 1>&2
fi
done

View File

@ -1,31 +1,30 @@
#!/bin/sh
# $0 string1 string2 file1 .. filen
# $0 oldString newString file1 .. fileN
#
if [ $# -lt 3 ]
then
echo "Usage: ${0##*/} [-f] <string1> <string2> <file1> .. <filen>"
echo "Usage: ${0##*/} <oldString> <newString> <file1> [.. fileN]"
echo ""
echo "Replaces all occurrences of string1 by string2 in files."
echo "(replacement of sed -i on those systems that don't support it)"
echo "Replaces all occurrences of oldString by newString in files."
echo "(replacement for sed -i on systems that don't support it)"
exit 1
fi
FROMSTRING=$1
shift
TOSTRING=$1
shift
oldString="$1"
newString="$2"
shift 2
for f in $*
for f
do
if grep "$FROMSTRING" "$f" >/dev/null
if grep "$oldString" "$f" >/dev/null
then
cp "$f" "${f}_bak"
sed -e "s@$FROMSTRING@$TOSTRING@g" "${f}"_bak > "$f"
rm -f "${f}"_bak
sed -e "s@$oldString@$newString@g" "${f}_bak" > "$f"
rm -f "${f}_bak"
#else
# echo "String $FROMSTRING not present in $f"
#fi
# echo "String $oldString not present in $f"
fi
done
# ----------------------------------------------------------------- end-of-file

View File

@ -159,7 +159,7 @@ Linux)
export WM_LDFLAGS='-m64'
;;
*)
echo Unknown WM_ARCH_OPTION $WM_ARCH_OPTION, should be 32 or 64
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
;;
esac
;;

View File

@ -149,7 +149,7 @@ case Linux:
breaksw
default:
echo Unknown WM_ARCH_OPTION $WM_ARCH_OPTION, should be 32 or 64
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"
breaksw
endsw
@ -213,12 +213,17 @@ endsw
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
#- prevent local variables from shadowing setenv variables
unset PATH MANPATH LD_LIBRARY_PATH LD_PRELOAD
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH ''
if (! $?MANPATH) setenv MANPATH ''
#- Clean PATH (path)
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
if ( $status == 0 ) setenv PATH $cleaned
if ( $status == 0 ) then
setenv PATH $cleaned
endif
#- Clean LD_LIBRARY_PATH
set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"`

View File

@ -74,6 +74,11 @@ _foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
# Make sure to pick up dummy versions of external libraries last
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy
# Compiler settings
# ~~~~~~~~~~~~~~~~~
unset gcc_version gmp_version mpfr_version
unsetenv MPFR_ARCH_PATH
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -84,40 +89,95 @@ switch ("$compilerInstall")
case OpenFOAM:
switch ("$WM_COMPILER")
case Gcc:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.3
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1/lib
breaksw
case Gcc442:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.2
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
breaksw
case Gcc43:
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.3.3
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
breaksw
endsw
set gcc_version=gcc-4.4.3
set gmp_version=gmp-5.0.1
set mpfr_version=mpfr-2.4.2
breaksw
# Check that the compiler directory can be found
if ( ! -d "$WM_COMPILER_DIR" ) then
case Gcc442:
set gcc_version=gcc-4.4.2
set gmp_version=gmp-4.2.4
set mpfr_version=mpfr-2.4.1
breaksw
case Gcc44:
set gcc_version=gcc-4.4.2
set gmp_version=gmp-4.2.4
set mpfr_version=mpfr-2.4.1
breaksw
case Gcc43:
set gcc_version=gcc-4.3.3
set gmp_version=gmp-4.2.4
set mpfr_version=mpfr-2.4.1
breaksw
default:
echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " Cannot find $WM_COMPILER_DIR installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
echo " Please check your settings"
echo
endif
breaksw
_foamAddPath ${WM_COMPILER_DIR}/bin
_foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}:${WM_COMPILER_DIR}/lib
_foamAddMan ${WM_COMPILER_DIR}/man
endsw
if ( $?gcc_version ) then
set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
# Check that the compiler directory can be found
if ( ! -d "$gccDir" ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/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 'compilerInstall' setting to 'system' in this file"
echo
endif
_foamAddMan $gccDir/man
_foamAddPath $gccDir/bin
_foamAddLib $gccDir/lib${WM_COMPILER_LIB_ARCH}:$gccDir/lib
# add in gmp/mpfr libraries
_foamAddLib $gmpDir/lib
_foamAddLib $mpfrDir/lib
# used by boost/CGAL:
setenv MPFR_ARCH_PATH $mpfrDir
endif
unset gcc_version gccDir gmp_version gmpDir mpfr_version mpfrDir
breaksw
endsw
# boost and CGAL
# ~~~~~~~~~~~~~~
set boost_version=boost_1_42_0
set cgal_version=CGAL-3.5.1
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
# enabled if CGAL is available
if ( -d "$CGAL_ARCH_PATH" ) then
if ( -d "$BOOST_ARCH_PATH" ) then
_foamAddLib $BOOST_ARCH_PATH/lib
else
unsetenv BOOST_ARCH_PATH
endif
_foamAddLib $CGAL_ARCH_PATH/lib
else
unsetenv BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH
endif
unset boost_version cgal_version
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
@ -259,17 +319,10 @@ else
endif
# CGAL library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~
if ( $?CGAL_LIB_DIR ) then
_foamAddLib $CGAL_LIB_DIR
endif
# Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if ( -f $FOAM_LIBBIN/libhoard.so ) then
# setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
# setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
#endif

View File

@ -98,10 +98,9 @@ _foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
# Make sure to pick up dummy versions of external libraries last
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_LIBBIN/dummy
# Compiler settings
# ~~~~~~~~~~~~~~~~~
unset compilerBin compilerLib compilerMan
unset gcc_version gmp_version mpfr_version MPFR_ARCH_PATH
# Select compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -112,52 +111,97 @@ case "${compilerInstall:-OpenFOAM}" in
OpenFOAM)
case "$WM_COMPILER" in
Gcc)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.3
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1/lib
gcc_version=gcc-4.4.3
gmp_version=gmp-5.0.1
mpfr_version=mpfr-2.4.2
;;
Gcc442)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.2
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
gcc_version=gcc-4.4.2
gmp_version=gmp-4.2.4
mpfr_version=mpfr-2.4.1
;;
Gcc44)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.2
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
gcc_version=gcc-4.4.2
gmp_version=gmp-4.2.4
mpfr_version=mpfr-2.4.1
;;
Gcc43)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.3.3
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib
_foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib
gcc_version=gcc-4.3.3
gmp_version=gmp-4.2.4
mpfr_version=mpfr-2.4.1
;;
*)
echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
echo " Please check your settings"
echo
;;
esac
# Check that the compiler directory can be found
if [ ! -d "$WM_COMPILER_DIR" ]
if [ -n "$gcc_version" ]
then
echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
echo " Cannot find $WM_COMPILER_DIR installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo
fi
gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
compilerBin=$WM_COMPILER_DIR/bin
compilerLib=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
compilerMan=$WM_COMPILER_DIR/man
# Check that the compiler directory can be found
[ -d "$gccDir" ] || {
echo
echo "Warning in $WM_PROJECT_DIR/etc/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 'compilerInstall' setting to 'system' in this file"
echo
}
_foamAddMan $gccDir/man
_foamAddPath $gccDir/bin
_foamAddLib $gccDir/lib
# 64-bit needs lib64, but 32-bit needs lib (not lib32)
if [ "$WM_ARCH_OPTION" = 64 ]
then
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
fi
# add in gmp/mpfr libraries
_foamAddLib $gmpDir/lib
_foamAddLib $mpfrDir/lib
# used by boost/CGAL:
export MPFR_ARCH_PATH=$mpfrDir
fi
unset gcc_version gccDir gmp_version gmpDir mpfr_version mpfrDir
;;
esac
if [ -d "$compilerBin" ]
# boost and CGAL
# ~~~~~~~~~~~~~~
boost_version=boost_1_42_0
cgal_version=CGAL-3.5.1
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
# enabled if CGAL is available
if [ -d "$CGAL_ARCH_PATH" ]
then
_foamAddPath $compilerBin
_foamAddLib $compilerLib
_foamAddMan $compilerMan
if [ -d "$BOOST_ARCH_PATH" ]
then
_foamAddLib $BOOST_ARCH_PATH/lib
else
unset BOOST_ARCH_PATH
fi
_foamAddLib $CGAL_ARCH_PATH/lib
else
unset BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH
fi
unset compilerBin compilerLib compilerMan compilerInstall
unset boost_version cgal_version
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
@ -301,11 +345,6 @@ fi
export MPI_BUFFER_SIZE
# CGAL library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~
[ -d "$CGAL_LIB_DIR" ] && _foamAddLib $CGAL_LIB_DIR
# Enable the hoard memory allocator if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if [ -f $FOAM_LIBBIN/libhoard.so ]
@ -316,6 +355,6 @@ export MPI_BUFFER_SIZE
# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset _foamAddPath _foamAddLib _foamAddMan minBufferSize
unset _foamAddPath _foamAddLib _foamAddMan compilerInstall minBufferSize
# ----------------------------------------------------------------- end-of-file

View File

@ -40,7 +40,7 @@ template <class Type>
const Foam::scalar Foam::FaceCellWave<Type>::geomTol_ = 1e-6;
template <class Type>
const Foam::scalar Foam::FaceCellWave<Type>::propagationTol_ = 0.01;
Foam::scalar Foam::FaceCellWave<Type>::propagationTol_ = 0.01;
// Write to ostream
template <class Type>

View File

@ -252,7 +252,7 @@ class FaceCellWave
// Private static data
static const scalar geomTol_;
static const scalar propagationTol_;
static scalar propagationTol_;
public:

View File

@ -61,8 +61,7 @@ Foam::polyBoundaryMesh::polyBoundaryMesh
:
polyPatchList(),
regIOobject(io),
mesh_(mesh),
neighbourEdgesPtr_(NULL)
mesh_(mesh)
{
if (readOpt() == IOobject::MUST_READ)
{
@ -110,17 +109,14 @@ Foam::polyBoundaryMesh::polyBoundaryMesh
:
polyPatchList(size),
regIOobject(io),
mesh_(pm),
neighbourEdgesPtr_(NULL)
mesh_(pm)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::polyBoundaryMesh::~polyBoundaryMesh()
{
deleteDemandDrivenData(neighbourEdgesPtr_);
}
{}
void Foam::polyBoundaryMesh::clearGeom()
@ -134,7 +130,8 @@ void Foam::polyBoundaryMesh::clearGeom()
void Foam::polyBoundaryMesh::clearAddressing()
{
deleteDemandDrivenData(neighbourEdgesPtr_);
neighbourEdgesPtr_.clear();
patchIDPtr_.clear();
forAll (*this, patchi)
{
@ -201,10 +198,10 @@ Foam::polyBoundaryMesh::neighbourEdges() const
<< " boundaries." << endl;
}
if (!neighbourEdgesPtr_)
if (!neighbourEdgesPtr_.valid())
{
neighbourEdgesPtr_ = new List<labelPairList>(size());
List<labelPairList>& neighbourEdges = *neighbourEdgesPtr_;
neighbourEdgesPtr_.reset(new List<labelPairList>(size()));
List<labelPairList>& neighbourEdges = neighbourEdgesPtr_();
// Initialize.
label nEdgePairs = 0;
@ -320,7 +317,36 @@ Foam::polyBoundaryMesh::neighbourEdges() const
}
}
return *neighbourEdgesPtr_;
return neighbourEdgesPtr_();
}
const Foam::labelList& Foam::polyBoundaryMesh::patchID() const
{
if (!patchIDPtr_.valid())
{
patchIDPtr_.reset
(
new labelList
(
mesh_.nFaces()
- mesh_.nInternalFaces()
)
);
labelList& patchID = patchIDPtr_();
const polyBoundaryMesh& bm = *this;
forAll(bm, patchI)
{
label bFaceI = bm[patchI].start() - mesh_.nInternalFaces();
forAll(bm[patchI], i)
{
patchID[bFaceI++] = patchI;
}
}
}
return patchIDPtr_();
}
@ -654,7 +680,8 @@ void Foam::polyBoundaryMesh::movePoints(const pointField& p)
void Foam::polyBoundaryMesh::updateMesh()
{
deleteDemandDrivenData(neighbourEdgesPtr_);
neighbourEdgesPtr_.clear();
patchIDPtr_.clear();
PstreamBuffers pBufs(Pstream::defaultCommsType);

View File

@ -67,8 +67,10 @@ class polyBoundaryMesh
//- Reference to mesh
const polyMesh& mesh_;
mutable autoPtr<labelList> patchIDPtr_;
//- Edges of neighbouring patches
mutable List<labelPairList>* neighbourEdgesPtr_;
mutable autoPtr<List<labelPairList> > neighbourEdgesPtr_;
// Private Member Functions
@ -157,6 +159,9 @@ public:
//- Return patch index for a given face label
label whichPatch(const label faceIndex) const;
//- Per boundary face label the patch index
const labelList& patchID() const;
//- Return the set of patch IDs corresponding to the given list of names
// Wild cards are expanded.
labelHashSet patchSet(const wordList&) const;

View File

@ -556,7 +556,6 @@ public:
//- Check for negative cell volumes
bool checkCellVolumes
(
const bool report = false,
labelHashSet* setPtr = NULL
) const;
@ -576,6 +575,14 @@ public:
labelHashSet* setPtr = NULL
) const;
//- Check face-decomposition tet volume
bool checkFaceTets
(
const bool report = false,
const scalar minTetVol = 0,
labelHashSet* setPtr = NULL
) const;
//- Check face skewness
bool checkFaceSkewness
(

View File

@ -26,6 +26,7 @@ License
#include "primitiveMesh.H"
#include "pyramidPointFaceRef.H"
#include "tetPointRef.H"
#include "ListOps.H"
#include "unitConversion.H"
#include "SortableList.H"
@ -401,7 +402,7 @@ bool Foam::primitiveMesh::checkFaceOrthogonality
<< "checking mesh non-orthogonality" << endl;
}
// for all internal faces check theat the d dot S product is positive
// for all internal faces check that the d dot S product is positive
const vectorField& centres = cellCentres();
const vectorField& areas = faceAreas();
@ -591,6 +592,114 @@ bool Foam::primitiveMesh::checkFacePyramids
}
bool Foam::primitiveMesh::checkFaceTets
(
const bool report,
const scalar minTetVol,
labelHashSet* setPtr
) const
{
if (debug)
{
Info<< "bool primitiveMesh::checkFaceTets("
<< "const bool, const scalar, labelHashSet*) const: "
<< "checking face orientation" << endl;
}
// check whether face area vector points to the cell with higher label
const vectorField& cc = cellCentres();
const vectorField& fc = faceCentres();
const labelList& own = faceOwner();
const labelList& nei = faceNeighbour();
const faceList& fcs = faces();
const pointField& p = points();
label nErrorPyrs = 0;
forAll (fcs, faceI)
{
// Create the owner tets - they will have negative volume
const face& f = fcs[faceI];
forAll(f, fp)
{
scalar tetVol = tetPointRef
(
p[f[fp]],
p[f.nextLabel(fp)],
fc[faceI],
cc[own[faceI]]
).mag();
if (tetVol > -minTetVol)
{
if (setPtr)
{
setPtr->insert(faceI);
}
nErrorPyrs++;
break; // no need to check other tets
}
}
if (isInternalFace(faceI))
{
// Create the neighbour tet - it will have positive volume
const face& f = fcs[faceI];
forAll(f, fp)
{
scalar tetVol = tetPointRef
(
p[f[fp]],
p[f.nextLabel(fp)],
fc[faceI],
cc[nei[faceI]]
).mag();
if (tetVol < minTetVol)
{
if (setPtr)
{
setPtr->insert(faceI);
}
nErrorPyrs++;
break;
}
}
}
}
reduce(nErrorPyrs, sumOp<label>());
if (nErrorPyrs > 0)
{
if (debug || report)
{
Info<< " ***Error in face tets: "
<< nErrorPyrs << " faces have incorrectly oriented face"
<< " decomposition triangles." << endl;
}
return true;
}
else
{
if (debug || report)
{
Info<< " Face tets OK." << endl;
}
return false;
}
}
bool Foam::primitiveMesh::checkFaceSkewness
(
const bool report,

View File

@ -69,6 +69,10 @@ bool Foam::motionSmoother::checkMesh
(
readScalar(dict.lookup("minVol", true))
);
const scalar minTetVol
(
readScalar(dict.lookup("minTetVol", true))
);
const scalar maxConcave
(
readScalar(dict.lookup("maxConcave", true))
@ -105,7 +109,6 @@ bool Foam::motionSmoother::checkMesh
(
readScalar(dict.lookup("minDeterminant", true))
);
label nWrongFaces = 0;
Info<< "Checking faces in error :" << endl;
@ -158,6 +161,30 @@ bool Foam::motionSmoother::checkMesh
nWrongFaces = nNewWrongFaces;
}
if (minTetVol > -GREAT)
{
polyMeshGeometry::checkFaceTets
(
report,
minTetVol,
mesh,
mesh.cellCentres(),
mesh.faceCentres(),
mesh.points(),
checkFaces,
baffles,
&wrongFaces
);
label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
Info<< " faces with face-decomposition tet volume < "
<< setw(5) << minTetVol << " : "
<< nNewWrongFaces-nWrongFaces << endl;
nWrongFaces = nNewWrongFaces;
}
if (maxConcave < 180.0-SMALL)
{
polyMeshGeometry::checkFaceAngles
@ -417,6 +444,10 @@ bool Foam::motionSmoother::checkMesh
(
readScalar(dict.lookup("minVol", true))
);
const scalar minTetVol
(
readScalar(dict.lookup("minTetVol", true))
);
const scalar maxConcave
(
readScalar(dict.lookup("maxConcave", true))
@ -501,6 +532,27 @@ bool Foam::motionSmoother::checkMesh
nWrongFaces = nNewWrongFaces;
}
if (minTetVol > -GREAT)
{
meshGeom.checkFaceTets
(
report,
minTetVol,
meshGeom.mesh().points(),
checkFaces,
baffles,
&wrongFaces
);
label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
Info<< " faces with face-decomposition tet volume < "
<< setw(5) << minTetVol << " : "
<< nNewWrongFaces-nWrongFaces << endl;
nWrongFaces = nNewWrongFaces;
}
if (maxConcave < 180.0-SMALL)
{
meshGeom.checkFaceAngles

View File

@ -26,6 +26,7 @@ License
#include "polyMeshGeometry.H"
#include "pyramidPointFaceRef.H"
#include "tetPointRef.H"
#include "syncTools.H"
#include "unitConversion.H"
@ -308,6 +309,59 @@ Foam::scalar Foam::polyMeshGeometry::calcSkewness
}
// Create the neighbour pyramid - it will have positive volume
bool Foam::polyMeshGeometry::checkFaceTet
(
const polyMesh& mesh,
const bool report,
const scalar minTetVol,
const pointField& p,
const label faceI,
const point& fc, // face centre
const point& cc, // cell centre
labelHashSet* setPtr
)
{
const face& f = mesh.faces()[faceI];
forAll(f, fp)
{
scalar tetVol = tetPointRef
(
p[f[fp]],
p[f.nextLabel(fp)],
fc,
cc
).mag();
if (tetVol < minTetVol)
{
if (report)
{
Pout<< "bool polyMeshGeometry::checkFaceTets("
<< "const bool, const scalar, const pointField&"
<< ", const pointField&, const labelList&,"
<< " labelHashSet*): "
<< "face " << faceI
<< " has a triangle that points the wrong way."
<< endl
<< "Tet volume: " << tetVol
<< " Face " << faceI
<< endl;
}
if (setPtr)
{
setPtr->insert(faceI);
}
return true;
}
}
return false;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
@ -719,6 +773,139 @@ bool Foam::polyMeshGeometry::checkFacePyramids
}
bool Foam::polyMeshGeometry::checkFaceTets
(
const bool report,
const scalar minTetVol,
const polyMesh& mesh,
const vectorField& cellCentres,
const vectorField& faceCentres,
const pointField& p,
const labelList& checkFaces,
const List<labelPair>& baffles,
labelHashSet* setPtr
)
{
// check whether face area vector points to the cell with higher label
const labelList& own = mesh.faceOwner();
const labelList& nei = mesh.faceNeighbour();
label nErrorPyrs = 0;
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
// Create the owner pyramid - note: exchange cell and face centre
// to get positive volume.
bool tetError = checkFaceTet
(
mesh,
report,
minTetVol,
p,
faceI,
cellCentres[own[faceI]], // face centre
faceCentres[faceI], // cell centre
setPtr
);
if (tetError)
{
nErrorPyrs++;
}
if (mesh.isInternalFace(faceI))
{
// Create the neighbour pyramid - it will have positive volume
bool tetError = checkFaceTet
(
mesh,
report,
minTetVol,
p,
faceI,
faceCentres[faceI], // face centre
cellCentres[nei[faceI]], // cell centre
setPtr
);
if (tetError)
{
nErrorPyrs++;
}
}
}
forAll(baffles, i)
{
label face0 = baffles[i].first();
label face1 = baffles[i].second();
bool tetError = checkFaceTet
(
mesh,
report,
minTetVol,
p,
face0,
cellCentres[own[face0]], // face centre
faceCentres[face0], // cell centre
setPtr
);
if (tetError)
{
nErrorPyrs++;
}
// Create the neighbour pyramid - it will have positive volume
tetError = checkFaceTet
(
mesh,
report,
minTetVol,
p,
face0,
faceCentres[face0], // face centre
cellCentres[own[face1]], // cell centre
setPtr
);
if (tetError)
{
nErrorPyrs++;
}
}
reduce(nErrorPyrs, sumOp<label>());
if (nErrorPyrs > 0)
{
if (report)
{
SeriousErrorIn
(
"polyMeshGeometry::checkFaceTets("
"const bool, const scalar, const pointField&, const pointField&"
", const labelList&, labelHashSet*)"
) << "Error in face pyramids: faces pointing the wrong way!"
<< endl;
}
return true;
}
else
{
if (report)
{
Info<< "Face tets OK.\n" << endl;
}
return false;
}
}
bool Foam::polyMeshGeometry::checkFaceSkewness
(
const bool report,
@ -1946,6 +2133,31 @@ bool Foam::polyMeshGeometry::checkFacePyramids
}
bool Foam::polyMeshGeometry::checkFaceTets
(
const bool report,
const scalar minTetVol,
const pointField& p,
const labelList& checkFaces,
const List<labelPair>& baffles,
labelHashSet* setPtr
) const
{
return checkFaceTets
(
report,
minTetVol,
mesh_,
cellCentres_,
faceCentres_,
p,
checkFaces,
baffles,
setPtr
);
}
bool Foam::polyMeshGeometry::checkFaceSkewness
(
const bool report,

View File

@ -109,6 +109,19 @@ class polyMeshGeometry
const point& fc
);
//- Detect&report incorrect face-triangle orientation
static bool checkFaceTet
(
const polyMesh&,
const bool report,
const scalar minTetVol,
const pointField& p,
const label faceI,
const point& fc, // face centre
const point& cc, // cell centre
labelHashSet* setPtr
);
public:
ClassName("polyMeshGeometry");
@ -195,6 +208,20 @@ public:
labelHashSet*
);
//- See primitiveMesh
static bool checkFaceTets
(
const bool report,
const scalar minPyrVol,
const polyMesh&,
const vectorField& cellCentres,
const vectorField& faceCentres,
const pointField& p,
const labelList& checkFaces,
const List<labelPair>& baffles,
labelHashSet*
);
//- See primitiveMesh
static bool checkFaceSkewness
(
@ -321,6 +348,16 @@ public:
labelHashSet* setPtr
) const;
bool checkFaceTets
(
const bool report,
const scalar minTetVol,
const pointField& p,
const labelList& checkFaces,
const List<labelPair>& baffles,
labelHashSet* setPtr
) const;
bool checkFaceSkewness
(
const bool report,

View File

@ -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
@ -30,11 +30,11 @@ License
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void Foam::bound(volScalarField& vsf, const dimensionedScalar& vsf0)
void Foam::bound(volScalarField& vsf, const dimensionedScalar& lowerBound)
{
scalar minVsf = min(vsf).value();
const scalar minVsf = min(vsf).value();
if (minVsf < vsf0.value())
if (minVsf < lowerBound.value())
{
Info<< "bounding " << vsf.name()
<< ", min: " << minVsf
@ -47,13 +47,13 @@ void Foam::bound(volScalarField& vsf, const dimensionedScalar& vsf0)
max
(
vsf.internalField(),
fvc::average(max(vsf, vsf0))().internalField()
*pos(-vsf.internalField())
fvc::average(max(vsf, lowerBound))().internalField()
* pos(-vsf.internalField())
),
vsf0.value()
lowerBound.value()
);
vsf.boundaryField() = max(vsf.boundaryField(), vsf0.value());
vsf.boundaryField() = max(vsf.boundaryField(), lowerBound.value());
}
}

View File

@ -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
@ -23,11 +23,13 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InNamespace
Foam::bound
Foam
Description
Bound the given scalar field if it has gone unbounded. Used extensively
in RAS and LES turbulence models.
Bound the given scalar field if it has gone unbounded.
Used extensively in RAS and LES turbulence models, but also of use
within solvers.
SourceFiles
bound.C
@ -49,7 +51,7 @@ namespace Foam
//- Bound the given scalar field if it has gone unbounded.
// Used extensively in RAS and LES turbulence models.
void bound(volScalarField& vsf, const dimensionedScalar& vsf0);
void bound(volScalarField&, const dimensionedScalar& lowerBound);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -29,9 +29,9 @@ Description
Face source variant of field value function object. Values of user-
specified fields reported for collections of faces.
cellObj1 // Name also used to identify output folder
faceObj1 // Name also used to identify output folder
{
type cellSource;
type faceSource;
functionObjectLibs ("libfieldValueFunctionObjects.so");
enabled true;
outputControl outputTime;

View File

@ -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
@ -106,7 +106,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
volScalarField K = 0.5*tr(B_);
solve
tmp<fvSymmTensorMatrix> BEqn
(
fvm::ddt(rho(), B_)
+ fvm::div(phi(), B_)
@ -118,6 +118,8 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
- (2*ce_ - 0.667*cm_)*I*rho()*epsilon()
);
BEqn().relax();
BEqn().solve();
// Bounding the component kinetic energies
@ -132,7 +134,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
}
K = 0.5*tr(B_);
bound(K, k0());
bound(K, kMin_);
updateSubGridScaleFields(K);
}

View File

@ -108,7 +108,9 @@ GenEddyVisc::GenEddyVisc
),
mesh_
)
{}
{
bound(k_, kMin_);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -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
@ -79,11 +79,11 @@ LESModel::LESModel
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subOrEmptyDict(type + "Coeffs")),
k0_("k0", dimVelocity*dimVelocity, SMALL),
kMin_("kMin", sqr(dimVelocity), SMALL),
delta_(LESdelta::New("delta", U.mesh(), *this))
{
readIfPresent("k0", k0_);
readIfPresent("kMin", kMin_);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
@ -131,8 +131,12 @@ autoPtr<LESModel> LESModel::New
{
FatalErrorIn
(
"LESModel::New(const volVectorField& U, const "
"surfaceScalarField& phi, const basicThermo&)"
"LESModel::New"
"("
"const volVectorField&, "
"const surfaceScalarField&, "
"const basicThermo&"
")"
) << "Unknown LESModel type " << modelName
<< endl << endl
<< "Valid LESModel types are :" << endl
@ -167,7 +171,7 @@ bool LESModel::read()
coeffDict_ <<= *dictPtr;
}
readIfPresent("k0", k0_);
kMin_.readIfPresent(*this);
delta_().read(*this);

View File

@ -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
@ -83,7 +83,7 @@ protected:
Switch printCoeffs_;
dictionary coeffDict_;
dimensionedScalar k0_;
dimensionedScalar kMin_;
autoPtr<LESdelta> delta_;
@ -170,16 +170,16 @@ public:
return coeffDict_;
}
//- Return the value of k0 which k is not allowed to be less than
const dimensionedScalar& k0() const
//- Return the lower allowable limit for k (default: SMALL)
const dimensionedScalar& kMin() const
{
return k0_;
return kMin_;
}
//- Allow k0 to be changed
dimensionedScalar& k0()
//- Allow kMin to be changed
dimensionedScalar& kMin()
{
return k0_;
return kMin_;
}
//- Access function to filter width

View File

@ -302,7 +302,7 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU)
volScalarField Stilda =
fv3()*::sqrt(2.0)*mag(skew(gradU)) + fv2()*nuTilda_/sqr(kappa_*dTilda_);
solve
tmp<fvScalarMatrix> nuTildaEqn
(
fvm::ddt(rho(), nuTilda_)
+ fvm::div(phi(), nuTilda_)
@ -318,6 +318,9 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& tgradU)
- fvm::Sp(rho()*Cw1_*fw(Stilda)*nuTilda_/sqr(dTilda_), nuTilda_)
);
nuTildaEqn().relax();
nuTildaEqn().solve();
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
nuTilda_.correctBoundaryConditions();

View File

@ -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
@ -74,10 +74,10 @@ dimensionedScalar dynOneEqEddy::ce_(const volSymmTensorField& D) const
pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta();
volScalarField ee =
2*delta()*ck_(D)*
(
2*delta()*ck_(D)
*(
filter_(sqrt(k_)*magSqr(D))
- 2*sqrt(KK + filter_(k_))*magSqr(filter_(D))
- 2*sqrt(KK + filter_(k_))*magSqr(filter_(D))
);
return average(ee*mm)/average(mm*mm);
@ -118,7 +118,7 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
volScalarField divU = fvc::div(phi()/fvc::interpolate(rho()));
volScalarField G = 2*muSgs_*(gradU && D);
solve
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(rho(), k_)
+ fvm::div(phi(), k_)
@ -129,7 +129,10 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
- fvm::Sp(ce_(D)*rho()*sqrt(k_)/delta(), k_)
);
bound(k_, dimensionedScalar("0", k_.dimensions(), 1.0e-10));
kEqn().relax();
kEqn().solve();
bound(k_, kMin_);
updateSubGridScaleFields(D);
}

View File

@ -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
@ -106,7 +106,7 @@ void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU)
volScalarField divU = fvc::div(phi()/fvc::interpolate(rho()));
volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU)));
solve
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(rho(), k_)
+ fvm::div(phi(), k_)
@ -117,7 +117,10 @@ void lowReOneEqEddy::correct(const tmp<volTensorField>& tgradU)
- fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_)
);
bound(k_, k0());
kEqn().relax();
kEqn().solve();
bound(k_, kMin_);
updateSubGridScaleFields();
}

View File

@ -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
@ -93,7 +93,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& tgradU)
volScalarField divU = fvc::div(phi()/fvc::interpolate(rho()));
volScalarField G = 2*muSgs_*(gradU && dev(symm(gradU)));
fvScalarMatrix kEqn
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(rho(), k_)
+ fvm::div(phi(), k_)
@ -104,10 +104,10 @@ void oneEqEddy::correct(const tmp<volTensorField>& tgradU)
- fvm::Sp(ce_*rho()*sqrt(k_)/delta(), k_)
);
kEqn.relax();
kEqn.solve();
kEqn().relax();
kEqn().solve();
bound(k_, k0());
bound(k_, kMin_);
updateSubGridScaleFields();
}

View File

@ -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
@ -229,7 +229,10 @@ LRR::LRR
<< exit(FatalError);
}
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
mut_ = Cmu_*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -324,7 +327,7 @@ void LRR::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
@ -359,7 +362,7 @@ void LRR::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Reynolds stress equation
@ -406,15 +409,15 @@ void LRR::correct()
R_.dimensions(),
symmTensor
(
k0_.value(), -GREAT, -GREAT,
k0_.value(), -GREAT,
k0_.value()
kMin_.value(), -GREAT, -GREAT,
kMin_.value(), -GREAT,
kMin_.value()
)
)
);
k_ = 0.5*tr(R_);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -258,7 +258,10 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
<< exit(FatalError);
}
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
mut_ = Cmu_*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -357,7 +360,7 @@ void LaunderGibsonRSTM::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
@ -397,7 +400,7 @@ void LaunderGibsonRSTM::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Reynolds stress equation
@ -453,15 +456,15 @@ void LaunderGibsonRSTM::correct()
R_.dimensions(),
symmTensor
(
k0_.value(), -GREAT, -GREAT,
k0_.value(), -GREAT,
k0_.value()
kMin_.value(), -GREAT, -GREAT,
kMin_.value(), -GREAT,
kMin_.value()
)
)
);
k_ == 0.5*tr(R_);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate turbulent viscosity

View File

@ -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
@ -187,7 +187,10 @@ LaunderSharmaKE::LaunderSharmaKE
autoCreateAlphat("alphat", mesh_)
)
{
mut_ = rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
mut_ = rho_*Cmu_*fMu()*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -275,7 +278,7 @@ void LaunderSharmaKE::correct()
if (!turbulence_)
{
// Re-calculate viscosity
mut_ == rho_*Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_ == rho_*Cmu_*fMu()*sqr(k_)/epsilon_;
// Re-calculate thermal diffusivity
alphat_ = mut_/Prt_;
@ -320,7 +323,7 @@ void LaunderSharmaKE::correct()
epsEqn().relax();
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -338,11 +341,11 @@ void LaunderSharmaKE::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity
mut_ == Cmu_*fMu()*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_ == Cmu_*fMu()*rho_*sqr(k_)/epsilon_;
// Re-calculate thermal diffusivity

View File

@ -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
@ -81,11 +81,9 @@ RASModel::RASModel
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subOrEmptyDict(type + "Coeffs")),
k0_("k0", dimVelocity*dimVelocity, SMALL),
epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL),
epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL),
omega0_("omega", dimless/dimTime, SMALL),
omegaSmall_("omegaSmall", omega0_.dimensions(), SMALL),
kMin_("kMin", sqr(dimVelocity), SMALL),
epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL),
omegaMin_("omegaMin", dimless/dimTime, SMALL),
y_(mesh_)
{
@ -135,9 +133,13 @@ autoPtr<RASModel> RASModel::New
{
FatalErrorIn
(
"RASModel::New(const volScalarField&, "
"const volVectorField&, const surfaceScalarField&, "
"basicThermo&)"
"RASModel::New"
"("
"const volScalarField&, "
"const volVectorField&, "
"const surfaceScalarField&, "
"basicThermo&"
")"
) << "Unknown RASModel type " << modelName
<< endl << endl
<< "Valid RASModel types are :" << endl
@ -219,11 +221,9 @@ bool RASModel::read()
coeffDict_ <<= *dictPtr;
}
k0_.readIfPresent(*this);
epsilon0_.readIfPresent(*this);
epsilonSmall_.readIfPresent(*this);
omega0_.readIfPresent(*this);
omegaSmall_.readIfPresent(*this);
kMin_.readIfPresent(*this);
epsilonMin_.readIfPresent(*this);
omegaMin_.readIfPresent(*this);
return true;
}

View File

@ -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
@ -93,19 +93,13 @@ protected:
scalar yPlusLam_;
//- Lower limit of k
dimensionedScalar k0_;
dimensionedScalar kMin_;
//- Lower limit of epsilon
dimensionedScalar epsilon0_;
//- Small epsilon value used to avoid divide by zero
dimensionedScalar epsilonSmall_;
dimensionedScalar epsilonMin_;
//- Lower limit for omega
dimensionedScalar omega0_;
//- Small omega value used to avoid divide by zero
dimensionedScalar omegaSmall_;
dimensionedScalar omegaMin_;
//- Near wall distance boundary field
nearWallDist y_;
@ -185,68 +179,40 @@ public:
// Access
//- Return the value of k0 which k is not allowed to be less than
const dimensionedScalar& k0() const
//- Return the lower allowable limit for k (default: SMALL)
const dimensionedScalar& kMin() const
{
return k0_;
return kMin_;
}
//- Return the value of epsilon0 which epsilon is not allowed to be
// less than
const dimensionedScalar& epsilon0() const
//- Return the lower allowable limit for epsilon (default: SMALL)
const dimensionedScalar& epsilonMin() const
{
return epsilon0_;
return epsilonMin_;
}
//- Return the value of epsilonSmall which is added to epsilon when
// calculating nut
const dimensionedScalar& epsilonSmall() const
//- Return the lower allowable limit for omega (default: SMALL)
const dimensionedScalar& omegaMin() const
{
return epsilonSmall_;
return omegaMin_;
}
//- Return the value of omega0 which epsilon is not allowed to be
// less than
const dimensionedScalar& omega0() const
//- Allow kMin to be changed
dimensionedScalar& kMin()
{
return omega0_;
return kMin_;
}
//- Return the value of omegaSmall which is added to epsilon when
// calculating nut
const dimensionedScalar& omegaSmall() const
//- Allow epsilonMin to be changed
dimensionedScalar& epsilonMin()
{
return omegaSmall_;
return epsilonMin_;
}
//- Allow k0 to be changed
dimensionedScalar& k0()
//- Allow omegaMin to be changed
dimensionedScalar& omegaMin()
{
return k0_;
}
//- Allow epsilon0 to be changed
dimensionedScalar& epsilon0()
{
return epsilon0_;
}
//- Allow epsilonSmall to be changed
dimensionedScalar& epsilonSmall()
{
return epsilonSmall_;
}
//- Allow omega0 to be changed
dimensionedScalar& omega0()
{
return omega0_;
}
//- Allow omegaSmall to be changed
dimensionedScalar& omegaSmall()
{
return omegaSmall_;
return omegaMin_;
}
//- Return the near wall distances

View File

@ -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
@ -186,7 +186,10 @@ RNGkEpsilon::RNGkEpsilon
autoCreateAlphat("alphat", mesh_)
)
{
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
mut_ = Cmu_*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -276,7 +279,7 @@ void RNGkEpsilon::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
@ -327,7 +330,7 @@ void RNGkEpsilon::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -339,12 +342,12 @@ void RNGkEpsilon::correct()
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)
- fvm::Sp(rho_*(epsilon_)/k_, k_)
- fvm::Sp(rho_*epsilon_/k_, k_)
);
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -168,7 +168,10 @@ kEpsilon::kEpsilon
autoCreateAlphat("alphat", mesh_)
)
{
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
mut_ = Cmu_*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -257,7 +260,7 @@ void kEpsilon::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
@ -300,7 +303,7 @@ void kEpsilon::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -318,7 +321,7 @@ void kEpsilon::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -258,7 +258,18 @@ kOmegaSST::kOmegaSST
autoCreateAlphat("alphat", mesh_)
)
{
mut_ = a1_*rho_*k_/max(a1_*omega_, F2()*sqrt(magSqr(symm(fvc::grad(U_)))));
bound(k_, kMin_);
bound(omega_, omegaMin_);
mut_ =
(
a1_*rho_*k_
/ max
(
a1_*omega_,
F2()*sqrt(magSqr(symm(fvc::grad(U_))))
)
);
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -414,7 +425,7 @@ void kOmegaSST::correct()
omegaEqn().boundaryManipulate(omega_.boundaryField());
solve(omegaEqn);
bound(omega_, omega0_);
bound(omega_, omegaMin_);
// Turbulent kinetic energy equation
tmp<fvScalarMatrix> kEqn
@ -430,7 +441,7 @@ void kOmegaSST::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -69,7 +69,7 @@ tmp<volScalarField> realizableKE::rCmu
volScalarField As = sqrt(6.0)*cos(phis);
volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU)));
return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_));
return 1.0/(A0_ + As*Us*k_/epsilon_);
}
@ -200,10 +200,10 @@ realizableKE::realizableKE
autoCreateAlphat("alphat", mesh_)
)
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
mut_ = rCmu(fvc::grad(U_))*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_ = rCmu(fvc::grad(U_))*rho_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
@ -341,7 +341,7 @@ void realizableKE::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -353,12 +353,12 @@ void realizableKE::correct()
- fvm::laplacian(DkEff(), k_)
==
G - fvm::SuSp(2.0/3.0*rho_*divU, k_)
- fvm::Sp(rho_*(epsilon_)/k_, k_)
- fvm::Sp(rho_*epsilon_/k_, k_)
);
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity
mut_ = rCmu(gradU, S2, magS)*rho_*sqr(k_)/epsilon_;

View File

@ -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
@ -102,7 +102,7 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
volScalarField K = 0.5*tr(B_);
volScalarField Epsilon = 2*nuEff()*magSqr(D);
fvSymmTensorMatrix BEqn
tmp<fvSymmTensorMatrix> BEqn
(
fvm::ddt(B_)
+ fvm::div(phi(), B_)
@ -114,23 +114,23 @@ void DeardorffDiffStress::correct(const tmp<volTensorField>& tgradU)
- (2*ce_ - 0.667*cm_)*I*Epsilon
);
BEqn.relax();
BEqn.solve();
BEqn().relax();
BEqn().solve();
// Bounding the component kinetic energies
forAll(B_, celli)
{
B_[celli].component(symmTensor::XX) =
max(B_[celli].component(symmTensor::XX), k0().value());
max(B_[celli].component(symmTensor::XX), kMin_.value());
B_[celli].component(symmTensor::YY) =
max(B_[celli].component(symmTensor::YY), k0().value());
max(B_[celli].component(symmTensor::YY), kMin_.value());
B_[celli].component(symmTensor::ZZ) =
max(B_[celli].component(symmTensor::ZZ), k0().value());
max(B_[celli].component(symmTensor::ZZ), kMin_.value());
}
K = 0.5*tr(B_);
bound(K, k0());
bound(K, kMin_);
updateSubGridScaleFields(K);
}

View File

@ -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
@ -78,10 +78,10 @@ LESModel::LESModel
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subOrEmptyDict(type + "Coeffs")),
k0_("k0", dimVelocity*dimVelocity, SMALL),
kMin_("kMin", sqr(dimVelocity), SMALL),
delta_(LESdelta::New("delta", U.mesh(), *this))
{
readIfPresent("k0", k0_);
readIfPresent("kMin", kMin_);
// Force the construction of the mesh deltaCoeffs which may be needed
// for the construction of the derived models and BCs
@ -128,8 +128,12 @@ autoPtr<LESModel> LESModel::New
{
FatalErrorIn
(
"LESModel::New(const volVectorField& U, const "
"surfaceScalarField& phi, transportModel&)"
"LESModel::New"
"("
"const volVectorField&, "
"const surfaceScalarField& ,"
"transportModel&"
")"
) << "Unknown LESModel type " << modelName
<< endl << endl
<< "Valid LESModel types are :" << endl
@ -167,7 +171,7 @@ bool LESModel::read()
delta_().read(*this);
readIfPresent("k0", k0_);
kMin_.readIfPresent(*this);
return true;
}

View File

@ -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
@ -83,7 +83,7 @@ protected:
Switch printCoeffs_;
dictionary coeffDict_;
dimensionedScalar k0_;
dimensionedScalar kMin_;
autoPtr<LESdelta> delta_;
@ -171,16 +171,16 @@ public:
return delta_();
}
//- Return the value of k0 which k is not allowed to be less than
const dimensionedScalar& k0() const
//- Return the lower allowable limit for k (default: SMALL)
const dimensionedScalar& kMin() const
{
return k0_;
return kMin_;
}
//- Allow k0 to be changed
dimensionedScalar& k0()
//- Allow kMin to be changed
dimensionedScalar& kMin()
{
return k0_;
return kMin_;
}

View File

@ -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
@ -90,7 +90,10 @@ LRRDiffStress::LRRDiffStress
)
)
{
updateSubGridScaleFields(0.5*tr(B_));
volScalarField K = 0.5*tr(B_);
bound(K, kMin_);
updateSubGridScaleFields(K);
printCoeffs();
}
@ -111,7 +114,7 @@ void LRRDiffStress::correct(const tmp<volTensorField>& tgradU)
volScalarField K = 0.5*tr(B_);
volScalarField Epsilon = 2*nuEff()*magSqr(D);
fvSymmTensorMatrix BEqn
tmp<fvSymmTensorMatrix> BEqn
(
fvm::ddt(B_)
+ fvm::div(phi(), B_)
@ -124,23 +127,23 @@ void LRRDiffStress::correct(const tmp<volTensorField>& tgradU)
- (0.667 - 2*c1_)*I*pow(K, 1.5)/delta()
);
BEqn.relax();
BEqn.solve();
BEqn().relax();
BEqn().solve();
// Bounding the component kinetic energies
forAll(B_, celli)
{
B_[celli].component(symmTensor::XX) =
max(B_[celli].component(symmTensor::XX), k0().value());
max(B_[celli].component(symmTensor::XX), kMin_.value());
B_[celli].component(symmTensor::YY) =
max(B_[celli].component(symmTensor::YY), k0().value());
max(B_[celli].component(symmTensor::YY), kMin_.value());
B_[celli].component(symmTensor::ZZ) =
max(B_[celli].component(symmTensor::ZZ), k0().value());
max(B_[celli].component(symmTensor::ZZ), kMin_.value());
}
K = 0.5*tr(B_);
bound(K, k0());
bound(K, kMin_);
updateSubGridScaleFields(K);
}

View File

@ -295,7 +295,7 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
const volScalarField dTilda = this->dTilda(S);
const volScalarField STilda = this->STilda(S, dTilda);
fvScalarMatrix nuTildaEqn
tmp<fvScalarMatrix> nuTildaEqn
(
fvm::ddt(nuTilda_)
+ fvm::div(phi(), nuTilda_)
@ -311,8 +311,8 @@ void SpalartAllmaras::correct(const tmp<volTensorField>& gradU)
- fvm::Sp(Cw1_*fw(STilda, dTilda)*nuTilda_/sqr(dTilda), nuTilda_)
);
nuTildaEqn.relax();
nuTildaEqn.solve();
nuTildaEqn().relax();
nuTildaEqn().solve();
bound(nuTilda_, dimensionedScalar("zero", nuTilda_.dimensions(), 0.0));
nuTilda_.correctBoundaryConditions();

View File

@ -176,7 +176,6 @@ SpalartAllmarasIDDES::SpalartAllmarasIDDES
1.63
)
)
{}

View File

@ -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
@ -80,10 +80,10 @@ dimensionedScalar dynOneEqEddy::ce(const volSymmTensorField& D) const
pow(KK + filter_(k_), 1.5)/(2*delta()) - filter_(pow(k_, 1.5))/delta();
volScalarField ee =
2*delta()*ck(D)
2*delta()*ck(D)
*(
filter_(sqrt(k_)*magSqr(D))
- 2*sqrt(KK + filter_(k_))*magSqr(filter_(D))
filter_(sqrt(k_)*magSqr(D))
- 2*sqrt(KK + filter_(k_))*magSqr(filter_(D))
);
dimensionedScalar mmmm = average(magSqr(mm));
@ -127,6 +127,8 @@ dynOneEqEddy::dynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
bound(k_, kMin_);
updateSubGridScaleFields(symm(fvc::grad(U)));
printCoeffs();
@ -135,15 +137,17 @@ dynOneEqEddy::dynOneEqEddy
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void dynOneEqEddy::correct(const tmp<volTensorField>& gradU)
void dynOneEqEddy::correct(const tmp<volTensorField>& tgradU)
{
const volTensorField& gradU = tgradU();
GenEddyVisc::correct(gradU);
volSymmTensorField D = symm(gradU);
volScalarField P = 2.0*nuSgs_*magSqr(D);
fvScalarMatrix kEqn
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(k_)
+ fvm::div(phi(), k_)
@ -153,10 +157,10 @@ void dynOneEqEddy::correct(const tmp<volTensorField>& gradU)
- fvm::Sp(ce(D)*sqrt(k_)/delta(), k_)
);
kEqn.relax();
kEqn.solve();
kEqn().relax();
kEqn().solve();
bound(k_, k0());
bound(k_, kMin_);
updateSubGridScaleFields(D);
}

View File

@ -118,6 +118,8 @@ dynSmagorinsky::dynSmagorinsky
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
bound(k_, kMin_);
updateSubGridScaleFields(dev(symm(fvc::grad(U))));
printCoeffs();
@ -133,6 +135,7 @@ void dynSmagorinsky::correct(const tmp<volTensorField>& gradU)
volSymmTensorField D = dev(symm(gradU));
k_ = cI(D)*sqr(delta())*magSqr(D);
bound(k_, kMin_);
updateSubGridScaleFields(D);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -263,8 +263,7 @@ kOmegaSSTSAS::kOmegaSSTSAS
)
),
omega0_("omega0", dimless/dimTime, SMALL),
omegaSmall_("omegaSmall", dimless/dimTime, SMALL),
omegaMin_("omegaMin", dimless/dimTime, SMALL),
y_(mesh_),
Cmu_
(
@ -324,6 +323,9 @@ kOmegaSSTSAS::kOmegaSSTSAS
mesh_
)
{
bound(k_, kMin_);
bound(omega_, omegaMin_);
updateSubGridScaleFields(magSqr(symm(fvc::grad(U))));
printCoeffs();
@ -346,9 +348,8 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
volVectorField gradK = fvc::grad(k_);
volVectorField gradOmega = fvc::grad(omega_);
volScalarField L = sqrt(k_)/(pow025(Cmu_)*(omega_ + omegaSmall_));
volScalarField CDkOmega =
(2.0*alphaOmega2_)*(gradK & gradOmega)/(omega_ + omegaSmall_);
volScalarField L = sqrt(k_)/(pow025(Cmu_)*omega_);
volScalarField CDkOmega = (2.0*alphaOmega2_)*(gradK & gradOmega)/omega_;
volScalarField F1 = this->F1(CDkOmega);
volScalarField G = nuSgs_*2.0*S2;
@ -368,14 +369,12 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
kEqn.relax();
kEqn.solve();
}
bound(k_, k0());
bound(k_, kMin_);
volScalarField grad_omega_k = max
(
magSqr(gradOmega)/
sqr(omega_ + omegaSmall_),
magSqr(gradK)/
sqr(k_ + k0())
magSqr(gradOmega)/sqr(omega_),
magSqr(gradK)/sqr(k_)
);
// Turbulent frequency equation
@ -397,7 +396,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
+ FSAS_
*max
(
dimensionedScalar("zero",dimensionSet(0, 0 , -2, 0, 0),0. ),
dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0),
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))
- 2.0/alphaPhi_*k_*grad_omega_k
)
@ -406,7 +405,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
omegaEqn.relax();
omegaEqn.solve();
}
bound(omega_, omega0_);
bound(omega_, omegaMin_);
updateSubGridScaleFields(S2);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -103,8 +103,7 @@ protected:
dimensionedScalar zetaTilda2_;
dimensionedScalar FSAS_;
dimensionedScalar omega0_;
dimensionedScalar omegaSmall_;
dimensionedScalar omegaMin_;
wallDist y_;
dimensionedScalar Cmu_;

View File

@ -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
@ -119,6 +119,8 @@ locDynOneEqEddy::locDynOneEqEddy
filterPtr_(LESfilter::New(U.mesh(), coeffDict())),
filter_(filterPtr_())
{
bound(k_, kMin_);
volScalarField KK = 0.5*(filter_(magSqr(U)) - magSqr(filter_(U)));
updateSubGridScaleFields(symm(fvc::grad(U)), KK);
@ -139,7 +141,7 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU)
volScalarField P = 2.0*nuSgs_*magSqr(D);
fvScalarMatrix kEqn
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(k_)
+ fvm::div(phi(), k_)
@ -149,10 +151,10 @@ void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU)
- fvm::Sp(ce(D, KK)*sqrt(k_)/delta(), k_)
);
kEqn.relax();
kEqn.solve();
kEqn().relax();
kEqn().solve();
bound(k_, k0());
bound(k_, kMin_);
updateSubGridScaleFields(D, KK);
}

View File

@ -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
@ -86,6 +86,8 @@ oneEqEddy::oneEqEddy
)
)
{
bound(k_, kMin_);
updateSubGridScaleFields();
printCoeffs();
@ -100,7 +102,7 @@ void oneEqEddy::correct(const tmp<volTensorField>& gradU)
volScalarField G = 2.0*nuSgs_*magSqr(symm(gradU));
fvScalarMatrix kEqn
tmp<fvScalarMatrix> kEqn
(
fvm::ddt(k_)
+ fvm::div(phi(), k_)
@ -110,10 +112,10 @@ void oneEqEddy::correct(const tmp<volTensorField>& gradU)
- fvm::Sp(ce_*sqrt(k_)/delta(), k_)
);
kEqn.relax();
kEqn.solve();
kEqn().relax();
kEqn().solve();
bound(k_, k0());
bound(k_, kMin_);
updateSubGridScaleFields();
}

View File

@ -72,7 +72,6 @@ spectEddyVisc::spectEddyVisc
LESModel(typeName, U, phi, transport),
GenEddyVisc(U, phi, transport),
cB_
(
dimensioned<scalar>::lookupOrAddToDict

View File

@ -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
@ -186,9 +186,6 @@ LRR::LRR
autoCreateNut("nut", mesh_)
)
{
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_.correctBoundaryConditions();
if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0)
{
FatalErrorIn
@ -201,6 +198,12 @@ LRR::LRR
<< exit(FatalError);
}
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
printCoeffs();
}
@ -320,7 +323,7 @@ void LRR::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Reynolds stress equation
@ -368,15 +371,15 @@ void LRR::correct()
R_.dimensions(),
symmTensor
(
k0_.value(), -GREAT, -GREAT,
k0_.value(), -GREAT,
k0_.value()
kMin_.value(), -GREAT, -GREAT,
kMin_.value(), -GREAT,
kMin_.value()
)
)
);
k_ = 0.5*tr(R_);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -140,7 +140,10 @@ LamBremhorstKE::LamBremhorstKE
autoCreateLowReNut("nut", mesh_)
)
{
nut_ = Cmu_*fMu_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*fMu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -260,7 +263,7 @@ void LamBremhorstKE::correct()
epsEqn().relax();
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -276,7 +279,7 @@ void LamBremhorstKE::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -224,7 +224,10 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
autoCreateNut("nut", mesh_)
)
{
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
if (couplingFactor_.value() < 0.0 || couplingFactor_.value() > 1.0)
@ -362,7 +365,7 @@ void LaunderGibsonRSTM::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Reynolds stress equation
@ -419,15 +422,15 @@ void LaunderGibsonRSTM::correct()
R_.dimensions(),
symmTensor
(
k0_.value(), -GREAT, -GREAT,
k0_.value(), -GREAT,
k0_.value()
kMin_.value(), -GREAT, -GREAT,
kMin_.value(), -GREAT,
kMin_.value()
)
)
);
k_ == 0.5*tr(R_);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate turbulent viscosity

View File

@ -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
@ -146,7 +146,10 @@ LaunderSharmaKE::LaunderSharmaKE
autoCreateLowReNut("nut", mesh_)
)
{
nut_ = Cmu_*fMu()*sqr(k_)/(epsilonTilda_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilonTilda_, epsilonMin_);
nut_ = Cmu_*fMu()*sqr(k_)/epsilonTilda_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -256,7 +259,7 @@ void LaunderSharmaKE::correct()
epsEqn().relax();
solve(epsEqn);
bound(epsilonTilda_, epsilon0_);
bound(epsilonTilda_, epsilonMin_);
// Turbulent kinetic energy equation
@ -272,7 +275,7 @@ void LaunderSharmaKE::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -171,8 +171,16 @@ LienCubicKE::LienCubicKE
),
gradU_(fvc::grad(U)),
eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))),
ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))),
eta_
(
k_/(epsilon_ + epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
),
ksi_
(
k_/(epsilon_ + epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
fEta_(A2_ + pow(eta_, 3.0)),
@ -226,7 +234,10 @@ LienCubicKE::LienCubicKE
)
)
{
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_) + C5viscosity_;
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*sqr(k_)/epsilon_ + C5viscosity_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -350,7 +361,7 @@ void LienCubicKE::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -367,7 +378,7 @@ void LienCubicKE::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -220,14 +220,22 @@ LienCubicKELowRe::LienCubicKELowRe
y_(mesh_),
gradU_(fvc::grad(U)),
eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))),
ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))),
eta_
(
k_/(epsilon_ + epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
),
ksi_
(
k_/(epsilon_ + epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
fEta_(A2_ + pow(eta_, 3.0)),
fEta_(A2_ + pow3(eta_)),
C5viscosity_
(
-2.0*pow(Cmu_, 3.0)*pow(k_, 4.0)/pow(epsilon_, 3.0)
-2.0*pow3(Cmu_)*pow4(k_)/pow3(epsilon_ + epsilonMin_)
*(magSqr(gradU_ + gradU_.T()) - magSqr(gradU_ - gradU_.T()))
),
@ -252,7 +260,7 @@ LienCubicKELowRe::LienCubicKELowRe
symm
(
// quadratic terms
pow(k_, 3.0)/sqr(epsilon_)
pow3(k_)/sqr(epsilon_ + epsilonMin_)
*(
Ctau1_/fEta_
*(
@ -263,8 +271,8 @@ LienCubicKELowRe::LienCubicKELowRe
+ Ctau3_/fEta_*(gradU_.T() & gradU_)
)
// cubic term C4
- 20.0*pow(k_, 4.0)/pow(epsilon_, 3.0)
*pow(Cmu_, 3.0)
- 20.0*pow4(k_)/pow3(epsilon_ + epsilonMin_)
*pow3(Cmu_)
*(
((gradU_ & gradU_) & gradU_.T())
+ ((gradU_ & gradU_.T()) & gradU_.T())
@ -280,12 +288,13 @@ LienCubicKELowRe::LienCubicKELowRe
)
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_
*(
scalar(1) - exp(-Am_*yStar_))
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL
)
*sqr(k_)/(epsilon_ + epsilonSmall_)
* (scalar(1) - exp(-Am_*yStar_))
/ (scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)
* sqr(k_)/epsilon_
// cubic term C5, implicit part
+ max
(
@ -430,11 +439,11 @@ void LienCubicKELowRe::correct()
epsEqn().relax();
# include "LienCubicKELowReSetWallDissipation.H"
# include "wallDissipationI.H"
#include "LienCubicKELowReSetWallDissipation.H"
#include "wallDissipationI.H"
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -451,7 +460,7 @@ void LienCubicKELowRe::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -180,9 +180,12 @@ LienLeschzinerLowRe::LienLeschzinerLowRe
autoCreateLowReNut("nut", mesh_)
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*(scalar(1) - exp(-Am_*yStar_))
/(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL)*sqr(k_)
/(epsilon_ + epsilonSmall_);
/(epsilon_);
nut_.correctBoundaryConditions();
printCoeffs();
@ -322,7 +325,7 @@ void LienLeschzinerLowRe::correct()
#include "wallDissipationI.H"
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -339,7 +342,7 @@ void LienLeschzinerLowRe::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -190,19 +190,27 @@ NonlinearKEShih::NonlinearKEShih
),
gradU_(fvc::grad(U)),
eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))),
ksi_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))),
eta_
(
k_/(epsilon_ + epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))
),
ksi_
(
k_/(epsilon_+ epsilonMin_)
*sqrt(2.0*magSqr(0.5*(gradU_ - gradU_.T())))
),
Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))),
fEta_(A2_ + pow(eta_, 3.0)),
nut_("nut", Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_)),
nut_("nut", Cmu_*sqr(k_)/(epsilon_ + epsilonMin_)),
nonlinearStress_
(
"nonlinearStress",
symm
(
pow(k_, 3.0)/sqr(epsilon_)
pow3(k_)/sqr(epsilon_ + epsilonMin_)
*(
Ctau1_/fEta_
*(
@ -215,6 +223,9 @@ NonlinearKEShih::NonlinearKEShih
)
)
{
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
#include "wallNonlinearViscosityI.H"
printCoeffs();
@ -343,7 +354,7 @@ void NonlinearKEShih::correct()
#include "wallDissipationI.H"
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -360,7 +371,7 @@ void NonlinearKEShih::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -80,11 +80,9 @@ RASModel::RASModel
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(subOrEmptyDict(type + "Coeffs")),
k0_("k0", dimVelocity*dimVelocity, SMALL),
epsilon0_("epsilon", k0_.dimensions()/dimTime, SMALL),
epsilonSmall_("epsilonSmall", epsilon0_.dimensions(), SMALL),
omega0_("omega0", dimless/dimTime, SMALL),
omegaSmall_("omegaSmall", omega0_.dimensions(), SMALL),
kMin_("kMin", sqr(dimVelocity), SMALL),
epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL),
omegaMin_("omegaMin", dimless/dimTime, SMALL),
y_(mesh_)
{
@ -133,8 +131,12 @@ autoPtr<RASModel> RASModel::New
{
FatalErrorIn
(
"RASModel::New(const volVectorField&, "
"const surfaceScalarField&, transportModel&)"
"RASModel::New"
"("
"const volVectorField&, "
"const surfaceScalarField&, "
"transportModel&"
")"
) << "Unknown RASModel type " << modelName
<< endl << endl
<< "Valid RASModel types are :" << endl
@ -213,11 +215,9 @@ bool RASModel::read()
coeffDict_ <<= *dictPtr;
}
k0_.readIfPresent(*this);
epsilon0_.readIfPresent(*this);
epsilonSmall_.readIfPresent(*this);
omega0_.readIfPresent(*this);
omegaSmall_.readIfPresent(*this);
kMin_.readIfPresent(*this);
epsilonMin_.readIfPresent(*this);
omegaMin_.readIfPresent(*this);
return true;
}

View File

@ -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
@ -87,19 +87,13 @@ protected:
dictionary coeffDict_;
//- Lower limit of k
dimensionedScalar k0_;
dimensionedScalar kMin_;
//- Lower limit of epsilon
dimensionedScalar epsilon0_;
//- Small epsilon value used to avoid divide by zero
dimensionedScalar epsilonSmall_;
dimensionedScalar epsilonMin_;
//- Lower limit for omega
dimensionedScalar omega0_;
//- Small omega value used to avoid divide by zero
dimensionedScalar omegaSmall_;
dimensionedScalar omegaMin_;
//- Near wall distance boundary field
nearWallDist y_;
@ -176,68 +170,40 @@ public:
// Access
//- Return the value of k0 which k is not allowed to be less than
const dimensionedScalar& k0() const
//- Return lower allowable limit for k (default: SMALL)
const dimensionedScalar& kMin() const
{
return k0_;
return kMin_;
}
//- Return the value of epsilon0 which epsilon is not allowed to be
// less than
const dimensionedScalar& epsilon0() const
//- Return the lower allowable limit for epsilon (default: SMALL)
const dimensionedScalar& epsilonMin() const
{
return epsilon0_;
return epsilonMin_;
}
//- Return the value of epsilonSmall which is added to epsilon when
// calculating nut
const dimensionedScalar& epsilonSmall() const
//- Return the lower allowable limit for omega (default: SMALL)
const dimensionedScalar& omegaMin() const
{
return epsilonSmall_;
return omegaMin_;
}
//- Return the value of omega0 which epsilon is not allowed to be
// less than
const dimensionedScalar& omega0() const
//- Allow kMin to be changed
dimensionedScalar& kMin()
{
return omega0_;
return kMin_;
}
//- Return the value of omegaSmall which is added to epsilon when
// calculating nut
const dimensionedScalar& omegaSmall() const
//- Allow epsilonMin to be changed
dimensionedScalar& epsilonMin()
{
return omegaSmall_;
return epsilonMin_;
}
//- Allow k0 to be changed
dimensionedScalar& k0()
//- Allow omegaMin to be changed
dimensionedScalar& omegaMin()
{
return k0_;
}
//- Allow epsilon0 to be changed
dimensionedScalar& epsilon0()
{
return epsilon0_;
}
//- Allow epsilonSmall to be changed
dimensionedScalar& epsilonSmall()
{
return epsilonSmall_;
}
//- Allow omega0 to be changed
dimensionedScalar& omega0()
{
return omega0_;
}
//- Allow omegaSmall to be changed
dimensionedScalar& omegaSmall()
{
return omegaSmall_;
return omegaMin_;
}
//- Return the near wall distances

View File

@ -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
@ -155,7 +155,10 @@ RNGkEpsilon::RNGkEpsilon
autoCreateNut("nut", mesh_)
)
{
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -274,7 +277,7 @@ void RNGkEpsilon::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -290,7 +293,7 @@ void RNGkEpsilon::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -128,7 +128,10 @@ kEpsilon::kEpsilon
autoCreateNut("nut", mesh_)
)
{
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = Cmu_*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -237,7 +240,7 @@ void kEpsilon::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -254,7 +257,7 @@ void kEpsilon::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -137,7 +137,10 @@ kOmega::kOmega
autoCreateNut("nut", mesh_)
)
{
nut_ = k_/(omega_ + omegaSmall_);
bound(k_, kMin_);
bound(omega_, omegaMin_);
nut_ = k_/omega_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -246,7 +249,7 @@ void kOmega::correct()
omegaEqn().boundaryManipulate(omega_.boundaryField());
solve(omegaEqn);
bound(omega_, omega0_);
bound(omega_, omegaMin_);
// Turbulent kinetic energy equation
@ -263,11 +266,11 @@ void kOmega::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity
nut_ = k_/(omega_ + omegaSmall_);
nut_ = k_/omega_;
nut_.correctBoundaryConditions();
}

View File

@ -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
@ -236,13 +236,18 @@ kOmegaSST::kOmegaSST
autoCreateNut("nut", mesh_)
)
{
bound(k_, kMin_);
bound(omega_, omegaMin_);
nut_ =
(
a1_*k_
/max
/ max
(
a1_*(omega_ + omegaSmall_),
a1_*omega_,
F2()*mag(symm(fvc::grad(U_)))
);
)
);
nut_.correctBoundaryConditions();
printCoeffs();
@ -374,7 +379,7 @@ void kOmegaSST::correct()
omegaEqn().boundaryManipulate(omega_.boundaryField());
solve(omegaEqn);
bound(omega_, omega0_);
bound(omega_, omegaMin_);
// Turbulent kinetic energy equation
tmp<fvScalarMatrix> kEqn
@ -390,7 +395,7 @@ void kOmegaSST::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -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
@ -126,6 +126,9 @@ qZeta::qZeta
)
),
qMin_("qMin", dimVelocity, SMALL),
zetaMin_("zetaMin", dimVelocity/dimTime, SMALL),
k_
(
IOobject
@ -193,7 +196,12 @@ qZeta::qZeta
autoCreateNut("nut", mesh_)
)
{
nut_ = Cmu_*fMu()*sqr(k_)/(epsilon_ + epsilonSmall_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
bound(q_, qMin_);
bound(zeta_, zetaMin_);
nut_ = Cmu_*fMu()*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -263,6 +271,9 @@ bool qZeta::read()
sigmaZeta_.readIfPresent(coeffDict());
anisotropic_.readIfPresent("anisotropic", coeffDict());
qMin_.readIfPresent(*this);
zetaMin_.readIfPresent(*this);
return true;
}
else
@ -302,7 +313,7 @@ void qZeta::correct()
zetaEqn().relax();
solve(zetaEqn);
bound(zeta_, epsilon0_/(2*sqrt(k0_)));
bound(zeta_, zetaMin_);
// q equation
@ -318,7 +329,7 @@ void qZeta::correct()
qEqn().relax();
solve(qEqn);
bound(q_, sqrt(k0_));
bound(q_, qMin_);
// Re-calculate k and epsilon

View File

@ -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
@ -66,6 +66,11 @@ class qZeta
dimensionedScalar sigmaZeta_;
Switch anisotropic_;
//- Lower limit of q
dimensionedScalar qMin_;
//- Lower limit of zeta
dimensionedScalar zetaMin_;
// Fields
@ -107,6 +112,33 @@ public:
// Member Functions
// Access
//- Return lower allowable limit for q (default: SMALL)
const dimensionedScalar& qMin() const
{
return qMin_;
}
//- Return the lower allowable limit for zeta (default: SMALL)
const dimensionedScalar& zetaMin() const
{
return zetaMin_;
}
//- Allow qMin to be changed
dimensionedScalar& qMin()
{
return qMin_;
}
//- Allow zetaMin to be changed
dimensionedScalar& zetaMin()
{
return zetaMin_;
}
//- Return the turbulence viscosity
virtual tmp<volScalarField> nut() const
{

View File

@ -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
@ -69,7 +69,7 @@ tmp<volScalarField> realizableKE::rCmu
volScalarField As = sqrt(6.0)*cos(phis);
volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU)));
return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_));
return 1.0/(A0_ + As*Us*k_/epsilon_);
}
@ -178,10 +178,10 @@ realizableKE::realizableKE
autoCreateNut("nut", mesh_)
)
{
bound(k_, k0_);
bound(epsilon_, epsilon0_);
bound(k_, kMin_);
bound(epsilon_, epsilonMin_);
nut_ = rCmu(fvc::grad(U_))*sqr(k_)/(epsilon_ + epsilonSmall_);
nut_ = rCmu(fvc::grad(U_))*sqr(k_)/epsilon_;
nut_.correctBoundaryConditions();
printCoeffs();
@ -303,7 +303,7 @@ void realizableKE::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
bound(epsilon_, epsilon0_);
bound(epsilon_, epsilonMin_);
// Turbulent kinetic energy equation
@ -319,7 +319,7 @@ void realizableKE::correct()
kEqn().relax();
solve(kEqn);
bound(k_, k0_);
bound(k_, kMin_);
// Re-calculate viscosity

View File

@ -353,14 +353,17 @@ meshQualityControls
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum tet volume. Is absolute volume of the tet formed by the
// face-centre decomposition triangle and the cell centre.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minTetVol 1e-20;
//- Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -335,13 +335,16 @@ meshQualityControls
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 0;
//- Minimum tet volume. Is absolute volume of the tet formed by the
// face-centre decomposition triangle and the cell centre.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minTetVol 1e-20;
//- Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -546,14 +546,17 @@ meshQualityControls
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum tet volume. Is absolute volume of the tet formed by the
// face-centre decomposition triangle and the cell centre.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minTetVol 1e-20;
//- Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -288,13 +288,16 @@ meshQualityControls
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-20;
//- Minimum tet volume. Is absolute volume of the tet formed by the
// face-centre decomposition triangle and the cell centre.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minTetVol 1e-20;
//- Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -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
@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# The Makefile use a POSIX shell
# The Makefile uses a POSIX shell
#------------------------------------------------------------------------------
SHELL = /bin/sh
@ -120,7 +120,7 @@ MAKE_DEP = @$(MKDEP) $< | $(WM_SCRIPTS)/addCompile $<
#------------------------------------------------------------------------------
# Include PROJECT directory tree file and
# source, object and dependency list files.
# These are constructed by wmakeDerivedFiles
# These are constructed by scripts/makeDerivedFiles
#------------------------------------------------------------------------------
include $(OBJECTS_DIR)/options
@ -148,7 +148,7 @@ LIB_HEADER_DIRS = \
#------------------------------------------------------------------------------
$(EXE): $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(EXE)
@$(WM_SCRIPTS)/makeTargetDir $(EXE)
$(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \
$(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE)
@ -156,7 +156,7 @@ exe: $(SEXE)
@echo \'$(SEXE)\' is up to date.
$(SEXE): $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(SEXE)
@$(WM_SCRIPTS)/makeTargetDir $(SEXE)
$(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
$(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)
@ -169,7 +169,7 @@ libso: $(LIB).$(SO)
@echo \'$(LIB).$(SO)\' is up to date.
$(LIB).$(SO): $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(LIB)
@$(WM_SCRIPTS)/makeTargetDir $(LIB)
@rm -f so_locations
@cd $(OBJECTS_DIR) ; \
$(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
@ -178,7 +178,7 @@ lib: $(LIB).a
@echo \'$(LIB).a\' is up to date.
$(LIB).a: $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(LIB)
@$(WM_SCRIPTS)/makeTargetDir $(LIB)
@rm -f $(LIB).a
$(AR) $(ARFLAGS) $(LIB).a $(OBJECTS)
$(RANLIB) $(LIB).a
@ -187,7 +187,7 @@ libo: $(LIB).o
@echo \'$(LIB).o\' is up to date.
$(LIB).o: $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(LIB)
@$(WM_SCRIPTS)/makeTargetDir $(LIB)
@rm -f $(LIB).o
$(LD) -r -o $(LIB).o $(OBJECTS)
@ -195,7 +195,7 @@ jar: $(LIB).jar
@echo \'$(LIB).jar\' is up to date.
$(LIB).jar: $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(LIB)
@$(WM_SCRIPTS)/makeTargetDir $(LIB)
jar cfm $(LIB).jar $(LIB_LIBS) -C $(CLASSES_DIR) .
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -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
@ -32,6 +32,7 @@
GENERAL_RULES = $(WM_DIR)/rules/General
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
WM_SCRIPTS = $(WM_DIR)/scripts
OBJECTS_DIR = $(WM_OPTIONS)
FFLAGS =
@ -61,16 +62,16 @@ $(FILES) : files
@$(CPP) $(GFLAGS) $(FFLAGS) files > $(FILES)
$(SFILES): files
@wmakeDerivedFiles
@$(WM_SCRIPTS)/makeDerivedFiles
$(OFILES): files
@wmakeDerivedFiles
@$(WM_SCRIPTS)/makeDerivedFiles
$(DFILES): files
@wmakeDerivedFiles
@$(WM_SCRIPTS)/makeDerivedFiles
$(IFILES): files
@wmakeDerivedFiles
@$(WM_SCRIPTS)/makeDerivedFiles
#------------------------------------------------------------------------------

View File

@ -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
@ -32,6 +32,7 @@
GENERAL_RULES = $(WM_DIR)/rules/General
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
WM_SCRIPTS = $(WM_DIR)/scripts
include $(GENERAL_RULES)/general
include $(RULES)/general
@ -47,8 +48,8 @@ OPTIONS = $(WM_OPTIONS)/options
# Causes all derived files to be remade if any are changed or missing
#------------------------------------------------------------------------------
$(OPTIONS) : options
@wmkdir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options > $(OPTIONS)
$(OPTIONS) : options
@$(WM_SCRIPTS)/makeDir $(WM_OPTIONS) ; $(CPP) $(GFLAGS) options > $(OPTIONS)
#------------------------------------------------------------------------------

View File

@ -3,7 +3,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

View File

@ -1,4 +1,11 @@
CGAL_INC = \
-Wno-old-style-cast \
-I${CGAL_SRC}/include \
-I${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}
-I$(CGAL_ARCH_PATH)/include \
-I$(MPFR_ARCH_PATH)/include \
-I$(BOOST_ARCH_PATH)/include/boost
CGAL_LIBS = \
-L$(MPFR_ARCH_PATH)/lib \
-L$(BOOST_ARCH_PATH)/lib \
-lmpfr \
-lboost_thread

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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
@ -24,22 +24,21 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# wmakeDerivedFiles
# makeDerivedFiles
#
# Description
# Constructs all the file list for make given the source file list
# (which written by hand or using makeFilesAndDirectories.)
# Constructs all the file list for make given the source file list,
# written was by hand or using makeFilesAndOptions.
#
#------------------------------------------------------------------------------
if [ ! -d "$WM_OPTIONS" ]
then
echo "The $WM_OPTIONS directory does not exist, exiting" 1>&2
[ -d "$WM_OPTIONS" ] || {
echo "The '$WM_OPTIONS' directory does not exist, exiting" 1>&2
exit 1
fi
}
# change to the $WM_OPTIONS directory
cd $WM_OPTIONS 2>/dev/null || {
cd "$WM_OPTIONS" 2>/dev/null || {
echo "Could not change to directory '$WM_OPTIONS'" 1>&2
exit 1
}
@ -50,15 +49,15 @@ grep "=" files > filesMacros
# Remove all macro definitions from the files list
grep -v "=" files > filesPlusBlank
# Add a newline to files to make sure the last line is followed by a newline
# Add a newline to files to ensure the last line is followed by a newline
echo "" >> filesPlusBlank
# Remove commented lines blank lines, and trailing blanks from files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sed -e '/^#/ d' \
-e '/^[ \t]*$/ d' \
-e 's/[ \t]*$//' \
# Remove commented lines, blank lines, and trailing blanks from files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sed -e '/^#/ d' \
-e '/^[ \t]*$/ d' \
-e 's/[ \t]*$//' \
filesPlusBlank > files.$$
rm filesPlusBlank
@ -80,7 +79,7 @@ rm tmpSourceFile
# ~~~~~~~~~~~~~~~~
sed -e 's%.*/%%' \
-e 's%^%$(OBJECTS_DIR)/%' \
-e 's%\.[a-zA-Z]*$%\.o%' \
-e 's%\.[a-zA-Z]*$%\.o%' \
files.$$ > tmpObjectFiles
echo "OBJECTS = " > tmpObjectFiles2
@ -96,7 +95,7 @@ rm tmpObjectFiles tmpObjectFiles2
# make localObjectFiles
# ~~~~~~~~~~~~~~~~~~~~~
sed -e 's%.*/%%' \
-e 's%\.[a-zA-Z]*$%\.o%' \
-e 's%\.[a-zA-Z]*$%\.o%' \
files.$$ > tmpLocalObjectFiles
echo "LOCAL_OBJECTS = " > tmpLocalObjectFiles2
@ -132,6 +131,4 @@ sed -e 's/\.[a-zA-Z]*$/.dep/' \
rm files.$$
cd ..
#------------------------------------------------------------------------------

View File

@ -3,7 +3,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
@ -24,28 +24,18 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# wmkdir
# makeDir
#
# Description
# Script to make directories that do not already exist
# Usage : wmkdir <dir> [.. <dirN>]
# Usage : makeDir <dir> [.. <dirN>]
#
#------------------------------------------------------------------------------
if [ $# -ge 1 ]
then
# provide help
if [ "$1" = "-h" -o "$1" = "-help" ]
then
echo "usage: ${0##*/} <dir> [.. <dirN>]"
echo " mkdir if directories do not already exist"
echo
else
for dir
do
[ -d "$dir" ] || mkdir -p "$dir"
done
fi
fi
for dir
do
[ -d "$dir" ] || mkdir -p "$dir"
done
#------------------------------------------------------------------------------

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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
@ -24,21 +24,19 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# mkObjectDir
# makeTargetDir
#
# Description
# Makes a directory hierarchy for the given object file
# Makes a directory hierarchy for the given target file
#
# Usage: mkObjectDir <directory>
# Usage: makeTargetDir <directory>
#
#------------------------------------------------------------------------------
if [ $# -eq 1 ]
then
if [ ! -d ${1%/*} -a $1 != ${1%/*} ]
then
mkdir -p ${1%/*}
fi
fi
for target
do
dir=${target%/*}
[ -d "$dir" ] || [ "$dir" = "$target" ] || mkdir -p "$dir"
done
#------------------------------------------------------------------------------

View File

@ -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

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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

View File

@ -3,7 +3,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
@ -58,13 +58,14 @@ USAGE
#------------------------------------------------------------------------------
# simple option parsing
unset forceUpdate
# default 'find' option
unset findOpt
# default ln option
# default 'ln' option
lnOpt="-s"
unset forceUpdate
# simple parse options
while [ "$#" -gt 0 ]
do
@ -74,7 +75,7 @@ do
;;
-f)
shift
forceUpdate=1
forceUpdate=true
lnOpt="-sf"
;;
-*)
@ -110,28 +111,25 @@ done
incDir=$baseDir/lnInclude
if [ ! -d $baseDir ]
then
[ -d $baseDir ] || {
echo "$Script error: base directory $baseDir does not exist" 1>&2
exit 2
fi
}
if [ -d $incDir ]
then
if [ ! "$forceUpdate" ]
then
# echo "$Script error: include directory $incDir already exists" 1>&2
exit 0
fi
[ "$forceUpdate" = true ] || {
# echo "$Script error: include directory $incDir already exists" 1>&2
exit 0
}
else
mkdir $incDir
fi
if [ ! -d $incDir ]
then
[ -d $incDir ] || {
echo "$Script error: failed to create include directory $incDir" 1>&2
exit 0
fi
}
cd $incDir || exit 1

Some files were not shown because too many files have changed in this diff Show More