mdolab / MACH-Aero

MACH: MDO of Aircraft Configurations with High fidelity
114 stars 53 forks source link

bugs the simulation is not stop to do simulation for single point optimization and not terminated succussfully for SLSQP optimizer #130

Closed EngJamal2023 closed 11 months ago

EngJamal2023 commented 11 months ago

explain the proplem what is it

I am writing to seek assistance with a problem I am facing while using the MACH-AERO software platform for single point optimization of airfoil S809. Specifically, I am trying to modify the objective function to maximize the lift while adhering to a drag constraint.

To achieve this, I have made some changes to the code. However, I am unsure about the mistakes I might have made in the process. I would greatly appreciate it if you could review the code and help me identify any errors or areas that require correction. Your expertise and guidance would be invaluable in resolving this issue.

Initially, I utilized the PreFoil Python script to generate points around the airfoil. Subsequently, I used certain parameters in the ADflow option to simulate my problem case. Despite dedicating more than a month to finding a solution, I have been unable to obtain any conclusive results.

Given your experience and knowledge in this field, I believe that your insights could significantly contribute to resolving this problem. Any assistance or suggestions you can provide would be highly appreciated.

Thank you for taking the time to consider my request. I look forward to your prompt response and guidance. Please let me know if there is any additional information or code snippets that would be helpful for you to review.

Best regards,

the s809 airfoil which i have been generated by prefoil

coords = airfoil.getSampledPts(
    200, spacingFunc=[sampling.bigeometric, sampling.polynomial], func_args=[{}, {"order": 15}]

image

the change that i have been used on the adflow solution

mycd = 0.01
# angle of attack
alpha = 1.5
# mach number
mach = 0.15
# cruising altitude
alt = 100
# rst parameters (end)

aeroOptions = {
.
.
.
   "acousticScaleFactor":0.1, 
   "ANKCharTimeStepType": "VLR",
    "NKSubSpaceSize": 600,

def objCon(funcs, printOK):
    # Assemble the objective and any additional constraints:
    funcs["obj"] = -1.0*funcs[ap["cl"]]
    funcs["cd_con_" + ap.name] = funcs[ap["cd"]] - mycd
    if printOK:
        print("funcs in obj:", funcs)
    return funcs
.
.
.
# Add objective
optProb.addObj("obj", scale=1e4)

optProb.addCon("cd_con_" + ap.name, lower=0.0, upper=0.0, scale=1.0)

the objective history during iteration like this

image

so what i should to do to fix this problem i hope i could find answer and i am sorry to bothering you .