2021-05-31 17:12:31 +05:00
|
|
|
from .application import application
|
|
|
|
|
2021-05-26 22:02:44 +05:00
|
|
|
import re
|
2021-05-26 17:18:39 +05:00
|
|
|
|
|
|
|
def potentialFoam(case: str = None):
|
|
|
|
application("potentialFoam", "-parallel", useMPI = True, case = case, stderr = True)
|
|
|
|
|
|
|
|
|
|
|
|
def simpleFoam(case: str = None):
|
|
|
|
_, returncode = application("simpleFoam", "-parallel", useMPI = True, case = case, stderr = True)
|
2021-05-26 22:02:44 +05:00
|
|
|
out = ""
|
2021-05-26 17:18:39 +05:00
|
|
|
|
|
|
|
with open("simpleFoam.log", "r") as io:
|
|
|
|
for line in io:
|
|
|
|
if re.search("solution converged", line):
|
2021-05-26 22:02:44 +05:00
|
|
|
out = "simpleFoam:\n\t{}".format(line.strip())
|
2021-05-26 17:18:39 +05:00
|
|
|
|
2021-05-26 22:02:44 +05:00
|
|
|
return returncode, out
|
2021-05-26 17:18:39 +05:00
|
|
|
|