Skip to content

Commit 75afebf

Browse files
committed
update docs
1 parent 135fbab commit 75afebf

File tree

8 files changed

+50
-23
lines changed

8 files changed

+50
-23
lines changed

docs/src/DuctAPE/advanced_usage/option.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ As part of the pre-process, an elliptic grid defining the wake geometry is solve
6969
For this solve there currently two options:
7070

7171
- [SLOR](@ref "DuctAPE.SLORGridSolverOptions"): DFDC grid solver
72-
- [SLOR+Newton](@ref "DuctAPE.GridSolverOptions")
72+
- [Default](@ref "DuctAPE.GridSolverOptions"): Default method compatible with ImplicitAD
7373

74-
The SLOR (successive line over relaxation) is the method employed by DFDC, and can be used by itself, or as a preconditioner to a Newton solve (using NLsolve.jl).
74+
The SLOR (successive line over relaxation) is the method employed by DFDC.
7575

7676
Selection of solver and solver settings follows the same pattern as with the quadrature settings, in that the user must pass the appropriate `GridSolverOptionsType` into the `set_options` call.
7777

@@ -80,16 +80,16 @@ For the SLOR method alone, the type is
8080
DuctAPE.SLORGridSolverOptions
8181
```
8282

83-
And for the SLOR+Newton method, the type is
83+
And for the default method compatible with ImplicitAD, the type is
8484
```@docs; canonical=false
8585
DuctAPE.GridSolverOptions
8686
```
8787

88-
As an example, this is the input that would be required to use the SLOR+Newton method with an absolute convergence tolerance of 1e-12, and also including the quadrature settings from above:
88+
As an example, this is the input that would be required to use the default method with an absolute convergence tolerance of 1e-10, and also including the quadrature settings from above:
8989

9090
```julia
9191
# define wake grid solver settings
92-
wake_solve_options = DuctAPE.GridSolverOptions(; atol=1e-12)
92+
wake_solve_options = DuctAPE.GridSolverOptions(; atol=1e-10)
9393

9494
# set all options
9595
options = DuctAPE.set_options(;
@@ -106,14 +106,15 @@ There are two general types of solvers available in DuctAPE, the first is very s
106106
The other type is for external solvers that converge an alternate residual that is default in DuctAPE.
107107
The various solver options include:
108108
- [CSOR](@ref "DuctAPE.CSORSolverOptions"): the DFDC solver
109+
- [ModCSOR](@ref "DuctAPE.ModCSORSolverOptions"): modified DFDC solver for ImplicitAD compatibility
109110
- [FixedPoint.jl](@ref "DuctAPE.FixedPointOptions")
110111
- [SpeedMapping.jl](@ref "DuctAPE.SpeedMappingOptions")
111112
- [MINPACK.jl](@ref "DuctAPE.MinpackOptions")
112113
- [SIAMFANLEquations.jl](@ref "DuctAPE.SIAMFANLEOptions")
113114
- [NLsolve.jl](@ref "DuctAPE.NLsolveOptions")
114115
- [SimpleNonlinearSolve.jl](@ref "DuctAPE.NonlinearSolveOptions")
115116

116-
Note that the CSOR, FixedPoint.jl, and SpeedMapping.jl are all different fixed-point iteration solvers, MINPACK.jl and SIAMFANLEquations.jl are primarily quasi-newton solvers, and NLsolve.jl and SimpleNonlinearSolve.jl have various solver options.
117+
Note that the CSOR, ModCSOR, FixedPoint.jl, and SpeedMapping.jl are all different fixed-point iteration solvers, MINPACK.jl and SIAMFANLEquations.jl are primarily quasi-newton solvers, and NLsolve.jl and SimpleNonlinearSolve.jl have various solver options.
117118

118119
DuctAPE also has some poly-algorithm solvers that employ more than one solver.
119120
The [Chain Solver](@ref "DuctAPE.ChainSolverOptions") option is the default which starts with a fixed-point iteration, and if it doesn't converge, moves on to a quasi-, then full Newton solver until either convergence is reached, or no convergence is found.
@@ -154,10 +155,9 @@ Here is an example for setting options with the CSOR solver.
154155
nop = 3
155156

156157
options = DuctAPE.set_options(;
157-
solver_options=DuctAPE.CSORSolverOptions(;
158+
solver_options=DuctAPE.ModCSORSolverOptions(;
158159
converged=fill(false, (1, nop)), # need a convergence flag for each operating point
159160
iterations=zeros(Int, (1, nop)), # need a iteration count for each operating point
160-
Vconv=ones(nop), # in this case, we need a reference velocity for each operating point
161161
),
162162
write_outputs=fill(false, nop), # we need to know which of the operating point outputs to write
163163
outfile=fill("", nop), # we need to include names, even if they won't be used.

docs/src/DuctAPE/api/private_prelims.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ DuctAPE.ConvergenceType
55
DuctAPE.Relative
66
DuctAPE.Absolute
77
DuctAPE.SolverOptionsType
8+
DuctAPE.InternalSolverOptions
9+
DuctAPE.InternalPolyAlgorithmOptions
810
DuctAPE.ExternalSolverOptions
9-
DuctAPE.PolyAlgorithmOptions
11+
DuctAPE.ExternalPolyAlgorithmOptions
1012
DuctAPE.GridSolverOptionsType
1113
DuctAPE.IntegrationMethod
1214
```

docs/src/DuctAPE/api/private_process.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,36 @@ DuctAPE.process
99
DuctAPE.solve
1010
```
1111

12-
#### Residuals
12+
#### Solvers
13+
##### ModCSOR
14+
```@docs
15+
DuctAPE.mod_COR_solver
16+
DuctAPE.relax_Gamr_mod!
17+
DuctAPE.relax_gamw_mod!
18+
DuctAPE.update_states!
19+
```
1320

1421
##### CSOR
1522
```@docs
16-
DuctAPE.CSOR_residual!
17-
DuctAPE.compute_CSOR_residual!
18-
DuctAPE.relax_Gamr!
19-
DuctAPE.relax_gamw!
2023
DuctAPE.apply_relaxation_schedule
2124
DuctAPE.update_CSOR_residual_values!
2225
DuctAPE.check_CSOR_convergence!
26+
DuctAPE.relax_Gamr!
27+
DuctAPE.relax_gamw!
28+
```
29+
30+
#### Residuals
31+
32+
##### ModCSOR
33+
```@docs
34+
DuctAPE.mod_CSOR_residual!
35+
DuctAPE.estimate_CSOR_states!
36+
```
37+
38+
##### CSOR
39+
```@docs
40+
DuctAPE.CSOR_residual!
41+
DuctAPE.compute_CSOR_residual!
2342
```
2443

2544
##### External Solvers

docs/src/DuctAPE/api/public_api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ DuctAPE.SIAMFANLEOptions
5656
DuctAPE.SpeedMappingOptions
5757
DuctAPE.FixedPointOptions
5858
DuctAPE.CSORSolverOptions
59+
DuctAPE.ModCSORSolverOptions
5960
```
6061
## Preprocess
6162

src/process/residuals/CSORresidual.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ Apply relaxed step to Gamr.
408408
- `Gamr::Array{Float}` : Array of rotor circulations (columns = rotors, rows = blade elements), updated in place
409409
- `delta_prev_mat::Array{Float}` : Array of previous iteration's differences in circulation values, updated in place
410410
- `delta_mat::Array{Float}` : Array of current iteration's differences in circulation values
411+
- `maxBGamr::Array{Float}` : stores value of maximum B*Gamr for each rotor
412+
- `maxdeltaBGamr::Array{Float}` : stores value of maximum change in B*Gamr for each rotor
411413
- `B::Vector{Float}` : number of blades on each rotor
412414
- `nrf::Float=0.4` : nominal relaxation factor
413415
- `bt1::Float=0.2` : backtrack factor 1
@@ -528,7 +530,9 @@ Apply relaxed step to gamw.
528530
- `gamw::Array{Float}` : Array of rotor circulations (columns = rotors, rows = blade elements), updated in place
529531
- `delta_prev_mat::Array{Float}` : Array of previous iteration's differences in circulation values, updated in place
530532
- `delta_mat::Array{Float}` : Array of current iteration's differences in circulation values
531-
- `B::Vector{Float}` : number of blades on each rotor
533+
- `maxdeltagamw::Array{Float}` : Single element array that gets updated with the new maximum change in gamw.
534+
535+
# Keyword Arguments:
532536
- `nrf::Float=0.4` : nominal relaxation factor
533537
- `bt1::Float=0.2` : backtrack factor 1
534538
- `bt2::Float=0.6` : backtrack factor 2

src/process/solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ function solve(
870870
end
871871

872872
function solve(
873-
solver_options::Union{ChainSolverOptions,CSORChainSolverOptions},
873+
solver_options::ChainSolverOptions,
874874
sensitivity_parameters,
875875
const_cache;
876876
initial_guess=nothing,

src/process/solvers/modCSORsolver.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function mod_COR_solver(
7575
end
7676

7777
"""
78-
relax_Gamr!(
78+
relax_Gamr_mod!(
7979
Gamr,
8080
r_Gamr_current,
8181
r_Gamr_previous,
@@ -103,7 +103,7 @@ Apply relaxed step to Gamr.
103103
- `pf1::Float=0.4` : press forward factor 1
104104
- `pf2::Float=0.5` : press forward factor 2
105105
"""
106-
function relax_Gamr!(
106+
function relax_Gamr_mod!(
107107
Gamr, B, r_Gamr_current, r_Gamr_previous; nrf=0.4, bt1=0.2, bt2=0.6, pf1=0.4, pf2=0.5
108108
)
109109

@@ -183,7 +183,7 @@ function relax_Gamr!(
183183
end
184184

185185
"""
186-
relax_gamw!(gamw, r_gamw_current, r_gamw_previous; nrf=0.4, btw=0.6, pfw=1.2)
186+
relax_gamw_mod!(gamw, r_gamw_current, r_gamw_previous; nrf=0.4, btw=0.6, pfw=1.2)
187187
188188
Apply relaxed step to gamw.
189189
@@ -199,7 +199,7 @@ Apply relaxed step to gamw.
199199
- `pf1::Float=0.4` : press forward factor 1
200200
- `pf2::Float=0.5` : press forward factor 2
201201
"""
202-
function relax_gamw!(gamw, r_gamw_current, r_gamw_previous; nrf=0.4, btw=0.6, pfw=1.2)
202+
function relax_gamw_mod!(gamw, r_gamw_current, r_gamw_previous; nrf=0.4, btw=0.6, pfw=1.2)
203203

204204
# initilize
205205
TF = eltype(gamw)
@@ -245,7 +245,7 @@ function update_states!(states, r_current, r_previous, B, relaxation_parameters,
245245

246246
# println("before: ", Gamr)
247247
# - relax Gamr values - #
248-
relax_Gamr!(
248+
relax_Gamr_mod!(
249249
Gamr,
250250
B,
251251
r_Gamr_current,
@@ -259,7 +259,7 @@ function update_states!(states, r_current, r_previous, B, relaxation_parameters,
259259
# println("after: ", Gamr)
260260

261261
# relax gamw values
262-
relax_gamw!(
262+
relax_gamw_mod!(
263263
gamw,
264264
r_gamw_current,
265265
r_gamw_previous;
@@ -269,7 +269,7 @@ function update_states!(states, r_current, r_previous, B, relaxation_parameters,
269269
)
270270

271271
# - relax sigr values using same method as Gamr - #
272-
relax_Gamr!(
272+
relax_Gamr_mod!(
273273
sigr,
274274
B,
275275
r_sigr_current,

src/utilities/options.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ Note that the defaults match DFDC with the exception of the relaxation schedule,
193193
- `convergence_type::ConvergenceType = Relative()` : dispatch for relative or absolute convergence criteria.
194194
- `Vconv::AbstractArray{Float} = [1.0]` : velocity used in relative convergence criteria (should be set to Vref).
195195
- `converged::AbstractArray{Bool} = [false]` : flag to track if convergence took place.
196+
- `iterations::AbstractArray{Int} = [0]` : iteration counter
196197
"""
197198
@kwdef struct CSORSolverOptions{TB,TC<:ConvergenceType,TF,TI,TS} <: InternalSolverOptions
198199
# Defaults are DFDC hard-coded values

0 commit comments

Comments
 (0)