Skip to content

Commit

Permalink
checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain-Gauthier committed Aug 14, 2024
1 parent 3e7638e commit d5298be
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 39 deletions.
54 changes: 26 additions & 28 deletions ceasiompy/AeroFrame_new/aeroframe_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,34 +279,32 @@ def compute_aero_work(row):
wing_df['aero_work'] = wing_df.apply(compute_aero_work, axis=1)
total_aero_work = wing_df['aero_work'].sum()

'''
E = 325e9 # Young's modulus in Pascals (example value)
G = 125e9 # Shear modulus in Pascals (example value)
A = 1.435e-3 # Cross-sectional area in square meters (example value)
I_x = 2.01e-9 # Second moment of area about y-axis in meters^4 (example value)
I_z = 1.465e-5 # Second moment of area about z-axis in meters^4 (example value)
J = I_x + I_z # Polar moment of inertia in meters^4 (example value)
# Compute axial strain energy
centerline_df['axial_strain_energy'] = 0.5 * (centerline_df['Fy']**2) / (E * A)
# Compute bending strain energy
centerline_df['bending_strain_energy'] = 0.5 * \
((centerline_df['Mx']**2 / (E * I_x)) + (centerline_df['Mz']**2 / (E * I_z)))
# Compute torsional strain energy
centerline_df['torsional_strain_energy'] = 0.5 * (centerline_df['My']**2) / (G * J)
# Sum the strain energies to get the total strain energy for each node
centerline_df['total_strain_energy'] = (
centerline_df['axial_strain_energy']
+ centerline_df['bending_strain_energy']
+ centerline_df['torsional_strain_energy']
)
# Sum the total strain energy over all nodes to get the total strain energy of the beam
total_strain_energy = centerline_df['total_strain_energy'].sum()
'''
# E = 325e9 # Young's modulus in Pascals (example value)
# G = 125e9 # Shear modulus in Pascals (example value)
# A = 1.435e-3 # Cross-sectional area in square meters (example value)
# I_x = 2.01e-9 # Second moment of area about y-axis in meters^4 (example value)
# I_z = 1.465e-5 # Second moment of area about z-axis in meters^4 (example value)
# J = I_x + I_z # Polar moment of inertia in meters^4 (example value)

# # Compute axial strain energy
# centerline_df['axial_strain_energy'] = 0.5 * (centerline_df['Fy']**2) / (E * A)

# # Compute bending strain energy
# centerline_df['bending_strain_energy'] = 0.5 * \
# ((centerline_df['Mx']**2 / (E * I_x)) + (centerline_df['Mz']**2 / (E * I_z)))

# # Compute torsional strain energy
# centerline_df['torsional_strain_energy'] = 0.5 * (centerline_df['My']**2) / (G * J)

# # Sum the strain energies to get the total strain energy for each node
# centerline_df['total_strain_energy'] = (
# centerline_df['axial_strain_energy']
# + centerline_df['bending_strain_energy']
# + centerline_df['torsional_strain_energy']
# )

# # Sum the total strain energy over all nodes to get the total strain energy of the beam
# total_strain_energy = centerline_df['total_strain_energy'].sum()

def compute_structural_work(row):
force = np.array([row['Fx'], row['Fy'], row['Fz']])
Expand Down
22 changes: 11 additions & 11 deletions ceasiompy/AeroFrame_new/func/aeroframe_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def create_wing_centerline(wing_df, centerline_df, N_beam, wg_origin, xyz_tot, f
"""Function to create the beam nodes along the wing centerline.
Function 'create_wing_centerline' creates the beam nodes along
the wing centerline, associating all the geometric properties
the wing centerline, associating all the geometric properties
and the applied forces and moments.
Args:
Expand All @@ -431,15 +431,15 @@ def create_wing_centerline(wing_df, centerline_df, N_beam, wg_origin, xyz_tot, f
n_iter (int): number of the current iteration.
xyz_tip (list): coordinates of the mid-chord tip center of the undeformed wing [m].
tip_def (list): coordinates of the mid-chord tip center of the deformed wing [m].
aera_profile (scipy.interpolate): profile of area of the cross-sections along
aera_profile (scipy.interpolate): profile of area of the cross-sections along
the span [m^2].
Ix_profile (scipy.interpolate.interp1d): profile of the second moment of area about
Ix_profile (scipy.interpolate.interp1d): profile of the second moment of area about
the x-axis along the span [m^4].
Iy_profile (scipy.interpolate.interp1d): profile of the second moment of area about
Iy_profile (scipy.interpolate.interp1d): profile of the second moment of area about
the y-axis along the span [m^4].
chord_profile (scipy.interpolate.interp1d): profile of the chord length along
chord_profile (scipy.interpolate.interp1d): profile of the chord length along
the span [m].
twist_profile (scipy.interpolate.interp1d): profile of the twist angle along
twist_profile (scipy.interpolate.interp1d): profile of the twist angle along
the span [deg].
CASE_PATH (Path): path to the flight case directory.
AVL_UNDEFORMED_PATH (Path): path to the undeformed AVL geometry.
Expand Down Expand Up @@ -620,15 +620,15 @@ def compute_cross_section(cpacs_path):
wg_origin (list): list of the coordinates of the origin of the wing geometry.
wg_twist_list (list): list of the twist angle of each cross-section [deg].
area_list (list): list of the area of each cross-section [m^2].
Ix_list (list): list of the second moment of area about the x-axis for each
Ix_list (list): list of the second moment of area about the x-axis for each
cross-section [m^4].
Iy_list (list): list of the second moment of area about the y-axis for each
Iy_list (list): list of the second moment of area about the y-axis for each
cross-section [m^4].
wg_center_x_list (list): list of the x-coordinates of the center of each
wg_center_x_list (list): list of the x-coordinates of the center of each
cross-section [m].
wg_center_y_list (list): list of the y-coordinates of the center of each
wg_center_y_list (list): list of the y-coordinates of the center of each
cross-section [m].
wg_center_z_list (list): list of the z-coordinates of the center of each
wg_center_z_list (list): list of the z-coordinates of the center of each
cross-section [m].
wg_chord_list (list): list of the chord length of each cross-section [m].
Expand Down

0 comments on commit d5298be

Please sign in to comment.