mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -178,12 +178,14 @@ Foam::label Foam::checkTopology
|
|||||||
if (mesh.checkFaceFaces(true, &faces))
|
if (mesh.checkFaceFaces(true, &faces))
|
||||||
{
|
{
|
||||||
noFailedChecks++;
|
noFailedChecks++;
|
||||||
|
}
|
||||||
|
|
||||||
label nFaces = returnReduce(faces.size(), sumOp<label>());
|
label nFaces = returnReduce(faces.size(), sumOp<label>());
|
||||||
|
if (nFaces > 0)
|
||||||
|
{
|
||||||
Info<< " <<Writing " << nFaces
|
Info<< " <<Writing " << nFaces
|
||||||
<< " faces with incorrect edges to set " << faces.name()
|
<< " faces with non-standard edge connectivity to set "
|
||||||
<< endl;
|
<< faces.name() << endl;
|
||||||
faces.instance() = mesh.pointsInstance();
|
faces.instance() = mesh.pointsInstance();
|
||||||
faces.write();
|
faces.write();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1161,7 +1161,7 @@ int Foam::system(const std::string& command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void* Foam::dlOpen(const fileName& lib)
|
void* Foam::dlOpen(const fileName& lib, const bool check)
|
||||||
{
|
{
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
{
|
{
|
||||||
@ -1170,6 +1170,13 @@ void* Foam::dlOpen(const fileName& lib)
|
|||||||
}
|
}
|
||||||
void* handle = ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
void* handle = ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||||
|
|
||||||
|
if (!handle && check)
|
||||||
|
{
|
||||||
|
WarningIn("dlOpen(const fileName&, const bool)")
|
||||||
|
<< "dlopen error : " << ::dlerror()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (POSIX::debug)
|
if (POSIX::debug)
|
||||||
{
|
{
|
||||||
std::cout
|
std::cout
|
||||||
|
|||||||
@ -193,6 +193,7 @@ dll = db/dynamicLibrary
|
|||||||
$(dll)/dlLibraryTable/dlLibraryTable.C
|
$(dll)/dlLibraryTable/dlLibraryTable.C
|
||||||
$(dll)/dynamicCode/dynamicCode.C
|
$(dll)/dynamicCode/dynamicCode.C
|
||||||
$(dll)/dynamicCode/dynamicCodeContext.C
|
$(dll)/dynamicCode/dynamicCodeContext.C
|
||||||
|
$(dll)/codedBase/codedBase.C
|
||||||
|
|
||||||
db/functionObjects/functionObject/functionObject.C
|
db/functionObjects/functionObject/functionObject.C
|
||||||
db/functionObjects/functionObjectList/functionObjectList.C
|
db/functionObjects/functionObjectList/functionObjectList.C
|
||||||
|
|||||||
@ -212,6 +212,21 @@ void Foam::Time::setControls()
|
|||||||
{
|
{
|
||||||
timeIndex_ = startTimeIndex_;
|
timeIndex_ = startTimeIndex_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scalar timeValue;
|
||||||
|
if (timeDict.readIfPresent("value", timeValue))
|
||||||
|
{
|
||||||
|
if (mag(timeValue - value()) > SMALL)
|
||||||
|
{
|
||||||
|
IOWarningIn("Time::setControls()", timeDict)
|
||||||
|
<< "Time read from time dictionary " << timeValue
|
||||||
|
<< " differs from actual time " << value() << '.' << nl
|
||||||
|
<< " This may cause unexpected database behaviour."
|
||||||
|
<< " If you are not interested" << nl
|
||||||
|
<< " in preserving time state delete the time dictionary."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -416,6 +416,12 @@ public:
|
|||||||
return functionObjects_;
|
return functionObjects_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- External access to the loaded libraries
|
||||||
|
const dlLibraryTable& libs() const
|
||||||
|
{
|
||||||
|
return libs_;
|
||||||
|
}
|
||||||
|
|
||||||
//- External access to the loaded libraries
|
//- External access to the loaded libraries
|
||||||
dlLibraryTable& libs()
|
dlLibraryTable& libs()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -307,6 +307,7 @@ bool Foam::Time::writeObject
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
timeDict.add("value", value());
|
||||||
timeDict.add("index", timeIndex_);
|
timeDict.add("index", timeIndex_);
|
||||||
timeDict.add("deltaT", deltaT_);
|
timeDict.add("deltaT", deltaT_);
|
||||||
timeDict.add("deltaT0", deltaT0_);
|
timeDict.add("deltaT0", deltaT0_);
|
||||||
|
|||||||
@ -143,8 +143,8 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Uncached opening of libPath
|
// Uncached opening of libPath. Do not complain if cannot be loaded
|
||||||
lib = dlOpen(libPath);
|
lib = dlOpen(libPath, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ Foam::functionEntries::codeStream::getFunction
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Uncached opening of libPath
|
// Uncached opening of libPath
|
||||||
lib = dlOpen(libPath);
|
lib = dlOpen(libPath, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
288
src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C
Normal file
288
src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.C
Normal file
@ -0,0 +1,288 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ 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 "codedBase.H"
|
||||||
|
#include "SHA1Digest.H"
|
||||||
|
#include "dynamicCode.H"
|
||||||
|
#include "dynamicCodeContext.H"
|
||||||
|
#include "dlLibraryTable.H"
|
||||||
|
#include "PstreamReduceOps.H"
|
||||||
|
#include "OSspecific.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void* Foam::codedBase::loadLibrary
|
||||||
|
(
|
||||||
|
const fileName& libPath,
|
||||||
|
const string& globalFuncName,
|
||||||
|
const dictionary& contextDict
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
void* lib = 0;
|
||||||
|
|
||||||
|
// avoid compilation by loading an existing library
|
||||||
|
if (!libPath.empty())
|
||||||
|
{
|
||||||
|
if (libs().open(libPath, false))
|
||||||
|
{
|
||||||
|
lib = libs().findLibrary(libPath);
|
||||||
|
|
||||||
|
// verify the loaded version and unload if needed
|
||||||
|
if (lib)
|
||||||
|
{
|
||||||
|
// provision for manual execution of code after loading
|
||||||
|
if (dlSymFound(lib, globalFuncName))
|
||||||
|
{
|
||||||
|
loaderFunctionType function =
|
||||||
|
reinterpret_cast<loaderFunctionType>
|
||||||
|
(
|
||||||
|
dlSym(lib, globalFuncName)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (function)
|
||||||
|
{
|
||||||
|
(*function)(true); // force load
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::updateLibrary()",
|
||||||
|
contextDict
|
||||||
|
) << "Failed looking up symbol " << globalFuncName
|
||||||
|
<< nl << "from " << libPath << exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::loadLibrary()",
|
||||||
|
contextDict
|
||||||
|
) << "Failed looking up symbol " << globalFuncName << nl
|
||||||
|
<< "from " << libPath << exit(FatalIOError);
|
||||||
|
|
||||||
|
lib = 0;
|
||||||
|
if (!libs().close(libPath, false))
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::loadLibrary()",
|
||||||
|
contextDict
|
||||||
|
) << "Failed unloading library "
|
||||||
|
<< libPath
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lib;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::codedBase::unloadLibrary
|
||||||
|
(
|
||||||
|
const fileName& libPath,
|
||||||
|
const string& globalFuncName,
|
||||||
|
const dictionary& contextDict
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
void* lib = 0;
|
||||||
|
|
||||||
|
if (libPath.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lib = libs().findLibrary(libPath);
|
||||||
|
|
||||||
|
if (!lib)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// provision for manual execution of code before unloading
|
||||||
|
if (dlSymFound(lib, globalFuncName))
|
||||||
|
{
|
||||||
|
loaderFunctionType function =
|
||||||
|
reinterpret_cast<loaderFunctionType>
|
||||||
|
(
|
||||||
|
dlSym(lib, globalFuncName)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (function)
|
||||||
|
{
|
||||||
|
(*function)(false); // force unload
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::unloadLibrary()",
|
||||||
|
contextDict
|
||||||
|
) << "Failed looking up symbol " << globalFuncName << nl
|
||||||
|
<< "from " << libPath << exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!libs().close(libPath, false))
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::updateLibrary()",
|
||||||
|
contextDict
|
||||||
|
) << "Failed unloading library " << libPath
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::codedBase::createLibrary
|
||||||
|
(
|
||||||
|
dynamicCode& dynCode,
|
||||||
|
const dynamicCodeContext& context
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
bool create = Pstream::master();
|
||||||
|
|
||||||
|
if (create)
|
||||||
|
{
|
||||||
|
// Write files for new library
|
||||||
|
if (!dynCode.upToDate(context))
|
||||||
|
{
|
||||||
|
// filter with this context
|
||||||
|
dynCode.reset(context);
|
||||||
|
|
||||||
|
this->prepare(dynCode, context);
|
||||||
|
|
||||||
|
if (!dynCode.copyOrCreateFiles(true))
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::createLibrary(..)",
|
||||||
|
context.dict()
|
||||||
|
) << "Failed writing files for" << nl
|
||||||
|
<< dynCode.libRelPath() << nl
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dynCode.wmakeLibso())
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"codedBase::createLibrary(..)",
|
||||||
|
context.dict()
|
||||||
|
) << "Failed wmake " << dynCode.libRelPath() << nl
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// all processes must wait for compile to finish
|
||||||
|
reduce(create, orOp<bool>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::codedBase::updateLibrary
|
||||||
|
(
|
||||||
|
const word& redirectType
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const dictionary& dict = this->codeDict();
|
||||||
|
|
||||||
|
dynamicCode::checkSecurity
|
||||||
|
(
|
||||||
|
"codedBase::updateLibrary()",
|
||||||
|
dict
|
||||||
|
);
|
||||||
|
|
||||||
|
dynamicCodeContext context(dict);
|
||||||
|
|
||||||
|
// codeName: redirectType + _<sha1>
|
||||||
|
// codeDir : redirectType
|
||||||
|
dynamicCode dynCode
|
||||||
|
(
|
||||||
|
redirectType + context.sha1().str(true),
|
||||||
|
redirectType
|
||||||
|
);
|
||||||
|
const fileName libPath = dynCode.libPath();
|
||||||
|
|
||||||
|
|
||||||
|
// the correct library was already loaded => we are done
|
||||||
|
if (libs().findLibrary(libPath))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Using dynamicCode for " << this->description().c_str()
|
||||||
|
<< " at line " << dict.startLineNumber()
|
||||||
|
<< " in " << dict.name() << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// remove instantiation of fvPatchField provided by library
|
||||||
|
this->clearRedirect();
|
||||||
|
|
||||||
|
// may need to unload old library
|
||||||
|
unloadLibrary
|
||||||
|
(
|
||||||
|
oldLibPath_,
|
||||||
|
dynamicCode::libraryBaseName(oldLibPath_),
|
||||||
|
context.dict()
|
||||||
|
);
|
||||||
|
|
||||||
|
// try loading an existing library (avoid compilation when possible)
|
||||||
|
if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
|
||||||
|
{
|
||||||
|
createLibrary(dynCode, context);
|
||||||
|
|
||||||
|
loadLibrary(libPath, dynCode.codeName(), context.dict());
|
||||||
|
}
|
||||||
|
|
||||||
|
// retain for future reference
|
||||||
|
oldLibPath_ = libPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::codedBase::codedBase()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::codedBase::~codedBase()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
142
src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.H
Normal file
142
src/OpenFOAM/db/dynamicLibrary/codedBase/codedBase.H
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ 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::codedBase
|
||||||
|
|
||||||
|
Description
|
||||||
|
Base class for function objects and boundary conditions using dynamic code
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
codedBase.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef codedBase_H
|
||||||
|
#define codedBase_H
|
||||||
|
|
||||||
|
#include "dictionary.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of classes
|
||||||
|
class dynamicCode;
|
||||||
|
class dynamicCodeContext;
|
||||||
|
class dlLibraryTable;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class codedBase Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class codedBase
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Previously loaded library
|
||||||
|
mutable fileName oldLibPath_;
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Global loader/unloader function type
|
||||||
|
typedef void (*loaderFunctionType)(bool);
|
||||||
|
|
||||||
|
//- Load specified library and execute globalFuncName(true)
|
||||||
|
void* loadLibrary
|
||||||
|
(
|
||||||
|
const fileName& libPath,
|
||||||
|
const string& globalFuncName,
|
||||||
|
const dictionary& contextDict
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Execute globalFuncName(false) and unload specified library
|
||||||
|
void unloadLibrary
|
||||||
|
(
|
||||||
|
const fileName& libPath,
|
||||||
|
const string& globalFuncName,
|
||||||
|
const dictionary& contextDict
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Create library based on the dynamicCodeContext
|
||||||
|
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
codedBase(const codedBase&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const codedBase&);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//- Update library as required
|
||||||
|
void updateLibrary
|
||||||
|
(
|
||||||
|
const word& redirectType
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- get the loaded dynamic libraries
|
||||||
|
virtual dlLibraryTable& libs() const = 0;
|
||||||
|
|
||||||
|
//- adapt the context for the current object
|
||||||
|
virtual void prepare
|
||||||
|
(
|
||||||
|
dynamicCode&,
|
||||||
|
const dynamicCodeContext &
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
|
// Return a description (type + name) for the output
|
||||||
|
virtual string description() const = 0;
|
||||||
|
|
||||||
|
// Clear any redirected objects
|
||||||
|
virtual void clearRedirect() const = 0;
|
||||||
|
|
||||||
|
// Get the dictionary to initialize the codeContext
|
||||||
|
virtual const dictionary& codeDict() const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
codedBase();
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~codedBase();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -78,7 +78,7 @@ bool Foam::dlLibraryTable::open
|
|||||||
{
|
{
|
||||||
if (functionLibName.size())
|
if (functionLibName.size())
|
||||||
{
|
{
|
||||||
void* functionLibPtr = dlOpen(functionLibName);
|
void* functionLibPtr = dlOpen(functionLibName, verbose);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -197,8 +197,9 @@ bool ping(const string&, const label timeOut=10);
|
|||||||
//- Execute the specified command
|
//- Execute the specified command
|
||||||
int system(const std::string& command);
|
int system(const std::string& command);
|
||||||
|
|
||||||
//- open a shared library. Return handle to library
|
//- open a shared library. Return handle to library. Print error message
|
||||||
void* dlOpen(const fileName& lib);
|
// if library cannot be loaded (check = true)
|
||||||
|
void* dlOpen(const fileName& lib, const bool check = true);
|
||||||
|
|
||||||
//- Close a dlopened library using handle. Return true if successful
|
//- Close a dlopened library using handle. Return true if successful
|
||||||
bool dlClose(void*);
|
bool dlClose(void*);
|
||||||
|
|||||||
@ -26,19 +26,10 @@ License
|
|||||||
#include "codedFixedValueFvPatchField.H"
|
#include "codedFixedValueFvPatchField.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "surfaceFields.H"
|
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "dlLibraryTable.H"
|
|
||||||
#include "IFstream.H"
|
|
||||||
#include "OFstream.H"
|
|
||||||
#include "SHA1Digest.H"
|
|
||||||
#include "dynamicCode.H"
|
#include "dynamicCode.H"
|
||||||
#include "dynamicCodeContext.H"
|
#include "dynamicCodeContext.H"
|
||||||
#include "stringOps.H"
|
#include "stringOps.H"
|
||||||
#include "IOdictionary.H"
|
|
||||||
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <link.h>
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -53,142 +44,6 @@ const Foam::word Foam::codedFixedValueFvPatchField<Type>::codeTemplateH
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void* Foam::codedFixedValueFvPatchField<Type>::loadLibrary
|
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
void* lib = 0;
|
|
||||||
|
|
||||||
// avoid compilation by loading an existing library
|
|
||||||
if (!libPath.empty())
|
|
||||||
{
|
|
||||||
dlLibraryTable& libs = const_cast<Time&>(this->db().time()).libs();
|
|
||||||
|
|
||||||
if (libs.open(libPath, false))
|
|
||||||
{
|
|
||||||
lib = libs.findLibrary(libPath);
|
|
||||||
|
|
||||||
// verify the loaded version and unload if needed
|
|
||||||
if (lib)
|
|
||||||
{
|
|
||||||
// provision for manual execution of code after loading
|
|
||||||
if (dlSymFound(lib, globalFuncName))
|
|
||||||
{
|
|
||||||
loaderFunctionType function =
|
|
||||||
reinterpret_cast<loaderFunctionType>
|
|
||||||
(
|
|
||||||
dlSym(lib, globalFuncName)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (function)
|
|
||||||
{
|
|
||||||
(*function)(true); // force load
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::"
|
|
||||||
"updateLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed looking up symbol " << globalFuncName
|
|
||||||
<< nl << "from " << libPath << exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::loadLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed looking up symbol " << globalFuncName << nl
|
|
||||||
<< "from " << libPath << exit(FatalIOError);
|
|
||||||
|
|
||||||
lib = 0;
|
|
||||||
if (!libs.close(libPath, false))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::loadLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed unloading library "
|
|
||||||
<< libPath
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return lib;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::codedFixedValueFvPatchField<Type>::unloadLibrary
|
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
void* lib = 0;
|
|
||||||
|
|
||||||
if (libPath.empty())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dlLibraryTable& libs = const_cast<Time&>(this->db().time()).libs();
|
|
||||||
|
|
||||||
lib = libs.findLibrary(libPath);
|
|
||||||
|
|
||||||
if (!lib)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// provision for manual execution of code before unloading
|
|
||||||
if (dlSymFound(lib, globalFuncName))
|
|
||||||
{
|
|
||||||
loaderFunctionType function =
|
|
||||||
reinterpret_cast<loaderFunctionType>
|
|
||||||
(
|
|
||||||
dlSym(lib, globalFuncName)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (function)
|
|
||||||
{
|
|
||||||
(*function)(false); // force unload
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::unloadLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed looking up symbol " << globalFuncName << nl
|
|
||||||
<< "from " << libPath << exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!libs.close(libPath, false))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::"
|
|
||||||
"updateLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed unloading library " << libPath
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::codedFixedValueFvPatchField<Type>::setFieldTemplates
|
void Foam::codedFixedValueFvPatchField<Type>::setFieldTemplates
|
||||||
(
|
(
|
||||||
@ -238,144 +93,82 @@ const Foam::IOdictionary& Foam::codedFixedValueFvPatchField<Type>::dict() const
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::codedFixedValueFvPatchField<Type>::createLibrary
|
Foam::dlLibraryTable& Foam::codedFixedValueFvPatchField<Type>::libs() const
|
||||||
|
{
|
||||||
|
return const_cast<dlLibraryTable&>(this->db().time().libs());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::codedFixedValueFvPatchField<Type>::prepare
|
||||||
(
|
(
|
||||||
dynamicCode& dynCode,
|
dynamicCode& dynCode,
|
||||||
const dynamicCodeContext& context
|
const dynamicCodeContext& context
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
bool create = Pstream::master();
|
// take no chances - typeName must be identical to redirectType_
|
||||||
|
dynCode.setFilterVariable("typeName", redirectType_);
|
||||||
|
|
||||||
if (create)
|
// set TemplateType and FieldType filter variables
|
||||||
{
|
// (for fvPatchField)
|
||||||
// Write files for new library
|
setFieldTemplates(dynCode);
|
||||||
if (!dynCode.upToDate(context))
|
|
||||||
{
|
|
||||||
// filter with this context
|
|
||||||
dynCode.reset(context);
|
|
||||||
|
|
||||||
// take no chances - typeName must be identical to redirectType_
|
// compile filtered C template
|
||||||
dynCode.setFilterVariable("typeName", redirectType_);
|
dynCode.addCompileFile(codeTemplateC);
|
||||||
|
|
||||||
// set TemplateType and FieldType filter variables
|
// copy filtered H template
|
||||||
// (for fvPatchField)
|
dynCode.addCopyFile(codeTemplateH);
|
||||||
setFieldTemplates(dynCode);
|
|
||||||
|
|
||||||
// compile filtered C template
|
|
||||||
dynCode.addCompileFile(codeTemplateC);
|
|
||||||
|
|
||||||
// copy filtered H template
|
|
||||||
dynCode.addCopyFile(codeTemplateH);
|
|
||||||
|
|
||||||
|
|
||||||
// debugging: make BC verbose
|
// debugging: make BC verbose
|
||||||
// dynCode.setFilterVariable("verbose", "true");
|
// dynCode.setFilterVariable("verbose", "true");
|
||||||
// Info<<"compile " << redirectType_ << " sha1: "
|
// Info<<"compile " << redirectType_ << " sha1: "
|
||||||
// << context.sha1() << endl;
|
// << context.sha1() << endl;
|
||||||
|
|
||||||
// define Make/options
|
// define Make/options
|
||||||
dynCode.setMakeOptions
|
dynCode.setMakeOptions
|
||||||
(
|
(
|
||||||
"EXE_INC = -g \\\n"
|
"EXE_INC = -g \\\n"
|
||||||
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
|
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
|
||||||
+ context.options()
|
+ context.options()
|
||||||
+ "\n\nLIB_LIBS = \\\n"
|
+ "\n\nLIB_LIBS = \\\n"
|
||||||
+ " -lOpenFOAM \\\n"
|
+ " -lOpenFOAM \\\n"
|
||||||
+ " -lfiniteVolume \\\n"
|
+ " -lfiniteVolume \\\n"
|
||||||
+ context.libs()
|
+ context.libs()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!dynCode.copyOrCreateFiles(true))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::createLibrary(..)",
|
|
||||||
context.dict()
|
|
||||||
) << "Failed writing files for" << nl
|
|
||||||
<< dynCode.libRelPath() << nl
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dynCode.wmakeLibso())
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::createLibrary(..)",
|
|
||||||
context.dict()
|
|
||||||
) << "Failed wmake " << dynCode.libRelPath() << nl
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// all processes must wait for compile to finish
|
|
||||||
reduce(create, orOp<bool>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::codedFixedValueFvPatchField<Type>::updateLibrary() const
|
const Foam::dictionary& Foam::codedFixedValueFvPatchField<Type>::codeDict()
|
||||||
|
const
|
||||||
{
|
{
|
||||||
dynamicCode::checkSecurity
|
|
||||||
(
|
|
||||||
"codedFixedValueFvPatchField<Type>::updateLibrary()",
|
|
||||||
dict_
|
|
||||||
);
|
|
||||||
|
|
||||||
// use system/codeDict or in-line
|
// use system/codeDict or in-line
|
||||||
const dictionary& codeDict =
|
return
|
||||||
(
|
(
|
||||||
dict_.found("code")
|
dict_.found("code")
|
||||||
? dict_
|
? dict_
|
||||||
: this->dict().subDict(redirectType_)
|
: this->dict().subDict(redirectType_)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
dynamicCodeContext context(codeDict);
|
|
||||||
|
|
||||||
// codeName: redirectType + _<sha1>
|
|
||||||
// codeDir : redirectType
|
|
||||||
dynamicCode dynCode
|
|
||||||
(
|
|
||||||
redirectType_ + context.sha1().str(true),
|
|
||||||
redirectType_
|
|
||||||
);
|
|
||||||
const fileName libPath = dynCode.libPath();
|
|
||||||
|
|
||||||
|
|
||||||
// the correct library was already loaded => we are done
|
template<class Type>
|
||||||
if (const_cast<Time&>(this->db().time()).libs().findLibrary(libPath))
|
Foam::string Foam::codedFixedValueFvPatchField<Type>::description() const
|
||||||
{
|
{
|
||||||
return;
|
return
|
||||||
}
|
"patch "
|
||||||
|
+ this->patch().name()
|
||||||
Info<< "Using dynamicCode for patch " << this->patch().name()
|
+ " on field "
|
||||||
<< " on field " << this->dimensionedInternalField().name() << nl
|
+ this->dimensionedInternalField().name();
|
||||||
<< "at line " << codeDict.startLineNumber()
|
}
|
||||||
<< " in " << codeDict.name() << endl;
|
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::codedFixedValueFvPatchField<Type>::clearRedirect() const
|
||||||
|
{
|
||||||
// remove instantiation of fvPatchField provided by library
|
// remove instantiation of fvPatchField provided by library
|
||||||
redirectPatchFieldPtr_.clear();
|
redirectPatchFieldPtr_.clear();
|
||||||
|
|
||||||
// may need to unload old library
|
|
||||||
unloadLibrary
|
|
||||||
(
|
|
||||||
oldLibPath_,
|
|
||||||
dynamicCode::libraryBaseName(oldLibPath_),
|
|
||||||
context.dict()
|
|
||||||
);
|
|
||||||
|
|
||||||
// try loading an existing library (avoid compilation when possible)
|
|
||||||
if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
|
|
||||||
{
|
|
||||||
createLibrary(dynCode, context);
|
|
||||||
|
|
||||||
loadLibrary(libPath, dynCode.codeName(), context.dict());
|
|
||||||
}
|
|
||||||
|
|
||||||
// retain for future reference
|
|
||||||
oldLibPath_ = libPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -389,7 +182,7 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(p, iF),
|
fixedValueFvPatchField<Type>(p, iF),
|
||||||
oldLibPath_(),
|
codedBase(),
|
||||||
redirectPatchFieldPtr_()
|
redirectPatchFieldPtr_()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -404,9 +197,9 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
|
codedBase(),
|
||||||
dict_(ptf.dict_),
|
dict_(ptf.dict_),
|
||||||
redirectType_(ptf.redirectType_),
|
redirectType_(ptf.redirectType_),
|
||||||
oldLibPath_(ptf.oldLibPath_),
|
|
||||||
redirectPatchFieldPtr_()
|
redirectPatchFieldPtr_()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -420,12 +213,12 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(p, iF, dict),
|
fixedValueFvPatchField<Type>(p, iF, dict),
|
||||||
|
codedBase(),
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
redirectType_(dict.lookup("redirectType")),
|
redirectType_(dict.lookup("redirectType")),
|
||||||
oldLibPath_(),
|
|
||||||
redirectPatchFieldPtr_()
|
redirectPatchFieldPtr_()
|
||||||
{
|
{
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -436,9 +229,9 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(ptf),
|
fixedValueFvPatchField<Type>(ptf),
|
||||||
|
codedBase(),
|
||||||
dict_(ptf.dict_),
|
dict_(ptf.dict_),
|
||||||
redirectType_(ptf.redirectType_),
|
redirectType_(ptf.redirectType_),
|
||||||
oldLibPath_(ptf.oldLibPath_),
|
|
||||||
redirectPatchFieldPtr_()
|
redirectPatchFieldPtr_()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -451,9 +244,9 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchField<Type>(ptf, iF),
|
fixedValueFvPatchField<Type>(ptf, iF),
|
||||||
|
codedBase(),
|
||||||
dict_(ptf.dict_),
|
dict_(ptf.dict_),
|
||||||
redirectType_(ptf.redirectType_),
|
redirectType_(ptf.redirectType_),
|
||||||
oldLibPath_(ptf.oldLibPath_),
|
|
||||||
redirectPatchFieldPtr_()
|
redirectPatchFieldPtr_()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -499,7 +292,7 @@ void Foam::codedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure library containing user-defined fvPatchField is up-to-date
|
// Make sure library containing user-defined fvPatchField is up-to-date
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
|
|
||||||
const fvPatchField<Type>& fvp = redirectPatchField();
|
const fvPatchField<Type>& fvp = redirectPatchField();
|
||||||
|
|
||||||
@ -519,7 +312,7 @@ void Foam::codedFixedValueFvPatchField<Type>::evaluate
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Make sure library containing user-defined fvPatchField is up-to-date
|
// Make sure library containing user-defined fvPatchField is up-to-date
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
|
|
||||||
const fvPatchField<Type>& fvp = redirectPatchField();
|
const fvPatchField<Type>& fvp = redirectPatchField();
|
||||||
|
|
||||||
|
|||||||
@ -79,9 +79,7 @@ SourceFiles
|
|||||||
#define codedFixedValueFvPatchField_H
|
#define codedFixedValueFvPatchField_H
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
#include "codedBase.H"
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <link.h>
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -100,7 +98,8 @@ class IOdictionary;
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class codedFixedValueFvPatchField
|
class codedFixedValueFvPatchField
|
||||||
:
|
:
|
||||||
public fixedValueFvPatchField<Type>
|
public fixedValueFvPatchField<Type>,
|
||||||
|
public codedBase
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -109,51 +108,29 @@ class codedFixedValueFvPatchField
|
|||||||
|
|
||||||
const word redirectType_;
|
const word redirectType_;
|
||||||
|
|
||||||
//- Previously loaded library
|
|
||||||
mutable fileName oldLibPath_;
|
|
||||||
|
|
||||||
mutable autoPtr<fvPatchField<Type> > redirectPatchFieldPtr_;
|
mutable autoPtr<fvPatchField<Type> > redirectPatchFieldPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
const IOdictionary& dict() const;
|
const IOdictionary& dict() const;
|
||||||
|
|
||||||
//- Global loader/unloader function type
|
|
||||||
typedef void (*loaderFunctionType)(bool);
|
|
||||||
|
|
||||||
static int collectLibsCallback
|
|
||||||
(
|
|
||||||
struct dl_phdr_info *info,
|
|
||||||
size_t size,
|
|
||||||
void *data
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Load specified library and execute globalFuncName(true)
|
|
||||||
void* loadLibrary
|
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Execute globalFuncName(false) and unload specified library
|
|
||||||
void unloadLibrary
|
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Set the rewrite vars controlling the Type
|
//- Set the rewrite vars controlling the Type
|
||||||
static void setFieldTemplates(dynamicCode& dynCode);
|
static void setFieldTemplates(dynamicCode& dynCode);
|
||||||
|
|
||||||
//- Create library based on the dynamicCodeContext
|
//- get the loaded dynamic libraries
|
||||||
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
|
virtual dlLibraryTable& libs() const;
|
||||||
|
|
||||||
//- Update library as required
|
//- adapt the context for the current object
|
||||||
void updateLibrary() const;
|
virtual void prepare(dynamicCode&, const dynamicCodeContext&) const;
|
||||||
|
|
||||||
|
// Return a description (type + name) for the output
|
||||||
|
virtual string description() const;
|
||||||
|
|
||||||
|
// Clear the ptr to the redirected object
|
||||||
|
virtual void clearRedirect() const;
|
||||||
|
|
||||||
|
// Get the dictionary to initialize the codeContext
|
||||||
|
virtual const dictionary& codeDict() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ defineTypeNameAndDebug(Foam::streamLine, 0);
|
|||||||
|
|
||||||
void Foam::streamLine::track()
|
void Foam::streamLine::track()
|
||||||
{
|
{
|
||||||
const Time& runTime = const_cast<Time&>(obr_.time());
|
const Time& runTime = obr_.time();
|
||||||
const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_);
|
const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_);
|
||||||
|
|
||||||
IDLList<streamLineParticle> initialParticles;
|
IDLList<streamLineParticle> initialParticles;
|
||||||
@ -383,7 +383,7 @@ void Foam::streamLine::read(const dictionary& dict)
|
|||||||
|
|
||||||
void Foam::streamLine::execute()
|
void Foam::streamLine::execute()
|
||||||
{
|
{
|
||||||
// const Time& runTime = const_cast<Time&>(obr_.time());
|
// const Time& runTime = obr_.time();
|
||||||
// Pout<< "**streamLine::execute : time:" << runTime.timeName() << endl;
|
// Pout<< "**streamLine::execute : time:" << runTime.timeName() << endl;
|
||||||
//
|
//
|
||||||
// bool isOutputTime = false;
|
// bool isOutputTime = false;
|
||||||
@ -418,15 +418,14 @@ void Foam::streamLine::execute()
|
|||||||
|
|
||||||
|
|
||||||
void Foam::streamLine::end()
|
void Foam::streamLine::end()
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::streamLine::write()
|
void Foam::streamLine::write()
|
||||||
{
|
{
|
||||||
if (active_)
|
if (active_)
|
||||||
{
|
{
|
||||||
const Time& runTime = const_cast<Time&>(obr_.time());
|
const Time& runTime = obr_.time();
|
||||||
const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_);
|
const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -49,271 +49,71 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
void* Foam::codedFunctionObject::loadLibrary
|
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
void* lib = 0;
|
|
||||||
|
|
||||||
// avoid compilation by loading an existing library
|
|
||||||
if (!libPath.empty())
|
|
||||||
{
|
|
||||||
dlLibraryTable& libs = const_cast<Time&>(time_).libs();
|
|
||||||
|
|
||||||
if (libs.open(libPath, false))
|
|
||||||
{
|
|
||||||
lib = libs.findLibrary(libPath);
|
|
||||||
|
|
||||||
// verify the loaded version and unload if needed
|
|
||||||
if (lib)
|
|
||||||
{
|
|
||||||
// provision for manual execution of code after loading
|
|
||||||
if (dlSymFound(lib, globalFuncName))
|
|
||||||
{
|
|
||||||
loaderFunctionType function =
|
|
||||||
reinterpret_cast<loaderFunctionType>
|
|
||||||
(
|
|
||||||
dlSym(lib, globalFuncName)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (function)
|
|
||||||
{
|
|
||||||
(*function)(true); // force load
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::updateLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed looking up symbol " << globalFuncName
|
|
||||||
<< nl << "from " << libPath << exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::loadLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed looking up symbol " << globalFuncName << nl
|
|
||||||
<< "from " << libPath << exit(FatalIOError);
|
|
||||||
|
|
||||||
lib = 0;
|
|
||||||
if (!libs.close(libPath, false))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::loadLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed unloading library "
|
|
||||||
<< libPath
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return lib;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::codedFunctionObject::unloadLibrary
|
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
void* lib = 0;
|
|
||||||
|
|
||||||
if (libPath.empty())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dlLibraryTable& libs = const_cast<Time&>(time_).libs();
|
|
||||||
|
|
||||||
lib = libs.findLibrary(libPath);
|
|
||||||
|
|
||||||
if (!lib)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// provision for manual execution of code before unloading
|
|
||||||
if (dlSymFound(lib, globalFuncName))
|
|
||||||
{
|
|
||||||
loaderFunctionType function =
|
|
||||||
reinterpret_cast<loaderFunctionType>
|
|
||||||
(
|
|
||||||
dlSym(lib, globalFuncName)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (function)
|
|
||||||
{
|
|
||||||
(*function)(false); // force unload
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::unloadLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed looking up symbol " << globalFuncName << nl
|
|
||||||
<< "from " << libPath << exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!libs.close(libPath, false))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::"
|
|
||||||
"updateLibrary()",
|
|
||||||
contextDict
|
|
||||||
) << "Failed unloading library " << libPath
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::codedFunctionObject::createLibrary
|
void Foam::codedFunctionObject::prepare
|
||||||
(
|
(
|
||||||
dynamicCode& dynCode,
|
dynamicCode& dynCode,
|
||||||
const dynamicCodeContext& context
|
const dynamicCodeContext& context
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
bool create = Pstream::master();
|
// Set additional rewrite rules
|
||||||
|
dynCode.setFilterVariable("typeName", redirectType_);
|
||||||
|
dynCode.setFilterVariable("codeRead", codeRead_);
|
||||||
|
dynCode.setFilterVariable("codeExecute", codeExecute_);
|
||||||
|
dynCode.setFilterVariable("codeEnd", codeEnd_);
|
||||||
|
//dynCode.setFilterVariable("codeWrite", codeWrite_);
|
||||||
|
|
||||||
if (create)
|
// compile filtered C template
|
||||||
{
|
dynCode.addCompileFile("functionObjectTemplate.C");
|
||||||
// Write files for new library
|
dynCode.addCompileFile("FilterFunctionObjectTemplate.C");
|
||||||
if (!dynCode.upToDate(context))
|
|
||||||
{
|
|
||||||
// filter with this context
|
|
||||||
dynCode.reset(context);
|
|
||||||
|
|
||||||
// Set additional rewrite rules
|
// copy filtered H template
|
||||||
dynCode.setFilterVariable("typeName", redirectType_);
|
dynCode.addCopyFile("FilterFunctionObjectTemplate.H");
|
||||||
dynCode.setFilterVariable("codeRead", codeRead_);
|
dynCode.addCopyFile("functionObjectTemplate.H");
|
||||||
dynCode.setFilterVariable("codeExecute", codeExecute_);
|
dynCode.addCopyFile("IOfunctionObjectTemplate.H");
|
||||||
dynCode.setFilterVariable("codeEnd", codeEnd_);
|
|
||||||
//dynCode.setFilterVariable("codeWrite", codeWrite_);
|
|
||||||
|
|
||||||
// compile filtered C template
|
// debugging: make BC verbose
|
||||||
dynCode.addCompileFile("functionObjectTemplate.C");
|
// dynCode.setFilterVariable("verbose", "true");
|
||||||
dynCode.addCompileFile("FilterFunctionObjectTemplate.C");
|
// Info<<"compile " << redirectType_ << " sha1: "
|
||||||
|
// << context.sha1() << endl;
|
||||||
|
|
||||||
// copy filtered H template
|
// define Make/options
|
||||||
dynCode.addCopyFile("FilterFunctionObjectTemplate.H");
|
dynCode.setMakeOptions
|
||||||
dynCode.addCopyFile("functionObjectTemplate.H");
|
(
|
||||||
dynCode.addCopyFile("IOfunctionObjectTemplate.H");
|
"EXE_INC = -g \\\n"
|
||||||
|
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
|
||||||
// debugging: make BC verbose
|
+ context.options()
|
||||||
// dynCode.setFilterVariable("verbose", "true");
|
+ "\n\nLIB_LIBS = \\\n"
|
||||||
// Info<<"compile " << redirectType_ << " sha1: "
|
+ " -lOpenFOAM \\\n"
|
||||||
// << context.sha1() << endl;
|
+ " -lfiniteVolume \\\n"
|
||||||
|
+ context.libs()
|
||||||
// define Make/options
|
);
|
||||||
dynCode.setMakeOptions
|
|
||||||
(
|
|
||||||
"EXE_INC = -g \\\n"
|
|
||||||
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
|
|
||||||
+ context.options()
|
|
||||||
+ "\n\nLIB_LIBS = \\\n"
|
|
||||||
+ " -lOpenFOAM \\\n"
|
|
||||||
+ " -lfiniteVolume \\\n"
|
|
||||||
+ context.libs()
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!dynCode.copyOrCreateFiles(true))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::createLibrary(..)",
|
|
||||||
context.dict()
|
|
||||||
) << "Failed writing files for" << nl
|
|
||||||
<< dynCode.libRelPath() << nl
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!dynCode.wmakeLibso())
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"codedFunctionObject::createLibrary(..)",
|
|
||||||
context.dict()
|
|
||||||
) << "Failed wmake " << dynCode.libRelPath() << nl
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// all processes must wait for compile to finish
|
|
||||||
reduce(create, orOp<bool>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::codedFunctionObject::updateLibrary() const
|
Foam::dlLibraryTable& Foam::codedFunctionObject::libs() const
|
||||||
{
|
{
|
||||||
dynamicCode::checkSecurity
|
return const_cast<Time&>(time_).libs();
|
||||||
(
|
}
|
||||||
"codedFunctionObject::updateLibrary()",
|
|
||||||
dict_
|
|
||||||
);
|
|
||||||
|
|
||||||
dynamicCodeContext context(dict_);
|
|
||||||
|
|
||||||
// codeName: redirectType + _<sha1>
|
|
||||||
// codeDir : redirectType
|
|
||||||
dynamicCode dynCode
|
|
||||||
(
|
|
||||||
redirectType_ + context.sha1().str(true),
|
|
||||||
redirectType_
|
|
||||||
);
|
|
||||||
const fileName libPath = dynCode.libPath();
|
|
||||||
|
|
||||||
|
|
||||||
// the correct library was already loaded => we are done
|
Foam::string Foam::codedFunctionObject::description() const
|
||||||
if (const_cast<Time&>(time_).libs().findLibrary(libPath))
|
{
|
||||||
{
|
return "functionObject " + name();
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Using dynamicCode for functionObject " << name()
|
|
||||||
<< " at line " << dict_.startLineNumber()
|
|
||||||
<< " in " << dict_.name() << endl;
|
|
||||||
|
|
||||||
|
|
||||||
// remove instantiation of fvPatchField provided by library
|
void Foam::codedFunctionObject::clearRedirect() const
|
||||||
|
{
|
||||||
redirectFunctionObjectPtr_.clear();
|
redirectFunctionObjectPtr_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
// may need to unload old library
|
|
||||||
unloadLibrary
|
|
||||||
(
|
|
||||||
oldLibPath_,
|
|
||||||
dynamicCode::libraryBaseName(oldLibPath_),
|
|
||||||
context.dict()
|
|
||||||
);
|
|
||||||
|
|
||||||
// try loading an existing library (avoid compilation when possible)
|
const Foam::dictionary& Foam::codedFunctionObject::codeDict() const
|
||||||
if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
|
{
|
||||||
{
|
return dict_;
|
||||||
createLibrary(dynCode, context);
|
|
||||||
|
|
||||||
loadLibrary(libPath, dynCode.codeName(), context.dict());
|
|
||||||
}
|
|
||||||
|
|
||||||
// retain for future reference
|
|
||||||
oldLibPath_ = libPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -323,14 +123,18 @@ Foam::codedFunctionObject::codedFunctionObject
|
|||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const Time& time,
|
const Time& time,
|
||||||
const dictionary& dict
|
const dictionary& dict,
|
||||||
|
bool readNow
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
functionObject(name),
|
functionObject(name),
|
||||||
time_(time),
|
codedBase(),
|
||||||
dict_(dict)
|
time_(time)
|
||||||
{
|
{
|
||||||
read(dict_);
|
if (readNow)
|
||||||
|
{
|
||||||
|
read(dict_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -363,21 +167,21 @@ Foam::codedFunctionObject::redirectFunctionObject() const
|
|||||||
|
|
||||||
bool Foam::codedFunctionObject::start()
|
bool Foam::codedFunctionObject::start()
|
||||||
{
|
{
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
return redirectFunctionObject().start();
|
return redirectFunctionObject().start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::codedFunctionObject::execute(const bool forceWrite)
|
bool Foam::codedFunctionObject::execute(const bool forceWrite)
|
||||||
{
|
{
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
return redirectFunctionObject().execute(forceWrite);
|
return redirectFunctionObject().execute(forceWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::codedFunctionObject::end()
|
bool Foam::codedFunctionObject::end()
|
||||||
{
|
{
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
return redirectFunctionObject().end();
|
return redirectFunctionObject().end();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,7 +244,7 @@ bool Foam::codedFunctionObject::read(const dictionary& dict)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLibrary();
|
updateLibrary(redirectType_);
|
||||||
return redirectFunctionObject().read(dict);
|
return redirectFunctionObject().read(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,30 +35,22 @@ SourceFiles
|
|||||||
#ifndef codedFunctionObject_H
|
#ifndef codedFunctionObject_H
|
||||||
#define codedFunctionObject_H
|
#define codedFunctionObject_H
|
||||||
|
|
||||||
#include "pointFieldFwd.H"
|
|
||||||
#include "functionObject.H"
|
#include "functionObject.H"
|
||||||
#include "dictionary.H"
|
#include "codedBase.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of classes
|
|
||||||
class objectRegistry;
|
|
||||||
class dictionary;
|
|
||||||
class mapPolyMesh;
|
|
||||||
class dynamicCode;
|
|
||||||
class dynamicCodeContext;
|
|
||||||
class IOdictionary;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class codedFunctionObject Declaration
|
Class codedFunctionObject Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class codedFunctionObject
|
class codedFunctionObject
|
||||||
:
|
:
|
||||||
public functionObject
|
public functionObject,
|
||||||
|
public codedBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -76,42 +68,28 @@ protected:
|
|||||||
string codeExecute_;
|
string codeExecute_;
|
||||||
string codeEnd_;
|
string codeEnd_;
|
||||||
|
|
||||||
//- Previously loaded library
|
|
||||||
mutable fileName oldLibPath_;
|
|
||||||
|
|
||||||
//- Underlying functionObject
|
//- Underlying functionObject
|
||||||
mutable autoPtr<functionObject> redirectFunctionObjectPtr_;
|
mutable autoPtr<functionObject> redirectFunctionObjectPtr_;
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Global loader/unloader function type
|
// Protected Member Functions
|
||||||
typedef void (*loaderFunctionType)(bool);
|
|
||||||
|
|
||||||
//- Load specified library and execute globalFuncName(true)
|
//- get the loaded dynamic libraries
|
||||||
void* loadLibrary
|
virtual dlLibraryTable& libs() const;
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Execute globalFuncName(false) and unload specified library
|
//- adapt the context for the current object
|
||||||
void unloadLibrary
|
virtual void prepare(dynamicCode &,const dynamicCodeContext&) const;
|
||||||
(
|
|
||||||
const fileName& libPath,
|
|
||||||
const string& globalFuncName,
|
|
||||||
const dictionary& contextDict
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
// Return a description (type + name) for the output
|
||||||
|
virtual string description() const;
|
||||||
|
|
||||||
//- Create library based on the dynamicCodeContext
|
// Clear any redirected objects
|
||||||
void createLibrary(dynamicCode&, const dynamicCodeContext&) const;
|
virtual void clearRedirect() const;
|
||||||
|
|
||||||
//- Update library as required
|
// Get the dictionary to initialize the codeContext
|
||||||
void updateLibrary() const;
|
virtual const dictionary& codeDict() const;
|
||||||
|
|
||||||
//- Read relevant dictionary entries
|
private:
|
||||||
void readDict();
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
codedFunctionObject(const codedFunctionObject&);
|
codedFunctionObject(const codedFunctionObject&);
|
||||||
@ -134,7 +112,8 @@ public:
|
|||||||
(
|
(
|
||||||
const word& name,
|
const word& name,
|
||||||
const Time& time,
|
const Time& time,
|
||||||
const dictionary& dict
|
const dictionary& dict,
|
||||||
|
bool readNow=true // allow child-classes to avoid compilation
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,8 @@ boundaryField
|
|||||||
|
|
||||||
left
|
left
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type uniformFixedValue;
|
||||||
value uniform (1 0 0);
|
uniformValue (1 0 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
cylinder
|
cylinder
|
||||||
|
|||||||
@ -62,19 +62,39 @@ functions
|
|||||||
|
|
||||||
Info<< "Reading inlet velocity uInfX\n" << endl;
|
Info<< "Reading inlet velocity uInfX\n" << endl;
|
||||||
|
|
||||||
|
scalar ULeft = 0.0;
|
||||||
|
label leftI = mesh().boundaryMesh().findPatchID("left");
|
||||||
|
const fvPatchVectorField& fvp = U.boundaryField()[leftI];
|
||||||
|
if (fvp.size())
|
||||||
|
{
|
||||||
|
ULeft = fvp[0].x();
|
||||||
|
}
|
||||||
|
reduce(ULeft, maxOp<scalar>());
|
||||||
|
|
||||||
dimensionedScalar uInfX
|
dimensionedScalar uInfX
|
||||||
(
|
(
|
||||||
"uInfx",
|
"uInfx",
|
||||||
dimensionSet(0, 1, -1, 0, 0),
|
dimensionSet(0, 1, -1, 0, 0),
|
||||||
U.boundaryField()[3][0].x()
|
ULeft
|
||||||
);
|
);
|
||||||
|
|
||||||
Info << "U at inlet = " << uInfX.value() << " m/s" << endl;
|
Info << "U at inlet = " << uInfX.value() << " m/s" << endl;
|
||||||
|
|
||||||
|
|
||||||
|
scalar magCylinder = 0.0;
|
||||||
|
label cylI = mesh().boundaryMesh().findPatchID("cylinder");
|
||||||
|
const fvPatchVectorField& cylFvp = mesh().C().boundaryField()[cylI];
|
||||||
|
if (cylFvp.size())
|
||||||
|
{
|
||||||
|
magCylinder = mag(cylFvp[0]);
|
||||||
|
}
|
||||||
|
reduce(magCylinder, maxOp<scalar>());
|
||||||
|
|
||||||
dimensionedScalar radius
|
dimensionedScalar radius
|
||||||
(
|
(
|
||||||
"radius",
|
"radius",
|
||||||
dimensionSet(0, 1, 0, 0, 0),
|
dimensionSet(0, 1, 0, 0, 0),
|
||||||
mag(U.mesh().boundary()[4].Cf()[0])
|
magCylinder
|
||||||
);
|
);
|
||||||
|
|
||||||
Info << "Cylinder radius = " << radius.value() << " m" << endl;
|
Info << "Cylinder radius = " << radius.value() << " m" << endl;
|
||||||
|
|||||||
11
tutorials/incompressible/pisoFoam/les/motorBike/Allclean
Executable file
11
tutorials/incompressible/pisoFoam/les/motorBike/Allclean
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial clean functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
(cd motorBike && ./Allclean)
|
||||||
|
|
||||||
|
rm -rf motorBikeLES
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
35
tutorials/incompressible/pisoFoam/les/motorBike/Allrun
Executable file
35
tutorials/incompressible/pisoFoam/les/motorBike/Allrun
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
|
||||||
|
cloneParallelCase()
|
||||||
|
{
|
||||||
|
if [ -d $2 ]
|
||||||
|
then
|
||||||
|
echo "Case already cloned: remove case directory $2 to clone"
|
||||||
|
else
|
||||||
|
echo "Cloning $2 case from $1 in parallel mode"
|
||||||
|
mkdir $2
|
||||||
|
cpfiles="0 0.org processor* system constant"
|
||||||
|
for f in $cpfiles
|
||||||
|
do
|
||||||
|
cp -r $1/$f $2
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Do the Spalart-Allmaras steady-state case
|
||||||
|
(cd motorBike && foamRunTutorials)
|
||||||
|
|
||||||
|
# Clone the steady-stae case to the LES case
|
||||||
|
cloneParallelCase motorBike motorBikeLES
|
||||||
|
|
||||||
|
# Do the LES case
|
||||||
|
cp lesFiles/Allrun motorBikeLES/
|
||||||
|
(cd motorBikeLES && foamRunTutorials)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
25
tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/Allrun
Executable file
25
tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/Allrun
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
|
||||||
|
# Set-up the LES case
|
||||||
|
cp ../lesFiles/fvS* ../lesFiles/controlDict system/
|
||||||
|
cp ../lesFiles/LESProperties ../lesFiles/turbulenceProperties constant/
|
||||||
|
cp ../lesFiles/nuSgs 0/
|
||||||
|
|
||||||
|
ls -d processor* | xargs -i rm -rf ./{}/0 $1
|
||||||
|
ls -d processor* | xargs -i mv ./{}/500 ./{}/0 $1
|
||||||
|
ls -d processor* | xargs -i rm -rf ./{}/0/uniform $1
|
||||||
|
|
||||||
|
ls -d processor* | xargs -i cp ../lesFiles/LESProperties ./{}/constant/ $1
|
||||||
|
ls -d processor* | xargs -i cp ../lesFiles/turbulenceProperties ./{}/constant/ $1
|
||||||
|
ls -d processor* | xargs -i cp ../lesFiles/nuSgs ./{}/0/ $1
|
||||||
|
|
||||||
|
|
||||||
|
runParallel pisoFoam 8
|
||||||
|
|
||||||
|
runApplication reconstructParMesh -constant -mergeTol 1e-6
|
||||||
|
|
||||||
|
runApplication reconstructPar
|
||||||
@ -0,0 +1,203 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object LESProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
LESModel SpalartAllmarasDDES;
|
||||||
|
|
||||||
|
delta cubeRootVol;
|
||||||
|
|
||||||
|
printCoeffs on;
|
||||||
|
|
||||||
|
laminarCoeffs
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
oneEqEddyCoeffs
|
||||||
|
{
|
||||||
|
ck 0.07;
|
||||||
|
ce 1.05;
|
||||||
|
}
|
||||||
|
|
||||||
|
dynOneEqEddyCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
filter simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
locDynOneEqEddyCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
filter simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
SmagorinskyCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
ck 0.07;
|
||||||
|
}
|
||||||
|
|
||||||
|
Smagorinsky2Coeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
ck 0.07;
|
||||||
|
cD2 0.02;
|
||||||
|
}
|
||||||
|
|
||||||
|
spectEddyViscCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
cB 8.22;
|
||||||
|
cK1 0.83;
|
||||||
|
cK2 1.03;
|
||||||
|
cK3 4.75;
|
||||||
|
cK4 2.55;
|
||||||
|
}
|
||||||
|
|
||||||
|
dynSmagorinskyCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
filter simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixedSmagorinskyCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
ck 0.07;
|
||||||
|
filter simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
dynMixedSmagorinskyCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
filter simple;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRRDiffStressCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
ck 0.09;
|
||||||
|
c1 1.8;
|
||||||
|
c2 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeardorffDiffStressCoeffs
|
||||||
|
{
|
||||||
|
ce 1.05;
|
||||||
|
ck 0.09;
|
||||||
|
cm 4.13;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpalartAllmarasCoeffs
|
||||||
|
{
|
||||||
|
alphaNut 1.5;
|
||||||
|
Cb1 0.1355;
|
||||||
|
Cb2 0.622;
|
||||||
|
Cw2 0.3;
|
||||||
|
Cw3 2;
|
||||||
|
Cv1 7.1;
|
||||||
|
Cv2 5.0;
|
||||||
|
CDES 0.65;
|
||||||
|
ck 0.07;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpalartAllmarasDDESCoeffs
|
||||||
|
{
|
||||||
|
alphaNut 1.5;
|
||||||
|
Cb1 0.1355;
|
||||||
|
Cb2 0.622;
|
||||||
|
Cw2 0.3;
|
||||||
|
Cw3 2.0;
|
||||||
|
Cv1 7.1;
|
||||||
|
Cv2 5.0;
|
||||||
|
CDES 0.65;
|
||||||
|
ck 0.07;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpalartAllmarasIDDESCoeffs
|
||||||
|
{
|
||||||
|
alphaNut 1.5;
|
||||||
|
kappa 0.4187;
|
||||||
|
Cb1 0.1355;
|
||||||
|
Cb2 0.622;
|
||||||
|
Cw2 0.3;
|
||||||
|
Cw3 2.0;
|
||||||
|
Cv1 7.1;
|
||||||
|
Cv2 5.0;
|
||||||
|
CDES 0.65;
|
||||||
|
ck 0.07;
|
||||||
|
}
|
||||||
|
|
||||||
|
cubeRootVolCoeffs
|
||||||
|
{
|
||||||
|
deltaCoeff 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
PrandtlCoeffs
|
||||||
|
{
|
||||||
|
delta cubeRootVol;
|
||||||
|
cubeRootVolCoeffs
|
||||||
|
{
|
||||||
|
deltaCoeff 1;
|
||||||
|
}
|
||||||
|
smoothCoeffs
|
||||||
|
{
|
||||||
|
delta cubeRootVol;
|
||||||
|
cubeRootVolCoeffs
|
||||||
|
{
|
||||||
|
deltaCoeff 1;
|
||||||
|
}
|
||||||
|
maxDeltaRatio 1.1;
|
||||||
|
}
|
||||||
|
Cdelta 0.158;
|
||||||
|
}
|
||||||
|
|
||||||
|
vanDriestCoeffs
|
||||||
|
{
|
||||||
|
delta cubeRootVol;
|
||||||
|
cubeRootVolCoeffs
|
||||||
|
{
|
||||||
|
deltaCoeff 1;
|
||||||
|
}
|
||||||
|
smoothCoeffs
|
||||||
|
{
|
||||||
|
delta cubeRootVol;
|
||||||
|
cubeRootVolCoeffs
|
||||||
|
{
|
||||||
|
deltaCoeff 1;
|
||||||
|
}
|
||||||
|
maxDeltaRatio 1.1;
|
||||||
|
}
|
||||||
|
Aplus 26;
|
||||||
|
Cdelta 0.158;
|
||||||
|
}
|
||||||
|
|
||||||
|
smoothCoeffs
|
||||||
|
{
|
||||||
|
delta cubeRootVol;
|
||||||
|
cubeRootVolCoeffs
|
||||||
|
{
|
||||||
|
deltaCoeff 1;
|
||||||
|
}
|
||||||
|
maxDeltaRatio 1.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
kappa 0.4187;
|
||||||
|
|
||||||
|
wallFunctionCoeffs
|
||||||
|
{
|
||||||
|
E 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
libs ("libOpenFOAM.so" "libfieldFunctionObjects.so");
|
||||||
|
|
||||||
|
application pisoFoam;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 0.7;
|
||||||
|
|
||||||
|
deltaT 1e-4;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 1000;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat binary;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression compressed;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
#include "readFields"
|
||||||
|
#include "cuttingPlane"
|
||||||
|
#include "streamLines"
|
||||||
|
#include "forceCoeffs"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default backward;
|
||||||
|
}
|
||||||
|
|
||||||
|
d2dt2Schemes
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
|
||||||
|
grad(nuTilda) cellLimited Gauss linear 1;
|
||||||
|
grad(U) cellLimited Gauss linear 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
|
||||||
|
div(phi,U) Gauss LUST unlimitedGrad(U);
|
||||||
|
//div(phi,U) Gauss linearUpwind unlimitedGrad(U);
|
||||||
|
div(phi,k) Gauss limitedLinear 1;
|
||||||
|
div(phi,nuTilda) Gauss limitedLinear 1;
|
||||||
|
|
||||||
|
div((nuEff*dev(T(grad(U))))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear limited 0.33;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default limited 0.33;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-6;
|
||||||
|
relTol 0.1;
|
||||||
|
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nPreSweeps 0;
|
||||||
|
nPostSweeps 2;
|
||||||
|
|
||||||
|
cacheAgglomeration true;
|
||||||
|
|
||||||
|
nCellsInCoarsestLevel 50;//10;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
mergeLevels 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
pFinal
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-6;
|
||||||
|
relTol 0;
|
||||||
|
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nPreSweeps 0;
|
||||||
|
nPostSweeps 2;
|
||||||
|
|
||||||
|
cacheAgglomeration true;
|
||||||
|
|
||||||
|
nCellsInCoarsestLevel 50;//10;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
mergeLevels 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
U
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
UFinal
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
k
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-07;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
B
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-07;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
nuTilda
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-07;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
U 1;
|
||||||
|
nuTilda 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object nuSgs;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.0544766;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.0544766;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.0544766;
|
||||||
|
value uniform 0.0544766;
|
||||||
|
}
|
||||||
|
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type nuSgsUSpaldingWallFunction;
|
||||||
|
value uniform 0.0544766;
|
||||||
|
}
|
||||||
|
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
"motorBike_.*"
|
||||||
|
{
|
||||||
|
type nuSgsUSpaldingWallFunction;
|
||||||
|
value uniform 0.0544766;
|
||||||
|
}
|
||||||
|
|
||||||
|
"proc.*"
|
||||||
|
{
|
||||||
|
type processor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType LESModel;
|
||||||
|
|
||||||
|
turbulenceModel SpalartAllmaras; //kEpsilon;
|
||||||
|
|
||||||
|
turbulence on;
|
||||||
|
|
||||||
|
laminarCoeffs
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
kEpsilonCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
}
|
||||||
|
|
||||||
|
RNGkEpsilonCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.0845;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.42;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.68;
|
||||||
|
alphak alphaK [0 0 0 0 0 0 0] 1.39;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 1.39;
|
||||||
|
eta0 eta0 [0 0 0 0 0 0 0] 4.38;
|
||||||
|
beta beta [0 0 0 0 0 0 0] 0.012;
|
||||||
|
}
|
||||||
|
|
||||||
|
NonlinearKEShihCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76932;
|
||||||
|
A1 A1 [0 0 0 0 0 0 0] 1.25;
|
||||||
|
A2 A2 [0 0 0 0 0 0 0] 1000;
|
||||||
|
Ctau1 Ctau1 [0 0 0 0 0 0 0] -4;
|
||||||
|
Ctau2 Ctau2 [0 0 0 0 0 0 0] 13;
|
||||||
|
Ctau3 Ctau3 [0 0 0 0 0 0 0] -2;
|
||||||
|
alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
LienCubicKECoeffs
|
||||||
|
{
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
A1 A1 [0 0 0 0 0 0 0] 1.25;
|
||||||
|
A2 A2 [0 0 0 0 0 0 0] 1000;
|
||||||
|
Ctau1 Ctau1 [0 0 0 0 0 0 0] -4;
|
||||||
|
Ctau2 Ctau2 [0 0 0 0 0 0 0] 13;
|
||||||
|
Ctau3 Ctau3 [0 0 0 0 0 0 0] -2;
|
||||||
|
alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
QZetaCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphaZeta alphaZeta [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
anisotropic no;
|
||||||
|
}
|
||||||
|
|
||||||
|
LaunderSharmaKECoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
}
|
||||||
|
|
||||||
|
LamBremhorstKECoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
}
|
||||||
|
|
||||||
|
LienCubicKELowReCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
A1 A1 [0 0 0 0 0 0 0] 1.25;
|
||||||
|
A2 A2 [0 0 0 0 0 0 0] 1000;
|
||||||
|
Ctau1 Ctau1 [0 0 0 0 0 0 0] -4;
|
||||||
|
Ctau2 Ctau2 [0 0 0 0 0 0 0] 13;
|
||||||
|
Ctau3 Ctau3 [0 0 0 0 0 0 0] -2;
|
||||||
|
alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9;
|
||||||
|
Am Am [0 0 0 0 0 0 0] 0.016;
|
||||||
|
Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263;
|
||||||
|
Amu Amu [0 0 0 0 0 0 0] 0.00222;
|
||||||
|
}
|
||||||
|
|
||||||
|
LienLeschzinerLowReCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
Am Am [0 0 0 0 0 0 0] 0.016;
|
||||||
|
Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263;
|
||||||
|
Amu Amu [0 0 0 0 0 0 0] 0.00222;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRRCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
Clrr1 Clrr1 [0 0 0 0 0 0 0] 1.8;
|
||||||
|
Clrr2 Clrr2 [0 0 0 0 0 0 0] 0.6;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
Cs Cs [0 0 0 0 0 0 0] 0.25;
|
||||||
|
Ceps Ceps [0 0 0 0 0 0 0] 0.15;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
}
|
||||||
|
|
||||||
|
LaunderGibsonRSTMCoeffs
|
||||||
|
{
|
||||||
|
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||||
|
Clg1 Clg1 [0 0 0 0 0 0 0] 1.8;
|
||||||
|
Clg2 Clg2 [0 0 0 0 0 0 0] 0.6;
|
||||||
|
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||||
|
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||||
|
C1Ref C1Ref [0 0 0 0 0 0 0] 0.5;
|
||||||
|
C2Ref C2Ref [0 0 0 0 0 0 0] 0.3;
|
||||||
|
Cs Cs [0 0 0 0 0 0 0] 0.25;
|
||||||
|
Ceps Ceps [0 0 0 0 0 0 0] 0.15;
|
||||||
|
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||||
|
alphaR alphaR [0 0 0 0 0 0 0] 1.22;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpalartAllmarasCoeffs
|
||||||
|
{
|
||||||
|
alphaNut alphaNut [0 0 0 0 0 0 0] 1.5;
|
||||||
|
Cb1 Cb1 [0 0 0 0 0 0 0] 0.1355;
|
||||||
|
Cb2 Cb2 [0 0 0 0 0 0 0] 0.622;
|
||||||
|
Cw2 Cw2 [0 0 0 0 0 0 0] 0.3;
|
||||||
|
Cw3 Cw3 [0 0 0 0 0 0 0] 2;
|
||||||
|
Cv1 Cv1 [0 0 0 0 0 0 0] 7.1;
|
||||||
|
//Next line Modified vorticity factor by Ashford 1996
|
||||||
|
Cv2 Cv2 [0 0 0 0 0 0 0] 5.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wallFunctionCoeffs
|
||||||
|
{
|
||||||
|
kappa kappa [0 0 0 0 0 0 0] 0.4187;
|
||||||
|
E E [0 0 0 0 0 0 0] 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
flowVelocity ( 20 0 0 );
|
||||||
|
|
||||||
|
pressure 0;
|
||||||
|
|
||||||
|
turbulentKE 0.24;
|
||||||
|
|
||||||
|
turbulentOmega 1.78;
|
||||||
|
|
||||||
|
dimensions [ 0 1 -1 0 0 0 0 ];
|
||||||
|
|
||||||
|
internalField uniform ( 20 0 0 );
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform ( 20 0 0 );
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform ( 0 0 0 );
|
||||||
|
value uniform ( 20 0 0 );
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform ( 20 0 0 );
|
||||||
|
}
|
||||||
|
"motorBike_.*"
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform ( 0 0 0 );
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
"proc.*"
|
||||||
|
{
|
||||||
|
type processor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
flowVelocity (20 0 0);
|
||||||
|
pressure 0;
|
||||||
|
turbulentKE 0.24;
|
||||||
|
turbulentOmega 1.78;
|
||||||
|
#inputMode merge
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object k;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ 0 2 -2 0 0 0 0 ];
|
||||||
|
|
||||||
|
internalField uniform 0.24;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.24;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.24;
|
||||||
|
value uniform 0.24;
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value uniform 0.24;
|
||||||
|
}
|
||||||
|
"motorBike_.*"
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value uniform 0.24;
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
"proc.*"
|
||||||
|
{
|
||||||
|
type processor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object nuTilda;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ 0 2 -1 0 0 0 0 ];
|
||||||
|
|
||||||
|
internalField uniform 0.05;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.05;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.05;
|
||||||
|
value uniform 0.05;
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
"motorBike_.*"
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
"proc.*"
|
||||||
|
{
|
||||||
|
type processor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object nut;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ 0 2 -1 0 0 0 0 ];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type nutUSpaldingWallFunction;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
"motorBike_.*"
|
||||||
|
{
|
||||||
|
type nutUSpaldingWallFunction;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
"proc.*"
|
||||||
|
{
|
||||||
|
type processor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [ 0 2 -2 0 0 0 0 ];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
"motorBike_.*"
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
"proc.*"
|
||||||
|
{
|
||||||
|
type processor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
14
tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allclean
Executable file
14
tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allclean
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial clean functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||||
|
|
||||||
|
rm -rf 0 > /dev/null 2>&1
|
||||||
|
|
||||||
|
cleanCase
|
||||||
|
|
||||||
|
# Reset decomposeParDict
|
||||||
|
cp system/decomposeParDict.hierarchical system/decomposeParDict
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
31
tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun
Executable file
31
tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
|
||||||
|
# Make dummy 0 directory
|
||||||
|
mkdir 0
|
||||||
|
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
cp system/decomposeParDict.hierarchical system/decomposeParDict
|
||||||
|
|
||||||
|
runApplication decomposePar
|
||||||
|
|
||||||
|
cp system/decomposeParDict.ptscotch system/decomposeParDict
|
||||||
|
|
||||||
|
runParallel snappyHexMesh 8 -overwrite -parallel
|
||||||
|
|
||||||
|
find . -type f -iname "*level*" -exec rm {} \;
|
||||||
|
|
||||||
|
ls -d processor* | xargs -i cp -r 0.org/* ./{}/0/ $1
|
||||||
|
|
||||||
|
runParallel renumberMesh 8 -overwrite
|
||||||
|
|
||||||
|
runParallel potentialFoam 8 -initialiseUBCs -noFunctionObjects
|
||||||
|
|
||||||
|
runParallel `getApplication` 8
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object RASProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
RASModel SpalartAllmaras;
|
||||||
|
|
||||||
|
turbulence on;
|
||||||
|
|
||||||
|
printCoeffs on;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-5 -4 0)
|
||||||
|
(15 -4 0)
|
||||||
|
(15 4 0)
|
||||||
|
(-5 4 0)
|
||||||
|
(-5 -4 8)
|
||||||
|
(15 -4 8)
|
||||||
|
(15 4 8)
|
||||||
|
(-5 4 8)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (20 8 8) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
(1 5 4 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(4 5 6 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-5 -4 0)
|
||||||
|
(15 -4 0)
|
||||||
|
(15 4 0)
|
||||||
|
(-5 4 0)
|
||||||
|
(-5 -4 8)
|
||||||
|
(15 -4 8)
|
||||||
|
(15 4 8)
|
||||||
|
(-5 4 8)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (20 10 10) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
(1 5 4 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(4 5 6 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object boundary;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
5
|
||||||
|
(
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
nFaces 320;
|
||||||
|
startFace 3456;
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 64;
|
||||||
|
startFace 3776;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 64;
|
||||||
|
startFace 3840;
|
||||||
|
}
|
||||||
|
lowerWall
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
nFaces 160;
|
||||||
|
startFace 3904;
|
||||||
|
}
|
||||||
|
upperWall
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
nFaces 160;
|
||||||
|
startFace 4064;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
transportModel Newtonian;
|
||||||
|
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 1.5e-05;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,112 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
libs ("libOpenFOAM.so" "libfieldFunctionObjects.so");
|
||||||
|
|
||||||
|
application simpleFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 500;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 500;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression compressed;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
readFields
|
||||||
|
{
|
||||||
|
functionObjectLibs ( "libfieldFunctionObjects.so" );
|
||||||
|
type readFields;
|
||||||
|
fields ( p U );
|
||||||
|
}
|
||||||
|
streamLines
|
||||||
|
{
|
||||||
|
type streamLine;
|
||||||
|
outputControl outputTime;
|
||||||
|
setFormat vtk;
|
||||||
|
U U;
|
||||||
|
trackForward true;
|
||||||
|
fields ( p U );
|
||||||
|
lifeTime 10000;
|
||||||
|
nSubCycle 5;
|
||||||
|
cloudName particleTracks;
|
||||||
|
seedSampleSet uniform;
|
||||||
|
uniformCoeffs
|
||||||
|
{
|
||||||
|
type uniform;
|
||||||
|
axis x;
|
||||||
|
start ( -1.001 1e-07 0.0011 );
|
||||||
|
end ( -1.001 1e-07 1.0011 );
|
||||||
|
nPoints 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cuttingPlane
|
||||||
|
{
|
||||||
|
type surfaces;
|
||||||
|
functionObjectLibs ( "libsampling.so" );
|
||||||
|
outputControl outputTime;
|
||||||
|
surfaceFormat vtk;
|
||||||
|
fields ( p U );
|
||||||
|
interpolationScheme cellPoint;
|
||||||
|
surfaces ( yNormal { type cuttingPlane ; planeType pointAndNormal ; pointAndNormalDict { basePoint ( 0 0 0 ) ; normalVector ( 0 1 0 ) ; } interpolate true ; } );
|
||||||
|
}
|
||||||
|
forces
|
||||||
|
{
|
||||||
|
type forceCoeffs;
|
||||||
|
functionObjectLibs ( "libforces.so" );
|
||||||
|
outputControl timeStep;
|
||||||
|
outputInterval 1;
|
||||||
|
patches ( "motorBike.*" );
|
||||||
|
pName p;
|
||||||
|
UName U;
|
||||||
|
rhoName rhoInf;
|
||||||
|
log true;
|
||||||
|
rhoInf 1;
|
||||||
|
liftDir ( 0 0 1 );
|
||||||
|
dragDir ( 1 0 0 );
|
||||||
|
CofR ( 0.72 0 0 );
|
||||||
|
pitchAxis ( 0 1 0 );
|
||||||
|
magUInf 20;
|
||||||
|
lRef 1.42;
|
||||||
|
Aref 0.75;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
cuttingPlane
|
||||||
|
{
|
||||||
|
type surfaces;
|
||||||
|
functionObjectLibs ("libsampling.so");
|
||||||
|
outputControl outputTime;
|
||||||
|
|
||||||
|
surfaceFormat vtk;
|
||||||
|
fields ( p U );
|
||||||
|
|
||||||
|
interpolationScheme cellPoint;
|
||||||
|
|
||||||
|
surfaces
|
||||||
|
(
|
||||||
|
yNormal
|
||||||
|
{
|
||||||
|
type cuttingPlane;
|
||||||
|
planeType pointAndNormal;
|
||||||
|
pointAndNormalDict
|
||||||
|
{
|
||||||
|
basePoint (0 0 0);
|
||||||
|
normalVector (0 1 0);
|
||||||
|
}
|
||||||
|
interpolate true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 8;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n ( 4 1 1 );
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 4 2 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 8;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n ( 4 1 1 );
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 4 2 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 8;
|
||||||
|
|
||||||
|
method ptscotch;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n ( 4 1 1 );
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 4 2 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
forces
|
||||||
|
{
|
||||||
|
type forceCoeffs;
|
||||||
|
functionObjectLibs ( "libforces.so" );
|
||||||
|
outputControl timeStep;
|
||||||
|
outputInterval 1;
|
||||||
|
|
||||||
|
patches ( "motorBike.*" );
|
||||||
|
pName p;
|
||||||
|
UName U;
|
||||||
|
rhoName rhoInf; // Indicates incompressible
|
||||||
|
log true;
|
||||||
|
rhoInf 1; // Redundant for incompressible
|
||||||
|
liftDir (0 0 1);
|
||||||
|
dragDir (1 0 0);
|
||||||
|
CofR (0.72 0 0); // Axle midpoint on ground
|
||||||
|
pitchAxis (0 1 0);
|
||||||
|
magUInf 20;
|
||||||
|
lRef 1.42; // Wheelbase length
|
||||||
|
Aref 0.75; // Estimated
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default steadyState;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(U) cellLimited Gauss linear 1;
|
||||||
|
grad(nuTilda) cellLimited Gauss linear 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linearUpwindV grad(U);
|
||||||
|
div(phi,k) Gauss upwind;
|
||||||
|
div(phi,omega) Gauss upwind;
|
||||||
|
div((nuEff*dev(T(grad(U))))) Gauss linear;
|
||||||
|
div(phi,nuTilda) Gauss upwind;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
tolerance 1e-07;
|
||||||
|
relTol 0.1;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nPreSweeps 0;
|
||||||
|
nPostSweeps 2;
|
||||||
|
cacheAgglomeration on;
|
||||||
|
agglomerator faceAreaPair;
|
||||||
|
nCellsInCoarsestLevel 10;
|
||||||
|
mergeLevels 1;
|
||||||
|
}
|
||||||
|
U
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0.1;
|
||||||
|
nSweeps 1;
|
||||||
|
}
|
||||||
|
k
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0.1;
|
||||||
|
nSweeps 1;
|
||||||
|
}
|
||||||
|
omega
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relTol 0.1;
|
||||||
|
nSweeps 1;
|
||||||
|
}
|
||||||
|
nuTilda
|
||||||
|
{
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
nSweeps 2;
|
||||||
|
tolerance 1e-08;
|
||||||
|
relT 0.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
potentialFlow
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
p 0.3;
|
||||||
|
U 0.5;
|
||||||
|
k 0.7;
|
||||||
|
omega 0.7;
|
||||||
|
nuTilda 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
cache
|
||||||
|
{
|
||||||
|
grad(U) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// Make sure all fields for functionObjects are loaded. Prevents any
|
||||||
|
// problems running with execFlowFunctionObjects.
|
||||||
|
readFields
|
||||||
|
{
|
||||||
|
// Where to load it from (if not already in solver)
|
||||||
|
functionObjectLibs ("libfieldFunctionObjects.so");
|
||||||
|
|
||||||
|
type readFields;
|
||||||
|
fields (p U);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,332 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object snappyHexMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Which of the steps to run
|
||||||
|
castellatedMesh true;
|
||||||
|
snap true;
|
||||||
|
addLayers false;
|
||||||
|
|
||||||
|
|
||||||
|
// Geometry. Definition of all surfaces. All surfaces are of class
|
||||||
|
// searchableSurface.
|
||||||
|
// Surfaces are used
|
||||||
|
// - to specify refinement for any mesh cell intersecting it
|
||||||
|
// - to specify refinement for any mesh cell inside/outside/near
|
||||||
|
// - to 'snap' the mesh boundary to the surface
|
||||||
|
geometry
|
||||||
|
{
|
||||||
|
motorBike.stl
|
||||||
|
{
|
||||||
|
type triSurfaceMesh;
|
||||||
|
name motorBike;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Analytical shape; cylinder, sphere
|
||||||
|
refinementBox
|
||||||
|
{
|
||||||
|
type searchableBox;
|
||||||
|
min (-1.0 -0.7 0.0);
|
||||||
|
max ( 8.0 0.7 2.5);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the castellatedMesh generation.
|
||||||
|
castellatedMeshControls
|
||||||
|
{
|
||||||
|
|
||||||
|
// Refinement parameters
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// If local number of cells is >= maxLocalCells on any processor
|
||||||
|
// switches from from refinement followed by balancing
|
||||||
|
// (current method) to (weighted) balancing before refinement.
|
||||||
|
maxLocalCells 100000;
|
||||||
|
|
||||||
|
// Overall cell limit (approximately). Refinement will stop immediately
|
||||||
|
// upon reaching this number so a refinement level might not complete.
|
||||||
|
// Note that this is the number of cells before removing the part which
|
||||||
|
// is not 'visible' from the keepPoint. The final number of cells might
|
||||||
|
// actually be a lot less.
|
||||||
|
maxGlobalCells 7000000;
|
||||||
|
|
||||||
|
// The surface refinement loop might spend lots of iterations refining just a
|
||||||
|
// few cells. This setting will cause refinement to stop if <= minimumRefine
|
||||||
|
// are selected for refinement. Note: it will at least do one iteration
|
||||||
|
// (unless the number of cells to refine is 0)
|
||||||
|
minRefinementCells 10;
|
||||||
|
|
||||||
|
// Allow a certain level of imbalance during refining
|
||||||
|
// (since balancing is quite expensive)
|
||||||
|
// Expressed as fraction of perfect balance (= overall number of cells /
|
||||||
|
// nProcs). 0=balance always.
|
||||||
|
maxLoadUnbalance 0.10;
|
||||||
|
|
||||||
|
|
||||||
|
// Number of buffer layers between different levels.
|
||||||
|
// 1 means normal 2:1 refinement restriction, larger means slower
|
||||||
|
// refinement.
|
||||||
|
nCellsBetweenLevels 3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit feature edge refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies a level for any cell intersected by its edges.
|
||||||
|
// This is a featureEdgeMesh, read from constant/triSurface for now.
|
||||||
|
features
|
||||||
|
(
|
||||||
|
//{
|
||||||
|
// file "someLine.eMesh";
|
||||||
|
// level 2;
|
||||||
|
//}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Surface based refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies two levels for every surface. The first is the minimum level,
|
||||||
|
// every cell intersecting a surface gets refined up to the minimum level.
|
||||||
|
// The second level is the maximum level. Cells that 'see' multiple
|
||||||
|
// intersections where the intersections make an
|
||||||
|
// angle > resolveFeatureAngle get refined up to the maximum level.
|
||||||
|
|
||||||
|
refinementSurfaces
|
||||||
|
{
|
||||||
|
motorBike
|
||||||
|
{
|
||||||
|
// Surface-wise min and max refinement level
|
||||||
|
level (6 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve sharp angles
|
||||||
|
resolveFeatureAngle 60;
|
||||||
|
|
||||||
|
|
||||||
|
// Region-wise refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies refinement level for cells in relation to a surface. One of
|
||||||
|
// three modes
|
||||||
|
// - distance. 'levels' specifies per distance to the surface the
|
||||||
|
// wanted refinement level. The distances need to be specified in
|
||||||
|
// descending order.
|
||||||
|
// - inside. 'levels' is only one entry and only the level is used. All
|
||||||
|
// cells inside the surface get refined up to the level. The surface
|
||||||
|
// needs to be closed for this to be possible.
|
||||||
|
// - outside. Same but cells outside.
|
||||||
|
|
||||||
|
refinementRegions
|
||||||
|
{
|
||||||
|
refinementBox
|
||||||
|
{
|
||||||
|
mode inside;
|
||||||
|
levels ((1E15 5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mesh selection
|
||||||
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// After refinement patches get added for all refinementSurfaces and
|
||||||
|
// all cells intersecting the surfaces get put into these patches. The
|
||||||
|
// section reachable from the locationInMesh is kept.
|
||||||
|
// NOTE: This point should never be on a face, always inside a cell, even
|
||||||
|
// after refinement.
|
||||||
|
locationInMesh (3 3 0.43);
|
||||||
|
|
||||||
|
|
||||||
|
// Whether any faceZones (as specified in the refinementSurfaces)
|
||||||
|
// are only on the boundary of corresponding cellZones or also allow
|
||||||
|
// free-standing zone faces. Not used if there are no faceZones.
|
||||||
|
allowFreeStandingZoneFaces false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the snapping.
|
||||||
|
snapControls
|
||||||
|
{
|
||||||
|
//- Number of patch smoothing iterations before finding correspondence
|
||||||
|
// to surface
|
||||||
|
nSmoothPatch 3;
|
||||||
|
|
||||||
|
//- Relative distance for points to be attracted by surface feature point
|
||||||
|
// or edge. True distance is this factor times local
|
||||||
|
// maximum edge length.
|
||||||
|
tolerance 4.0;
|
||||||
|
|
||||||
|
//- Number of mesh displacement relaxation iterations.
|
||||||
|
nSolveIter 30;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the layer addition.
|
||||||
|
addLayersControls
|
||||||
|
{
|
||||||
|
// Are the thickness parameters below relative to the undistorted
|
||||||
|
// size of the refined cell outside layer (true) or absolute sizes (false).
|
||||||
|
relativeSizes true;
|
||||||
|
|
||||||
|
// Per final patch (so not geometry!) the layer information
|
||||||
|
layers
|
||||||
|
{
|
||||||
|
"(lowerWall|motorBike).*"
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expansion factor for layer mesh
|
||||||
|
expansionRatio 1.0;
|
||||||
|
|
||||||
|
//- Wanted thickness of final added cell layer. If multiple layers
|
||||||
|
// is the thickness of the layer furthest away from the wall.
|
||||||
|
// See relativeSizes parameter.
|
||||||
|
finalLayerThickness 0.3;
|
||||||
|
|
||||||
|
//- Minimum thickness of cell layer. If for any reason layer
|
||||||
|
// cannot be above minThickness do not add layer.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
minThickness 0.1;
|
||||||
|
|
||||||
|
//- If points get not extruded do nGrow layers of connected faces that are
|
||||||
|
// also not grown. This helps convergence of the layer addition process
|
||||||
|
// close to features.
|
||||||
|
nGrow 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced settings
|
||||||
|
|
||||||
|
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||||
|
// make straight angle.
|
||||||
|
featureAngle 60;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 3;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of surface normals
|
||||||
|
nSmoothSurfaceNormals 1;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of interior mesh movement direction
|
||||||
|
nSmoothNormals 3;
|
||||||
|
|
||||||
|
// Smooth layer thickness over surface patches
|
||||||
|
nSmoothThickness 2;
|
||||||
|
|
||||||
|
// Stop layer growth on highly warped cells
|
||||||
|
maxFaceThicknessRatio 0.5;
|
||||||
|
|
||||||
|
// Reduce layer growth where ratio thickness to medial
|
||||||
|
// distance is large
|
||||||
|
maxThicknessToMedialRatio 0.3;
|
||||||
|
|
||||||
|
// Angle used to pick up medial axis points
|
||||||
|
minMedianAxisAngle 90;
|
||||||
|
|
||||||
|
// Create buffer region for new layer terminations
|
||||||
|
nBufferCellsNoExtrude 0;
|
||||||
|
|
||||||
|
// Overall max number of layer addition iterations
|
||||||
|
nLayerIter 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Generic mesh quality settings. At any undoable phase these determine
|
||||||
|
// where to undo.
|
||||||
|
meshQualityControls
|
||||||
|
{
|
||||||
|
//- Maximum non-orthogonality allowed. Set to 180 to disable.
|
||||||
|
maxNonOrtho 65;
|
||||||
|
|
||||||
|
//- Max skewness allowed. Set to <0 to disable.
|
||||||
|
maxBoundarySkewness 20;
|
||||||
|
maxInternalSkewness 4;
|
||||||
|
|
||||||
|
//- Max concaveness allowed. Is angle (in degrees) below which concavity
|
||||||
|
// is allowed. 0 is straight face, <0 would be convex face.
|
||||||
|
// 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;
|
||||||
|
minTetQuality 1e-30;
|
||||||
|
|
||||||
|
//- Minimum face area. Set to <0 to disable.
|
||||||
|
minArea -1;
|
||||||
|
|
||||||
|
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
|
||||||
|
//- and face centre triangles normal
|
||||||
|
minTwist 0.02;
|
||||||
|
|
||||||
|
//- minimum normalised cell determinant
|
||||||
|
//- 1 = hex, <= 0 = folded or flattened illegal cell
|
||||||
|
minDeterminant 0.001;
|
||||||
|
|
||||||
|
//- minFaceWeight (0 -> 0.5)
|
||||||
|
minFaceWeight 0.02;
|
||||||
|
|
||||||
|
//- minVolRatio (0 -> 1)
|
||||||
|
minVolRatio 0.01;
|
||||||
|
|
||||||
|
//must be >0 for Fluent compatibility
|
||||||
|
minTriangleTwist -1;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
//- Number of error distribution iterations
|
||||||
|
nSmoothScale 4;
|
||||||
|
//- amount to scale back displacement at error points
|
||||||
|
errorReduction 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
// Flags for optional output
|
||||||
|
// 0 : only write final meshes
|
||||||
|
// 1 : write intermediate meshes
|
||||||
|
// 2 : write volScalarField with cellLevel for postprocessing
|
||||||
|
// 4 : write current intersections as .obj files
|
||||||
|
debug 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
|
||||||
|
// Note: the write tolerance needs to be higher than this.
|
||||||
|
mergeTolerance 1E-6;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
streamLines
|
||||||
|
{
|
||||||
|
type streamLine;
|
||||||
|
|
||||||
|
// Output every
|
||||||
|
outputControl outputTime;
|
||||||
|
// outputInterval 10;
|
||||||
|
|
||||||
|
setFormat vtk; //gnuplot; //xmgr; //raw; //jplot;
|
||||||
|
|
||||||
|
// Velocity field to use for tracking.
|
||||||
|
U U;
|
||||||
|
|
||||||
|
// Tracked forwards (+U) or backwards (-U)
|
||||||
|
trackForward true;
|
||||||
|
|
||||||
|
// Names of fields to sample. Should contain above velocity field!
|
||||||
|
fields (p U);
|
||||||
|
|
||||||
|
// Steps particles can travel before being removed
|
||||||
|
lifeTime 10000;
|
||||||
|
|
||||||
|
// Number of steps per cell (estimate). Set to 1 to disable subcycling.
|
||||||
|
nSubCycle 5;
|
||||||
|
|
||||||
|
// Cloud name to use
|
||||||
|
cloudName particleTracks;
|
||||||
|
|
||||||
|
// Seeding method. See the sampleSets in sampleDict.
|
||||||
|
seedSampleSet uniform; //cloud;//triSurfaceMeshPointSet;
|
||||||
|
|
||||||
|
uniformCoeffs
|
||||||
|
{
|
||||||
|
type uniform;
|
||||||
|
axis x; //distance;
|
||||||
|
|
||||||
|
// Note: tracks slightly offset so as not to be on a face
|
||||||
|
start (-1.001 1e-7 0.0011);
|
||||||
|
end (-1.001 1e-7 1.0011);
|
||||||
|
nPoints 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user