Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OpenCFD/OpenFOAM-2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Ferraris committed Aug 1, 2011
2 parents 275700a + ae8dc90 commit e9c3e82
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 60 deletions.
6 changes: 6 additions & 0 deletions applications/solvers/basic/potentialFoam/createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions applications/solvers/basic/potentialFoam/potentialFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 1 addition & 5 deletions src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand All @@ -2534,10 +2534,6 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findNearest
nearestPoint
);
}
else
{
nearestPoint = vector::zero;
}

return pointIndexHit(nearestShapeI != -1, nearestPoint, nearestShapeI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
62 changes: 40 additions & 22 deletions src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ defineTypeNameAndDebug(Foam::dlLibraryTable, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Foam::dlLibraryTable::dlLibraryTable()
:
HashTable<fileName, void*, Hash<void*> >()
{}


Expand All @@ -45,8 +43,6 @@ Foam::dlLibraryTable::dlLibraryTable
const dictionary& dict,
const word& libsEntry
)
:
HashTable<fileName, void*, Hash<void*> >()
{
open(dict, libsEntry);
}
Expand All @@ -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());
}
}

Expand Down Expand Up @@ -95,7 +92,7 @@ bool Foam::dlLibraryTable::open
{
WarningIn
(
"dlLibraryTable::open(const fileName&)"
"dlLibraryTable::open(const fileName&, const bool)"
) << "could not load " << functionLibName
<< endl;
}
Expand All @@ -104,7 +101,9 @@ bool Foam::dlLibraryTable::open
}
else
{
return insert(functionLibPtr, functionLibName);
libPtrs_.append(functionLibPtr);
libNames_.append(functionLibName);
return true;
}
}
else
Expand All @@ -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)
{
Expand All @@ -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;
}

Expand Down
10 changes: 6 additions & 4 deletions src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ SourceFiles
#define dlLibraryTable_H

#include "label.H"
#include "Hash.H"
#include "HashTable.H"
#include "DynamicList.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Expand All @@ -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&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFOAM/db/regIOobject/regIOobjectRead.C
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,8 +87,11 @@ bool Foam::solidBodyMotionFvMesh::update()

fvMesh::movePoints
(
transform(SBMFPtr_().transformation(),
undisplacedPoints_)
transform
(
SBMFPtr_().transformation(),
undisplacedPoints_
)
);

if (foundObject<volVectorField>("U"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubset.C
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ startTime 0;

stopAt endTime;

endTime 1;
endTime 1.5;

deltaT 0.001;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ startTime 0;

stopAt endTime;

endTime 1;
endTime 1.5;

deltaT 0.001;

Expand Down
2 changes: 2 additions & 0 deletions tutorials/incompressible/simpleFoam/motorBike/0.org/k
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ boundaryField
lowerWall
{
type kqRWallFunction;
value $internalField;
}

"motorBike_.*"
{
type kqRWallFunction;
value $internalField;
}

#include "include/frontBackUpperPatches"
Expand Down
2 changes: 2 additions & 0 deletions tutorials/incompressible/simpleFoam/motorBike/0.org/omega
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ boundaryField
lowerWall
{
type omegaWallFunction;
value $internalField;
}

"motorBike_.*"
{
type omegaWallFunction;
value $internalField;
}

#include "include/frontBackUpperPatches"
Expand Down
17 changes: 5 additions & 12 deletions tutorials/incompressible/simpleFoam/motorBike/system/controlDict
Original file line number Diff line number Diff line change
@@ -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 | |
\*---------------------------------------------------------------------------*/
Expand All @@ -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;

Expand All @@ -44,13 +44,6 @@ timePrecision 6;

runTimeModifiable true;

libs
(
"libOpenFOAM.so"
"libcompressibleTurbulenceModels.so"
"libcompressibleRASModels.so"
);

functions
{
#include "readFields"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e9c3e82

Please sign in to comment.