Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Quadrature Methods #39

Merged
merged 13 commits into from
Apr 4, 2024
12 changes: 10 additions & 2 deletions src/DuctAPE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const c4b = C4Blade
# - Packages for Calculating Unit Induced Velocities - #
# For Kernels
using SpecialFunctions # required for elliptic integrals

# For Integration
using FastGaussQuadrature
using QuadGK
Expand All @@ -23,11 +24,14 @@ using PreallocationTools # caches
# - Packages for Solves - #
using ImplicitAD # used for all solves
using LinearAlgebra # linear solve and LU decomposition

# General Nonlinear solves
using SimpleNonlinearSolve

# Fixed-Point Iteration Solvers
# using FixedPointAcceleration
using SpeedMapping

# For using NLsolve
using NLsolve #for newton solver
using LineSearches # used in newton solver
Expand Down Expand Up @@ -86,12 +90,16 @@ include("preprocess/geometry/elliptic_grid_residuals.jl")

# Induced Velocity Functions
include("preprocess/velocities/unit_induced_velocities.jl")
include("preprocess/velocities/integrals.jl")
include("preprocess/velocities/induced_velocity_matrices.jl")
include("preprocess/velocities/body_aic.jl")
# Quadrature
include("preprocess/velocities/integrands.jl")
include("preprocess/velocities/out_of_place_integrals.jl")
include("preprocess/velocities/gausslegendre_integrals.jl")
include("preprocess/velocities/romberg_integrals.jl")
include("preprocess/velocities/gausskronrod_integrals.jl")

##### ----- PROCESS ----- #####

# Solve and Residual Functions
include("process/solve.jl")
include("process/residuals/CSORresidual.jl")
Expand Down
9 changes: 5 additions & 4 deletions src/analysis/analyses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ function analyze(

# out-of-place version currently has 22,292,181 allocations.
# TODO: do this in place for the solve input cache items. eventually will want to have a post-processing and output cache too.
ivb, A_bb_LU, lu_decomp_flag, airfoils, idmaps, panels, problem_dimensions = precompute_parameters_iad!(
ivb, A_bb_LU, lu_decomp_flag, airfoils, idmaps, panels, problem_dimensions = precompute_parameters!(
solve_parameter_tuple.ivr,
solve_parameter_tuple.ivw,
solve_parameter_tuple.blade_elements,
solve_parameter_tuple.linsys,
solve_parameter_tuple.wakeK,
propulsor;
grid_solver_options=options.wake_solver_options,
grid_solver_options=options.grid_solver_options,
integration_options=options.integration_options,
autoshiftduct=options.autoshiftduct,
itcpshift=options.itcpshift,
axistol=options.axistol,
Expand All @@ -105,11 +106,11 @@ function analyze(
#=
NOTE: If the linear system or wake did not converge, there is likely a serious problem that would lead to an error in the solve, so we will exit here with a fail flag for an optimizer or user
=#
if iszero(lu_decomp_flag) || !options.wake_solver_options.converged[1]
if iszero(lu_decomp_flag) || !options.grid_solver_options.converged[1]
if !options.silence_warnings
if iszero(lu_decomp_flag)
@warn "Exiting. LU decomposition of the LHS matrix for the linear system failed. Please check your body geometry and ensure that there will be no panels lying directly atop eachother or other similar problematic geometry."
elseif !options.wake_solver_options.converged[1]
elseif !options.grid_solver_options.converged[1]
@warn "Exiting. Wake elliptic grid solve did not converge. Consider a looser convergence tolerance if the geometry looks good."
end
end
Expand Down
Loading
Loading