Moved fluidfoam to olaflow file

This commit is contained in:
Edgar P. Burkhart 2022-03-07 11:30:53 +01:00
parent 62af6a03ed
commit 4869c982bb
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 20 additions and 5 deletions

View file

@ -6,7 +6,6 @@ import re
import matplotlib.pyplot as plt
import numpy as np
from fluidfoam import readof
from scipy import interpolate
from .olaflow import OFModel
@ -30,11 +29,10 @@ sws = np.load(sws_out.joinpath("sws.npz"))
x, t = sws["x"], sws["t"]
olaflow_root = pathlib.Path(config.get("olaflow", "root"))
of_x, of_y, of_z = mesh = readof.readmesh(str(olaflow_root))
model = OFModel(olaflow_root)
model.read_mesh()
watl = interpolate.interp1d(x, sws["watl"][680])
alpha_water = np.where(model.z < watl(model.x), 1, 0)
alpha_water = np.where(of_z < watl(of_x), 1, 0)
model = OFModel(olaflow_root)
model.write_field("alpha.water", alpha_water)