@@ -7,71 +7,41 @@ Main solver structure for the Vortex Step Method.
77# Attributes
88
99## General settings
10- - `aerodynamic_model_type`::Model: The model type, see: [Model](@ref)
11- - density::Float64: Air density [kg/m³]
12- - `max_iterations`::Int64
13- - `allowed_error`::Float64: relative error
14- - `tol_reference_error`::Float64
15- - `relaxation_factor`::Float64
10+ - `aerodynamic_model_type`::Model = VSM : The model type, see: [Model](@ref)
11+ - density::Float64 = 1.225 : Air density [kg/m³]
12+ - `max_iterations`::Int64 = 1500
13+ - `allowed_error`::Float64 = 1e-5 : relative error
14+ - `tol_reference_error`::Float64 = 0.001
15+ - `relaxation_factor`::Float64 = 0.03: Relaxation factor for convergence
1616
1717## Damping settings
18- - `is_with_artificial_damping`::Bool
19- - `artificial_damping`::NamedTuple{(:k2, :k4), Tuple{Float64, Float64}}
18+ - `is_with_artificial_damping`::Bool = false: Whether to apply artificial damping
19+ - `artificial_damping`::NamedTuple{(:k2, :k4), Tuple{Float64, Float64}} = (k2=0.1, k4=0.0): Artificial damping parameters
2020
2121## Additional settings
22- - `type_initial_gamma_distribution`::InitialGammaDistribution: see: [InitialGammaDistribution](@ref)
23- - `core_radius_fraction`::Float64
24- - mu::Float64
25- - `is_only_f_and_gamma_output`::Bool
22+ - `type_initial_gamma_distribution`::InitialGammaDistribution = ELLIPTIC : see: [InitialGammaDistribution](@ref)
23+ - `core_radius_fraction`::Float64 = 1e-20:
24+ - mu::Float64 = 1.81e-5: Dynamic viscosity [N·s/m²]
25+ - `is_only_f_and_gamma_output`::Bool = false: Whether to only output f and gamma
2626"""
27- struct Solver
27+ @with_kw struct Solver
2828 # General settings
29- aerodynamic_model_type:: Model
30- density:: Float64
31- max_iterations:: Int64
32- allowed_error:: Float64
33- tol_reference_error:: Float64
34- relaxation_factor:: Float64
29+ aerodynamic_model_type:: Model = VSM
30+ density:: Float64 = 1.225
31+ max_iterations:: Int64 = 1500
32+ allowed_error:: Float64 = 1e-5
33+ tol_reference_error:: Float64 = 0.001
34+ relaxation_factor:: Float64 = 0.03
3535
3636 # Damping settings
37- is_with_artificial_damping:: Bool
38- artificial_damping:: NamedTuple{(:k2, :k4), Tuple{Float64, Float64}}
37+ is_with_artificial_damping:: Bool = false
38+ artificial_damping:: NamedTuple{(:k2, :k4), Tuple{Float64, Float64}} = (k2 = 0.1 , k4 = 0.0 )
3939
4040 # Additional settings
41- type_initial_gamma_distribution:: InitialGammaDistribution
42- core_radius_fraction:: Float64
43- mu:: Float64
44- is_only_f_and_gamma_output:: Bool
45-
46- function Solver (;
47- aerodynamic_model_type:: Model = VSM,
48- density:: Float64 = 1.225 ,
49- max_iterations:: Int64 = 1500 ,
50- allowed_error:: Float64 = 1e-5 , # rel_err
51- tol_reference_error:: Float64 = 0.001 ,
52- relaxation_factor:: Float64 = 0.03 ,
53- is_with_artificial_damping:: Bool = false ,
54- artificial_damping:: NamedTuple{(:k2, :k4), Tuple{Float64, Float64}} = (k2= 0.1 , k4= 0.0 ),
55- type_initial_gamma_distribution:: InitialGammaDistribution = ELLIPTIC,
56- core_radius_fraction:: Float64 = 1e-20 ,
57- mu:: Float64 = 1.81e-5 , # TODO do not use magic constants
58- is_only_f_and_gamma_output:: Bool = false
59- )
60- new (
61- aerodynamic_model_type,
62- density,
63- max_iterations,
64- allowed_error,
65- tol_reference_error,
66- relaxation_factor,
67- is_with_artificial_damping,
68- artificial_damping,
69- type_initial_gamma_distribution,
70- core_radius_fraction,
71- mu,
72- is_only_f_and_gamma_output
73- )
74- end
41+ type_initial_gamma_distribution:: InitialGammaDistribution = ELLIPTIC
42+ core_radius_fraction:: Float64 = 1e-20
43+ mu:: Float64 = 1.81e-5
44+ is_only_f_and_gamma_output:: Bool = false
7545end
7646
7747"""
0 commit comments