湍流模型编译通过但是在计算的时候显示不能加载动态库
-
请教各位老师,在DES模型的基础上做了修改,wmake后:
wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file myTurbulentTransportModels.C g++ -std=c++11 -m64 -DOPENFOAM=1806 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I../turbulenceModels/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/transportModels -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/finiteVolume/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/meshTools/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/TurbulenceModels/incompressible/lnInclude -IlnInclude -I. -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/OpenFOAM/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/OSspecific/POSIX/lnInclude -fPIC -c turbulentTransportModels/myTurbulentTransportModels.C -o Make/linux64GccDPInt64Opt/turbulentTransportModels/myTurbulentTransportModels.o g++ -std=c++11 -m64 -DOPENFOAM=1806 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I../turbulenceModels/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/transportModels -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/finiteVolume/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/meshTools/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/TurbulenceModels/incompressible/lnInclude -IlnInclude -I. -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/OpenFOAM/lnInclude -I/home/fxr/OpenFOAM/OpenFOAM-v1806/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt64Opt/turbulentTransportModels/myTurbulentTransportModels.o -L/home/fxr/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt64Opt/lib \ -lincompressibleTransportModels -lturbulenceModels -lfiniteVolume -lmeshTools -lincompressibleTurbulenceModels -o /home/fxr/OpenFOAM/fxr-v1806/platforms/linux64GccDPInt64Opt/lib/test1_libIncompressibleTurbulenceModels.so
以上编译应该是没问题的,但是当我在算例中调用新的湍流模型后就报错:
Create time --> FOAM Warning : From function void* Foam::dlOpen(const Foam::fileName&, bool) in file POSIX.C at line 1516 dlopen error : /home/fxr/OpenFOAM/fxr-v1806/platforms/linux64GccDPInt64Opt/lib/test1_libIncompressibleTurbulenceModels.so: undefined symbol: _ZNK4Foam9LESModels17kOmegaSSTIDDES_TrINS_29IncompressibleTurbulenceModelINS_14transportModelEEEE5GbyNuERKNS_16DimensionedFieldIdNS_7volMeshEEESA_SA_ --> FOAM Warning : From function bool Foam::dlLibraryTable::open(const Foam::fileName&, bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 109 could not load "test1_libIncompressibleTurbulenceModels.so" Create mesh for time = 0 PIMPLE: no residual control data found. Calculations will employ 5 corrector loops Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting turbulence model type LES [0] [0] [0] --> FOAM FATAL ERROR: [0] Unknown LESModel type banana Valid LESModel types: 12 ( DeardorffDiffStress Smagorinsky SpalartAllmarasDDES SpalartAllmarasDES SpalartAllmarasIDDES WALE dynamicKEqn dynamicLagrangian kEqn kOmegaSSTDDES kOmegaSSTDES kOmegaSSTIDDES )
而且可以看到有效模型里面并没有出现自己修改的湍流模型,请问各位老师是什么原因???
make/files如下turbulentTransportModels/myTurbulentTransportModels.C LIB = $(FOAM_USER_LIBBIN)/test1_libIncompressibleTurbulenceModels
make/options如下
EXE_INC = \ -I../turbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude LIB_LIBS = \ -lincompressibleTransportModels \ -lturbulenceModels \ -lfiniteVolume \ -lmeshTools \ -lincompressibleTurbulenceModels
用的openfoam1806,感谢