Hi, I have trained a flow past airfoil problem with parameterization for the angle of attack AoA.
Supposed I want to find the AoA which gives the highest lift within the range which I did the training.
Thru the PointwiseMonitor, I can compute the lift force using this:
force_p1 = PointwiseMonitor(
airfoil1_geo.sample_boundary(1000),
output_names=["p"],
metrics={
"force_x_p1": lambda var: torch.sum(-2.*var["normal_x"] * var["area"] * var["p"]),
"force_y_p1": lambda var: torch.sum(-2.*var["normal_y"] * var["area"] * var["p"]),
},
nodes=nodes,
)
domain.add_monitor(force_p1)
However it is given as an output after every 1000 steps in a csv file during training.
Is there anyway I can create a function in Modulus which gives me the lift given my inputs such as AoA? In this way, I can use many different types of optimizers to get my AoA for max lift.
Of course, I think I can also read from the csv file to get the lift but it will be very slow with all the i/o.
Thanks.