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

This commit is contained in:
mattijs
2017-06-26 16:25:23 +01:00
84 changed files with 710 additions and 292 deletions

View File

@ -1,4 +1,4 @@
OpenFOAM-v1612+
OpenFOAM-1706
==================
Known Build Issues
==================
@ -22,16 +22,15 @@ VTK
---
If using the runTimePostProcessing to create on-the-fly images, you
can simply just compile ParaView-5.0.1 and these libraries will
be used.
can simply just compile ParaView and these libraries will be used.
If you elect to use a separate VTK compilation (for example for
off-screen rendering), it is advisable to reuse the VTK libraries that
are provided with ParaView-5.0.1, by making an appropriate symlink
are provided with ParaView by making an appropriate symlink
prior to using makeVTK. This doesn't just reduce disk-space, but works
much better than using the VTK-7.1.0.tar file.
much better than using the VTK tar file.
Using runTimePostProcessing with the 'plain' VTK-7.1.0 libraries does
Using runTimePostProcessing with the 'plain' VTK libraries does
generally work, but does not exit cleanly:
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
@ -60,4 +59,21 @@ there are also minimum gcc/g++ requirements there:
If your system compiler is too old to build the minimum required gcc or
clang/llvm, it is just simply too old.
-------------------------
Building with spack
-------------------------
If you are building with spack, note that the depends_on for paraview
resolves poorly. The +qt dependency (for building the reader module)
may need to be specified as a preference by including the following in
your `~/.spack/packages.yaml` file:
packages:
paraview:
variants: +qt
It appears that spack will otherwise ignore any paraview+qt version
and attempt to install a paraview~qt version instead.
--

View File

@ -110,6 +110,11 @@ int main(int argc, char *argv[])
mixture.correct();
if (pimple.frozenFlow())
{
continue;
}
#include "UEqn.H"
// --- Pressure corrector loop

View File

@ -1,10 +1,2 @@
// Defining isoAdvection
isoAdvection advector(alpha1, phi, U);
bool frozenFlow = pimple.dict().lookupOrDefault<bool>("frozenFlow", false);
if (frozenFlow)
{
Info<< "Employing frozen-flow assumption: "
<< "pressure-velocity system will not be updated"
<< endl;
}

View File

@ -108,7 +108,7 @@ int main(int argc, char *argv[])
mixture.correct();
if (frozenFlow)
if (pimple.frozenFlow())
{
continue;
}

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev-OpenCFD.overlap |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: http://www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile

View File

@ -651,7 +651,7 @@ int main(int argc, char *argv[])
);
// corrector for mesh motion
twoDPointCorrector* correct2DPtr = NULL;
twoDPointCorrector* correct2DPtr = nullptr;
if (motionObj.typeHeaderOk<IOdictionary>(true))
{

View File

@ -28,7 +28,7 @@ int USERD_set_filenames
// remove the last '/' from rootDir
if (the_path[lRoot-1] == '/')
{
the_path[lRoot-1] = char(NULL);
the_path[lRoot-1] = '\0';
}
else
{

View File

@ -97,6 +97,7 @@ done
cat << HEADER > $outFile
#----------------------------------*-sh-*--------------------------------------
# Bash completions for OpenFOAM applications
# Formatted as "complete ... -F _of_APPNAME APPNAME
unset -f _of_filter_opts 2>/dev/null
_of_filter_opts()

View File

@ -62,6 +62,14 @@ die()
exit 1
}
# Automatically upgrade copyrights in files.
# Disabled by default since some changes (eg, spelling) do not automatically
# imply an update copyright.
optCopyright=false
# Run all tests (do not exit on first failure)
optAll=false
#-----------------------------------------------------------------------------
# Check content that will be added by this commit.
@ -76,11 +84,27 @@ fi
# called manually with arguments for the files/directories to be tested?
if [ "$#" -gt 0 ]
then
case "$1" in
-h | -help)
die "interactive usage: supply list of files/directories to check"
;;
esac
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
die "interactive usage: supply list of files/directories to check"
;;
-copy)
echo "$hookName: adjust copyright enabled" 1>&2
optCopyright=true
shift
;;
-all)
echo "$hookName: do all tests (no premature exit)" 1>&2
optAll=true
shift
;;
*)
break
;;
esac
done
# obtain list of all specified files/directories
fileList=$(git ls-files -- $@ 2>/dev/null)
@ -100,6 +124,8 @@ unset badFiles
# join list of files with this amount of space
Indent=" "
exitCode=0
#
# report bad files and die if there are any
#
@ -114,7 +140,14 @@ dieOnBadFiles()
echo "File(s):" 1>&2
echo "$badFiles" 1>&2
echo '' 1>&2
exit 1
exitCode=1
if [ "$optAll" = true ]
then
return 0 # Continue to the next test
else
exit $exitCode
fi
fi
}
@ -314,7 +347,7 @@ MESSAGE
#
# check that OpenFOAM Foundation copyright is current
# check that copyright date is current
#
checkCopyright()
{
@ -327,9 +360,9 @@ checkCopyright()
startYear=`grep "Copyright.*OpenCFD" $f | sed 's/[^0-9]*\([0-9]*\).*/\1/g'`
endYear=`grep "Copyright.*-.*OpenCFD" $f | sed 's/[^-]*-\([0-9]*\).*/\1/g'`
#echo "startYear=$startYear endYear=$endYear"
if [ "$startYear" != "" ]
if [ -n "$startYear" ]
then
if [ "$endYear" != "" ]
if [ -n "$endYear" ]
then
# Date is of type 2011-2012 OpenCFD Ltd.
if [ "$year" != "$endYear" ]
@ -371,7 +404,11 @@ checkLineLengthNonDirective
# check for non-standard code patterns
checkNonStandardCodePatterns
checkCopyright
# Stop now if there were any errors
[ "$exitCode" = 0 ] || exit $exitCode
# check copyright date (normally disabled)
[ "$optCopyright" = true ] && checkCopyright
exit 0
#------------------------------------------------------------------------------

View File

@ -65,4 +65,24 @@
-ms-transform: translateY(-50%);
content: "C++ Source Code Guide";
font-size: 180%;
}
}
.OFTable {
width: 100%;
border: 0px;
margin-top: 10px;
margin-bottom: 10px;
background-color: rgb(245,245,245);
padding: 5px;
}
.OFTable th {
text-align: left;
padding: 5px;
border-bottom: 2px solid rgb(175,175,175);
}
.OFTable td {
padding-left: 5px;
}

View File

@ -1,5 +1,6 @@
#----------------------------------*-sh-*--------------------------------------
# Bash completions for OpenFOAM applications
# Formatted as "complete ... -F _of_APPNAME APPNAME
unset -f _of_filter_opts 2>/dev/null
_of_filter_opts()

View File

@ -181,6 +181,17 @@ unset -f wmRefresh 2>/dev/null
unset -f foamVersion 2>/dev/null
unset -f foamPV 2>/dev/null
# Cleanup bash completions, which look like this:
# "complete ... -F _of_APPNAME APPNAME
# For economy, obtain list first but also add in 'filter_opts' helper
foamClean="$(complete 2>/dev/null | sed -n -e 's/complete.*-F _of_.* \(..*\)$/\1/p')"
for cleaned in $foamClean filter_opts
do
unset -f _of_$cleaned 2>/dev/null
complete -r $cleaned 2>/dev/null
done
#------------------------------------------------------------------------------
# Intermediate variables (do as last for a clean exit code)

View File

@ -1284,7 +1284,7 @@ int Foam::system(const Foam::UList<Foam::string>& command)
{
// in child:
// Need command and arguments separately.
// args is a NULL-terminated list of c-strings
// args is a nullptr-terminated list of c-strings
CStringList args(SubList<string>(command, 0));
if (argc > 1)

View File

@ -97,10 +97,11 @@ inline uint64_t Foam::endian::swap64(uint64_t u)
);
// alternative formulation
//
// u = ((u<< 8) & 0xFF00FF00FF00FF00ull) | ((u>> 8) & 0x00FF00FF00FF00FFull);
// u = ((u<<16) & 0xFFFF0000FFFF0000ull) | ((u>>16) & 0x0000FFFF0000FFFFull);
// return (u >> 32) | (u << 32);
/*
u = ((u<< 8) & 0xFF00FF00FF00FF00ull) | ((u>> 8) & 0x00FF00FF00FF00FFull);
u = ((u<<16) & 0xFFFF0000FFFF0000ull) | ((u>>16) & 0x0000FFFF0000FFFFull);
return (u >> 32) | (u << 32);
*/
#endif
}

View File

@ -39,6 +39,14 @@ namespace Foam
bool Foam::functionObject::postProcess(false);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
Foam::word Foam::functionObject::scopedName(const word& name) const
{
return name_ + ":" + name;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObject::functionObject(const word& name)

View File

@ -154,6 +154,14 @@ class functionObject
void operator=(const functionObject&) = delete;
protected:
// Protected Member Functions
//- Return a scoped name, e.g. used to construct local field names
word scopedName(const word& name) const;
public:
//- Runtime type information

View File

@ -158,7 +158,7 @@ Foam::functionObjects::regionFunctionObject::~regionFunctionObject()
bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict)
{
return functionObject::read(dict);
return stateFunctionObject::read(dict);
}

View File

@ -248,7 +248,7 @@ bool Foam::timeControl::execute()
default:
{
FatalErrorInFunction
<< "Undefined output control: "
<< "Undefined time control: "
<< timeControlNames_[timeControl_] << nl
<< abort(FatalError);
break;

View File

@ -73,7 +73,7 @@ class CStringList
// Does not include the final nul-character
size_t len_;
//- List of strings, including trailing NULL pointer
//- List of strings, including trailing nullptr
char** argv_;
//- Flattened content with interspersed nul-characters
@ -109,8 +109,8 @@ public:
// Public Members
//- Count the number of parameters until the first NULL pointer.
// Return 0 if argv is NULL.
//- Count the number of parameters until the first nullptr
// Return 0 if argv is nullptr.
static inline int count(const char * const argv[]);
@ -120,7 +120,7 @@ public:
inline int size() const;
//- Return the list of C-strings (ie, argv)
// The position at argc is a NULL pointer
// The position at argc is a nullptr
inline char** strings() const;
@ -148,8 +148,8 @@ public:
template<class StringType>
static List<StringType> asList(int argc, const char * const argv[]);
//- Create a list from a NULL-terminated list of argv parameters.
// A null pointer for argv is permissible.
//- Create a list from a nullptr-terminated list of argv parameters.
// Using a nullptr for argv is permissible.
template<class StringType>
static inline List<StringType> asList(const char * const argv[]);

View File

@ -85,10 +85,10 @@ bool Foam::ccm::base::close()
{
if (CCMIOIsValidEntity(globalState_->root))
{
CCMIOCloseFile(NULL, globalState_->root);
CCMIOCloseFile(nullptr, globalState_->root);
}
delete globalState_;
globalState_ = 0;
globalState_ = nullptr;
return true;
}

View File

@ -52,7 +52,7 @@ void Foam::ccm::reader::determineFieldInfo
(
CCMIONextEntity
(
NULL,
nullptr,
fieldSetNode,
kCCMIOFieldPhase,
&phaseI,
@ -74,7 +74,7 @@ void Foam::ccm::reader::determineFieldInfo
(
CCMIONextEntity
(
NULL,
nullptr,
phaseNode,
kCCMIOField,
&fieldI,
@ -84,12 +84,12 @@ void Foam::ccm::reader::determineFieldInfo
&& CCMIOReadField
(
NULL,
nullptr,
fieldNode,
fullName,
shortName,
&dims,
NULL
nullptr
)
== kCCMIONoErr
)
@ -139,7 +139,7 @@ void Foam::ccm::reader::determineFieldInfo
(
CCMIONextEntity
(
NULL,
nullptr,
fieldNode,
kCCMIOFieldData,
&dataI,
@ -149,20 +149,20 @@ void Foam::ccm::reader::determineFieldInfo
&& CCMIOEntitySize
(
NULL,
nullptr,
dataNode,
NULL,
nullptr,
&maxId
)
== kCCMIONoErr
&& CCMIOReadFieldDatad
(
NULL,
nullptr,
dataNode,
NULL,
nullptr,
&dataLocation,
NULL,
nullptr,
kCCMIOStart,
kCCMIOEnd
)
@ -212,7 +212,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
(globalState_->root),
kCCMIOState,
&stateI,
@ -230,7 +230,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
stateNode,
kCCMIOProcessor,
&procI,
@ -240,11 +240,11 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOReadProcessor
(
NULL,
nullptr,
processorNode,
NULL, // Ignore verticesNode
NULL, // Ignore topologyNode
NULL, // Ignore initialField
nullptr, // Ignore verticesNode
nullptr, // Ignore topologyNode
nullptr, // Ignore initialField
&solutionNode
)
== kCCMIONoErr
@ -263,7 +263,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
solutionNode,
kCCMIORestart,
&restartI,
@ -273,7 +273,7 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOEntityName
(
NULL,
nullptr,
stateNode,
solutionName
)
@ -281,13 +281,13 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOReadRestartInfo
(
NULL,
nullptr,
restartNode,
NULL, // Ignore solverName
nullptr, // Ignore solverName
&iteration,
&timeValue,
NULL, // Ignore timeUnits
NULL // Ignore startAngle
nullptr, // Ignore timeUnits
nullptr // Ignore startAngle
)
== kCCMIONoErr
)
@ -310,7 +310,7 @@ bool Foam::ccm::reader::detectSolution()
(
CCMIONextEntity
(
NULL,
nullptr,
processorNode,
kCCMIOLagrangianData,
&lagrangianI,
@ -320,9 +320,9 @@ bool Foam::ccm::reader::detectSolution()
&& CCMIOReadLagrangianData
(
NULL,
nullptr,
lagrangianNode,
NULL,
nullptr,
&lagrangianSolutions
)
== kCCMIONoErr
@ -366,10 +366,10 @@ Foam::ccm::reader::readField
(
CCMIOGetState
(
NULL,
nullptr,
(globalState_->root),
solutionName.c_str(),
NULL,
nullptr,
&stateNode
)
!= kCCMIONoErr
@ -420,7 +420,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
stateNode,
kCCMIOProcessor,
&procI,
@ -430,11 +430,11 @@ Foam::ccm::reader::readField
&& CCMIOReadProcessor
(
NULL,
nullptr,
processorNode,
NULL, // Ignore verticesNode
NULL, // Ignore topologyNode
NULL, // Ignore initialField
nullptr, // Ignore verticesNode
nullptr, // Ignore topologyNode
nullptr, // Ignore initialField
&solutionNode
)
== kCCMIONoErr
@ -448,7 +448,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
solutionNode,
kCCMIOFieldPhase,
&phaseI,
@ -465,7 +465,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
phaseNode,
kCCMIOField,
&fieldI,
@ -480,10 +480,10 @@ Foam::ccm::reader::readField
(
&(globalState_->error),
fieldNode,
NULL,
nullptr,
shortName,
&dims,
NULL
nullptr
);
assertNoError
(
@ -501,7 +501,7 @@ Foam::ccm::reader::readField
(
CCMIONextEntity
(
NULL,
nullptr,
fieldNode,
kCCMIOFieldData,
&dataI,
@ -518,20 +518,20 @@ Foam::ccm::reader::readField
(
CCMIOEntitySize
(
NULL,
nullptr,
dataNode,
&n,
NULL
nullptr
)
== kCCMIONoErr
&& CCMIOReadFieldDatad
(
NULL,
nullptr,
dataNode,
&mapId,
&dataLocation,
NULL,
nullptr,
kCCMIOStart,
kCCMIOEnd
)
@ -549,10 +549,10 @@ Foam::ccm::reader::readField
(
CCMIOEntityDescription
(
NULL,
nullptr,
dataNode,
&len,
NULL
nullptr
)
== kCCMIONoErr
)
@ -563,7 +563,7 @@ Foam::ccm::reader::readField
(
CCMIOEntityDescription
(
NULL,
nullptr,
dataNode,
&len,
dataLabel
@ -577,7 +577,7 @@ Foam::ccm::reader::readField
strstr(fieldName.c_str(), "SIG")
|| strstr(fieldName.c_str(), "EPS")
)
&& strstr(dataLabel, "So") == NULL
&& strstr(dataLabel, "So") == nullptr
)
{
okayCombination = false;
@ -607,8 +607,8 @@ Foam::ccm::reader::readField
(
&(globalState_->error),
dataNode,
NULL,
NULL,
nullptr,
nullptr,
rawData.begin(),
kCCMIOStart,
kCCMIOEnd

View File

@ -46,6 +46,7 @@ void Foam::solutionControl::read(const bool absTolOnly)
solutionDict.lookupOrDefault("momentumPredictor", true);
transonic_ = solutionDict.lookupOrDefault("transonic", false);
consistent_ = solutionDict.lookupOrDefault("consistent", false);
frozenFlow_ = solutionDict.lookupOrDefault("frozenFlow", false);
// Read residual information
const dictionary residualDict
@ -228,6 +229,7 @@ Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName)
momentumPredictor_(true),
transonic_(false),
consistent_(false),
frozenFlow_(false),
corr_(0),
corrNonOrtho_(0)
{}

View File

@ -87,6 +87,10 @@ protected:
// "consistent" approach of SIMPLEC
bool consistent_;
//- Flag to indicate that the flow system of equations should not
// be evolved
bool frozenFlow_;
// Evolution
@ -199,6 +203,10 @@ public:
// "consistent" approach of SIMPLEC
inline bool consistent() const;
//- Flag to indicate that the flow system of equations should not
// be evolved
inline bool frozenFlow() const;
// Evolution

View File

@ -73,6 +73,12 @@ inline bool Foam::solutionControl::consistent() const
}
inline bool Foam::solutionControl::frozenFlow() const
{
return frozenFlow_;
}
inline bool Foam::solutionControl::correctNonOrthogonal()
{
corrNonOrtho_++;

View File

@ -592,7 +592,7 @@ Foam::vector Foam::turbulentDFSEMInletFvPatchVectorField::uDashEddy
void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
(
List<List<eddy> >& overlappingEddies
List<List<eddy>>& overlappingEddies
) const
{
int oldTag = UPstream::msgType();
@ -604,7 +604,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
Pstream::scatterList(patchBBs);
// Per processor indices into all segments to send
List<DynamicList<label> > dynSendMap(Pstream::nProcs());
List<DynamicList<label>> dynSendMap(Pstream::nProcs());
forAll(eddies_, i)
{
@ -1050,7 +1050,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::updateCoeffs()
}
// Add contributions from overlapping eddies
List<List<eddy> > overlappingEddies(Pstream::nProcs());
List<List<eddy>> overlappingEddies(Pstream::nProcs());
calcOverlappingProcEddies(overlappingEddies);
forAll(overlappingEddies, procI)

View File

@ -231,7 +231,7 @@ class turbulentDFSEMInletFvPatchVectorField
//- Helper function to interpolate values from the boundary data or
// read from dictionary
template<class Type>
tmp<Field<Type> > interpolateOrRead
tmp<Field<Type>> interpolateOrRead
(
const word& fieldName,
const dictionary& dict,
@ -240,7 +240,7 @@ class turbulentDFSEMInletFvPatchVectorField
//- Helper function to interpolate values from the boundary data
template<class Type>
tmp<Field<Type> > interpolateBoundaryData
tmp<Field<Type>> interpolateBoundaryData
(
const word& fieldName
) const;
@ -258,7 +258,7 @@ class turbulentDFSEMInletFvPatchVectorField
// processor
void calcOverlappingProcEddies
(
List<List<eddy> >& overlappingEddies
List<List<eddy>>& overlappingEddies
) const;

View File

@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::tmp<Foam::Field<Type>>
Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
(
const word& fieldName,
@ -40,7 +40,7 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
{
if (dict.found(fieldName))
{
tmp<Field<Type> > tFld
tmp<Field<Type>> tFld
(
new Field<Type>
(
@ -62,7 +62,7 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::tmp<Foam::Field<Type>>
Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData
(
const word& fieldName

View File

@ -0,0 +1,186 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Curle.H"
#include "fvcDdt.H"
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
using namespace Foam::constant;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(Curle, 0);
addToRunTimeSelectionTable
(
functionObject,
Curle,
dictionary
);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::functionObjects::Curle::calc()
{
if (foundObject<volScalarField>(fieldName_))
{
// Evaluate pressure force time derivative
const volScalarField& p = lookupObject<volScalarField>(fieldName_);
const volScalarField dpdt(scopedName("dpdt"), fvc::ddt(p));
const volScalarField::Boundary& dpdtBf = dpdt.boundaryField();
const surfaceVectorField::Boundary& SfBf = mesh_.Sf().boundaryField();
dimensionedVector dfdt
(
"0",
p.dimensions()*dimArea/dimTime,
vector::zero
);
for (auto patchi : patchSet_)
{
dfdt.value() += sum(dpdtBf[patchi]*SfBf[patchi]);
}
reduce(dfdt.value(), sumOp<vector>());
// Construct and store Curle acoustic pressure
const volVectorField& C = mesh_.C();
tmp<volScalarField> tpDash
(
new volScalarField
(
IOobject
(
resultName_,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("0", p.dimensions(), 0)
)
);
volScalarField& pDash = tpDash.ref();
const volVectorField d(scopedName("d"), C - x0_);
pDash = 4*mathematical::pi/c0_*(d/magSqr(d) & dfdt);
return store(resultName_, tpDash);
}
else
{
return false;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::Curle::Curle
(
const word& name,
const Time& runTime,
const dictionary& dict
)
:
fieldExpression(name, runTime, dict, "p"),
patchSet_(),
x0_("x0", dimLength, vector::zero),
c0_("c0", dimVelocity, 0)
{
read(dict);
setResultName(typeName, fieldName_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::Curle::~Curle()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::Curle::read(const dictionary& dict)
{
if (fieldExpression::read(dict))
{
patchSet_ =
mesh_.boundaryMesh().patchSet(wordReList(dict.lookup("patches")));
if (patchSet_.empty())
{
WarningInFunction
<< "No patches defined"
<< endl;
return false;
}
// Read the reference speed of sound
dict.lookup("c0") >> c0_;
// Set the location of the effective point source to the area-average
// of the patch face centres
const volVectorField::Boundary& Cbf = mesh_.C().boundaryField();
const surfaceScalarField::Boundary& magSfBf =
mesh_.magSf().boundaryField();
x0_.value() = vector::zero;
scalar sumMagSf = 0;
for (auto patchi : patchSet_)
{
x0_.value() += sum(Cbf[patchi]*magSfBf[patchi]);
sumMagSf += sum(magSfBf[patchi]);
}
reduce(x0_.value(), sumOp<vector>());
reduce(sumMagSf, sumOp<scalar>());
x0_.value() /= sumMagSf + ROOTVSMALL;
return true;
}
return false;
}
// ************************************************************************* //

View File

@ -0,0 +1,173 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::Curle
Group
grpFieldFunctionObjects
Description
Calculates the acoustic pressure based on Curle's analogy.
Curle's analogy is implemented as:
\f[
p' = 4 \frac{\pi}{c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
\f]
where
\vartable
p' | Curle's acoustic pressure [Pa] or [Pa (m3/rho)]
c_0 | Reference speed of sound [m/s]
\vec d | Distance vector to observer locations [m]
F | Force [N] or [N (m3/rho)]
\endvartable
Note
Only the normal-pressure force is included in the force calculation
Usage
Example of function object specification:
\verbatim
Curle1
{
type Curle;
libs ("libfieldFunctionObjects.so");
...
patches (surface1 surface2);
c0 330;
}
\endverbatim
Where the entries comprise:
\table
Property | Description | Required | Default value
type | Type name: Curle | yes |
field | Pressure field name | no | p
result | Acoustic pressure field name | no | Curle
patches | Sound generation patch names | yes |
c0 | Reference speed of sound | yes |
\endtable
See also
- Foam::functionObjects::fieldExpression
- Foam::functionObjects::fvMeshFunctionObject
SourceFiles
Curle.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_Curle_H
#define functionObjects_Curle_H
#include "fieldExpression.H"
#include "dimensionedScalar.H"
#include "dimensionedVector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class Curle Declaration
\*---------------------------------------------------------------------------*/
class Curle
:
public fieldExpression
{
// Private data
// Read from dictionary
//- Patches to integrate forces over
labelHashSet patchSet_;
//- Area-averaged centre of patch faces
dimensionedVector x0_;
//- Reference speed of souund
dimensionedScalar c0_;
// Private Member Functions
//- Disallow default bitwise copy construct
Curle(const Curle&) = delete;
//- Disallow default bitwise assignment
void operator=(const Curle&) = delete;
protected:
//- Calculate the acoustic pressure field and return true if successful
virtual bool calc();
public:
//- Runtime type information
TypeName("Curle");
// Constructors
//- Construct from Time and dictionary
Curle
(
const word& name,
const Time& runTime,
const dictionary& dict
);
//- Destructor
virtual ~Curle();
// Member Functions
//- Read the Curle data
virtual bool read(const dictionary&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -52,6 +52,7 @@ PecletNo/PecletNo.C
blendingFactor/blendingFactor.C
pressure/pressure.C
MachNo/MachNo.C
Curle/Curle.C
fieldsExpression/fieldsExpression.C
add/add.C

View File

@ -92,14 +92,14 @@ Usage
Where the entries comprise:
\table
Property | Description | Required | Default value
type | type name: pressure | yes |
type | type name: pressure | yes |
field | Name of the pressure field | no | p
U | Name of the velocity field | no | U
rho | Name of the density field | no | rho
result | Name of the resulting field | no | derived from p
calcTotal | Calculate total coefficient | yes |
pRef | Reference pressure for total pressure | no | 0
calcCoeff | Calculate pressure coefficient | yes |
calcCoeff | Calculate pressure coefficient | yes |
pInf | Freestream pressure for coefficient calculation | no |
UInf | Freestream velocity for coefficient calculation | no |
rhoInf | Freestream density for coefficient calculation | no |

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -114,7 +114,10 @@ bool Foam::functionObjects::valueAverage::read(const dictionary& dict)
dict.lookup("functionObject") >> functionObjectName_;
dict.lookup("fields") >> fieldNames_;
window_ = dict.lookupOrDefault<scalar>("window", -1);
if (dict.readIfPresent("window", window_))
{
window_ = obr().time().userTimeToTime(window_);
}
totalTime_.setSize(fieldNames_.size());
forAll(totalTime_, i)

View File

@ -72,6 +72,11 @@ Description
patches and suppress writing the internalMesh.
Consecutive output numbering can be used in conjunction with \c overwrite.
See also
Foam::functionObjects::vtkWrite
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObjects::timeControl
SourceFiles
ensightWrite.C
ensightWriteTemplates.C

View File

@ -62,6 +62,7 @@ Usage
\endtable
See also
Foam::functionObjects::ensightWrite
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObjects::timeControl

View File

@ -123,7 +123,7 @@ void Foam::pairPatchAgglomeration::setEdgeWeights
const label nCoarseI = max(fineToCoarse) + 1;
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
HashSet<edge, Hash<edge> > fineFeaturedFaces(coarsePatch.nEdges()/10);
HashSet<edge, Hash<edge>> fineFeaturedFaces(coarsePatch.nEdges()/10);
// Map fine faces with featured edge into coarse faces
forAllConstIter(EdgeMap<scalar>, facePairWeight_, iter)

View File

@ -180,9 +180,9 @@ public:
);
//- Construct and return a clone
virtual autoPtr<InjectionModel<CloudType> > clone() const
virtual autoPtr<InjectionModel<CloudType>> clone() const
{
return autoPtr<InjectionModel<CloudType> >
return autoPtr<InjectionModel<CloudType>>
(
new InjectedParticleDistributionInjection<CloudType>(*this)
);

View File

@ -145,9 +145,9 @@ public:
);
//- Construct and return a clone
virtual autoPtr<InjectionModel<CloudType> > clone() const
virtual autoPtr<InjectionModel<CloudType>> clone() const
{
return autoPtr<InjectionModel<CloudType> >
return autoPtr<InjectionModel<CloudType>>
(
new InjectedParticleInjection<CloudType>(*this)
);

View File

@ -274,7 +274,7 @@ public:
return R_();
}
//- Update and return the co-ordinate roation for a list of cells
//- Update and return the co-ordinate rotation for a list of cells
const coordinateRotation& R
(
const polyMesh& mesh,

View File

@ -358,8 +358,8 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
const bool nearestOnly,
const coordinateSystem& referenceCS,
const label sourceSize,
const List<FixedList<label, 3> >& nearestVertex,
const List<FixedList<scalar, 3> >& nearestVertexWeight
const List<FixedList<label, 3>>& nearestVertex,
const List<FixedList<scalar, 3>>& nearestVertexWeight
)
:
perturb_(perturb),

View File

@ -123,8 +123,8 @@ public:
const bool nearestOnly,
const coordinateSystem& referenceCS,
const label sourceSize,
const List<FixedList<label, 3> >& nearestVertex,
const List<FixedList<scalar, 3> >& nearestVertexWeight
const List<FixedList<label, 3>>& nearestVertex,
const List<FixedList<scalar, 3>>& nearestVertexWeight
);
//- Construct and return a clone

View File

@ -1047,7 +1047,7 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
interpolationCells_.transfer(interpolationCells);
List<Map<label> > compactMap;
List<Map<label>> compactMap;
mapDistribute map(globalCells, cellStencil_, compactMap);
cellInterpolationMap_.transfer(map);

View File

@ -488,7 +488,7 @@ void Foam::cellCellStencils::inverseDistance::markDonors
// Indices of tgtcells to send over to each processor
List<DynamicList<label> > tgtSendCells(Pstream::nProcs());
List<DynamicList<label>> tgtSendCells(Pstream::nProcs());
forAll(srcOverlapProcs, i)
{
label procI = srcOverlapProcs[i];
@ -1548,7 +1548,7 @@ void Foam::cellCellStencils::inverseDistance::createStencil
}
// Re-do the mapDistribute
List<Map<label> > compactMap;
List<Map<label>> compactMap;
mapDistribute map(globalCells, cellStencil_, compactMap);
cellInterpolationMap_.transfer(map);
}
@ -1902,7 +1902,7 @@ bool Foam::cellCellStencils::inverseDistance::update()
}
interpolationCells_.transfer(interpolationCells);
List<Map<label> > compactMap;
List<Map<label>> compactMap;
mapDistribute map(globalCells, cellStencil_, compactMap);
cellInterpolationMap_.transfer(map);

View File

@ -317,7 +317,7 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
// Indices of tgtcells to send over to each processor
List<DynamicList<label> > tgtSendCells(Pstream::nProcs());
List<DynamicList<label>> tgtSendCells(Pstream::nProcs());
forAll(srcOverlapProcs, i)
{
label procI = srcOverlapProcs[i];
@ -768,7 +768,7 @@ bool Foam::cellCellStencils::trackingInverseDistance::update()
}
interpolationCells_.transfer(interpolationCells);
List<Map<label> > compactMap;
List<Map<label>> compactMap;
mapDistribute map(globalCells, cellStencil_, compactMap);
cellInterpolationMap_.transfer(map);

View File

@ -80,16 +80,8 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
{
if (!isA<oversetFvPatch>(p))
{
FatalIOErrorIn
(
"oversetFvPatchField<Type>::oversetFvPatchField"
"("
"const fvPatch&, "
"const DimensionedField<Type, volMesh>&, "
"const dictionary&"
")",
dict
) << " patch type '" << p.type()
FatalIOErrorInFunction(dict)
<< " patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->internalField().name()

View File

@ -103,9 +103,9 @@ public:
oversetFvPatchField(const oversetFvPatchField<Type>&);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
virtual tmp<fvPatchField<Type>> clone() const
{
return tmp<fvPatchField<Type> >
return tmp<fvPatchField<Type>>
(
new oversetFvPatchField<Type>(*this)
);
@ -119,12 +119,12 @@ public:
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
virtual tmp<fvPatchField<Type>> clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
return tmp<fvPatchField<Type>>
(
new oversetFvPatchField<Type>(*this, iF)
);

View File

@ -108,19 +108,8 @@ void Foam::setRefCells
if (refCells.size() != regionNeedReference.size())
{
FatalIOErrorIn
(
"setRefCell\n"
"(\n"
" const volScalarField&,\n"
" const volScalarField&,\n"
" const dictionary&,\n"
" labelList&,\n"
" scalarField&,\n"
" const bool\n"
")\n",
dict
) << "Number of refCells " << refCells.size()
FatalIOErrorInFunction(dict)
<< "Number of refCells " << refCells.size()
<< " does not correspond to number of regions "
<< regionNeedReference.size()
<< exit(FatalIOError);
@ -146,19 +135,8 @@ void Foam::setRefCells
&& regionRefCells[regionI] == -1
)
{
FatalIOErrorIn
(
"setRefCell\n"
"(\n"
" const volScalarField&,\n"
" const volScalarField&,\n"
" const dictionary&,\n"
" labelList&,\n"
" scalarField&,\n"
" const bool\n"
")\n",
dict
) << "Have no reference cell for region " << regionI
FatalIOErrorInFunction(dict)
<< "Have no reference cell for region " << regionI
<< nl
<< "Overall per-region reference cells "
<< regionRefCells
@ -173,19 +151,8 @@ void Foam::setRefCells
if (refPoints.size() != regionNeedReference.size())
{
FatalIOErrorIn
(
"setRefCell\n"
"(\n"
" const volScalarField&,\n"
" const volScalarField&,\n"
" const dictionary&,\n"
" labelList&,\n"
" scalarField&,\n"
" const bool\n"
")\n",
dict
) << "Number of refPoints " << refPoints.size()
FatalIOErrorInFunction(dict)
<< "Number of refPoints " << refPoints.size()
<< " does not correspond to number of regions "
<< regionNeedReference.size()
<< exit(FatalIOError);
@ -226,19 +193,8 @@ void Foam::setRefCells
{
if (hasRef[regionI] != 1)
{
FatalIOErrorIn
(
"setRefCell\n"
"(\n"
" const volScalarField&,\n"
" const volScalarField&,\n"
" const dictionary&,\n"
" labelList&,\n"
" scalarField&,\n"
" const bool\n"
")\n",
dict
) << "Unable to set reference cell for field " << field.name()
FatalIOErrorInFunction(dict)
<< "Unable to set reference cell for field " << field.name()
<< nl
<< " Reference points " << refPointName
<< " " << refPoints
@ -251,19 +207,8 @@ void Foam::setRefCells
}
else
{
FatalIOErrorIn
(
"setRefCell\n"
"(\n"
" const volScalarField&,\n"
" const volScalarField&,\n"
" const dictionary&,\n"
" labelList&,\n"
" scalarField&,\n"
" const bool\n"
")\n",
dict
) << "Unable to set reference cell for field " << field.name()
FatalIOErrorInFunction(dict)
<< "Unable to set reference cell for field " << field.name()
<< nl
<< " Please supply either " << refCellName
<< " or " << refPointName << nl << exit(FatalIOError);

View File

@ -118,7 +118,7 @@ public:
//- Return the windowed data
template<class Type>
tmp<Field<Type> > apply
tmp<Field<Type>> apply
(
const Field<Type>& fld,
const label windowI

View File

@ -42,10 +42,8 @@ Foam::autoPtr<Foam::windowModel> Foam::windowModel::New
if (!cstrIter.found())
{
FatalErrorIn
(
"windowModel::New(const dictionary&, const label)"
) << "Unknown windowModel type "
FatalErrorInFunction
<< "Unknown windowModel type "
<< modelType << nl << nl
<< "Valid windowModel types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc()

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::windowModel::apply
Foam::tmp<Foam::Field<Type>> Foam::windowModel::apply
(
const Field<Type>& fld,
const label windowI
@ -44,7 +44,7 @@ Foam::tmp<Foam::Field<Type> > Foam::windowModel::apply
}
tmp<Field<Type> > tresult(new Field<Type>(nSamples, pTraits<Type>::zero));
tmp<Field<Type>> tresult(new Field<Type>(nSamples, pTraits<Type>::zero));
Field<Type>& result = tresult.ref();
label nWindow = nWindowsTotal(fld.size());

View File

@ -108,7 +108,7 @@ public:
virtual wordList fieldNames(const label timeIndex) const = 0;
//- Return a scalar field at a given time
virtual tmp<Field<scalar> > field
virtual tmp<Field<scalar>> field
(
const label timeIndex,
const label fieldIndex,
@ -116,7 +116,7 @@ public:
) const = 0;
//- Return a vector field at a given time
virtual tmp<Field<vector> > field
virtual tmp<Field<vector>> field
(
const label timeIndex,
const label fieldIndex,
@ -124,7 +124,7 @@ public:
) const = 0;
//- Return a sphericalTensor field at a given time
virtual tmp<Field<sphericalTensor> > field
virtual tmp<Field<sphericalTensor>> field
(
const label timeIndex,
const label fieldIndex,
@ -132,7 +132,7 @@ public:
) const = 0;
//- Return a symmTensor field at a given time
virtual tmp<Field<symmTensor> > field
virtual tmp<Field<symmTensor>> field
(
const label timeIndex,
const label fieldIndex,
@ -140,7 +140,7 @@ public:
) const = 0;
//- Return a tensor field at a given time
virtual tmp<Field<tensor> > field
virtual tmp<Field<tensor>> field
(
const label timeIndex,
const label fieldIndex,

View File

@ -159,11 +159,7 @@ void Foam::fileFormats::FLMAsurfaceFormat<Face>::write
{
if (!os.good())
{
FatalErrorIn
(
"fileFormats::FLMAsurfaceFormat::write"
"(OSstream&, const MeshedSurfaceProxy<Face>&)"
)
FatalErrorInFunction
<< "bad output state "
<< exit(FatalError);
}
@ -352,11 +348,7 @@ void Foam::fileFormats::FLMAsurfaceFormat<Face>::write
}
else
{
FatalErrorIn
(
"fileFormats::FLMAsurfaceFormat::write"
"(const fileName&, const MeshedSurfaceProxy<Face>&)"
)
FatalErrorInFunction
<< "Cannot open file for writing " << filename
<< exit(FatalError);
}

View File

@ -64,7 +64,7 @@ class boundaryRadiationProperties
// Private data
//- Ptr list of boundaryRadiationProperties
List<autoPtr<boundaryRadiationPropertiesPatch> >
List<autoPtr<boundaryRadiationPropertiesPatch>>
radBoundaryPropertiesPtrList_;

View File

@ -153,7 +153,7 @@ public:
) const = 0;
//- Return net solid sensible enthalpy [J/Kg]
virtual tmp<DimensionedField<scalar, volMesh> > RRsHs() const = 0;
virtual tmp<DimensionedField<scalar, volMesh>> RRsHs() const = 0;
//- Return specie Table for gases
virtual const speciesTable& gasTable() const = 0;

View File

@ -188,7 +188,7 @@ public:
inline tmp<volScalarField::Internal> RRs() const;
//- Return net solid sensible enthalpy
inline tmp<DimensionedField<scalar, volMesh> > RRsHs() const;
inline tmp<DimensionedField<scalar, volMesh>> RRsHs() const;
//- Solve the reaction system for the given time step
// and return the characteristic time

View File

@ -97,10 +97,10 @@ Foam::solidChemistryModel<CompType, SolidThermo>::RRs() const
template<class CompType, class SolidThermo>
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::solidChemistryModel<CompType, SolidThermo>::RRsHs() const
{
tmp<DimensionedField<scalar, volMesh> > tRRsHs
tmp<DimensionedField<scalar, volMesh>> tRRsHs
(
new DimensionedField<scalar, volMesh>
(

View File

@ -72,7 +72,8 @@ Foam::scalar Foam::waveModels::Grimshaw::eta
const scalar eps2 = eps*eps;
const scalar eps3 = eps*eps2;
const scalar C = sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
const scalar C =
sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
const scalar ts = 3.5*h/sqrt(H/h);
const scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
@ -109,7 +110,8 @@ Foam::vector Foam::waveModels::Grimshaw::Uf
const scalar eps2 = eps*eps;
const scalar eps3 = eps*eps2;
const scalar C = sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
const scalar C =
sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
const scalar ts = 3.5*h/sqrt(eps);
const scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
@ -228,19 +230,19 @@ void Foam::waveModels::Grimshaw::setVelocity
if (fraction > 0)
{
const label paddlei = faceToPaddle_[facei];
const label paddlei = faceToPaddle_[facei];
const vector Uf = this->Uf
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_,
z
);
const vector Uf = this->Uf
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_,
z
);
U_[facei] = fraction*Uf*tCoeff;
}

View File

@ -320,19 +320,19 @@ void Foam::waveModels::McCowan::setVelocity
if (fraction > 0)
{
const label paddlei = faceToPaddle_[facei];
const label paddlei = faceToPaddle_[facei];
const vector Uf = this->Uf
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_,
z
);
const vector Uf = this->Uf
(
waveHeight_,
waterDepthRef_,
xPaddle_[paddlei],
yPaddle_[paddlei],
waveAngle_,
t,
x0_,
z
);
U_[facei] = fraction*Uf*tCoeff;
}

View File

@ -74,14 +74,14 @@ protected:
virtual scalar newtonRapsonF1
(
const scalar x0,
const scalar H,
const scalar H,
const scalar h
) const;
virtual scalar newtonRapsonF2
(
const scalar x0,
const scalar H,
const scalar H,
const scalar h,
const scalar xa,
const scalar m,

View File

@ -615,7 +615,11 @@ void Foam::waveModels::StokesV::initialise
f1 = pi*H/d - 2*pi/(k*d)*(lambda + l3*b33 + l5*(b35 + b55));
f2 = (2*pi*d)/(mag(g_)*sqr(T)) - k*d/(2*pi)*tanh(k*d)*(1 + l2*c1 + l4*c2);
f2 =
(
(2*pi*d)/(mag(g_)*sqr(T))
- k*d/(2*pi)*tanh(k*d)*(1 + l2*c1 + l4*c2)
);
const scalar lambdaPr =
(f1*Bmat21 - f2*Bmat11)/(Bmat11*Bmat22 - Bmat12*Bmat21);

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.x |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1612+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1612+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1612+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1612+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v3.0+ |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/