dust-sctoolbox 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dust-sctoolbox might be problematic. Click here for more details.
- dust_sctoolbox-0.0.1/PKG-INFO +174 -0
- dust_sctoolbox-0.0.1/README.md +162 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox/SCanalysis.py +753 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox/parsing.py +176 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox/run_dust.py +39 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox/run_sctoolbox.py +23 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox/write_dust.py +1095 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox.egg-info/PKG-INFO +174 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox.egg-info/SOURCES.txt +13 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox.egg-info/dependency_links.txt +1 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox.egg-info/entry_points.txt +2 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox.egg-info/requires.txt +4 -0
- dust_sctoolbox-0.0.1/dust_sctoolbox.egg-info/top_level.txt +1 -0
- dust_sctoolbox-0.0.1/pyproject.toml +26 -0
- dust_sctoolbox-0.0.1/setup.cfg +4 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dust_sctoolbox
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: DUST stability and control analysis tools
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: numpy
|
|
9
|
+
Requires-Dist: PyYAML
|
|
10
|
+
Requires-Dist: matplotlib
|
|
11
|
+
Requires-Dist: h5py
|
|
12
|
+
|
|
13
|
+
# SCtoolbox
|
|
14
|
+
|
|
15
|
+
SCtoolbox - Modules and Input Guide
|
|
16
|
+
===================================
|
|
17
|
+
|
|
18
|
+
This file describes the framework's Python scripts, the functions defined in
|
|
19
|
+
each module, and the settings available in input.yml.
|
|
20
|
+
|
|
21
|
+
## Install and run
|
|
22
|
+
|
|
23
|
+
Install the package:
|
|
24
|
+
|
|
25
|
+
python -m pip install dust-sctoolbox
|
|
26
|
+
|
|
27
|
+
From the directory containing input.yml, run:
|
|
28
|
+
|
|
29
|
+
dust_sctoolbox
|
|
30
|
+
|
|
31
|
+
The DUST model path in input.yml is relative to that directory. DUST must be
|
|
32
|
+
installed separately, with dust_pre, dust, and dust_post available on PATH.
|
|
33
|
+
When running from a source checkout, use `python main.py` from the case
|
|
34
|
+
directory.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## 1. CONFIGURABLE INPUTS IN input.yml
|
|
38
|
+
===================================
|
|
39
|
+
|
|
40
|
+
The file contains three sections: sim_data, analysis_data, and post_data.
|
|
41
|
+
Model and component paths are relative to sim_data.dust_path unless stated
|
|
42
|
+
otherwise.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
sim_data
|
|
46
|
+
--------
|
|
47
|
+
- dust_path [required]: base directory containing the DUST model. May be an
|
|
48
|
+
absolute path or a path relative to the directory containing input.yml.
|
|
49
|
+
- model_folder [required]: DUST model directory under dust_path. Must be a
|
|
50
|
+
relative path.
|
|
51
|
+
- reference_file [required]: model's DUST reference file, for example
|
|
52
|
+
references.in.
|
|
53
|
+
- body_reference [conditional]: reference_tag of the body receiving the
|
|
54
|
+
prescribed dynamic motion. Required for dynamic analyses.
|
|
55
|
+
- u_inf [conditional]: list of freestream speeds [m/s] used for dynamic cases.
|
|
56
|
+
Each value creates a case; the DUST input defines the direction along x.
|
|
57
|
+
For zero_attitude and static/differential analyses, the baseline velocity is
|
|
58
|
+
read from the model's dust.in.
|
|
59
|
+
- alpha_0 [optional]: initial mean angle of attack [degrees] for dynamic cases.
|
|
60
|
+
A scalar or list is accepted; each value is combined with each other dynamic
|
|
61
|
+
sweep value. Default: 0.0.
|
|
62
|
+
- beta_0 [optional]: initial mean sideslip angle [degrees] for dynamic cases.
|
|
63
|
+
A scalar or list is accepted; each value is combined with each other dynamic
|
|
64
|
+
sweep value. Default: 0.0.
|
|
65
|
+
- dt [required]: simulation and DUST output time step [s].
|
|
66
|
+
- tend [required]: requested simulation end time [s]. The simulation stops at
|
|
67
|
+
this time even when it is not an integer multiple of the period.
|
|
68
|
+
- rho [required]: fluid density [kg/m^3].
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
analysis_data
|
|
72
|
+
-------------
|
|
73
|
+
- analysis_type [required]: analysis mode. Supported values:
|
|
74
|
+
- zero_attitude
|
|
75
|
+
- static_alpha
|
|
76
|
+
- static_beta
|
|
77
|
+
- static_v
|
|
78
|
+
- control_blade_pitch
|
|
79
|
+
- control_omega
|
|
80
|
+
- control_surface
|
|
81
|
+
- rolling
|
|
82
|
+
- pitching
|
|
83
|
+
- yawing
|
|
84
|
+
- plunging
|
|
85
|
+
- lateral
|
|
86
|
+
- phugoid
|
|
87
|
+
- lateral_phugoid
|
|
88
|
+
- ampl [conditional]: motion amplitude or increment applied in the perturbed
|
|
89
|
+
case. Accepts a scalar or vector for static and dynamic analyses. Each
|
|
90
|
+
static amplitude runs as an independent baseline/perturbed pair; dynamic
|
|
91
|
+
analyses run every amplitude/frequency combination. Units and use depend on
|
|
92
|
+
analysis_type:
|
|
93
|
+
- static_alpha, static_beta: angular perturbation [rad].
|
|
94
|
+
- static_v: freestream-speed increment [m/s].
|
|
95
|
+
- control_blade_pitch: Collective increment [degrees].
|
|
96
|
+
- control_omega: rot_rate increment [rad/s].
|
|
97
|
+
- control_surface: hinge amplitude increment, in the units expected by the
|
|
98
|
+
DUST component file.
|
|
99
|
+
- rolling, pitching, yawing: angular amplitude [rad].
|
|
100
|
+
- plunging, lateral, phugoid, lateral_phugoid: translation amplitude [m].
|
|
101
|
+
For differential modes, ampl must be non-zero and is added to the baseline
|
|
102
|
+
value in the perturbed case. Not required for zero_attitude.
|
|
103
|
+
- omega [conditional]: angular frequency [rad/s]. Required for dynamic
|
|
104
|
+
analyses; accepts a scalar or vector. Every amplitude/frequency combination
|
|
105
|
+
runs as a separate case. Not required for static or control analyses.
|
|
106
|
+
- pole_offset [optional]: three coordinates [m] defining the dynamic-motion
|
|
107
|
+
pole offset, for example [0.0, 0.0, 0.0]. Defaults to zero when omitted.
|
|
108
|
+
- rotor_reference [conditional]: reference_tag of the rotor to perturb.
|
|
109
|
+
Required for control_blade_pitch and control_omega; the reference must have
|
|
110
|
+
a multiplicity block of type rotor. control_blade_pitch changes Collective
|
|
111
|
+
in the Pitch degree of freedom; control_omega changes rot_rate.
|
|
112
|
+
- component_path [conditional]: path to the component .in file containing the
|
|
113
|
+
hinge, relative to model_folder, for example Geometry/wing.in. Required for
|
|
114
|
+
control_surface and must remain inside the model directory.
|
|
115
|
+
- hinge_tag [conditional]: hinge_Tag of the hinge to perturb in component_path.
|
|
116
|
+
It must identify exactly one hinge with a hinge_rotation_function block
|
|
117
|
+
containing exactly one amplitude assignment.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
post_data
|
|
121
|
+
---------
|
|
122
|
+
- component [required]: component name or selector supported by DUST for load
|
|
123
|
+
extraction, for example all.
|
|
124
|
+
- reference_tag [required]: DUST reference used to calculate loads and moments.
|
|
125
|
+
- reference_area [required]: reference area [m^2]; must be positive.
|
|
126
|
+
- reference_length [required]: reference length [m]; must be positive.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## 2. RUNNING THE FRAMEWORK AND OUTPUTS
|
|
132
|
+
====================================
|
|
133
|
+
|
|
134
|
+
Run the installed command from the directory containing input.yml:
|
|
135
|
+
|
|
136
|
+
sctoolbox
|
|
137
|
+
|
|
138
|
+
From a source checkout, run:
|
|
139
|
+
|
|
140
|
+
python main.py
|
|
141
|
+
|
|
142
|
+
The framework creates a model copy with the suffix _SC_N and an Output_SC_N
|
|
143
|
+
directory for analysis results.
|
|
144
|
+
|
|
145
|
+
Each dynamic sweep condition is run from its own model copy and has its own
|
|
146
|
+
Output_SC_N directory. Dynamic analysis saves the derivative report and plot
|
|
147
|
+
to the corresponding output directory, without saving a coefficient history
|
|
148
|
+
file or displaying the plot interactively. Derivative results for different
|
|
149
|
+
cases are separated by a blank line in the console. Output files are named
|
|
150
|
+
"<model>_loads_hysteresis.png", "<model>_stability_derivatives.dat", and
|
|
151
|
+
"<model>_stability_derivatives.h5". The HDF5 file contains a single
|
|
152
|
+
derivatives dataset and corresponding derivative_names, with case settings
|
|
153
|
+
and derivative metadata in its attributes; it can be read from Python with h5py
|
|
154
|
+
and from MATLAB with h5read/h5info.
|
|
155
|
+
When ampl is a vector for a static or control analysis, each amplitude is run
|
|
156
|
+
as an independent baseline/perturbed pair, with its own model copy and
|
|
157
|
+
Output_SC_N directory.
|
|
158
|
+
Static and control analysis plots are named "<model>_loads.png".
|
|
159
|
+
|
|
160
|
+
Differential analyses (static_alpha, static_beta, static_v,
|
|
161
|
+
control_blade_pitch, control_omega, and control_surface) run two simulations:
|
|
162
|
+
baseline and perturbed. DUST post-processing averages the loads over the final
|
|
163
|
+
10 time steps using average = T; the averaged file does not contain a time
|
|
164
|
+
column. The derivative is calculated as the coefficient difference divided by
|
|
165
|
+
the actual parameter difference.
|
|
166
|
+
|
|
167
|
+
For dynamic analyses, post-processing selects the last complete period ending
|
|
168
|
+
at or before tend, counting periods from the time origin t=0. Any remaining
|
|
169
|
+
fraction of the simulation is excluded from the analysis.
|
|
170
|
+
|
|
171
|
+
Outputs include coefficient and derivative files and, for dynamic and
|
|
172
|
+
differential analyses, plots saved in the generated directories.
|
|
173
|
+
|
|
174
|
+
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# SCtoolbox
|
|
2
|
+
|
|
3
|
+
SCtoolbox - Modules and Input Guide
|
|
4
|
+
===================================
|
|
5
|
+
|
|
6
|
+
This file describes the framework's Python scripts, the functions defined in
|
|
7
|
+
each module, and the settings available in input.yml.
|
|
8
|
+
|
|
9
|
+
## Install and run
|
|
10
|
+
|
|
11
|
+
Install the package:
|
|
12
|
+
|
|
13
|
+
python -m pip install dust-sctoolbox
|
|
14
|
+
|
|
15
|
+
From the directory containing input.yml, run:
|
|
16
|
+
|
|
17
|
+
dust_sctoolbox
|
|
18
|
+
|
|
19
|
+
The DUST model path in input.yml is relative to that directory. DUST must be
|
|
20
|
+
installed separately, with dust_pre, dust, and dust_post available on PATH.
|
|
21
|
+
When running from a source checkout, use `python main.py` from the case
|
|
22
|
+
directory.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 1. CONFIGURABLE INPUTS IN input.yml
|
|
26
|
+
===================================
|
|
27
|
+
|
|
28
|
+
The file contains three sections: sim_data, analysis_data, and post_data.
|
|
29
|
+
Model and component paths are relative to sim_data.dust_path unless stated
|
|
30
|
+
otherwise.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
sim_data
|
|
34
|
+
--------
|
|
35
|
+
- dust_path [required]: base directory containing the DUST model. May be an
|
|
36
|
+
absolute path or a path relative to the directory containing input.yml.
|
|
37
|
+
- model_folder [required]: DUST model directory under dust_path. Must be a
|
|
38
|
+
relative path.
|
|
39
|
+
- reference_file [required]: model's DUST reference file, for example
|
|
40
|
+
references.in.
|
|
41
|
+
- body_reference [conditional]: reference_tag of the body receiving the
|
|
42
|
+
prescribed dynamic motion. Required for dynamic analyses.
|
|
43
|
+
- u_inf [conditional]: list of freestream speeds [m/s] used for dynamic cases.
|
|
44
|
+
Each value creates a case; the DUST input defines the direction along x.
|
|
45
|
+
For zero_attitude and static/differential analyses, the baseline velocity is
|
|
46
|
+
read from the model's dust.in.
|
|
47
|
+
- alpha_0 [optional]: initial mean angle of attack [degrees] for dynamic cases.
|
|
48
|
+
A scalar or list is accepted; each value is combined with each other dynamic
|
|
49
|
+
sweep value. Default: 0.0.
|
|
50
|
+
- beta_0 [optional]: initial mean sideslip angle [degrees] for dynamic cases.
|
|
51
|
+
A scalar or list is accepted; each value is combined with each other dynamic
|
|
52
|
+
sweep value. Default: 0.0.
|
|
53
|
+
- dt [required]: simulation and DUST output time step [s].
|
|
54
|
+
- tend [required]: requested simulation end time [s]. The simulation stops at
|
|
55
|
+
this time even when it is not an integer multiple of the period.
|
|
56
|
+
- rho [required]: fluid density [kg/m^3].
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
analysis_data
|
|
60
|
+
-------------
|
|
61
|
+
- analysis_type [required]: analysis mode. Supported values:
|
|
62
|
+
- zero_attitude
|
|
63
|
+
- static_alpha
|
|
64
|
+
- static_beta
|
|
65
|
+
- static_v
|
|
66
|
+
- control_blade_pitch
|
|
67
|
+
- control_omega
|
|
68
|
+
- control_surface
|
|
69
|
+
- rolling
|
|
70
|
+
- pitching
|
|
71
|
+
- yawing
|
|
72
|
+
- plunging
|
|
73
|
+
- lateral
|
|
74
|
+
- phugoid
|
|
75
|
+
- lateral_phugoid
|
|
76
|
+
- ampl [conditional]: motion amplitude or increment applied in the perturbed
|
|
77
|
+
case. Accepts a scalar or vector for static and dynamic analyses. Each
|
|
78
|
+
static amplitude runs as an independent baseline/perturbed pair; dynamic
|
|
79
|
+
analyses run every amplitude/frequency combination. Units and use depend on
|
|
80
|
+
analysis_type:
|
|
81
|
+
- static_alpha, static_beta: angular perturbation [rad].
|
|
82
|
+
- static_v: freestream-speed increment [m/s].
|
|
83
|
+
- control_blade_pitch: Collective increment [degrees].
|
|
84
|
+
- control_omega: rot_rate increment [rad/s].
|
|
85
|
+
- control_surface: hinge amplitude increment, in the units expected by the
|
|
86
|
+
DUST component file.
|
|
87
|
+
- rolling, pitching, yawing: angular amplitude [rad].
|
|
88
|
+
- plunging, lateral, phugoid, lateral_phugoid: translation amplitude [m].
|
|
89
|
+
For differential modes, ampl must be non-zero and is added to the baseline
|
|
90
|
+
value in the perturbed case. Not required for zero_attitude.
|
|
91
|
+
- omega [conditional]: angular frequency [rad/s]. Required for dynamic
|
|
92
|
+
analyses; accepts a scalar or vector. Every amplitude/frequency combination
|
|
93
|
+
runs as a separate case. Not required for static or control analyses.
|
|
94
|
+
- pole_offset [optional]: three coordinates [m] defining the dynamic-motion
|
|
95
|
+
pole offset, for example [0.0, 0.0, 0.0]. Defaults to zero when omitted.
|
|
96
|
+
- rotor_reference [conditional]: reference_tag of the rotor to perturb.
|
|
97
|
+
Required for control_blade_pitch and control_omega; the reference must have
|
|
98
|
+
a multiplicity block of type rotor. control_blade_pitch changes Collective
|
|
99
|
+
in the Pitch degree of freedom; control_omega changes rot_rate.
|
|
100
|
+
- component_path [conditional]: path to the component .in file containing the
|
|
101
|
+
hinge, relative to model_folder, for example Geometry/wing.in. Required for
|
|
102
|
+
control_surface and must remain inside the model directory.
|
|
103
|
+
- hinge_tag [conditional]: hinge_Tag of the hinge to perturb in component_path.
|
|
104
|
+
It must identify exactly one hinge with a hinge_rotation_function block
|
|
105
|
+
containing exactly one amplitude assignment.
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
post_data
|
|
109
|
+
---------
|
|
110
|
+
- component [required]: component name or selector supported by DUST for load
|
|
111
|
+
extraction, for example all.
|
|
112
|
+
- reference_tag [required]: DUST reference used to calculate loads and moments.
|
|
113
|
+
- reference_area [required]: reference area [m^2]; must be positive.
|
|
114
|
+
- reference_length [required]: reference length [m]; must be positive.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
## 2. RUNNING THE FRAMEWORK AND OUTPUTS
|
|
120
|
+
====================================
|
|
121
|
+
|
|
122
|
+
Run the installed command from the directory containing input.yml:
|
|
123
|
+
|
|
124
|
+
sctoolbox
|
|
125
|
+
|
|
126
|
+
From a source checkout, run:
|
|
127
|
+
|
|
128
|
+
python main.py
|
|
129
|
+
|
|
130
|
+
The framework creates a model copy with the suffix _SC_N and an Output_SC_N
|
|
131
|
+
directory for analysis results.
|
|
132
|
+
|
|
133
|
+
Each dynamic sweep condition is run from its own model copy and has its own
|
|
134
|
+
Output_SC_N directory. Dynamic analysis saves the derivative report and plot
|
|
135
|
+
to the corresponding output directory, without saving a coefficient history
|
|
136
|
+
file or displaying the plot interactively. Derivative results for different
|
|
137
|
+
cases are separated by a blank line in the console. Output files are named
|
|
138
|
+
"<model>_loads_hysteresis.png", "<model>_stability_derivatives.dat", and
|
|
139
|
+
"<model>_stability_derivatives.h5". The HDF5 file contains a single
|
|
140
|
+
derivatives dataset and corresponding derivative_names, with case settings
|
|
141
|
+
and derivative metadata in its attributes; it can be read from Python with h5py
|
|
142
|
+
and from MATLAB with h5read/h5info.
|
|
143
|
+
When ampl is a vector for a static or control analysis, each amplitude is run
|
|
144
|
+
as an independent baseline/perturbed pair, with its own model copy and
|
|
145
|
+
Output_SC_N directory.
|
|
146
|
+
Static and control analysis plots are named "<model>_loads.png".
|
|
147
|
+
|
|
148
|
+
Differential analyses (static_alpha, static_beta, static_v,
|
|
149
|
+
control_blade_pitch, control_omega, and control_surface) run two simulations:
|
|
150
|
+
baseline and perturbed. DUST post-processing averages the loads over the final
|
|
151
|
+
10 time steps using average = T; the averaged file does not contain a time
|
|
152
|
+
column. The derivative is calculated as the coefficient difference divided by
|
|
153
|
+
the actual parameter difference.
|
|
154
|
+
|
|
155
|
+
For dynamic analyses, post-processing selects the last complete period ending
|
|
156
|
+
at or before tend, counting periods from the time origin t=0. Any remaining
|
|
157
|
+
fraction of the simulation is excluded from the analysis.
|
|
158
|
+
|
|
159
|
+
Outputs include coefficient and derivative files and, for dynamic and
|
|
160
|
+
differential analyses, plots saved in the generated directories.
|
|
161
|
+
|
|
162
|
+
|