Skip to content

Commit

Permalink
structure change acquisition of average values
Browse files Browse the repository at this point in the history
  • Loading branch information
JBertholdt committed Feb 28, 2024
1 parent d3c65aa commit e1f5178
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
14 changes: 10 additions & 4 deletions birdpressure/AnalBarber.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,20 @@ class AnalBarber(Timing):
average force exerted during steady state phase [Pa]
P_H: float or ndarray
peak pressure (hugonoit pressure) [MPa]
f_peak_av: float or ndarray
force applied during hugonoit state [N]
c_r: float or ndarray
release wave velocity [m/s]
t_b: float or ndarray
peak impact pressure duration [s]
t_c: float or ndarray
duration until shocked area dissipates [s]
f_hist: ndarray
pressure history force array [N]
t_hist: ndarray
pressure history time array [s]
impulse_tot: float or ndarray
total impulse over per impact [Ns]
"""

def __init__(self, bird: Bird, impact_scenario: ImpactScenario, grid: GridGenerator, eos: EOS, initial_pressure = 101325):
Expand All @@ -59,16 +67,16 @@ def __init__(self, bird: Bird, impact_scenario: ImpactScenario, grid: GridGenera
self.grid = grid
self.eos = eos

#self.min_axis = self.grid.min_axis
#self.maj_axis = self.grid.maj_axis
self.U, self.V, self.W = self.get_UVW()
self.c_p = 1 - (self.V ** 2 + self.W ** 2) / (self.impact_scenario.get_impact_velocity() ** 2)
self.P = self.c_p * 1 / 2 * self.bird.get_density() * self.impact_scenario.get_impact_velocity() ** 2
self.f_steady_av, self.P_steady_av = self.get_averages()
self.P_H = self.det_peak_P()
self.f_peak_av = self.P_H * self.grid.impact_area
self.c_r = self.eos.get_c_r(self.P_H)
self.t_b = self.find_t_b(self.c_r)
self.t_c = self.find_t_c(self.c_r)
self.f_hist, self.t_hist, self.impulse_tot = self.find_force_history(self.f_peak_av, self.f_steady_av, self.c_r)



Expand Down Expand Up @@ -210,8 +218,6 @@ def get_averages(self):

def show_averaged_force_history(self):
"""Function to plot force history"""
self.f_peak_av = self.P_H*self.grid.impact_area
self.f_hist, self.t_hist, self.impulse_tot = self.find_force_history(self.f_peak_av, self.f_steady_av,self.c_r)
self.plot_f_history(self.f_hist,self.t_hist)


Expand Down
19 changes: 16 additions & 3 deletions birdpressure/AnalWilbeck.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ class AnalWilbeck(Timing):
shock wave velocity [m/s]
P_H: float or ndarray
peak (hugonoit) pressure [N/m^2]
f_peak_av: float or ndarray
force applied during hugonoit state [N]
c_r: float or ndarray
release wave velocity [m/s]
P_s: float ndarray
steady state stagnation point pressure [N/m^2]
p_steady_av: float or ndarray
average pressure applied during steady state [N/m^2]
f_steady_av: float or ndarray
force applied during steady state [N]
f_hist: ndarray
pressure history force array [N]
t_hist: ndarray
pressure history time array [s]
impulse_tot: float or ndarray
total impulse over per impact [Ns]
"""

def __init__(self, bird: Bird, impact_scenario: ImpactScenario, grid: GridGenerator, eos: EOS, initial_pressure = 101325):
Expand All @@ -47,8 +60,11 @@ def __init__(self, bird: Bird, impact_scenario: ImpactScenario, grid: GridGenera

self.u_s = self.find_u_s()
self.P_H = self.det_peak_P()
self.f_peak_av = self.P_H * self.grid.impact_area
self.c_r = self.eos.get_c_r(self.P_H)
self.P_s = self.get_P_s()
self.p_steady_av, self.f_steady_av = self.get_averages()
self.f_hist, self.t_hist, self.impulse_tot = self.find_force_history(self.f_peak_av, self.f_steady_av, self.c_r)

def get_averages(self, circular_cross = True):
"""Function to compute average pressure and force during steady state"""
Expand Down Expand Up @@ -148,9 +164,6 @@ def show_banks(self):

def show_averaged_force_history(self):
"""Function to plot force history"""
self.p_steady_av, self.f_steady_av = self.get_averages()
self.f_peak_av = self.P_H*self.grid.impact_area
self.f_hist, self.t_hist, self.impulse_tot = self.find_force_history(self.f_peak_av, self.f_steady_av, self.c_r)
self.plot_f_history(self.f_hist, self.t_hist)


Expand Down

0 comments on commit e1f5178

Please sign in to comment.