You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/preprocess/geometry/elliptic_grid_residuals.jl
+45-6Lines changed: 45 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,17 @@ function center_stencil_2_mixed(f, x, y)
108
108
end
109
109
110
110
"""
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
112
122
"""
113
123
functionelliptic_grid_residual!(r, y, x, p)
114
124
@@ -230,8 +240,6 @@ function elliptic_grid_residual!(r, y, x, p)
230
240
return r
231
241
end
232
242
233
-
"""
234
-
"""
235
243
functionelliptic_grid_residual_dfdc!(r, y, x, p)
236
244
237
245
# - extract parameters - #
@@ -389,6 +397,16 @@ function elliptic_grid_residual_dfdc!(r, y, x, p)
389
397
end
390
398
391
399
"""
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
392
410
"""
393
411
functionsolve_elliptic_grid(x, p)
394
412
@@ -417,12 +435,34 @@ function solve_elliptic_grid(x, p)
417
435
end
418
436
419
437
"""
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
0 commit comments