Python API
このページでは、代表的な Python API の使い方を示します。API 名、JSON key、ファイル名は翻訳せず、そのまま記載します。
run_file
最も基本的な実行方法です。
import eMachineSim
result = eMachineSim.run_file(
r"Examples\thermal\bdf\input_sample_bdf_min_hexa_qvol.json",
r"Examples\thermal\bdf",
)
Thermal API
result = eMachineSim.thermal.run_file(input_json, run_directory)
result = eMachineSim.thermal.run_bdf(input_json, run_directory)
thermal workflow では、BDF/QVOL import、JSON volume heat source、FEMH、thermal network、gap coupling などを扱います。
Structural API
result = eMachineSim.structural.run_file(input_json, run_directory)
result = eMachineSim.structural.run_static(input_json, run_directory)
structural workflow では、遠心力、拘束条件、displacement、von Mises stress などを確認します。
Modal / NVH API
result = eMachineSim.modal.run_file(input_json, run_directory)
result = eMachineSim.modal.run(input_json, run_directory)
modal / NVH workflow では、natural frequency、mode shape、force mapping、frequency response、simplified acoustic indicator を確認します。
Session
session = eMachineSim.Session()
session.initialize(input_json, run_directory)
result = session.solve()
session.finalize()
Session.solve() は、初期化済み session で解析を実行します。条件を patch して連続実行する場合は update_input() を併用します。
Result object
戻り値には、実行状態、出力ディレクトリ、主要ファイルの情報などが含まれます。詳細な数値は CSV diagnostics を確認してください。