This repository has been archived on 2022-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
openfoam_project/openfoam/run/blockmesh.py

17 lines
413 B
Python

import subprocess as sp
import logging
def blockmesh(case_dir):
blockmesh_log = logging.getLogger('blockMesh')
proc = sp.Popen(
('blockMesh'),
cwd=case_dir,
stdout=sp.PIPE,
stderr=sp.PIPE,
text=True,
)
for line in proc.stdout:
blockmesh_log.info(line[:-1])
for line in proc.stderr:
blockmesh_log.error(line[:-1])
return proc.wait()