mdolab / CMPLXFOIL

GNU General Public License v2.0
29 stars 20 forks source link

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

Open lucaerosBGD opened 10 months ago

lucaerosBGD commented 10 months ago

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
A-CGray commented 10 months ago

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