@@ -16,6 +16,7 @@ using Parameters
1616using Serialization
1717using SharedArrays
1818using PreallocationTools
19+ using PrecompileTools
1920using Pkg
2021
2122# Export public interface
@@ -242,4 +243,44 @@ include("body_aerodynamics.jl")
242243include (" wake.jl" )
243244include (" solver.jl" )
244245
246+ @setup_workload begin
247+ # Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the
248+ # precompile file and potentially make loading faster.
249+ # list = [OtherType("hello"), OtherType("world!")]
250+ path = dirname (pathof (@__MODULE__ ))
251+
252+ @compile_workload begin
253+ # all calls in this block will be precompiled, regardless of whether
254+ # they belong to your package or not (on Julia 1.8 and higher)
255+ # Step 1: Define wing parameters
256+ n_panels = 20 # Number of panels
257+ span = 20.0 # Wing span [m]
258+ chord = 1.0 # Chord length [m]
259+ v_a = 20.0 # Magnitude of inflow velocity [m/s]
260+ density = 1.225 # Air density [kg/m³]
261+ alpha_deg = 30.0 # Angle of attack [degrees]
262+ alpha = deg2rad (alpha_deg)
263+
264+ # Step 2: Create wing geometry with linear panel distribution
265+ wing = Wing (n_panels, spanwise_panel_distribution= LINEAR)
266+
267+ # Add wing sections - defining only tip sections with inviscid airfoil model
268+ add_section! (wing,
269+ [0.0 , span/ 2 , 0.0 ], # Left tip LE
270+ [chord, span/ 2 , 0.0 ], # Left tip TE
271+ INVISCID)
272+ add_section! (wing,
273+ [0.0 , - span/ 2 , 0.0 ], # Right tip LE
274+ [chord, - span/ 2 , 0.0 ], # Right tip TE
275+ INVISCID)
276+
277+ # Step 3: Initialize aerodynamics
278+ body_aero:: BodyAerodynamics = BodyAerodynamics ([wing])
279+
280+ y = [panel. control_point[2 ] for panel in body_aero. panels]
281+
282+ nothing
283+ end
284+ end
285+
245286end # module
0 commit comments