CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Error Duplicate entry swirlFlowRateInletVelocity (https://www.cfd-online.com/Forums/openfoam-programming-development/190247-error-duplicate-entry-swirlflowrateinletvelocity.html)

ggulgulia July 8, 2017 10:59

Error Duplicate entry swirlFlowRateInletVelocity
 
Hello Foamer's,

I am trying to compile and use a custom patch type for a swril boundary condition. I do the following steps for it:

1. Copy the .C and .H file in a suitable user directory.
2. In the same directory I create a Make/options and Make/files with following contents:

Make/options
Code:

EXE_INC = \
    -I$(LIB_SRC)/finiteVolume/lnInclude\
    -I$(LIB_SRC)/finiteVolume/lnInclude
   
EXE_LIBS =

Make/files
Code:

swirlFlowRateInletVelocityFvPatchVectorField.C

LIB_LIB = $(FOAM_USER_LIBBIN)/swirlFlowRateInletVelocity

3. In the directory where .C and .H files are kept i type : wmake libso to compile the patch. From the compilation message every thing seems ok.

4. Next I add the code
Code:

libs ("swirlFlowRateInletVelocity.so");
in my system/controlDict.

As far as I know, these are the steps needed for compilation of the boundary.

Now when I type blockMesh on the terminal, I get the error :

Code:

Running blockMesh on /home/gajendra/Desktop/sfgsg
Duplicate entry swirlFlowRateInletVelocity in runtime selection table fvPatchField
#0    /opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x3e) [0x7fa931a9f2ee]
#1    /home/gajendra/OpenFOAM/gajendra-4.1/platforms/linux64GccDPInt32Opt/lib/swirlFlowRateInletVelocity.so(+0xe872) [0x7fa92b845872]
#2    /lib64/ld-linux-x86-64.so.2(+0x106ba) [0x7fa932b4f6ba]
#3    /lib64/ld-linux-x86-64.so.2(+0x107cb) [0x7fa932b4f7cb]
#4    /lib64/ld-linux-x86-64.so.2(+0x158e2) [0x7fa932b548e2]
#5    /lib64/ld-linux-x86-64.so.2(+0x10564) [0x7fa932b4f564]
#6    /lib64/ld-linux-x86-64.so.2(+0x14da9) [0x7fa932b53da9]
#7    /lib/x86_64-linux-gnu/libdl.so.2(+0xf09) [0x7fa9311b2f09]
#8    /lib64/ld-linux-x86-64.so.2(+0x10564) [0x7fa932b4f564]
#9    /lib/x86_64-linux-gnu/libdl.so.2(+0x1571) [0x7fa9311b3571]
#10    /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x31) [0x7fa9311b2fa1]
#11    /opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam6dlOpenERKNS_8fileNameEb+0x2f) [0x7fa931a9927f]
#12    /opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_8fileNameEb+0x2b) [0x7fa93174030b]
#13    /opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_10dictionaryERKNS_4wordE+0xbd) [0x7fa93174052d]
#14    /opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam4TimeC1ERKNS_4wordERKNS_7argListES3_S3_+0x4b4) [0x7fa931768244

If anybody can suggest where am I going wrong, it will be really helpful.

Thank you

khedar July 9, 2017 07:26

You cannot keep the library name same as that of an existing library. In your case you need to change
Code:

LIB_LIB = $(FOAM_USER_LIBBIN)/swirlFlowRateInletVelocity
and also change the names of the .C and .H files along with the names inside those file. There are a lot of tutorials on creating custom b.c., please understand them carefully to avoid these simple errors.

ggulgulia July 9, 2017 11:54

Hello Khedar,

Thanks for the reply. I was of the impression that swirlFlowRateInletVelocity was not available in my version of openFoam. I guess then I don't need to create anything new here.

Best
Gajendra


All times are GMT -4. The time now is 03:52.