@@ -146,34 +146,49 @@ end
146146
147147 # Run analysis
148148 P = length (body_aero. panels)
149- solver_object = Solver {P} (
149+ loop_solver = Solver {P} (
150150 aerodynamic_model_type= model,
151- core_radius_fraction= core_radius_fraction
151+ core_radius_fraction= core_radius_fraction,
152+ solver_type= LOOP,
153+ atol= 1e-8 ,
154+ rtol= 1e-8
152155 )
153- results_NEW = solve (solver_object, body_aero; reference_point= [0 ,1 ,0 ])
156+ nonlin_solver = Solver {P} (
157+ aerodynamic_model_type= model,
158+ core_radius_fraction= core_radius_fraction,
159+ solver_type= NONLIN,
160+ atol= 1e-8 ,
161+ rtol= 1e-8
162+ )
163+ results_NEW = solve (loop_solver, body_aero; reference_point= [0 ,1 ,0 ])
154164 # println(results_NEW)
155165
156166 @test results_NEW isa Dict
157167
158- sol = solve! (solver_object, body_aero; reference_point= [0 ,1 ,0 ])
168+ @testset " Loop and nonlin solve!" begin
169+ loop_sol = solve! (loop_solver, body_aero; reference_point= [0 ,1 ,0 ])
170+ nonlin_sol = solve! (nonlin_solver, body_aero; reference_point= [0 ,1 ,0 ])
159171
160- @test sol. force. x ≈ - 117.97225244011436 atol= 1e-4
161- @test sol. force. y ≈ 0.0 atol= 1e-10
162- @test sol. force. z ≈ 1481.996390329679 atol= 1e-4 rtol= 1e-4
172+ @test all (isapprox .(nonlin_sol. gamma_distribution, loop_sol. gamma_distribution; atol= 1e-4 ))
163173
164- @test sol . moment . x ≈ - 1481.996390329678 atol= 1e-4 rtol = 1e-4
165- @test sol . moment . y ≈ 0.0 atol= 1e-10
166- @test sol . moment . z ≈ - 117.97225244011435 atol= 1e-4
174+ @test loop_sol . force . x ≈ - 117.96518414816444 atol= 1e-4
175+ @test loop_sol . force . y ≈ 0.0 atol= 1e-10
176+ @test loop_sol . force . z ≈ 1481.996390329679 atol= 1e-4 rtol = 1e-4
167177
168- @test sol. force_coefficients[1 ] ≈ - 0.039050322560956294 atol= 1e-4 # CFx
169- @test sol. force_coefficients[2 ] ≈ 0.0 atol= 1e-4 # CFy
170- @test sol. force_coefficients[3 ] ≈ 0.49055973654418716 atol= 1e-4 # CFz
171- @test sol. force_coefficients[3 ] / sol. force_coefficients[1 ] ≈ sol. force[3 ] / sol. force[1 ]
172- @test sol. moment_distribution[1 ] ≈ - 0.0006683746751654071 atol= 1e-8
173- @test sol. moment_coeff_dist[1 ] ≈ - 2.212405554436003e-7 atol= 1e-10
174- @test sol. moment_distribution[1 ] / sol. moment_distribution[2 ] ≈ sol. moment_coeff_dist[1 ] / sol. moment_coeff_dist[2 ]
178+ @test loop_sol. moment. x ≈ - 1481.996390329678 atol= 1e-4 rtol= 1e-4
179+ @test loop_sol. moment. y ≈ 0.0 atol= 1e-10
180+ @test loop_sol. moment. z ≈ - 117.9651841481644 atol= 1e-4
175181
176- @test sol. solver_status == FEASIBLE
182+ @test loop_sol. force_coefficients[1 ] ≈ - 0.039050322560956294 atol= 1e-4 # CFx
183+ @test loop_sol. force_coefficients[2 ] ≈ 0.0 atol= 1e-4 # CFy
184+ @test loop_sol. force_coefficients[3 ] ≈ 0.49055973654418716 atol= 1e-4 # CFz
185+ @test loop_sol. force_coefficients[3 ] / loop_sol. force_coefficients[1 ] ≈ loop_sol. force[3 ] / loop_sol. force[1 ]
186+ @test loop_sol. moment_distribution[1 ] ≈ - 0.0006683569356186426 atol= 1e-8
187+ @test loop_sol. moment_coeff_dist[1 ] ≈ - 2.212405554436003e-7 atol= 1e-10
188+ @test loop_sol. moment_distribution[1 ] / loop_sol. moment_distribution[2 ] ≈ loop_sol. moment_coeff_dist[1 ] / loop_sol. moment_coeff_dist[2 ]
189+
190+ @test loop_sol. solver_status == FEASIBLE
191+ end
177192
178193 # Calculate forces using uncorrected alpha
179194 alpha = results_NEW[" alpha_uncorrected" ]
0 commit comments