示例#1
0
# Create an array of alpha values.
# In this case we create 6 evenly spaced values from 0 - 5.
alphaList = np.linspace(0, 5, 6)

# Create storage for the evaluated lift and drag coefficients
CL = []
CD = []
# rst Start loop
# Loop over the alpha values and evaluate the polar
for alpha in alphaList:

    # rst update AP
    # Update the name in the AeroProblem. This allows us to modify the
    # output file names with the current alpha.
    ap.name = "wing_%4.2f" % alpha

    # Update the alpha in aero problem and print it to the screen.
    ap.alpha = alpha
    if comm.rank == 0:
        print("current alpha: %f" % ap.alpha)

    # rst Run ADflow
    # Solve the flow
    CFDSolver(ap)

    # Evaluate functions
    funcs = {}
    CFDSolver.evalFunctions(ap, funcs)

    # Store the function values in the output list
示例#2
0
elif args.task == "polar":
    # Create an array of alpha values.
    # In this case we create 6 evenly spaced values from 0 - 5.
    alphaList = np.linspace(0, 5, 6)

    # Create storage for the evaluated lift and drag coefficients
    CLList = []
    CDList = []
    # rst Start loop
    # Loop over the alpha values and evaluate the polar
    for alpha in alphaList:

        # rst update AP
        # Update the name in the AeroProblem. This allows us to modify the
        # output file names with the current alpha.
        ap.name = f"wing_{alpha:4.2f}"

        # Update the alpha in aero problem and print it to the screen.
        ap.alpha = alpha
        if comm.rank == 0:
            print(f"current alpha: {ap.alpha}")

        # rst Run ADflow polar
        # Solve the flow
        CFDSolver(ap)

        # Evaluate functions
        funcs = {}
        CFDSolver.evalFunctions(ap, funcs)

        # Store the function values in the output list