Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
sergio
2016-10-31 08:43:38 -07:00
11 changed files with 111 additions and 25125 deletions

View File

@ -97,29 +97,24 @@ cleanCase()
rm -rf surfaceSampling > /dev/null 2>&1
rm -rf cuttingPlane > /dev/null 2>&1
rm -rf system/machines > /dev/null 2>&1
rm -rf Ensight EnSight ensightWrite VTK > /dev/null 2>&1
# From mpirunDebug
rm -f gdbCommands mpirun.schema
cleanSnappyFiles
if [ -d constant/polyMesh ]
then
rm -rf constant/polyMesh > /dev/null 2>&1
fi
rm -f 0/cellDist > /dev/null 2>&1
if [ -d constant ]
then
(cd constant && \
rm -rf \
cellToRegion cellLevel* pointLevel* \
cellDecomposition cellToRegion cellLevel* pointLevel* \
polyMesh tetDualMesh \
> /dev/null 2>&1 \
)
fi
rm -rf constant/tetDualMesh > /dev/null 2>&1
rm -rf VTK > /dev/null 2>&1
rm -f 0/cellLevel 0/pointLevel 0/cellDist constant/cellDecomposition
if [ -e system/blockMeshDict.m4 ]
then
rm -f system/blockMeshDict > /dev/null 2>&1
@ -130,7 +125,7 @@ cleanCase()
removeCase()
{
echo "Removing ${1:-unknown} case"
rm -rf $1
[ "$#" -ge 1 ] && rm -rf "$1"
}

View File

@ -42,23 +42,54 @@ isParallel()
#
isTest()
{
for i in "$@"; do
if [ "$i" = "-test" ]
then
return 0
fi
done
for i; do [ "$i" = "-test" ] && return 0; done
return 1
}
#
# Extract 'numberOfSubdomains' from system/decomposeParDict
# (or alternative location).
#
# On failure:
# return '1'
# exit status 1
#
getNumberOfProcessors()
{
foamDictionary -entry numberOfSubdomains -value system/decomposeParDict
# Re-use positional parameters for automatic whitespace elimination
set -- $(foamDictionary -entry numberOfSubdomains -value "${1:-system/decomposeParDict}")
if [ "$#" -eq 1 ]
then
echo "$1"
else
echo "Error retrieving 'numberOfSubdomains' from decomposeParDict" 1>&2
echo 1
return 1
fi
}
#
# Extract 'application' from system/controlDict
#
# On failure:
# return 'false' which is also a command (ie, shell builtin or /bin/false)
# exit status 1
#
getApplication()
{
sed -ne 's/^ *application\s*\([a-zA-Z]*\)\s*;.*$/\1/p' system/controlDict
# Re-use positional parameters for automatic whitespace elimination
set -- $(foamDictionary -entry application -value system/controlDict)
if [ "$#" -eq 1 ]
then
echo "$1"
else
echo "Error retrieving 'application' from controlDict" 1>&2
echo false
return 1
fi
}
runApplication()

View File

@ -32,7 +32,7 @@
#------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=plus.master.develop
export WM_PROJECT_VERSION=plus
################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
@ -42,15 +42,15 @@ export WM_PROJECT_VERSION=plus.master.develop
#
# Please set to the appropriate path if the default is not correct.
#
[ $BASH_SOURCE ] && \
export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \
export FOAM_INST_DIR=$HOME/$WM_PROJECT
# export FOAM_INST_DIR=~$WM_PROJECT
# export FOAM_INST_DIR=/opt/$WM_PROJECT
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT
[ $BASH_SOURCE ] && FOAM_INST_DIR=$(\cd ${BASH_SOURCE%/*/*/*} && \pwd -P) || \
FOAM_INST_DIR=$HOME/$WM_PROJECT
# FOAM_INST_DIR=~$WM_PROJECT
# FOAM_INST_DIR=/opt/$WM_PROJECT
# FOAM_INST_DIR=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################
export FOAM_INST_DIR
# The default environment variables below can be overridden in a prefs.sh file
# located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM,

View File

@ -59,6 +59,7 @@ set cmake_version=cmake-system
#------------------------------------------------------------------------------
# Clean the PATH
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) setenv PATH $cleaned

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -83,7 +83,7 @@ readField
// 2. Patch-groups. (using non-wild card entries of dictionaries)
// (patchnames already matched above)
// Note: in reverse order of entries in the dictionary (last
// patchGroups wins). This is so is consistent with dictionary wildcard
// patchGroups wins). This is so it is consistent with dictionary wildcard
// behaviour
if (dict.size())
{
@ -570,14 +570,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::
writeEntry(const word& keyword, Ostream& os) const
{
os.beginBlock(keyword);
forAll(*this, patchi)
{
os.beginBlock(this->operator[](patchi).patch().name());
os << this->operator[](patchi);
os.endBlock();
}
this->writeEntries(os);
os.endBlock() << flush;
// Check state of IOstream
@ -589,6 +582,19 @@ writeEntry(const word& keyword, Ostream& os) const
}
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::
writeEntries(Ostream& os) const
{
forAll(*this, patchi)
{
os.beginBlock(this->operator[](patchi).patch().name());
os << this->operator[](patchi);
os.endBlock();
}
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -218,6 +218,9 @@ public:
//- Write boundary field as dictionary entry
void writeEntry(const word& keyword, Ostream& os) const;
//- Write dictionary entries of the individual boundary fields.
void writeEntries(Ostream& os) const;
// Member operators

View File

@ -141,12 +141,24 @@ void Foam::functionObjects::fieldAverage::calcAverages()
prevTimeIndex_ = currentTimeIndex;
}
bool doRestart = false;
if (periodicRestart_ && currentTime > restartPeriod_*periodIndex_)
{
restart();
doRestart = true;
periodIndex_++;
}
if (currentTime >= restartTime_)
{
doRestart = true; // Restart is overdue.
restartTime_ = GREAT; // Avoid triggering again
}
if (doRestart)
{
restart();
}
Log
<< type() << " " << name() << " write:" << nl
<< " Calculating averages" << nl;
@ -262,6 +274,7 @@ Foam::functionObjects::fieldAverage::fieldAverage
restartOnOutput_(false),
periodicRestart_(false),
restartPeriod_(GREAT),
restartTime_(GREAT),
initialised_(false),
faItems_(),
totalIter_(),
@ -296,6 +309,25 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
if (periodicRestart_)
{
dict.lookup("restartPeriod") >> restartPeriod_;
Log
<< " Restart period " << restartPeriod_
<< nl << endl;
}
restartTime_ = GREAT;
if (dict.readIfPresent("restartTime", restartTime_))
{
if (restartTime_ < obr_.time().value())
{
// The restart time is already in the past - ignore
restartTime_ = GREAT;
}
else
{
Log
<< " Restart scheduled at time " << restartTime_
<< nl << endl;
}
}
readAveragingProperties();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -106,6 +106,7 @@ Usage
restartOnOutput | Restart the averaging on output | no | no
periodicRestart | Periodically restart the averaging | no | no
restartPeriod | Periodic restart period | conditional |
restartTime | One-shot reset of the averaging | no | great
fields | list of fields and averaging options | yes |
\endtable
@ -166,6 +167,9 @@ protected:
//- Restart period
scalar restartPeriod_;
//- Specific restart time
scalar restartTime_;
//- Initialised flag
bool initialised_;

View File

@ -1,62 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/bottomWater";
object cellToRegion;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
minX
{
type zeroGradient;
}
maxX
{
type zeroGradient;
}
minY
{
type zeroGradient;
}
minZ
{
type zeroGradient;
}
maxZ
{
type zeroGradient;
}
bottomWater_to_rightSolid
{
type calculated;
value uniform 0;
}
bottomWater_to_leftSolid
{
type calculated;
value uniform 0;
}
bottomWater_to_heater
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //