Skip to content

Commit

Permalink
adds in a correction for force center offset (e.g., CM due to normali…
Browse files Browse the repository at this point in the history
…zation operation).
  • Loading branch information
peterdsharpe committed Apr 3, 2024
1 parent b40d4ab commit e65fb28
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions aerosandbox/geometry/airfoil/airfoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,17 +648,23 @@ def get_aero_from_neuralfoil(self,
include_360_deg_effects: bool = True,
) -> Dict[str, Union[float, np.ndarray]]:

airfoil_normalization = self.normalize(return_dict=True)

kulfan_airfoil = airfoil_normalization["airfoil"].to_kulfan_airfoil(
### Normalize the inputs and evaluate
normalization_outputs = self.normalize(return_dict=True)
normalized_airfoil = normalization_outputs["airfoil"].to_kulfan_airfoil(
n_weights_per_side=8,
N1=0.5,
N2=1.0,
normalize_coordinates=False # No need to redo this
)
delta_alpha = normalization_outputs["rotation_angle"] # degrees
x_translation_LE = normalization_outputs["x_translation"]
y_translation_LE = normalization_outputs["y_translation"]
scale = normalization_outputs["scale_factor"]

x_translation_qc = -x_translation_LE + 0.25 * (1/scale * np.cosd(delta_alpha)) - 0.25
y_translation_qc = -y_translation_LE + 0.25 * (1/scale * np.sind(-delta_alpha))

return kulfan_airfoil.get_aero_from_neuralfoil(
alpha=alpha + airfoil_normalization["rotation_angle"],
Re=Re / airfoil_normalization["scale_factor"],
raw_aero = normalized_airfoil.get_aero_from_neuralfoil(
alpha=alpha + delta_alpha,
Re=Re / scale,
mach=mach,
n_crit=n_crit,
xtr_upper=xtr_upper,
Expand All @@ -668,6 +674,12 @@ def get_aero_from_neuralfoil(self,
include_360_deg_effects=include_360_deg_effects
)

### Correct the force vectors and lift-induced moment from translation
extra_CM = -raw_aero["CL"] * x_translation_qc + raw_aero["CD"] * y_translation_qc
raw_aero["CM"] = raw_aero["CM"] + extra_CM

return raw_aero

def plot_polars(self,
alphas: Union[np.ndarray, List[float]] = np.linspace(-20, 20, 500),
Res: Union[np.ndarray, List[float]] = 10 ** np.arange(3, 9),
Expand Down

0 comments on commit e65fb28

Please sign in to comment.