Skip to content

Commit

Permalink
I added a new class for incremental problems to problems.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
camUrban committed Dec 2, 2024
1 parent 00cd0ed commit 1ae9436
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions pterasoftware/problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module contains the following classes:
SteadyProblem: This is a class for steady aerodynamics problems.
UnsteadyProblem: This is a class for unsteady aerodynamics problems.
IncrementalUnsteadyProblem: This is a class for unsteady aerodynamics problems where the geometry is not precomputed for each time step.
This module contains the following exceptions:
None
Expand Down Expand Up @@ -141,3 +142,52 @@ def __init__(self, movement, only_final_results=False):

# Append this steady problem to the list of steady problems.
self.steady_problems.append(this_steady_problem)


class IncrementalUnsteadyProblem:
"""This is a class for unsteady aerodynamics problems where the geometry is not precomputed for each time step.
This class contains the following public methods:
None
This class contains the following class attributes:
None
Subclassing:
This class is not meant to be subclassed.
"""

def __init__(self, incremental_movement):
"""This is the initialization method.
:param incremental_movement: IncrementalMovement
This is the movement object that contains this problem's airplane and
operating point objects.
"""
# Initialize the class attributes.
self.incremental_movement = incremental_movement
self.num_steps = self.incremental_movement.num_steps
self.delta_time = self.incremental_movement.delta_time

# Initialize empty lists that will hold the loads and load coefficients each
# airplane object experiences.
self.near_field_forces_wind_axes = []
self.near_field_force_coefficients_wind_axes = []
self.near_field_moments_wind_axes = []
self.near_field_moment_coefficients_wind_axes = []

# Get the airplane objects and the operating point object associated with
# the initial time step. This will be a list of the airplane snapshots associated
# with each base airplane.
these_airplanes = []
for this_base_airplane in incremental_movement.airplanes:
these_airplanes.append(this_base_airplane[0])

this_operating_point = incremental_movement.operating_points[0]

# Create a list to hold the steady problem's at each time step and add the first steady problem.
self.steady_problems = [
SteadyProblem(
airplanes=these_airplanes, operating_point=this_operating_point
)
]

0 comments on commit 1ae9436

Please sign in to comment.