Generate moment coefficientsΒΆ
The following steps are performed to obtain all the artifacts for force coefficient use case:
Read parameters file
Read Mesh description
Its path can be specified
Or it can be obtained from the simulation configuration file
Read data for pressure coefficient
[1]:
from cfdmod.pressure.path_manager import CmPathManager
import pathlib
path_manager = CmPathManager(output_path=pathlib.Path("./output/pressure"))
Read parameters file
[ ]:
from cfdmod.pressure import CmCaseConfig
config_path = pathlib.Path("./fixtures/tests/pressure/Cm_params.yaml")
post_proc_cfg = CmCaseConfig.from_file(config_path)
post_proc_cfg
Read mesh from file
[3]:
from lnas import LnasFormat
mesh_path = pathlib.Path("./fixtures/tests/pressure/galpao/galpao.normalized.lnas")
mesh = LnasFormat.from_file(mesh_path)
mesh.geometry.vertices.shape, mesh.geometry.triangles.shape
[3]:
((1549, 3), (2915, 3))
Calculate moment coefficient
[ ]:
from cfdmod.pressure import run_cm
cp_path = pathlib.Path("./fixtures/tests/pressure/data/cp_t.normalized.h5")
run_cm(
cp_h5=cp_path,
mesh_path=mesh_path,
cfg_path=config_path,
output=path_manager.output_path,
)