OpenFoam6安装swak4Foam
作者:互联网
OpenFoam6安装swak4Foam
一个结合了groovyBC和funkySetFields功能的库:它为用户提供了指定涉及字段的表达式并计算它们的可能性。这个库提供了许多实用程序(例如funkySetFields使用表达式设置字段)、边界条件(groovyBC根据表达式指定任意边界条件)和函数对象,这些工具允许做许多需要编程的事情。
提示:以下是本篇文章正文内容,下面案例可供参考
一、准备工作
代码如下(示例):
sudo apt update
sudo apt install snapd
sudo snap install hello-world
sudo snap install mercurial
sudo apt-get install python-is-python3
链接:https://snapcraft.io/docs/installing-snap-on-ubuntu
二、安装swak4Foam
代码如下(示例):
//在~/OpenFoam文件夹安装swak4Foam
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam
cd swak4Foam
./AllwmakeAll
链接: https://openfoamwiki.net/index.php/Contrib/swak4Foam
三、测试是否安装成功swak4Foam
代码如下(示例):
//测试是否安装成功
funkySetFields
//安装成功会报错然后显示版本号 安装在了of6下面
dyfluid@dyfluid-virtual-machine:~/OpenFOAM/swak4Foam $ funkySetFields
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 6-db8dc6436097
Exec : funkySetFields
Date : Jun 28 2021
Time : 18:35:47
Host : "dyfluid-virtual-machine"
PID : 55100
I/O : uncollated
Case : /home/dyfluid/OpenFOAM/swak4Foam
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
swakVersion: 2021.05 (Release date: 2021-05-31)
// *
四、OpenFOAM8下面安装swak4Foam没成功
代码如下(示例):
//如果安装错了of版本下的swak4Foan想换成of8版本
of8
./Allwclean
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam swak4Foam
cd swak4Foam
./AllwmakeAll
//报错
In file included from funkyPythonPostproc.C:41:0:
../../Libraries/languageIntegration/swakPythonIntegration/lnInclude/pythonInterpreterWrapper.H:49:20: fatal error: Python.h: 没有那个文件或目录
#include "Python.h"
//把python设置为python2.7
sudo apt-get install python-is-python2
./AllwmakeAll
//
cd ~/swak4Foam/Libraries
./Allwclean
./Allwmake
ls $FOAM_USER_LIBBIN
//libgroovyBC.so /swak4Foam
gedit /home/dyfluid/OpenFOAM/swak4Foam/Libraries/languageIntegration/swakPythonIntegration/Make/options
//add -I/urs/bin/python
//fatal error: Python.h: No such file or directory
sudo apt-get install python3-dev # for python3.x installs
sudo apt-get install python-dev # for python2.x installs
//解决python-dev无法安装(依赖关系)
sudo apt-get install aptitude
sudo aptitude install python-dev
wmake Utilities/funkySetFields
//报错
OpenFOAM.org version 8
OpenFOAM.org version 8
OpenFOAM.org version 8
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -IMake/linux64GccDPInt32Opt -I/home/dyfluid/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-8/src/sampling/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-8/src/meshTools/lnInclude -I../../Libraries/swak4FoamParsers/lnInclude/ -IlnInclude -I. -I/home/dyfluid/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude -I/home/dyfluid/OpenFOAM/OpenFOAM-8/src/OSspecific/POSIX/lnInclude -fPIC -fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/funkySetFields.o -L/home/dyfluid/OpenFOAM/OpenFOAM-8/platforms/linux64GccDPInt32Opt/lib \
-lfiniteVolume -lmeshTools -lsampling -L/home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/lib -lswak4FoamParsers -lOpenFOAM -ldl \
-lm -o /home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/bin/funkySetFields
/usr/bin/ld.bfd: /home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/lib/libswak4FoamParsers.so: undefined reference to `Foam::UOPstream::writeQuoted(std::string const&, bool)'
/usr/bin/ld.bfd: /home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/lib/libswak4FoamParsers.so: undefined reference to `Foam::fileName::operator=(std::string const&)'
/usr/bin/ld.bfd: /home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/lib/libswak4FoamParsers.so: undefined reference to `Foam::operator<<(Foam::Ostream&, std::string const&)'
/usr/bin/ld.bfd: /home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/lib/libswak4FoamParsers.so: undefined reference to `Foam::prefixOSstream::writeQuoted(std::string const&, bool)'
collect2: error: ld returned 1 exit status
make: *** [/home/dyfluid/OpenFOAM/OpenFOAM-8/wmake/makefiles/general:142:/home/dyfluid/OpenFOAM/dyfluid-8/platforms/linux64GccDPInt32Opt/bin/funkySetFields] 错误 1
gedit /home/dyfluid/OpenFOAM/swak4Foam/Utilities/funkySetFields/Make/options
总结
主要介绍了在OpenFOAM6下面安装swak4Foam的步骤和常见报错
@OpenFoam6安装swak4Foam
标签:OpenFoam6,sudo,OpenFOAM,dyfluid,install,swak4Foam,home,安装 来源: https://blog.csdn.net/zq93538196/article/details/118310086