CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc (https://www.cfd-online.com/Forums/openfoam-community-contributions/99168-groovybc-openfoam-2-0-parabolic-velocity-bc.html)

ofslcm March 27, 2012 12:55

groovyBC in openFOAM-2.0 for parabolic velocity bc
 
Hi,

I'm using in openFOAM-2.0 on a 3D case groovyBC to perform this parabolic inlet velocity profile:

U(0,y,z)=Um*y*z*(H-y)*(H-z)/h^4
V=0
W=0

where Um=4*U(0,H/2,H/2,t)

What I've implemented is:

in
{
type groovyBC;
variables "yp=pts().y;zp=pts().z;minZ=min(zp);maxZ=max(zp);H =(maxZ-minZ)/2;U@in=4*U(0,H,H)*normal();";
valueExpression "U*yp*zp*(H-yp)*(H-zp)/pow(H,4)";
}


and I got the following error message:

--> FOAM FATAL IO ERROR:
cannot find file

file: /Users/soledad/OpenFoam/soledad-2.0.0/run/Cylinder/incompressible/icoFoam/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

As in the wiki says, I've added in the contolDict: libs ( "libgroovyBC.so" ) ;
Could you help me please?

Thank you

solOF

gschaider March 27, 2012 14:41

Quote:

Originally Posted by ofslcm (Post 351786)
and I got the following error message:

--> FOAM FATAL IO ERROR:
cannot find file

file: /Users/soledad/OpenFoam/soledad-2.0.0/run/Cylinder/incompressible/icoFoam/system/controlDict at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

As in the wiki says, I've added in the contolDict: libs ( "libgroovyBC.so" ) ;
Could you help me please?

Thank you

solOF

The problem is that there is no controlDict there (you're trying to run the solver in the directory of the sources not in a case-directory). It's got nothing to do with groovyBC

ofslcm March 27, 2012 18:39

Hi,

thank you for your quick response. But I don't understand what should I do. I've copied the folder groovyBC on a case directory and I've try to run the case again, but I still get the same error. This is the path:

~/OpenFoam/cases-2.0.0/run/Cylinder/incompressible/icoFoam/cylinder_00/groovyBC

Please, would you mind to explain it to me again?

Thank you

solOF

gschaider March 27, 2012 19:32

Quote:

Originally Posted by ofslcm (Post 351818)
Hi,

thank you for your quick response. But I don't understand what should I do. I've copied the folder groovyBC on a case directory and I've try to run the case again, but I still get the same error. This is the path:

~/OpenFoam/cases-2.0.0/run/Cylinder/incompressible/icoFoam/cylinder_00/groovyBC

Please, would you mind to explain it to me again?

Thank you

solOF

The original error message said basically "there is no control dict here". That has nothing to do with groovyBC

You don't have to copy the folder with the groovyBC-sources to the case. groovyBC has to be compiled once (see the instructions on the Wiki-page - the swak-page if you're using the groovyBC from there)

Then you'll have to prepare the case as described (also there) and you should be in business

ofslcm March 28, 2012 05:49

Hi,

thank you. I've already compiled groovyBC but I got the following:


Making dependency list for source file PatchValueExpressionDriver.C
could not open file edgeList.H for source file PatchValueExpressionDriver.C
could not open file point.H for source file PatchValueExpressionDriver.C
could not open file intersection.H for source file PatchValueExpressionDriver.C
could not open file HashSet.H for source file PatchValueExpressionDriver.C
could not open file objectHit.H for source file PatchValueExpressionDriver.C
could not open file PrimitivePatch.C for source file PatchValueExpressionDriver.C
could not open file face.H for source file PatchValueExpressionDriver.C
could not open file SubList.H for source file PatchValueExpressionDriver.C
could not open file pointField.H for source file PatchValueExpressionDriver.C
could not open file commSchedule.H for source file PatchValueExpressionDriver.C
could not open file globalMeshData.H for source file PatchValueExpressionDriver.C
could not open file cyclicPolyPatch.H for source file PatchValueExpressionDriver.C
could not open file GeometricFieldFunctions.C for source file PatchValueExpressionDriver.C
could not open file GeometricFieldFunctions.H for source file PatchValueExpressionDriver.C
could not open file GeometricFieldFunctionsM.H for source file PatchValueExpressionDriver.C
could not open file GeometricScalarField.C for source file PatchValueExpressionDriver.C
could not open file GeometricTensorField.H for source file PatchValueExpressionDriver.C
could not open file GeometricSphericalTensorField.H for source file PatchValueExpressionDriver.C
could not open file volMesh.H for source file PatchValueExpressionDriver.C
could not open file fvMesh.H for source file PatchValueExpressionDriver.C
could not open file fvPatchField.H for source file PatchValueExpressionDriver.C
could not open file volFieldsFwd.H for source file PatchValueExpressionDriver.C
could not open file calculatedFvPatchFields.H for source file PatchValueExpressionDriver.C
could not open file interpolationTable.H for source file PatchValueExpressionDriver.C
could not open file PatchResult.H for source file PatchValueExpressionDriver.C
could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionDriver.C
could not open file PatchValueExpressionDriverI.H for source file PatchValueExpressionDriver.C
could not open file Random.H for source file PatchValueExpressionDriver.C
SOURCE=PatchValueExpressionDriver.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 -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude -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/PatchValueExpressionDriver.o
SOURCE=groovyBCFvPatchFields.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 -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude -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/groovyBCFvPatchFields.o
SOURCE=groovyBCPointPatchFields.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 -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude -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/groovyBCPointPatchFields.o
'/Users/soledad/OpenFOAM/soledad-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/libgroovyBC.dylib' is up to date.




It seems not to find .H files. I'm working with Mac and with openFOAM-2.0. I have Bison 2.3.

At the beginning I compiled groovyBC and I got the following error:

PatchValueExpressionDriver.C:192: error: expected unqualified-id before ‘::’ token

PatchValueExpressionDriver.C:202: error: expected unqualified-id before ‘::’ token

then I remove the Foam:: in these two lines.

Could you help me please?

Thank you

ofslcm March 28, 2012 07:33

Sorry, I forgot to add the error that I have when I'm running the case:


--> FOAM Warning :
From function dlLibraryTable::open(const fileName&)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libgroovyBC.so"
Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U



--> FOAM FATAL IO ERROR:
Unknown patchField type groovyBC for patch type patch

Valid patchField types are :

thank you

gschaider March 28, 2012 07:53

Quote:

Originally Posted by ofslcm (Post 351897)
Hi,

thank you. I've already compiled groovyBC but I got the following:


Making dependency list for source file PatchValueExpressionDriver.C
could not open file edgeList.H for source file PatchValueExpressionDriver.C
could not open file point.H for source file PatchValueExpressionDriver.C
could not open file intersection.H for source file PatchValueExpressionDriver.C
could not open file HashSet.H for source file PatchValueExpressionDriver.C
could not open file objectHit.H for source file PatchValueExpressionDriver.C
could not open file PrimitivePatch.C for source file PatchValueExpressionDriver.C
could not open file face.H for source file PatchValueExpressionDriver.C
could not open file SubList.H for source file PatchValueExpressionDriver.C
could not open file pointField.H for source file PatchValueExpressionDriver.C
could not open file commSchedule.H for source file PatchValueExpressionDriver.C
could not open file globalMeshData.H for source file PatchValueExpressionDriver.C
could not open file cyclicPolyPatch.H for source file PatchValueExpressionDriver.C
could not open file GeometricFieldFunctions.C for source file PatchValueExpressionDriver.C
could not open file GeometricFieldFunctions.H for source file PatchValueExpressionDriver.C
could not open file GeometricFieldFunctionsM.H for source file PatchValueExpressionDriver.C
could not open file GeometricScalarField.C for source file PatchValueExpressionDriver.C
could not open file GeometricTensorField.H for source file PatchValueExpressionDriver.C
could not open file GeometricSphericalTensorField.H for source file PatchValueExpressionDriver.C
could not open file volMesh.H for source file PatchValueExpressionDriver.C
could not open file fvMesh.H for source file PatchValueExpressionDriver.C
could not open file fvPatchField.H for source file PatchValueExpressionDriver.C
could not open file volFieldsFwd.H for source file PatchValueExpressionDriver.C
could not open file calculatedFvPatchFields.H for source file PatchValueExpressionDriver.C
could not open file interpolationTable.H for source file PatchValueExpressionDriver.C
could not open file PatchResult.H for source file PatchValueExpressionDriver.C
could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionDriver.C
could not open file PatchValueExpressionDriverI.H for source file PatchValueExpressionDriver.C
could not open file Random.H for source file PatchValueExpressionDriver.C
SOURCE=PatchValueExpressionDriver.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 -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude -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/PatchValueExpressionDriver.o
SOURCE=groovyBCFvPatchFields.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 -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude -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/groovyBCFvPatchFields.o
SOURCE=groovyBCPointPatchFields.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 -I/Users/soledad/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude -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/groovyBCPointPatchFields.o
'/Users/soledad/OpenFOAM/soledad-2.0.0/platforms/darwinIntel64Gcc45DPOpt/lib/libgroovyBC.dylib' is up to date.




It seems not to find .H files. I'm working with Mac and with openFOAM-2.0. I have Bison 2.3.

At the beginning I compiled groovyBC and I got the following error:

PatchValueExpressionDriver.C:192: error: expected unqualified-id before ‘::’ token

PatchValueExpressionDriver.C:202: error: expected unqualified-id before ‘::’ token

then I remove the Foam:: in these two lines.

Could you help me please?

Thank you

It seems that you're using the "old-school" groovyBC from http://openfoamwiki.net/index.php/Contrib_groovyBC

Have a look at the top of the page. There it says that support for this is discontinued with 2.0

ofslcm March 28, 2012 10:52

Hi,

thank you. I've already intall swak4Foam, but I have the following kind of error when I compile:

Making dependency list for source file funkyDoCalc.C
could not open file IOList.H for source file funkyDoCalc.C
could not open file CompactIOList.C for source file funkyDoCalc.C
could not open file labelIOList.H for source file funkyDoCalc.C
could not open file polyBoundaryMesh.H for source file funkyDoCalc.C
could not open file boundBox.H for source file funkyDoCalc.C
could not open file pointZoneMesh.H for source file funkyDoCalc.C
could not open file faceZoneMesh.H for source file funkyDoCalc.C
could not open file cellZoneMesh.H for source file funkyDoCalc.C
could not open file lduMesh.H for source file funkyDoCalc.C
could not open file fvBoundaryMesh.H for source file funkyDoCalc.C
could not open file surfaceInterpolation.H for source file funkyDoCalc.C
could not open file fvSchemes.H for source file funkyDoCalc.C
could not open file fvSolution.H for source file funkyDoCalc.C
could not open file data.H for source file funkyDoCalc.C
could not open file DimensionedField.H for source file funkyDoCalc.C
could not open file volFieldsFwd.H for source file funkyDoCalc.C
could not open file surfaceFieldsFwd.H for source file funkyDoCalc.C
could not open file pointFieldsFwd.H for source file funkyDoCalc.C
could not open file slicedVolFieldsFwd.H for source file funkyDoCalc.C
could not open file slicedSurfaceFieldsFwd.H for source file funkyDoCalc.C
could not open file fvPatchFvMeshTemplates.C for source file funkyDoCalc.C
could not open file fvc.H for source file funkyDoCalc.C
could not open file fvMatrices.H for source file funkyDoCalc.C
could not open file fvm.H for source file funkyDoCalc.C
could not open file linear.H for source file funkyDoCalc.C
could not open file uniformDimensionedFields.H for source file funkyDoCalc.C
could not open file calculatedFvPatchFields.H for source file funkyDoCalc.C
could not open file fixedValueFvPatchFields.H for source file funkyDoCalc.C
could not open file adjustPhi.H for source file funkyDoCalc.C
could not open file findRefCell.H for source file funkyDoCalc.C
could not open file constants.H for source file funkyDoCalc.C
could not open file argList.H for source file funkyDoCalc.C
could not open file timeSelector.H for source file funkyDoCalc.C
could not open file CommonValueExpressionDriver.H for source file funkyDoCalc.C
could not open file IFstream.H for source file funkyDoCalc.C
could not open file addRegionOption.H for source file funkyDoCalc.C
could not open file setRootCase.H for source file funkyDoCalc.C
could not open file createTime.H for source file funkyDoCalc.C
could not open file createNamedMesh.H for source file funkyDoCalc.C


and when I'm running the code I get:

Create time

--> FOAM Warning :
From function dlLibraryTable::open(const fileName&)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libgroovyBC.so"
Create mesh for time = 0

Reading transportProperties

Reading field p



--> FOAM FATAL IO ERROR:
inconsistent patch and patchField types for
patch type symmetryPlane and patchField type zeroGradient

file: ./cylinder_00/0/p::boundaryField::base from line 26 to line 26.

From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
in file /Users/jomipp/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 164.

FOAM exiting


I'm using Mac.

Could you help me?

Thank you

gschaider March 28, 2012 16:56

Quote:

Originally Posted by ofslcm (Post 351953)
Hi,

thank you. I've already intall swak4Foam, but I have the following kind of error when I compile:

What precisely do you mean with "have already installed"

Quote:

Originally Posted by ofslcm (Post 351953)
Making dependency list for source file funkyDoCalc.C
could not open file IOList.H for source file funkyDoCalc.C

<nipped redundant information>

could not open file createNamedMesh.H for source file funkyDoCalc.C

The utilities are the last part the compilation script compiles. What happens with the Libraries

The error messages you posted are not very helpful. What happens once g++ is called?

Quote:

Originally Posted by ofslcm (Post 351953)
and when I'm running the code I get:

Create time

--> FOAM Warning :
From function dlLibraryTable::open(const fileName&)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libgroovyBC.so"
Create mesh for time = 0

Reading transportProperties

Reading field p

That is because it didn't compile properly

Quote:

Originally Posted by ofslcm (Post 351953)

--> FOAM FATAL IO ERROR:
inconsistent patch and patchField types for
patch type symmetryPlane and patchField type zeroGradient

file: ./cylinder_00/0/p::boundaryField::base from line 26 to line 26.

From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
in file /Users/jomipp/OpenFoam/OF-Org-2.0/OpenFOAM-2.0.0/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 164.

FOAM exiting

That is a general misconfiguration of the case. A symmetryPlan only allows symmetry-BC

Quote:

Originally Posted by ofslcm (Post 351953)

I'm using Mac.

Could you help me?

Thank you


ofslcm March 29, 2012 06:44

Hi,

thank you. I've already corrected the problem with the symmetryPlane BC.

Related to compilation: I have download swak4Foam and as it says in the wiki, I've compiled the files with wmake all, however I have many problems, since some files cannot be opened. Could you help me? This is the first part of the compilation error. It seems no to find the libraries:


Bison is version 2.3
No 'swakConfiguration'. Python etc won't work
OpenFOAM-version: Major 2 Minor 0 Patch 0
No Libraries/swak4FoamParsers/foamVersion4swak.H. Generated
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file SurfacesRepository.C
could not open file PrimitivePatchMeshData.C for source file SurfacesRepository.C
could not open file PrimitivePatchMeshEdges.C for source file SurfacesRepository.C
could not open file PrimitivePatchPointAddressing.C for source file SurfacesRepository.C
could not open file PrimitivePatchProjectPoints.C for source file SurfacesRepository.C
could not open file PrimitivePatchCheck.C for source file SurfacesRepository.C
could not open file labelPair.H for source file SurfacesRepository.C
could not open file boundBox.H for source file SurfacesRepository.C
could not open file pointZoneMesh.H for source file SurfacesRepository.C
could not open file faceZoneMesh.H for source file SurfacesRepository.C
could not open file cellZoneMesh.H for source file SurfacesRepository.C
could not open file coordinateSystems.H for source file SurfacesRepository.C
could not open file interpolation.H for source file SurfacesRepository.C
could not open file sampledSurfaceTemplates.C for source file SurfacesRepository.C
Making dependency list for source file SetsRepository.C

gschaider March 31, 2012 16:30

Quote:

Originally Posted by ofslcm (Post 352150)
Hi,

thank you. I've already corrected the problem with the symmetryPlane BC.

Related to compilation: I have download swak4Foam and as it says in the wiki, I've compiled the files with wmake all, however I have many problems, since some files cannot be opened. Could you help me? This is the first part of the compilation error. It seems no to find the libraries:


Bison is version 2.3
No 'swakConfiguration'. Python etc won't work
OpenFOAM-version: Major 2 Minor 0 Patch 0
No Libraries/swak4FoamParsers/foamVersion4swak.H. Generated
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file SurfacesRepository.C
could not open file PrimitivePatchMeshData.C for source file SurfacesRepository.C
could not open file PrimitivePatchMeshEdges.C for source file SurfacesRepository.C
could not open file PrimitivePatchPointAddressing.C for source file SurfacesRepository.C
could not open file PrimitivePatchProjectPoints.C for source file SurfacesRepository.C
could not open file PrimitivePatchCheck.C for source file SurfacesRepository.C
could not open file labelPair.H for source file SurfacesRepository.C
could not open file boundBox.H for source file SurfacesRepository.C
could not open file pointZoneMesh.H for source file SurfacesRepository.C
could not open file faceZoneMesh.H for source file SurfacesRepository.C
could not open file cellZoneMesh.H for source file SurfacesRepository.C
could not open file coordinateSystems.H for source file SurfacesRepository.C
could not open file interpolation.H for source file SurfacesRepository.C
could not open file sampledSurfaceTemplates.C for source file SurfacesRepository.C
Making dependency list for source file SetsRepository.C

a) what are the first errors of the "real" compilation (from g++)

b) what does
ls $FOAM_SRC/OpenFOAM/lnInclude/PrimitivePatchMeshData.C
say (is the file found)

c) what does
ulimit -a
say (because if the rest of the compilation works this might be an issue with the number of file-descriptors)

ofslcm April 7, 2012 10:42

Thank you for the help.

The problem is solved. I need to change the extension ".so" by ".dylib" and openFoam is finding the library :)

solOF

Mojtaba.a August 14, 2012 08:34

Quote:

Originally Posted by ofslcm (Post 353599)
Thank you for the help.

The problem is solved. I need to change the extension ".so" by ".dylib" and openFoam is finding the library :)

solOF

Can you explain where you have changed the extension ".so" by ".dylib" ?
I have the same problem

ofslcm August 14, 2012 10:13

In the controlDict, where you call to your function, change the extension .so by .dylib, for example: forces.dylib

Mojtaba.a August 14, 2012 10:28

Quote:

Originally Posted by ofslcm (Post 377055)
In the controlDict, where you call to your function, change the extension .so by .dylib, for example: forces.dylib

Thanks, that solved my problem :)

gschaider August 20, 2012 16:52

Quote:

Originally Posted by ofslcm (Post 377055)
In the controlDict, where you call to your function, change the extension .so by .dylib, for example: forces.dylib

Is that on a Mac? Which version of OF-patches for that do you use? The one I published replace ".so" with ".dylib" on the fly. So you can keep "libfoo.so" in the files and OF will look for "libfoo.dylib". That way the case works on Linux and MacOSX

Raymond.Leoi August 15, 2013 08:41

inlet { type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; valueExpression "10*(1+0.5*sin(500*time()))*para"; value uniform (10 0 0); }

The above is an example for groovxyBC in OFwiki. The valueExpression shows a time-dependent variable. I supposed it's for velocities. Why is a constant velocity vector specified at the end?

gschaider August 15, 2013 12:40

Quote:

Originally Posted by Raymond.Leoi (Post 445953)
inlet { type groovyBC; variables "yp=pts().y;minY=min(yp);maxY=max(yp);para=-(maxY-pos().y)*(pos().y-minY)/(0.25*pow(maxY-minY,2))*normal();"; valueExpression "10*(1+0.5*sin(500*time()))*para"; value uniform (10 0 0); }

The above is an example for groovxyBC in OFwiki. The valueExpression shows a time-dependent variable. I supposed it's for velocities. Why is a constant velocity vector specified at the end?

You mean "value uniform (10 0 0);"? That is there to keep Paraview and other tools that don't know groovyBC happy

linch August 23, 2013 12:02

Hi Bernhard,

Quote:

Originally Posted by ofslcm (Post 352150)
Related to compilation: I have download swak4Foam and as it says in the wiki, I've compiled the files with wmake all, however I have many problems, since some files cannot be opened. Could you help me? This is the first part of the compilation error. It seems no to find the libraries:


Bison is version 2.3
No 'swakConfiguration'. Python etc won't work
...

I have the same problem trying to compile swak4foam:
Code:

No 'swakConfiguration'. Python etc won't work
Checking swak4Foam-version and generating file
Traceback (most recent call last):
  File "./maintainanceScripts/makeSwakVersionFile.py", line 8, in <module>
    output = Popen(["hg", "branch"], stdout=PIPE).communicate()[0]
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Bison is version 2.5
Flex is version 2.5.35 (Minor version: 35)
OpenFOAM-version: Major 2 Minor 1 Patch x
No swak4FoamParsers/foamVersion4swak.H. Generated
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file helpers/printSwakVersion.C
Making dependency list for source file repositories/SurfacesRepository.C
Making dependency list for source file repositories/SetsRepository.C
Making dependency list for source file repositories/GlobalVariablesRepository.C
Making dependency list for source file ExpressionDriverWriter.C
Making dependency list for source file ExpressionResult/ExpressionResult.C
Making dependency list for source file ExpressionResult/StoredExpressionResult.C
Making dependency list for source file ExpressionResult/DelayedExpressionResult.C
Making dependency list for source file setsAndSurfaces/swakRegistryProxySurface.C
Making dependency list for source file setsAndSurfaces/swakRegistryProxySet.C
Making dependency list for source file FieldValueExpressionParser.yy
could not open file FieldValueExpressionParser.tab.hh for source file FieldValueExpressionParser.yy
could not open file FixedValuePointPatchField.H for source file FieldValueExpressionParser.yy
could not open file ZeroGradientPointPatchField.H for source file FieldValueExpressionParser.yy
could not open file CalculatedPointPatchField.H for source file FieldValueExpressionParser.yy
Making dependency list for source file PatchValueExpressionParser.yy
could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionParser.yy
Making dependency list for source file SubsetValueExpressionParser.yy
could not open file SubsetValueExpressionParser.tab.hh for source file SubsetValueExpressionParser.yy
Making dependency list for source file CommonValueExpressionDriver.C
Making dependency list for source file makeSwakDataEntry.C
Making dependency list for source file FieldValueExpressionLexer.ll
could not open file FieldValueExpressionParser.tab.hh for source file FieldValueExpressionLexer.ll
could not open file FixedValuePointPatchField.H for source file FieldValueExpressionLexer.ll
could not open file ZeroGradientPointPatchField.H for source file FieldValueExpressionLexer.ll
could not open file CalculatedPointPatchField.H for source file FieldValueExpressionLexer.ll
Making dependency list for source file FieldValueExpressionDriver.C
could not open file FieldValueExpressionParser.tab.hh for source file FieldValueExpressionDriver.C
could not open file FixedValuePointPatchField.H for source file FieldValueExpressionDriver.C
could not open file ZeroGradientPointPatchField.H for source file FieldValueExpressionDriver.C
could not open file CalculatedPointPatchField.H for source file FieldValueExpressionDriver.C
Making dependency list for source file PatchValueExpressionLexer.ll
could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionLexer.ll
Making dependency list for source file PatchValueExpressionDriver.C
could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionDriver.C
could not open file FieldValueExpressionParser.tab.hh for source file PatchValueExpressionDriver.C
could not open file FixedValuePointPatchField.H for source file PatchValueExpressionDriver.C
could not open file ZeroGradientPointPatchField.H for source file PatchValueExpressionDriver.C
could not open file CalculatedPointPatchField.H for source file PatchValueExpressionDriver.C
could not open file SubsetValueExpressionParser.tab.hh for source file PatchValueExpressionDriver.C

Am I missing some package? Some infos:
- OF-2.1.x
Code:

uname -a:
Linux master 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux

Code:

ulimit -a:
core file size          (blocks, -c) 0
data seg size          (kbytes, -d) unlimited
scheduling priority            (-e) 0
file size              (blocks, -f) unlimited
pending signals                (-i) 96202
max locked memory      (kbytes, -l) unlimited
max memory size        (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues    (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 65536
cpu time              (seconds, -t) unlimited
max user processes              (-u) 96202
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Code:

gcc --version:
gcc (Debian 4.7.2-5) 4.7.2

Best regards,
Ilya

gschaider August 23, 2013 14:13

Quote:

Originally Posted by linch (Post 447712)
Hi Bernhard,



I have the same problem trying to compile swak4foam: [CODE]No 'swakConfiguration'. Python etc won't work
Checking swak4Foam-version and generating file
Traceback (most recent call last):
File "./maintainanceScripts/makeSwakVersionFile.py", line 8, in <module>
output = Popen(["hg", "branch"], stdout=PIPE).communicate()[0]
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Bison is version 2.5
Flex is version 2.5.35 (Minor version: 35)
OpenFOAM-version: Major 2 Minor 1 Patch x
No swak4FoamParsers/foamVersion4swak.H. Generated

Hm. That is a rather old version of swak you're using. Isn't it? According to the source repository I fixed this last december and since then there have been at least 3 releases.

Anyway. This is only because you have no mercurial installed and doesn't affect the rest of the compilation anyway (the script generates the header file with the version information and in the end it would have said "oh. that didn't change" and left the file alone).

But do yourself a favour: get the latest version

linch August 26, 2013 04:27

1 Attachment(s)
The version was 0.2.3 (next to last according to Swak4Foam-Wiki) and suitable to OF up to 2.2 (2.1 is the one I use).

Now I've got v0.2.4 (release, available via svn, must be the latest one), but the errors are still there.

There are also a couple of other error related to openmpi (see attachment for the full log)
Code:

/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Waitall'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Abort'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_double'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Get_count'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Init'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Probe'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Send'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Allreduce'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_packed'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Buffer_detach'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Bsend'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_byte'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Irecv'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Recv'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_comm_world'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Get_processor_name'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Test'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Isend'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Finalize'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `ompi_mpi_op_sum'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Buffer_attach'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_size'
/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Comm_rank'

. Somehow, swak is looking for the "OF-internal" openmpi, while an external is used. I think I'm missing something.

Best regards,
Ilya

gschaider August 26, 2013 07:02

Quote:

Originally Posted by linch (Post 448039)
The version was 0.2.3 (next to last according to Swak4Foam-Wiki) and suitable to OF up to 2.2 (2.1 is the one I use).

Now I've got v0.2.4 (release, available via svn, must be the latest one), but the errors are still there.

There are also a couple of other error related to openmpi (see attachment for the full log)
Code:

/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/openmpi-system/libPstream.so: undefined reference to `MPI_Waitall'
. Somehow, swak is looking for the "OF-internal" openmpi, while an external is used. I think I'm missing something.

Best regards,
Ilya

Have you ever tried compiling other software than swak with that installation? Because it seems that this is a problem with the installation, not swak. swak doesn't specify which MPI to use but uses the options that wmake automatically generates (have a look for instance at Utilities/replayTransientBC/Make/options - that is one of the links that is failing and it uses only standard-options).

What version of Linux are you using?

linch August 26, 2013 11:06

Thanks Bernhard,

the problem was indeed somewhere else. I was looking for it for a while with our admin, who takes care of the cluster. Finally, his conclusion was that the openmpi installed on the cluster was compiled with intel compiler while OF uses gcc. However, compiling ThirdPartys and src's caused no errors, these errors occurred only while compiling some application and swak4foam. After recompiling the openmpi with gcc, everything was ok.

Nevertheless, the warnings
Quote:

could not open file [...] for source file [...]
are still there. But since there are no errors, I think it's ok.

Thank you for the hints and best regards,
Ilya

bufs July 10, 2015 09:44

groovyBC problems
 
Hi guys,


it's my first time using groovyBC and I'm trying to set up a parabolic profile of inlet velocity. What I'm doing is editing the U file to have the following code for inlet

Code:

inlet
    {
        type              groovyBC;
    variables          "yp = pts().y; minY = min(yp); maxY = max(yp); rad = 0.5*(maxY - minY); vavg = 0.23;";
    valueExpression    "2.0*vavg*(1.0-pow(pos().y/rad, 2))*normal()";
    value              uniform (10 0 0);
    }

and also I edited the controlDict file in system to include

Code:

libs ("libOpenFOAM.so"
      "libsimpleSwakFunctionObjects.so"
      "libswakFunctionObjects.so"
      "libgroovyBC.so"
);

But, when I run the case I get the following message

Code:

Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementSBRStress
Selecting motion diffusion: inverseDistance
Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
Reading field rAU if present

No field sources present


PIMPLE: no residual control data found. Calculations will employ 2 corrector loops


Starting time loop

Courant Number mean: 0.00054139691 max: 0.023902054
deltaT = 0.00011990408
Time = 0.00011990408

DICPCG:  Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0
DICPCG:  Solving for cellDisplacementy, Initial residual = 0, Final residual = 0, No Iterations 0
word::stripInvalid() called for word yp
    For debug level (= 2) > 1 this is considered fatal
Aborted (core dumped)

Anyone knows what I'm doing wrong?

Navip August 23, 2015 22:41

Hi Bernhard,

I use openfoam/2.3.0 on a virtual machine (MASSIVE). I try to implement a zero flux condition via swaf4foam. I have swak4foam/2.3.0. I guess it is well installed as the answer to the command module show swak4foam/2.3.0

-------------------------------------------------------------------
/usr/local/Modules/modulefiles/swak4foam/2.3.0:

conflict swak4foam
module load openfoam/2.3.0
module load bison
module-whatis An OpenFOAM library that combines the functionality of groovyBC (boundary conditions) and funkySetFields (set fields) (v2.3.0)
prepend-path LD_LIBRARY_PATH /usr/local/swak4foam/2.3.0/lib
prepend-path PATH /usr/local/swak4foam/2.3.0/bin
prepend-path MANPATH /usr/local/swak4foam/2.3.0/man
setenv GCONV_PATH /usr/lib64/gconv/
setenv SWAK4FOAM_SRC /usr/local/swak4foam/2.3.0/Libraries
-------------------------------------------------------------------





So the installation seems to be complete. When I try to set up the path of the plug-in

libs (
"libgroovyBC.so"
);

I have a FOAM:WARNING

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libgroovyBC.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libgroovyBC.so"

The foam warning doesn't stop the program as this isn't a fatal error. But I need to use this groovyBC for my boundary condition. My boundary condition is:

upperWall
{
type groovyBC;
value uniform (0 0 0);
valueExpression "0.001*T-DT*fvc::snGrad(T)"
}

And as expected I now have a fatal error:

--> FOAM FATAL IO ERROR:
Unknown patchField type groovyBC for patch type patch

Valid patchField types are :.......


Do you have any idea how I can solve this problem? Why do I receive a foam warning for the .so file while swak4foam is apparently well installed.

smodh March 6, 2017 10:03

groovyBC or codedfixedValue
 
Hello Foamers,

I want to implement a boundary condition at electrode.

N_P= K * Efield * N_P

I am solving following equation with modified pisoFoam.

(fvm::ddt(N_P)) + (fvm::div(phi+(K*Efield), N_P))

and for the electrode, I have to implent following BC, N_P = K * Efield * N_P.
so my BC condition will change with every time step.

In this equation N_P and Efield " need to be taken from electrode at previous time step and K is dimensionedScalar fix value 1.

Should I have to used codedfixed BC or some other BC? I have also trying groovyBC but I am failed.
is there anyone know how to implemrnt this BC?
Thanks in advance.


All times are GMT -4. The time now is 04:06.