wmake错误:对rhotabularThermo::rho(int) const未定义的引用
-
大家好,
我新编译了一个物性库,没有报错。
但是想要用求解器调用这个库一起编译的时候,报错:/home/dyfluid/OpenFOAM/dyfluid-5.x/platforms/linux64GccDPInt32Opt/lib/librhoTabularThermophysicalModels.so:对‘Foam::rhotabularThermo::rho(int) const’未定义的引用
我在options添加了这个库的相关头文件与路径。在库代码中相关的信息:
.H文件:
.C文件:
不知道为何会提示这个错误,另外我使用外挂这个库的方法时,提示unknown rhoThermo type,我比对了makeThermos的组合类型,没有拼错,十分疑惑,还望指点。
-
@东岳
Foam::tmp<Foam::volScalarField> Foam::rhotabularThermo::rho() const { volScalarField rho_ = lookupOrConstruct2 ( T_.mesh(), phasePropertyName("thermo:rho_").c_str(), dimensionSet(1, -1, -2, 0, 0) ); volScalarField T_back = lookupOrConstruct2 ( T_.mesh(), phasePropertyName("thermo:T_back").c_str(), dimensionSet(0, 0, 0, 1, 0) ); volScalarField p_back = lookupOrConstruct2 ( T_.mesh(), phasePropertyName("thermo:p_back").c_str(), dimensionSet(1, -3, 0, 0, 0) ); /* Check if the temperature or pressure fields have changed since the last iteration. */ forAll(T_, faceI) { if(T_[faceI] != T_back[faceI] || p_[faceI] != p_back[faceI]) { //Info << "difference" << endl; forAll(T_, faceI2) { rho_[faceI2] = densityTable(T_[faceI2], p_[faceI2]); T_back[faceI2] = T_[faceI2]; p_back[faceI2] = p_[faceI2]; } return rho_; } } return rho_; }
整个代码片段是这样的
-
问题已解决。
在.C文件中少了下面这段代码:Foam::tmp<Foam::scalarField> Foam::rhotabularThermo::rho(const label patchi) const { return rho_.boundaryField()[patchi]; }