我想围绕OpenFoam创建一个更大的应用程序,考虑到网格化是使用Python完成的,我希望将./Allrun脚本包含到我的Python文件中。第一个输入是导入python中的os并从./Allrun脚本中插入命令。然而,我只遇到以下错误消息:
./Allrun: line 5: /bin/tools/RunFunctions: No such file or directory
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'
--> FOAM FATAL ERROR :
Could not find mandatory etc entry (mode=ugo)
'controlDict'这是Python代码:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
os.system("./Allrun")还有我的./Allrun脚本:
#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
gmshToFoam constant/pipeHex.msh
createPatch -overwrite我认为这个问题与路径有关,但我不知道如何解决这个问题。
任何帮助都是非常感谢的!
发布于 2022-10-21 07:43:47
经过一番挖掘,我自己找到了解决办法。据信,这条路是以某种方式解决问题的,结果证明这是真的。添加
source /opt/openfoam9/etc/bashrc成功了。
https://stackoverflow.com/questions/74139772
复制相似问题