我想用rhocentralfoamlts,稳态的求解器,但是编译的时候有错误提示,不知道什么原因。



  • cc@ubuntu:~/Downloads/rhoCentralLTS-OF-2.1$ wmake
    Making dependency list for source file rhoCentralLTS.C
    SOURCE=rhoCentralLTS.C ;  g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/dynamicMesh/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linuxGccDPOpt/rhoCentralLTS.o
    In file included from createFields.H:35:0,
                     from rhoCentralLTS.C:48:
    rhoBoundaryTypes.H: In function ‘int main(int, char**)’:
    rhoBoundaryTypes.H:12:36: error: ‘fixedRhoFvPatchScalarField’ has not been declared
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:35:8: warning: unused variable ‘maxCo’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
    make: *** [Make/linuxGccDPOpt/rhoCentralLTS.o] Error 1
    cc@ubuntu:~/Downloads/rhoCentralLTS-OF-2.1$ cd ..
    cc@ubuntu:~/Downloads$ wmake
    wmake error: 'Make' directory does not exist in /home/cc/Downloads
    cc@ubuntu:~/Downloads$ cd rhoCentralLTS-OF-2.1/
    cc@ubuntu:~/Downloads/rhoCentralLTS-OF-2.1$ wmake
    SOURCE=rhoCentralLTS.C ;  g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/dynamicMesh/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linuxGccDPOpt/rhoCentralLTS.o
    In file included from createFields.H:35:0,
                     from rhoCentralLTS.C:48:
    rhoBoundaryTypes.H: In function ‘int main(int, char**)’:
    rhoBoundaryTypes.H:12:36: error: ‘fixedRhoFvPatchScalarField’ has not been declared
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:35:8: warning: unused variable ‘maxCo’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
    make: *** [Make/linuxGccDPOpt/rhoCentralLTS.o] Error 1
    cc@ubuntu:~/Downloads/rhoCentralLTS-OF-2.1$ wmake
    SOURCE=rhoCentralLTS.C ;  g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam211/src/finiteVolume/lnInclude -I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam211/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam211/src/dynamicMesh/lnInclude -I/opt/openfoam211/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linuxGccDPOpt/rhoCentralLTS.o
    In file included from createFields.H:35:0,
                     from rhoCentralLTS.C:48:
    rhoBoundaryTypes.H: In function ‘int main(int, char**)’:
    rhoBoundaryTypes.H:12:36: error: ‘fixedRhoFvPatchScalarField’ has not been declared
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:32:12: warning: unused variable ‘adjustTimeStep’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:35:8: warning: unused variable ‘maxCo’ [-Wunused-variable]
    /opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
    make: *** [Make/linuxGccDPOpt/rhoCentralLTS.o] Error 1
    cc@ubuntu:~/Downloads/rhoCentralLTS-OF-2.1$


  • ‘fixedRhoFvPatchScalarField’ has not been declared
    

    你需要声明这个场



  • @赵一铭 你好,我这个是从群里下载的,从来没有编译过,应该是直接可以用的那,这个怎么弄



  • @小葱小虫

    2个原因:
    1.版本不对。你看看是不是你们能用的一个openfoam版本。
    2.代码缺失。有可能有一些类库你没有哦。