CMPLXFOIL icon indicating copy to clipboard operation
CMPLXFOIL copied to clipboard

Add cp, cf, x, y arrays in the available functions for optimization

Open lucaerosBGD opened this issue 2 years ago • 2 comments

Description of feature

Add the following slice data in the available function for optimization : # "cp_visc_upper": viscous CP on the airfoil's upper surface # "cp_invisc_upper": inviscid CP on the airfoil's upper surface # "x_upper": x coordinates of the upper surface CP data # "y_upper": y coordinates of the upper surface CP data # "cp_visc_lower": viscous CP on the airfoil's lower surface # "cp_invisc_lower": inviscid CP on the airfoil's lower surface # "x_lower": x coordinates of the lower surface CP data # "y_lower": y coordinates of the lower surface CP data # "cf_upper": skin friction coefficient on the upper surface # "x_cf_upper": x coordinates of upper surface skin friction coefficient # "y_cf_upper": y coordinates of upper surface skin friction coefficient # "cf_lower": skin friction coefficient on the lower surface # "x_cf_lower": x coordinates of lower surface skin friction coefficient # "y_cf_lower": y coordinates of lower surface skin friction coefficient Thus we could optimize and constraint parameters available in this list (max pressure gradients for example)

Potential solution

lucaerosBGD avatar Nov 09 '23 07:11 lucaerosBGD

Hey @lucaerosBGD , this shouldn't be too hard to add, you just need to return the values from the real/complex slice data dictionaries in the same way we already do from the real/complex funcs dictionaries,

Here's where we do that in the function evaluation: https://github.com/mdolab/CMPLXFOIL/blob/c1701d9aeb80e014427703db1be1369fd49e125c/cmplxfoil/CMPLXFOIL.py#L606-L614

And here's where we do that in the derivative calculation: https://github.com/mdolab/CMPLXFOIL/blob/c1701d9aeb80e014427703db1be1369fd49e125c/cmplxfoil/CMPLXFOIL.py#L763-L771

A-CGray avatar Nov 09 '23 17:11 A-CGray