跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 计算工程、金融与科学

arXiv:2203.16394 (cs)
[提交于 2022年3月30日]

标题:A general approach for running Python codes in OpenFOAM using an embedded pybind11 Python interpreter

作者:Simon Rodriguez, Philip Cardiff
查看论文《A general approach for running Python codes in OpenFOAM using an embedded pybind11 Python interpreter》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:As the overlap between traditional computational mechanics and machine learning grows, there is an increasing demand for straight-forward approaches to interface Python-based procedures with C++-based OpenFOAM. This article introduces one such general methodology, allowing the execution of Python code directly within an OpenFOAM solver without the need for Python code translation. The proposed approach is based on the lightweight library pybind11, where OpenFOAM data is transferred to an embedded Python interpreter for manipulation, and results are returned as needed. Following a review of related approaches, the article describes the approach, with a particular focus on data transfer between Python and OpenFOAM, executing Python scripts and functions, and practical details about the implementation in OpenFOAM. Three complementary test cases are presented to highlight the functionality and demonstrate the effect of different data transfer approaches: a Python-based velocity profile boundary condition; a Python-based solver for prototyping; and a machine learning mechanical constitutive law class for solids4foam which performs field calculations.
评论: Preprint submitted to OpenFOAM Journal
主题: 计算工程、金融与科学 (cs.CE)
引用方式: arXiv:2203.16394 [cs.CE]
  (或者 arXiv:2203.16394v1 [cs.CE] 对于此版本)
  https://doi.org/10.48550/arXiv.2203.16394
相关 DOI: https://doi.org/10.51560/ofj.v2.79

提交历史

来自:Simon Antonio Rodriguez Luzardo
[v1] 2022年3月30日 星期三 15:25:03 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.CE
< 上一篇   |   下一篇 >
最新 | 近期 | 2022-03
切换浏览方式为:
cs

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站