Generate force coefficientsΒΆ

The following steps are performed to obtain all the artifacts for force coefficient use case:

  1. Read parameters file

  2. Read Mesh description

    • Its path can be specified

    • Or it can be obtained from the simulation configuration file

  3. Read data for pressure coefficient

Instantiate path manager

[5]:
from cfdmod.pressure.path_manager import CfPathManager
import pathlib

path_manager = CfPathManager(output_path=pathlib.Path("./output/pressure"))

Read parameters file

[ ]:
from cfdmod.pressure import CfCaseConfig

config_path = pathlib.Path("./fixtures/tests/pressure/Cf_params.yaml")
post_proc_cfg = CfCaseConfig.from_file(config_path)

post_proc_cfg.force_coefficient

Read Mesh from file

[7]:
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
[7]:
((1549, 3), (2915, 3))

Calculate force coefficient

[ ]:
from cfdmod.pressure import run_cf

cp_path = pathlib.Path("./fixtures/tests/pressure/data/cp_t.normalized.h5")

run_cf(
    cp_h5=cp_path,
    mesh_path=mesh_path,
    cfg_path=config_path,
    output=path_manager.output_path,
)