Skip to content

Commit 5c729d8

Browse files
committed
update elliptic grid solve docstrings
1 parent 75afebf commit 5c729d8

File tree

2 files changed

+52
-6
lines changed

2 files changed

+52
-6
lines changed

docs/src/DuctAPE/api/private_preprocess.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ DuctAPE.generate_wake_grid!
2222
DuctAPE.initialize_wake_grid
2323
DuctAPE.initialize_wake_grid!
2424
DuctAPE.relax_grid!
25+
DuctAPE.solve_elliptic_grid!
26+
DuctAPE.solve_elliptic_grid
27+
DuctAPE.elliptic_grid_residual!
28+
DuctAPE.backward_stencil_1
29+
DuctAPE.center_stencil_1
30+
DuctAPE.center_stencil_2
31+
DuctAPE.center_stencil_2_mixed
2532
DuctAPE.generate_wake_panels
2633
DuctAPE.generate_wake_panels!
2734
DuctAPE.get_wake_k

src/preprocess/geometry/elliptic_grid_residuals.jl

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,17 @@ function center_stencil_2_mixed(f, x, y)
108108
end
109109

110110
"""
111-
assume grid has radial lines of constant axial position such that z'(ξ)=1.0 and z''(ξ)=z`(η)=z''(η)=0.0
111+
elliptic_grid_residual!(r, y, x, p)
112+
113+
Residual function for elliptic grid solver.
114+
115+
Note: We assume grid has radial lines of constant axial position (as is done in the grid initialization) such that z'(ξ)=1.0 and z''(ξ)=z'(η)=z''(η)=0.0.
116+
117+
# Arguments
118+
- `r::Vector{Float}` : residual values
119+
- `y::Vector{Float}` : states
120+
- `x::Vector{Float}` : inputs (to which derivatives are sensitive)
121+
- `p::Vector{Float}` : constants
112122
"""
113123
function elliptic_grid_residual!(r, y, x, p)
114124

@@ -230,8 +240,6 @@ function elliptic_grid_residual!(r, y, x, p)
230240
return r
231241
end
232242

233-
"""
234-
"""
235243
function elliptic_grid_residual_dfdc!(r, y, x, p)
236244

237245
# - extract parameters - #
@@ -389,6 +397,16 @@ function elliptic_grid_residual_dfdc!(r, y, x, p)
389397
end
390398

391399
"""
400+
solve_elliptic_grid!(x,p)
401+
402+
Solve for elliptic grid using a non-SLOR approach that is compatible with ImplicitAD
403+
404+
# Arguments:
405+
- `x::Vector{Float}` : inputs (including initial guess for wake grid points)
406+
- `p::NamedTuple` : constant parameters
407+
408+
# Returns:
409+
- `converged_states::Vector{Float}` : converged states for grid solver
392410
"""
393411
function solve_elliptic_grid(x, p)
394412

@@ -417,12 +435,34 @@ function solve_elliptic_grid(x, p)
417435
end
418436

419437
"""
438+
solve_elliptic_grid!(
439+
wake_grid;
440+
algorithm=:trust_region,
441+
autodiff=:forward,
442+
atol=1e-14,
443+
iteration_limit=10,
444+
converged=[false],
445+
verbose=false,
446+
)
447+
448+
Solve for elliptic grid using a non-SLOR approach that is compatible with ImplicitAD
449+
450+
# Arguments:
451+
- `wake_grid::Array{Float}` : initial guess for grid points.
452+
453+
# Keyword Arguments:
454+
- `algorithm::Symbol=:trust_region` : NLsolve algorithm type
455+
- `autodiff::Symbol=:forward` : NLsolve derivatives option
456+
- `atol::Float=1e-10` : convergence tolerance, default = 1e-9
457+
- `iteration_limit::Int=10` : maximum number of iterations to run, default=100
458+
- `converged::Vector{Bool}=[false]` : convergence flag
459+
- `verbose::Bool=false` : flag to print verbose statements
420460
"""
421461
function solve_elliptic_grid!(
422462
wake_grid;
423463
algorithm=:trust_region,
424464
autodiff=:forward,
425-
atol=1e-14,
465+
atol=1e-10,
426466
iteration_limit=10,
427467
converged=[false],
428468
verbose=false,
@@ -480,12 +520,11 @@ end
480520
Relax wake_grid using elliptic wake_grid solver.
481521
482522
# Arguments:
523+
- `wake_grid::Array{Float}` : initial guess for grid points.
483524
484525
# Keyword Arguments:
485526
- `iteration_limit::Int` : maximum number of iterations to run, default=100
486527
- `atol::Float` : convergence tolerance, default = 1e-9
487-
488-
# Returns:
489528
"""
490529
function relax_grid!(
491530
wake_grid;

0 commit comments

Comments
 (0)