コード例 #1
0
  /**
   * This function plots the airfoil drag polar using a parabolic approssimation.
   *
   * @author Manuela Ruocco
   */
  public void plotPolar() {
    System.out.println("\n \n-----------------------------------------------------");
    System.out.println("STARTING PLOT AIRFOIL DRAG POLAR");
    System.out.println("-----------------------------------------------------");

    MyArray alphaArray = new MyArray();
    int _numberOfAlpha = 40;
    double[] cdArrayPolar = new double[_numberOfAlpha];
    double[] clArrayPolar = new double[_numberOfAlpha];
    Amount<Angle> alphaActualAmount;

    Amount<Angle> alphaStart = Amount.valueOf(toRadians(-6.), SI.RADIAN);
    Amount<Angle> alphaEnd = Amount.valueOf(toRadians(12.), SI.RADIAN);

    alphaArray.setDouble(
        MyArrayUtils.linspace(
            alphaStart.getEstimatedValue(), alphaEnd.getEstimatedValue(), _numberOfAlpha));

    String folderPathPolar =
        MyConfiguration.currentDirectoryString + File.separator + "out" + File.separator;
    String subfolderPathPolar =
        JPADStaticWriteUtils.createNewFolder(folderPathPolar + "Polar_Airfoil" + File.separator);

    for (int i = 0; i < _numberOfAlpha; i++) {
      alphaActualAmount = Amount.valueOf(alphaArray.get(i), SI.RADIAN);
      clArrayPolar[i] = calculateClAtAlpha(alphaActualAmount.getEstimatedValue());
      cdArrayPolar[i] = calculateCdAtAlpha(alphaActualAmount);
    }

    MyChartToFileUtils.plotNoLegend(
        cdArrayPolar,
        clArrayPolar,
        null,
        null,
        null,
        null,
        "Cd",
        "Cl",
        "",
        "",
        subfolderPathPolar,
        "Polar_Airfoil ");

    System.out.println("\n \n-----------------------------------------------------");
    System.out.println("DONE");
    System.out.println("-----------------------------------------------------");
  }
コード例 #2
0
  public void plotClvsAlpha(String subfolderPath, String name) {

    System.out.println("\n \n-----------------------------------------------------");
    System.out.println("STARTING PLOT AIRFOIL CL vs ALPHA CURVE " + name);
    System.out.println("-----------------------------------------------------");

    MyArray alphaArray = new MyArray();
    int _numberOfAlpha = 60;
    double[] clArray = new double[_numberOfAlpha];
    double[] alphaArrayDeg = new double[_numberOfAlpha];

    Amount<Angle> alphaActualAmount;
    Amount<Angle> alphaStart = Amount.valueOf(toRadians(-6.), SI.RADIAN);
    Amount<Angle> alphaEnd = Amount.valueOf(toRadians(25.0), SI.RADIAN);

    alphaArray.setDouble(
        MyArrayUtils.linspace(
            alphaStart.getEstimatedValue(), alphaEnd.getEstimatedValue(), _numberOfAlpha));

    for (int i = 0; i < _numberOfAlpha; i++) {
      alphaActualAmount = Amount.valueOf(alphaArray.get(i), SI.RADIAN);
      clArray[i] = calculateClAtAlpha(alphaActualAmount.getEstimatedValue());
      alphaArrayDeg[i] = alphaActualAmount.to(NonSI.DEGREE_ANGLE).getEstimatedValue();
    }

    MyChartToFileUtils.plotNoLegend(
        alphaArrayDeg,
        clArray,
        null,
        null,
        null,
        null,
        "alpha",
        "CL",
        "deg",
        "",
        subfolderPath,
        "CL vs alpha Airfoil" + name);

    System.out.println("-----------------------------------------------------");
    System.out.println("\n DONE");
    System.out.println("-----------------------------------------------------");
  }