Permalink
Browse files

Merge branch 'master' of github.com:OpenCFD/OpenFOAM-2.0.x

  • Loading branch information...
2 parents 275700a + ae8dc90 commit e9c3e82952cd70bcd2bfda9944b89eb1b857aabb Sergio Ferraris committed Aug 1, 2011
@@ -44,6 +44,12 @@
fvc::interpolate(U) & mesh.Sf()
);
+ if (args.optionFound("initialiseUBCs"))
+ {
+ U.correctBoundaryConditions();
+ phi = fvc::interpolate(U) & mesh.Sf();
+ }
+
label pRefCell = 0;
scalar pRefValue = 0.0;
@@ -38,6 +38,11 @@ Description
int main(int argc, char *argv[])
{
argList::addBoolOption("writep", "write the final pressure field");
+ argList::addBoolOption
+ (
+ "initialiseUBCs",
+ "initialise U boundary conditions"
+ );
#include "setRootCase.H"
#include "createTime.H"
@@ -2520,7 +2520,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
{
scalar nearestDistSqr = startDistSqr;
label nearestShapeI = -1;
- point nearestPoint;
+ point nearestPoint = vector::zero;
if (nodes_.size())
{
@@ -2534,10 +2534,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
nearestPoint
);
}
- else
- {
- nearestPoint = vector::zero;
- }
return pointIndexHit(nearestShapeI != -1, nearestPoint, nearestShapeI);
}
@@ -75,7 +75,7 @@ Foam::fileName Foam::functionEntries::includeEntry::includeFileName
fName.expand();
// relative name
- if (fName.size() && !fName.isAbsolute())
+ if (!fName.isAbsolute())
{
fName = fileName(is.name()).path()/fName;
}
@@ -35,8 +35,6 @@ defineTypeNameAndDebug(Foam::dlLibraryTable, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::dlLibraryTable::dlLibraryTable()
-:
- HashTable<fileName, void*, Hash<void*> >()
{}
@@ -45,8 +43,6 @@ Foam::dlLibraryTable::dlLibraryTable
const dictionary& dict,
const word& libsEntry
)
-:
- HashTable<fileName, void*, Hash<void*> >()
{
open(dict, libsEntry);
}
@@ -56,17 +52,18 @@ Foam::dlLibraryTable::dlLibraryTable
Foam::dlLibraryTable::~dlLibraryTable()
{
- forAllConstIter(dlLibraryTable, *this, iter)
+ forAllReverse(libPtrs_, i)
{
- // bug in dlclose - does not call static destructors of
- // loaded library when actually unloading the library.
- // See https://bugzilla.novell.com/show_bug.cgi?id=680125 and 657627.
- if (debug)
+ if (libPtrs_[i])
{
- Info<< "dlLibraryTable::~dlLibraryTable() : closing " << iter()
- << " with handle " << long(iter.key()) << endl;
+ if (debug)
+ {
+ Info<< "dlLibraryTable::~dlLibraryTable() : closing "
+ << libNames_[i]
+ << " with handle " << long(libPtrs_[i]) << endl;
+ }
+ dlClose(libPtrs_[i]);
}
- dlClose(iter.key());
}
}
@@ -95,7 +92,7 @@ bool Foam::dlLibraryTable::open
{
WarningIn
(
- "dlLibraryTable::open(const fileName&)"
+ "dlLibraryTable::open(const fileName&, const bool)"
) << "could not load " << functionLibName
<< endl;
}
@@ -104,7 +101,9 @@ bool Foam::dlLibraryTable::open
}
else
{
- return insert(functionLibPtr, functionLibName);
+ libPtrs_.append(functionLibPtr);
+ libNames_.append(functionLibName);
+ return true;
}
}
else
@@ -120,18 +119,30 @@ bool Foam::dlLibraryTable::close
const bool verbose
)
{
- void* libPtr = findLibrary(functionLibName);
- if (libPtr)
+ label index = -1;
+ forAllReverse(libNames_, i)
+ {
+ if (libNames_[i] == functionLibName)
+ {
+ index = i;
+ break;
+ }
+ }
+
+ if (index != -1)
{
if (debug)
{
Info<< "dlLibraryTable::close : closing " << functionLibName
- << " with handle " << long(libPtr) << endl;
+ << " with handle " << long(libPtrs_[index]) << endl;
}
- erase(libPtr);
+ bool ok = dlClose(libPtrs_[index]);
+
+ libPtrs_[index] = NULL;
+ libNames_[index] = fileName::null;
- if (!dlClose(libPtr))
+ if (!ok)
{
if (verbose)
{
@@ -153,13 +164,20 @@ bool Foam::dlLibraryTable::close
void* Foam::dlLibraryTable::findLibrary(const fileName& functionLibName)
{
- forAllConstIter(dlLibraryTable, *this, iter)
+ label index = -1;
+ forAllReverse(libNames_, i)
{
- if (iter() == functionLibName)
+ if (libNames_[i] == functionLibName)
{
- return iter.key();
+ index = i;
+ break;
}
}
+
+ if (index != -1)
+ {
+ return libPtrs_[index];
+ }
return NULL;
}
@@ -36,8 +36,7 @@ SourceFiles
#define dlLibraryTable_H
#include "label.H"
-#include "Hash.H"
-#include "HashTable.H"
+#include "DynamicList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -49,11 +48,14 @@ namespace Foam
\*---------------------------------------------------------------------------*/
class dlLibraryTable
-:
- public HashTable<fileName, void*, Hash<void*> >
{
// Private Member Functions
+ DynamicList<void*> libPtrs_;
+
+ DynamicList<fileName> libNames_;
+
+
//- Disallow default bitwise copy construct
dlLibraryTable(const dlLibraryTable&);
@@ -62,8 +62,8 @@ bool Foam::dlLibraryTable::open
WarningIn
(
"dlLibraryTable::open"
- "(const dictionary& dict, const word& libsEntry, "
- "const TablePtr tablePtr)"
+ "(const dictionary&, const word&, "
+ "const TablePtr&)"
) << "library " << libName
<< " did not introduce any new entries"
<< endl << endl;
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -87,8 +87,11 @@ bool Foam::solidBodyMotionFvMesh::update()
fvMesh::movePoints
(
- transform(SBMFPtr_().transformation(),
- undisplacedPoints_)
+ transform
+ (
+ SBMFPtr_().transformation(),
+ undisplacedPoints_
+ )
);
if (foundObject<volVectorField>("U"))
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
+ \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -193,9 +193,7 @@ void Foam::fvMeshSubset::doCoupledPatches
if (nUncoupled > 0)
{
Info<< "Uncoupled " << nUncoupled << " faces on coupled patches. "
- << "(processorPolyPatch, cyclicPolyPatch)" << nl
- << "You might need to run couplePatches to restore the patch face"
- << " ordering." << nl << endl;
+ << "(processorPolyPatch, cyclicPolyPatch)" << endl;
}
}
@@ -23,7 +23,7 @@ startTime 0;
stopAt endTime;
-endTime 1;
+endTime 1.5;
deltaT 0.001;
@@ -23,7 +23,7 @@ startTime 0;
stopAt endTime;
-endTime 1;
+endTime 1.5;
deltaT 0.001;
@@ -34,11 +34,13 @@ boundaryField
lowerWall
{
type kqRWallFunction;
+ value $internalField;
}
"motorBike_.*"
{
type kqRWallFunction;
+ value $internalField;
}
#include "include/frontBackUpperPatches"
@@ -34,11 +34,13 @@ boundaryField
lowerWall
{
type omegaWallFunction;
+ value $internalField;
}
"motorBike_.*"
{
type omegaWallFunction;
+ value $internalField;
}
#include "include/frontBackUpperPatches"
@@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
-| \\ / O peration | Version: 2.0.0 |
+| \\ / O peration | Version: 2.0.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@@ -16,19 +16,19 @@ FoamFile
application simpleFoam;
-startFrom latestTime;
+startFrom latestTime;
startTime 0;
-stopAt nextWrite;
+stopAt endTime;
endTime 500;
deltaT 1;
-writeControl timeStep;
+writeControl timeStep;
-writeInterval 1;
+writeInterval 100;
purgeWrite 0;
@@ -44,13 +44,6 @@ timePrecision 6;
runTimeModifiable true;
-libs
-(
- "libOpenFOAM.so"
- "libcompressibleTurbulenceModels.so"
- "libcompressibleRASModels.so"
-);
-
functions
{
#include "readFields"
@@ -27,7 +27,7 @@ gradSchemes
divSchemes
{
default none;
- div(phi,U) Gauss linearUpwind grad(U);
+ 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;

0 comments on commit e9c3e82

Please sign in to comment.