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/)
-   -   Duplicate entry SpalartAllmaras in runtime selection table LESModel (https://www.cfd-online.com/Forums/openfoam-programming-development/145790-duplicate-entry-spalartallmaras-runtime-selection-table-lesmodel.html)

wenxu December 12, 2014 04:23

Duplicate entry SpalartAllmaras in runtime selection table LESModel
 
Hello,everyone.
I encounter the problem which had troubled me for some time, and i also searched the forum but i did not get any clear answer. So i started a new post here. Every one could give me some suggestions even if you did not encounter this problem.:)

My Make/options is as follows:
Quote:

EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_FLAMELETPCC_SRC)/turbulenceModels/compressible/turbulenceModel \
-I/root/OpenFOAM/root-2.3.0/src/flameletPCC/flameletIntermediate/lnInclude \
-I/root/OpenFOAM/root-2.3.0/src/flameletPCC/coalCombustion/lnInclude \
-I$(LIB_FLAMELETPCC_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_FLAMELETPCC_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_FLAMELETPCC_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_FLAMELETPCC_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_FLAMELETPCC_SRC)/combustionModels/lnInclude

Quote:

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lFlameletPCCcompressibleTurbulenceModel \
-lFlameletPCCcompressibleLESModels \
-lFlameletPCCcompressibleRASModels \
-lFlameletPCCreactionThermophysicalModels \
-lFlameletPCCspecie \
-lFlameletPCCbasicThermophysicalModels \
-lFlameletPCCchemistryModel \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lflameletPCCintermediate \
-lflameletPCCcoalCombustion\
-lFlameletPCCCombustionModels
Where the LIB_FLAMELETPCC_SRC is the envierment to my local src case.
The library was compiled with no problem, but when i run the solver , I encounter the following error:
Quote:

Duplicate entry SpalartAllmaras in runtime selection table LESModel
#0 /opt/openfoam230/platforms/linuxGccDPOpt/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+ 0x29) [0xb4893ca9]
#1 /root/OpenFOAM/root-2.3.0/platforms/linuxGccDPOpt/lib/libFlameletPCCcompressibleLESModels.so(+0x448f3) [0xb76158f3]
#2 /lib/ld-linux.so.2(+0xeeab) [0xb77a8eab]
#3 /lib/ld-linux.so.2(+0xef94) [0xb77a8f94]
#4 /lib/ld-linux.so.2(+0x120f) [0xb779b20f]
Duplicate entry vanDriest in runtime selection table foamLESdelta
#0 /opt/openfoam230/platforms/linuxGccDPOpt/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+ 0x29) [0xb4893ca9]
#1 /root/OpenFOAM/root-2.3.0/platforms/linuxGccDPOpt/lib/libFlameletPCCcompressibleLESModels.so(+0x44b0b) [0xb7615b0b]
#2 /lib/ld-linux.so.2(+0xeeab) [0xb77a8eab]
#3 /lib/ld-linux.so.2(+0xef94) [0xb77a8f94]
#4 /lib/ld-linux.so.2(+0x120f) [0xb779b20f]
Many errors to list here.

The second error is as follows:
Quote:

Selecting turbulence model type LESModel
Selecting LES turbulence model Smagorinsky
Selecting LES delta type vanDriest
Selecting LES delta type cubeRootVol
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam230/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam230/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::compressible::LESModels::Smagorinsky::update SubGridScaleFields(Foam::GeometricField<Foam::Tens or<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/root/OpenFOAM/root-2.3.0/platforms/linuxGccDPOpt/lib/libFlameletPCCcompressibleLESModels.so"
#4 Foam::compressible::LESModels::Smagorinsky::Smagor insky(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&, Foam::word const&) in "/opt/openfoam230/platforms/linuxGccDPOpt/lib/libcompressibleLESModels.so"
#5 Foam::compressible::LESModel::adddictionaryConstru ctorToTable<Foam::compressible::LESModels::Smagori nsky>::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam230/platforms/linuxGccDPOpt/lib/libcompressibleLESModels.so"
#6 Foam::compressible::LESModel::New(Foam::GeometricF ield<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam230/platforms/linuxGccDPOpt/lib/libcompressibleLESModels.so"
#7 Foam::compressible::turbulenceModel::addturbulence ModelConstructorToTable<Foam::compressible::LESMod el>::NewturbulenceModel(Foam::GeometricField<doubl e, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/opt/openfoam230/platforms/linuxGccDPOpt/lib/libcompressibleLESModels.so"
#8 Foam::compressible::turbulenceModel::New(Foam::Geo metricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo&, Foam::word const&) in "/root/OpenFOAM/root-2.3.0/platforms/linuxGccDPOpt/lib/libFlameletPCCcompressibleTurbulenceModel.so"
#9
Please give me some suggestions. Thank you in advance!

regards,
wen

wenxu December 13, 2014 01:29

Have solved it!

matzbanni May 15, 2015 07:41

And how did you solve it?

wenxu May 15, 2015 08:10

We had used two library, one is the standard library, the other one is the library in our own $HOME/SRC.

For example: in my case, [QUOTE-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \][/QUOTE]
These are standard library in $(LIB_SRC). We should COPY these standard libraries in our own library folder and substitute these standard library with own library, say, $(LIB_YOUOWM_SRC), Then in the solver, you should use these libraries: $(LIB_YOUOWM_SRC), BUT not: $(LIB_SRC)


please do not forget define $(LIB_YOUOWM_SRC) in your .bashrc like:
export $(LIB_YOUOWM_SRC) = $HOME/your run case library path/src

Good luck!

Xu

skeptik May 29, 2015 08:31

To whom it may concern...

When you re-use some code, better to re-name name of the classes and functions. So such errors does not appear.

You can take a look at Jens Höpken presentation "A brief introduction on the basic structure of functionObjects" where he suggests

Quote:

Code re-use I
1 Start your favourite OpenFOAM version terminal
2 Find the existing forces functionObject:
src ; find . -name "forces.H" | grep -v "lnInclude"
3 Goto your user directory: cd $WM_PROJECT_USER_DIR
4 Create the directory for your sources:
mkdir -p src/customForces
5 Change to this directory: cd src/customForces
6 Copy the content of the directory containing forces.H
7 Delete all *.dep files: rm *.dep

Code re-use II
1 Rename all *forces*.[H,C] to *customForces*.[H,C]
2 In all files, replace forces by customForces
For Vim users: %s/forces/customForces/g
3 In all files, replace calccustomForcesMoments by
calcForcesMoments
4 Create Make folder with two empty files in it: files and options
5 Adjust Make/files to:
customForces.C
customForcesFunctionObject.C
LIB = $(FOAM_USER_LIBBIN)/libcustomForces
So there are two classes with different name forces and customForces in namespace. The classes are identical but there are no errors with it. And you can keep re-use and rewrite original code to get something suitable.

matzbanni May 29, 2015 08:34

Quote:

Originally Posted by skeptik (Post 548177)
To whom it may concern...

When you re-use some code, better to re-name name of the classes and functions. So such errors does not appear.

You can take a look at Jens Höpken presentation "A brief introduction on the basic structure of functionObjects" where he suggests



So there are two classes with different name forces and customForces in namespace. The classes are identical but there are no errors with it. And you can keep re-use and rewrite original code to get something suitable.

Thanks for your input! In my case I forgot to build a custom swak4foam-version for my sample-utilities...

Best Regards


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