CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   friction forces icoFoam (http://www.cfd-online.com/Forums/openfoam/99240-friction-forces-icofoam.html)

ofslcm March 29, 2012 07:20

friction forces icoFoam
 
Hi,

I'm trying to get the lift and drag forces using icoFoam. I've add on my controlDict:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so");
rhoInf 1000;
patches (cylinder);
CofR (0 0 0);
outputControl timeStep;
outputInterval 1;
}
forceCoeffs
{
// rhoInf - reference density
// CofR - Centre of rotation
// dragDir - Direction of drag coefficient
// liftDir - Direction of lift coefficient
// pitchAxis - Pitching moment axis
// magUinf - free stream velocity magnitude
// lRef - reference length
// Aref - reference area
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (cylinder);
rhoName rhoInf;
rhoInf 1000;
CofR (0 0 0);
liftDir (0 0 1);
dragDir (0 1 0);
pitchAxis (0 0 1);
magUInf 0.001;
lRef 0.1; // cylinder max diameter
Aref 0.314159265358979; //projected area from cylinder
outputControl timeStep;
outputInterval 1;
}
);


and I got the following error:


--> FOAM Warning :
From function dlLibraryTable::open(const fileName&)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libforces.so"


--> FOAM FATAL ERROR:
Unknown function type forces

Table of functionObjects is empty


From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.

FOAM exiting


Should I add anything else to any file and recompile?

Thank you

solOF

flowris March 30, 2012 02:39

For me, it was not necessary, but maybe try to add
libs ( "libmyDynamicFvMesh.so" );
before
functions {

ofslcm March 30, 2012 03:10

Hi,

thank you but it is still not working. I'm using MacOS and OpenFoam-2.0 and I have the following kind of problem when I'm compiling :

+ wmakePrintBuild -check
no git description found
+ /bin/rm -f OpenFOAM/Make/darwinIntel64Gcc45DPOpt/global.C OpenFOAM/Make/darwinIntel64Gcc45DPOpt/global.o
+ wmakeLnInclude OpenFOAM
+ wmakeLnInclude OSspecific/POSIX
+ Pstream/Allwmake
+ wmake libso dummy
'/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/dummy/libPstream.dylib' is up to date.
+ case "$WM_MPLIB" in
+ set +x

Note: ignore spurious warnings about missing mpicxx.h headers

wmake libso mpi
'/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/openmpi-system/libPstream.dylib' is up to date.
+ OSspecific/POSIX/Allwmake
Making dependency list for source file signals/sigQuit.C
Making dependency list for source file signals/sigInt.C
Making dependency list for source file signals/sigSegv.C
Making dependency list for source file signals/sigFpe.C
SOURCE=signals/sigFpe.C ; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IlnInclude -I. -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc45DPOpt/sigFpe.o
SOURCE=signals/sigSegv.C ; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IlnInclude -I. -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc45DPOpt/sigSegv.o
SOURCE=signals/sigInt.C ; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IlnInclude -I. -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc45DPOpt/sigInt.o
SOURCE=signals/sigQuit.C ; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IlnInclude -I. -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc45DPOpt/sigQuit.o
ld -r -o /Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/libOSspecific.o Make/darwinIntel64Gcc45DPOpt/sigFpe.o Make/darwinIntel64Gcc45DPOpt/sigSegv.o Make/darwinIntel64Gcc45DPOpt/sigInt.o Make/darwinIntel64Gcc45DPOpt/sigQuit.o Make/darwinIntel64Gcc45DPOpt/regExp.o Make/darwinIntel64Gcc45DPOpt/timer.o Make/darwinIntel64Gcc45DPOpt/fileStat.o Make/darwinIntel64Gcc45DPOpt/POSIX.o Make/darwinIntel64Gcc45DPOpt/cpuTime.o Make/darwinIntel64Gcc45DPOpt/clockTime.o Make/darwinIntel64Gcc45DPOpt/memInfo.o Make/darwinIntel64Gcc45DPOpt/fileMonitor.o Make/darwinIntel64Gcc45DPOpt/printStack.o
'/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/libOSspecific.o' is up to date.
+ wmake libso OpenFOAM
SOURCE=global/global.Cver ; sed -e 's!VERSION_STRING!2.0.0!' -e 's!BUILD_STRING!2.0.0-a317a4e7cd55!' $SOURCE > Make/darwinIntel64Gcc45DPOpt/global.C; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IMake/darwinIntel64Gcc45DPOpt -IlnInclude -I. -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c Make/darwinIntel64Gcc45DPOpt/global.C -o Make/darwinIntel64Gcc45DPOpt/global.o
'/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/libOpenFOAM.dylib' is up to date.
+ wmake libso fileFormats
Making dependency list for source file starcd/STARCDCore.C
SOURCE=starcd/STARCDCore.C ; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -IlnInclude -I. -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc45DPOpt/STARCDCore.o
'/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/libfileFormats.dylib' is up to date.
+ wmake libso triSurface
Making dependency list for source file triSurfaceFields/triSurfaceFields.C
could not open file faceTemplates.C for source file triSurfaceFields/triSurfaceFields.C
could not open file triFaceTemplates.C for source file triSurfaceFields/triSurfaceFields.C
could not open file labelledTriI.H for source file triSurfaceFields/triSurfaceFields.C
could not open file geometricSurfacePatchList.H for source file triSurfaceFields/triSurfaceFields.C
could not open file surfacePatchList.H for source file triSurfaceFields/triSurfaceFields.C
could not open file triFaceList.H for source file triSurfaceFields/triSurfaceFields.C
could not open file triSurfaceFieldsFwd.H for source file triSurfaceFields/triSurfaceFields.C
Making dependency list for source file tools/labelledTri/sortLabelledTri.C
Making dependency list for source file triSurface/surfacePatch/surfacePatchIOList.C
Making dependency list for source file triSurface/surfacePatch/surfacePatch.C
Making dependency list for source file triSurface/geometricSurfacePatch/geometricSurfacePatch.C
Making dependency list for source file triSurface/interfaces/NAS/readNAS.C
Making dependency list for source file triSurface/interfaces/VTK/writeVTK.C
Making dependency list for source file triSurface/interfaces/AC3D/writeAC.C
Making dependency list for source file triSurface/interfaces/AC3D/readAC.C
Making dependency list for source file triSurface/interfaces/DX/writeDX.C
Making dependency list for source file triSurface/interfaces/TRI/readTRI.C
Making dependency list for source file triSurface/interfaces/TRI/writeTRI.C
Making dependency list for source file triSurface/interfaces/OFF/writeOFF.C
Making dependency list for source file triSurface/interfaces/OFF/readOFF.C
Making dependency list for source file triSurface/interfaces/SMESH/writeSMESH.C
Making dependency list for source file triSurface/interfaces/OBJ/writeOBJ.C
Making dependency list for source file triSurface/interfaces/OBJ/readOBJ.C
Making dependency list for source file triSurface/interfaces/GTS/readGTS.C
Making dependency list for source file triSurface/interfaces/GTS/writeGTS.C
Making dependency list for source file triSurface/interfaces/STL/readSTLBINARY.C
Making dependency list for source file triSurface/interfaces/STL/readSTLASCII.L
Making dependency list for source file triSurface/interfaces/STL/readSTL.C
Making dependency list for source file triSurface/interfaces/STL/writeSTL.C
Making dependency list for source file triSurface/stitchTriangles.C
Making dependency list for source file triSurface/triSurfaceAddressing.C
Making dependency list for source file triSurface/triSurface.C
could not open file dimensionSet.H for source file triSurface/triSurface.C
could not open file dimensionedType.C for source file triSurface/triSurface.C
could not open file dimensionedScalarFwd.H for source file triSurface/triSurface.C
could not open file Switch.H for source file triSurface/triSurface.C
could not open file instantList.H for source file triSurface/triSurface.C
could not open file dlLibraryTable.H for source file triSurface/triSurface.C
could not open file functionObjectList.H for source file triSurface/triSurface.C
could not open file fileMonitor.H for source file triSurface/triSurface.C
could not open file boundBox.H for source file triSurface/triSurface.C
could not open file SortableList.H for source file triSurface/triSurface.C
could not open file PackedBoolList.H for source file triSurface/triSurface.C
Making dependency list for source file meshTriangulation/meshTriangulation.C
could not open file cellModelI.H for source file meshTriangulation/meshTriangulation.C
could not open file cellShapeI.H for source file meshTriangulation/meshTriangulation.C
could not open file primitiveMeshI.H for source file meshTriangulation/meshTriangulation.C
could not open file pointIOField.H for source file meshTriangulation/meshTriangulation.C
could not open file faceIOList.H for source file meshTriangulation/meshTriangulation.C
could not open file labelIOList.H for source file meshTriangulation/meshTriangulation.C
could not open file polyBoundaryMesh.H for source file meshTriangulation/meshTriangulation.C
could not open file boundBox.H for source file meshTriangulation/meshTriangulation.C
could not open file pointZoneMesh.H for source file meshTriangulation/meshTriangulation.C
could not open file faceZoneMesh.H for source file meshTriangulation/meshTriangulation.C
could not open file cellZoneMesh.H for source file meshTriangulation/meshTriangulation.C
could not open file faceTriangulation.H for source file meshTriangulation/meshTriangulation.C


Is it OpenFoam not proper installed? It could be the reason why the forces lib is not find?

Thank you

solOF

ofslcm April 7, 2012 10:57

Hi,

I've solved the problem. It is working changing the extension ".so" by ".dylib".

solOF


All times are GMT -4. The time now is 07:11.