Thx. 应该不是环境变量的问题。我是win 10 下的Ubuntu 22.04 wls2,自己的电脑。
我重新make了下,仔细看了下error,是源文件中有错误,是不是不修改这个错误就无法调用sdfibm求解器呢?
这是尝试调用的情况:
wx@DESKTOP-448V5SB:/mnt/c/Users/miss_/Desktop/falling_ellipse$ sdfibm
-bash: /usr/local/bin/sdfibm: Permission denied
wx@DESKTOP-448V5SB:/mnt/c/Users/miss_/Desktop/falling_ellipse$ sudo sdfibm
sudo: sdfibm: command not found
wx@DESKTOP-448V5SB:/mnt/c/Users/miss_/Desktop/falling_ellipse$ ls ~ /usr/local/bin/
/home/wx:
''$'\001\020''3@pu'$'\001''@8'$'\r''@'$'\036\035\006\004''@@@�'$'\002''�'$'\002\b\003\004\030\003\030\003\030\003\034\034\001\001\004''�'$'\037''�'$'\037\020\001\005'
OpenFOAM
sdfibm
/usr/local/bin/:
sdfibm
附上make情况:
make -C libcollision
make[1]: Entering directory '/home/wx/sdfibm/src/libcollision'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/wx/sdfibm/src/libcollision'
make -C libmotion
make[1]: Entering directory '/home/wx/sdfibm/src/libmotion'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/wx/sdfibm/src/libmotion'
make -C libshape
make[1]: Entering directory '/home/wx/sdfibm/src/libshape'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/wx/sdfibm/src/libshape'
g++ -m64 -Dlinux32 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -DNoRepository -ftemplate-depth-100 -fPIC -std=c++11 -DWM_ARCH_OPTION=64 -DWM_LABEL_SIZE=32 -s -O3 main.cpp -o main.o -I. -IlnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/dynamicFvMesh/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/OSspecific/POSIX/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/meshTools/lnInclude -c
In file included from main.cpp:9:0:
createFields.h: In function ‘int main(int, char**)’:
createFields.h:20:58: warning: ‘Foam::dimensioned<Type>::dimensioned(Foam::Istream&) [with Type = double]’ is deprecated: Since 2018-11 [-Wdeprecated-declarations]
dimensionedScalar nu (transportProperties.lookup("nu") );
^
In file included from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.H:565:0,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedScalar.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/TimeState.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/Time.H:50,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvCFD.H:6,
from main.cpp:1:
/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.C:275:1: note: declared here
Foam::dimensioned<Type>::dimensioned(Istream& is)
^~~~
In file included from main.cpp:9:0:
createFields.h:23:58: warning: ‘Foam::dimensioned<Type>::dimensioned(Foam::Istream&) [with Type = double]’ is deprecated: Since 2018-11 [-Wdeprecated-declarations]
dimensionedScalar rho (transportProperties.lookup("rho"));
^
In file included from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.H:565:0,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedScalar.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/TimeState.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/Time.H:50,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvCFD.H:6,
from main.cpp:1:
/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.C:275:1: note: declared here
Foam::dimensioned<Type>::dimensioned(Istream& is)
^~~~
In file included from main.cpp:9:0:
createFields.h:24:60: warning: ‘Foam::dimensioned<Type>::dimensioned(Foam::Istream&) [with Type = double]’ is deprecated: Since 2018-11 [-Wdeprecated-declarations]
dimensionedScalar alpha(transportProperties.lookup("alpha"));
^
In file included from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.H:565:0,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedScalar.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/TimeState.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/Time.H:50,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvCFD.H:6,
from main.cpp:1:
/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.C:275:1: note: declared here
Foam::dimensioned<Type>::dimensioned(Istream& is)
^~~~
g++ -m64 -Dlinux32 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -DNoRepository -ftemplate-depth-100 -fPIC -std=c++11 -DWM_ARCH_OPTION=64 -DWM_LABEL_SIZE=32 -s -O3 solidcloud.cpp -o solidcloud.o -I. -IlnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/dynamicFvMesh/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/OSspecific/POSIX/lnInclude -I/home/wx/OpenFOAM/OpenFOAM-v1912/src/meshTools/lnInclude -c
solidcloud.cpp: In member function ‘void sdfibm::SolidCloud::initFromDictionary(const Foam::word&)’:
solidcloud.cpp:28:5: error: ‘IFstream’ is not a member of ‘Foam’
Foam::IFstream ifstream = Foam::IFstream(dictfile);
^~~~
solidcloud.cpp:29:30: error: ‘ifstream’ was not declared in this scope
dictionary root(ifstream());
^
solidcloud.cpp:29:30: note: suggested alternative:
In file included from /home/wx/OpenFOAM/ThirdParty-v1912/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/iomanip:39:0,
from solidcloud.cpp:3:
/home/wx/OpenFOAM/ThirdParty-v1912/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/iosfwd:162:34: note: ‘std::ifstream ’
typedef basic_ifstream<char> ifstream;
^~~~~~~~
solidcloud.cpp: In member function ‘void sdfibm::SolidCloud::linkFluid(const volVectorField&)’:
solidcloud.cpp:587:77: error: invalid initialization of reference of type ‘const dimensionedScalar& {aka const Foam::dimensioned<double>&}’ from expression of type ‘Foam::ITstream’
const Foam::dimensionedScalar& density = transportProperties.lookup("rho");
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
solidcloud.cpp: In member function ‘void sdfibm::SolidCloud::interact(const real&, const real&)’:
solidcloud.cpp:618:19: error: ambiguous overload for ‘operator=’ (operand types are ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ and ‘int’)
(*m_ptr_ct) = 0;
^
In file included from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/GeometricField.H:774:0,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/GeometricScalarField.H:40,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/GeometricFields.H:40,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/volFields.H:39,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvMatrix.H:46,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvmDdt.H:41,
from /home/wx/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvm.H:45,
from solidcloud.h:10,
from solidcloud.cpp:8:
/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/GeometricField.C:1188:6: note: candidate: void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=(const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
^~~~
/home/wx/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/GeometricField.C:1224:6: note: candidate: void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=(const Foam::dimensioned<Type>&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
^~~~
make: *** [Makefile:56: solidcloud.o] Error 1
再次感谢