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

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

parents 76b25b20 c1993c92
# -*- mode: org; -*-
#
#+TITLE: *OpenFOAM README for version 1.5*
#+TITLE: OpenFOAM README for version 1.6
#+AUTHOR: OpenCFD Ltd.
#+DATE: 26 August 2008
#+DATE: July 2009
#+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{}
......@@ -62,7 +62,7 @@
in the OpenFOAM release. e.g. in
+ $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
+ where <VERSION> corresponds to the version 1.4, 1.5, ...
+ where <VERSION> corresponds to the version 1.5, 1.6, ...
1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
etc/bashrc file by adding the following line to the end of your
......@@ -135,7 +135,7 @@
* Getting Started
Create a project directory within the $HOME/OpenFOAM directory named
<USER>-<VERSION> (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5)
<USER>-<VERSION> (e.g. 'chris-1.6' for user chris and OpenFOAM version 1.6)
and create a directory named 'run' within it, e.g. by typing:
+ mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
......@@ -156,12 +156,13 @@
* Compiling Paraview 3.3 and the PV3FoamReader module
A version of Qt 4.3.x must be installed to compile ParaView. The compilation
is a fairly simple process using the supplied buildParaView3.3-cvs script that
has worked is our tests with other packages supplied in the ThirdParty
directory, namely cmake-2.4.6 and gcc-4.3.1. Execute the following:
+ cd $FOAM_INST_DIR/ThirdParty
+ rm -rf ParaView3.3-cvs/platforms
+ buildParaView3.3-cvs
is a fairly simple process using the supplied buildParaView script that
has worked in our tests with other packages supplied in the ThirdParty
directory, namely cmake-2.6.4 and gcc-4.3.3. Execute the following:
+ cd $WM_THIRD_PARTY_DIR
+ rm -rf paraview-3.6/platforms
+ buildParaView
The PV3FoamReader module is an OpenFOAM utility that can be compiled in the
usual manner as follows:
......@@ -184,3 +185,4 @@
is the default mode on a 64-bit machine. To use an installed 32-bit version,
the user must set the environment variable WM_ARCH_OPTION to 32 before
sourcing the etc/bashrc (or etc/cshrc) file.
......@@ -145,6 +145,8 @@
+ The *new* =readList(Istream&)= can read a bracket-delimited list or handle
a single value as a list of size 1. This can be a useful convenience when
processing command-line options.
+ Export *new* environment variable =FOAM_CASENAME= that contains the
name part of the =FOAM_CASE= environment variable
*** Misc. improvements
+ Improved consistency and interoperability between =face= and =triFace= classes.
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso BCs
wclean
# ----------------------------------------------------------------- end-of-file
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso phaseModel
wclean libso interfacialModels
wclean libso kineticTheoryModels
wclean
# ----------------------------------------------------------------- end-of-file
......@@ -29,6 +29,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "IOstreams.H"
#include "IOobject.H"
#include "IFstream.H"
......@@ -41,6 +42,15 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList args(argc, argv);
Info<< nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< endl;
{
dictionary dict1(IFstream("testDict")());
Info<< "dict1: " << dict1 << nl
......
......@@ -14,6 +14,9 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#inputMode merge
#includeIfPresent "someUnknownFile"
#includeIfPresent "$FOAM_CASE/someUnknownFile"
#includeIfPresent "$FOAM_CASE/someUnknownFile-$FOAM_CASENAME"
internalField uniform 1;
......@@ -78,7 +81,6 @@ boundaryField
// NB: the inputMode has a global scope
#inputMode merge
#include "testDict2"
#includeIfPresent "SomeUnknownFile"
foo
{
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso extrudeModel
wclean
# ----------------------------------------------------------------- end-of-file
......@@ -4,3 +4,5 @@ set -x
rm -rf PV3FoamReader/Make
wclean libso vtkPV3Foam
# ----------------------------------------------------------------- end-of-file
......@@ -261,11 +261,15 @@ Foam::vtkPV3Foam::vtkPV3Foam
// Set the case as an environment variable - some BCs might use this
if (fullCasePath.name().find("processor", 0) == 0)
{
setEnv("FOAM_CASE", fullCasePath.path(), true);
const fileName globalCase = fullCasePath.path();
setEnv("FOAM_CASE", globalCase, true);
setEnv("FOAM_CASENAME", globalCase.name(), true);
}
else
{
setEnv("FOAM_CASE", fullCasePath, true);
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
}
// look for 'case{region}.OpenFOAM'
......@@ -299,6 +303,7 @@ Foam::vtkPV3Foam::vtkPV3Foam
{
Info<< "fullCasePath=" << fullCasePath << nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< "region=" << meshRegion_ << endl;
}
......
......@@ -2,10 +2,17 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume
-lincompressibleRASModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume \
-lmeshTools \
-lsampling
......@@ -26,25 +26,156 @@ Application
yPlusRAS
Description
Calculates and reports yPlus for all wall patches, for the specified times.
Calculates and reports yPlus for all wall patches, for the specified times
when using RAS turbulence models.
Default behaviour assumes operating in incompressible mode. To apply to
compressible RAS cases, use the -compressible option.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "RASModel.H"
#include "wallFvPatch.H"
#include "incompressible/RAS/RASModel/RASModel.H"
#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
#include "basicPsiThermo.H"
#include "compressible/RAS/RASModel/RASModel.H"
#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
#include "wallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void calcIncompressibleYPlus
(
const fvMesh& mesh,
const Time& runTime,
const volVectorField& U,
volScalarField& yPlus
)
{
typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
wallFunctionPatchField;
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> RASModel
(
incompressible::RASModel::New(U, phi, laminarTransport)
);
const volScalarField::GeometricBoundaryField nutPatches =
RASModel->nut()().boundaryField();
forAll(nutPatches, patchi)
{
if (isA<wallFunctionPatchField>(nutPatches[patchi]))
{
const wallFunctionPatchField& nutPw =
dynamic_cast<const wallFunctionPatchField&>
(nutPatches[patchi]);
yPlus.boundaryField()[patchi] = nutPw.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << nutPw.patch().name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
}
}
}
void calcCompressibleYPlus
(
const fvMesh& mesh,
const Time& runTime,
const volVectorField& U,
volScalarField& yPlus
)
{
typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
wallFunctionPatchField;
IOobject rhoHeader
(
"rho",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (!rhoHeader.headerOk())
{
Info<< " no rho field" << endl;
return;
}
Info << "Reading field rho\n" << endl;
volScalarField rho(rhoHeader, mesh);
#include "compressibleCreatePhi.H"
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
autoPtr<compressible::RASModel> RASModel
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
const volScalarField::GeometricBoundaryField mutPatches =
RASModel->mut()().boundaryField();
forAll(mutPatches, patchi)
{
if (isA<wallFunctionPatchField>(mutPatches[patchi]))
{
const wallFunctionPatchField& mutPw =
dynamic_cast<const wallFunctionPatchField&>
(mutPatches[patchi]);
yPlus.boundaryField()[patchi] = mutPw.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << mutPw.patch().name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
}
}
}
int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "addRegionOption.H"
argList::validOptions.insert("compressible","");
#include "setRootCase.H"
# include "createTime.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
#include "createNamedMesh.H"
bool compressible = args.optionFound("compressible");
forAll(timeDirs, timeI)
{
......@@ -76,49 +207,35 @@ int main(int argc, char *argv[])
dimensionedScalar("yPlus", dimless, 0.0)
);
Info << "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> RASModel
IOobject UHeader
(
incompressible::RASModel::New(U, phi, laminarTransport)
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
if (UHeader.headerOk())
{
const fvPatch& currPatch = patches[patchi];
Info << "Reading field U\n" << endl;
volVectorField U(UHeader, mesh);
if (typeid(currPatch) == typeid(wallFvPatch))
if (compressible)
{
yPlus.boundaryField()[patchi] = RASModel->yPlus(patchi);
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
<< " named " << currPatch.name()
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(Yp) << nl << endl;
calcCompressibleYPlus(mesh, runTime, U, yPlus);
}
else
{
calcIncompressibleYPlus(mesh, runTime, U, yPlus);
}
}
else
{
Info<< " no U field" << endl;
}
Info<< "Writing yPlus to field "
<< yPlus.name() << nl << endl;
Info<< "Writing yPlus to field " << yPlus.name() << nl << endl;
yPlus.write();
}
......@@ -128,4 +245,5 @@ int main(int argc, char *argv[])
return 0;
}
// ************************************************************************* //
......@@ -33,9 +33,9 @@
#------------------------------------------------------------------------------
# Base settings
FOAM_VERSION=1.5
SUPPLIED_VERSION_GCC=4.3.1
MIN_VERSION_GCC=4.2.0
FOAM_VERSION=1.6
SUPPLIED_VERSION_GCC=4.3.3
MIN_VERSION_GCC=4.3.1
# General
WIDTH=20
......@@ -46,10 +46,8 @@ CRITICALERROR=0
SSHRSHOK=0
# System variables
USER_SHELL=`basename $SHELL`
HOST_NAME=`uname -n`
OS=`uname -s`
OS_VERSION=`uname -r`
USER_NAME=$LOGNAME
if [ ! -n $USER_NAME ]; then
USER_NAME=$USER
......@@ -92,7 +90,7 @@ length () {
stringLength () {
echo $1 | wc -m | tr -d " "
echo $1 | wc -m | tr -d " "
}
......@@ -125,7 +123,7 @@ reportEnv () {
SunOS)
if /usr/bin/test -e $EXP_ENV ; then
EXISTS=" yes "
if [ "$2" != "noPath" ]; then
if [ "$2" != noPath ]; then
ON_PATH=" no "
OLD_IFS=$IFS
IFS=':'
......@@ -152,7 +150,7 @@ reportEnv () {
*)
if [ -e "$EXP_ENV" ] ; then
EXISTS=" yes "
if [ "$2" != "noPath" ]; then
if [ "$2" != noPath ]; then
ON_PATH=" no "
OLD_IFS=$IFS
IFS=':'
......@@ -182,10 +180,10 @@ 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
if [ "$3" = yes ] && [ "$ERROR" = true ]; then
CRITICALERROR=`expr $CRITICALERROR + 1`
echo "WARNING: CRITICAL ERROR"
echo
......@@ -312,9 +310,9 @@ pingTest () {
case $OS in
SunOS)
PINGTEST=`/usr/sbin/ping $1 2>&1`
if [ "`echo $PINGTEST | grep "alive"`" != "" ] ; then
if [ "`echo $PINGTEST | grep alive`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep "unknown host"`" != "" ] ; then
elif [ "`echo $PINGTEST | grep 'unknown host'`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
......@@ -322,9 +320,9 @@ pingTest () {
;;
*)
PINGTEST=`/bin/ping -w 3 -c 1 $1 2>&1`
if [ "`echo $PINGTEST | grep "1 received"`" != "" ] ; then
if [ "`echo $PINGTEST | grep '1 received'`" != "" ] ; then
RESULT="Successful"
elif [ "`echo $PINGTEST | grep "unknown host"`" != "" ] ; then
elif [ "`echo $PINGTEST | grep 'unknown host'`" != "" ] ; then
RESULT="No_entry_for_\"$1\"_in_/etc/hosts"
else
RESULT="Networking_cannot_reach_$1"
......@@ -334,7 +332,7 @@ pingTest () {
echo "`fixlen "Pinging_$1" 25` `fixlen "$RESULT" 45` `fixlen "$2" 5`"
if [ "$2" = "yes" ] && [ "$RESULT" != "Successful" ]; then
if [ "$2" = yes ] && [ "$RESULT" != Successful ]; then
CRITICALERROR=`expr $CRITICALERROR + 1`
echo "WARNING: CRITICAL ERROR"
echo
......@@ -351,7 +349,7 @@ EOF
checkTelnetPort () {
if [ -x "/usr/bin/telnet" ] || [ -x "/bin/telnet" ] ; then
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'
......@@ -361,7 +359,7 @@ checkTelnetPort () {
RESULT="Not_active*"
fi
else
RESULT='No_telnet_running:_cannot_check*'
RESULT='No_telnet_installed:_cannot_check*'
fi
}
......@@ -369,7 +367,7 @@ checkTelnetPort () {
checkRsh () {
checkTelnetPort $HOST_NAME 222
echo "`fixlen "Test_rsh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != 'Successful' ]; then
if [ "$RESULT" != Successful ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
}
......@@ -378,14 +376,14 @@ checkRsh () {
checkSsh () {
checkTelnetPort $HOST_NAME 22
echo "`fixlen "Test_ssh:" 25` `fixlen "$RESULT" 45` "yes""
if [ "$RESULT" != 'Successful' ]; then
if [ "$RESULT" != Successful ]; then
SSHRSHOK=`expr $SSHRSHOK + 1`
fi
}
checkOpenFOAMEnvironment() {
if [ ! -d "$WM_PROJECT_INST_DIR" -o ! -d "$WM_THIRD_PARTY_DIR" ]; then
[ -d "$WM_PROJECT_INST_DIR" ] && [ -d "$WM_THIRD_PARTY_DIR" ] || {
echo ""
echo "FATAL ERROR: OpenFOAM environment not configured."
echo ""
......@@ -394,22 +392,23 @@ checkOpenFOAMEnvironment() {
echo " to source the OpenFOAM environment."
echo ""
exit 1
fi
}
}
checkUserShell() {
case $USER_SHELL in
csh | tcsh)
USER_CONFIG_TYPE="cshrc"
echo "`fixlen "Shell:" $WIDTH` ${USER_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` ${USER_SHELL}"
*/bash | */ksh)
# USER_CONFIG_TYPE="bashrc"
echo "`fixlen "Shell:" $WIDTH` ${SHELL##*/}"
;;
*) USER_CONFIG_TYPE=""
echo "`fixlen "Shell:" $WIDTH` ${USER_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."
......@@ -435,15 +434,18 @@ checkHostName() {
checkOS () {
if [ "$OS" = "Linux" ] || [ "$OS" = "LinuxAMD64" ] || [ "$OS" = "SunOS" ]; then
echo "`fixlen "OS:" $WIDTH` ${OS} version ${OS_VERSION}"
else
case "$OS" in
Linux | LinuxAMD64 | SunOS )
echo "`fixlen "OS:" $WIDTH` ${OS} version $(uname -r)"
;;
*)
echo "FATAL ERROR: Incompatible operating system \"$OS\"."
echo " OpenFOAM ${FOAM_VERSION} is currently "
echo " available for Linux and SunOS only."
echo
FATALERROR=`expr $FATALERROR + 1`
fi
;;