aerosim-cfdmod 1.1.2__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.
- aerosim_cfdmod-1.1.2/LICENSE +202 -0
- aerosim_cfdmod-1.1.2/PKG-INFO +109 -0
- aerosim_cfdmod-1.1.2/README.md +63 -0
- aerosim_cfdmod-1.1.2/cfdmod/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/analysis/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/analysis/inflow/__init__.py +1 -0
- aerosim_cfdmod-1.1.2/cfdmod/analysis/inflow/functions.py +183 -0
- aerosim_cfdmod-1.1.2/cfdmod/analysis/inflow/profile.py +51 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/configs/hashable.py +16 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/geometry/STL.py +78 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/geometry/region_meshing.py +188 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/geometry/transformation_config.py +38 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/vtk/probe_vtm.py +42 -0
- aerosim_cfdmod-1.1.2/cfdmod/api/vtk/write_vtk.py +145 -0
- aerosim_cfdmod-1.1.2/cfdmod/logger.py +36 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/__init__.py +19 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/figure.py +18 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/main.py +90 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/plots.py +191 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/probe.py +74 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/section.py +114 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/shed.py +32 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/altimetry/vertices.py +69 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/loft/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/loft/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/loft/functions.py +452 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/loft/main.py +97 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/loft/parameters.py +68 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/base_config.py +35 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/chunking.py +206 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/cp_config.py +58 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/cp_data.py +262 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/extreme_values.py +127 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/force/Cf_config.py +68 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/force/Cf_data.py +220 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/force/Cf_geom.py +36 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/force/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/force/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/force/main.py +95 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/geometry.py +161 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/main.py +105 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/moment/Cm_config.py +65 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/moment/Cm_data.py +231 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/moment/Cm_geom.py +89 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/moment/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/moment/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/moment/main.py +95 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/output.py +48 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/path_manager.py +109 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/Ce_config.py +84 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/Ce_data.py +248 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/Ce_geom.py +99 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/main.py +87 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/shape/zoning_config.py +91 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/statistics.py +88 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/zoning/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/zoning/body_config.py +44 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/zoning/processing.py +228 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/pressure/zoning/zoning_model.py +135 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/roughness_gen/__init__.py +17 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/roughness_gen/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/roughness_gen/build_element.py +73 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/roughness_gen/linear_pattern.py +58 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/roughness_gen/main.py +68 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/roughness_gen/parameters.py +186 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/s1/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/s1/plotting.py +37 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/s1/probe.py +19 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/s1/profile.py +103 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/snapshot/__init__.py +0 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/snapshot/__main__.py +6 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/snapshot/camera.py +142 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/snapshot/colormap.py +62 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/snapshot/config.py +138 -0
- aerosim_cfdmod-1.1.2/cfdmod/use_cases/snapshot/process_image.py +68 -0
- aerosim_cfdmod-1.1.2/cfdmod/utils.py +165 -0
- aerosim_cfdmod-1.1.2/pyproject.toml +139 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aerosim-cfdmod
|
|
3
|
+
Version: 1.1.2
|
|
4
|
+
Summary: Tools for analysis of CFD cases
|
|
5
|
+
Home-page: https://github.com/AeroSim-CFD/cfdmod
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Author: Waine Oliveira Jr
|
|
8
|
+
Author-email: waine@aerosim.io
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Provides-Extra: docs
|
|
17
|
+
Provides-Extra: geometry
|
|
18
|
+
Provides-Extra: lnas
|
|
19
|
+
Provides-Extra: notebook
|
|
20
|
+
Provides-Extra: vtk
|
|
21
|
+
Requires-Dist: aerosim-lnas (>=0.6.0,<0.7.0)
|
|
22
|
+
Requires-Dist: colorama (>=0.4.6,<0.5.0)
|
|
23
|
+
Requires-Dist: ipykernel (>=6.25.2,<7.0.0) ; extra == "notebook"
|
|
24
|
+
Requires-Dist: ipython (>=8.15.0,<9.0.0) ; extra == "notebook"
|
|
25
|
+
Requires-Dist: jupyter (>=1.0.0,<2.0.0) ; extra == "notebook"
|
|
26
|
+
Requires-Dist: matplotlib (>=3.7.3,<4.0.0)
|
|
27
|
+
Requires-Dist: myst-parser (>=2.0.0,<3.0.0) ; extra == "docs"
|
|
28
|
+
Requires-Dist: nbsphinx (>=0.9.3,<0.10.0) ; extra == "docs"
|
|
29
|
+
Requires-Dist: numpy (>=1.26.0,<2.0.0)
|
|
30
|
+
Requires-Dist: pandas (>=2.1.0,<3.0.0)
|
|
31
|
+
Requires-Dist: pyarrow (>=15.0.0,<16.0.0)
|
|
32
|
+
Requires-Dist: pydantic (>=2.3,<3.0)
|
|
33
|
+
Requires-Dist: pymeshlab (>=2023,<2024) ; extra == "geometry"
|
|
34
|
+
Requires-Dist: pyvista (>=0.43.1,<0.44.0) ; extra == "vtk"
|
|
35
|
+
Requires-Dist: ruamel-yaml (>=0.18.5,<0.19.0)
|
|
36
|
+
Requires-Dist: scipy (>=1.11.2,<2.0.0)
|
|
37
|
+
Requires-Dist: sphinx-autobuild (>=2021.3.14,<2022.0.0) ; extra == "docs"
|
|
38
|
+
Requires-Dist: sphinx-book-theme (>=1.0.1,<2.0.0) ; extra == "docs"
|
|
39
|
+
Requires-Dist: sphinxcontrib-bibtex (>=2.6.1,<3.0.0) ; extra == "docs"
|
|
40
|
+
Requires-Dist: tables (>=3.9.1,<4.0.0)
|
|
41
|
+
Requires-Dist: trimesh (>=3.23.5,<4.0.0) ; extra == "geometry"
|
|
42
|
+
Requires-Dist: vtk (>=9.2.6,<10.0.0) ; extra == "vtk"
|
|
43
|
+
Project-URL: Repository, https://github.com/AeroSim-CFD/cfdmod
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# cfdmod
|
|
47
|
+
|
|
48
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/testing.yaml)
|
|
49
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/pages/pages-build-deployment)
|
|
50
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/linting.yaml)
|
|
51
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/build_and_deploy_artifacts.yaml)
|
|
52
|
+
|
|
53
|
+
Package to provide analysis and processing tools for CFD cases
|
|
54
|
+
|
|
55
|
+
## Tests
|
|
56
|
+
|
|
57
|
+
This codebase uses Pytest framework and it features tests for loft, cp, s1profile, config_models and altimetry modules. To run the tests via CLI:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
poetry run pytest <path/to/tests>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The tests can also be automated to run in different environments, and include dist build commands using <a href="https://tox.wiki/en/stable/" target="_blank">tox</a>:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
poetry run tox
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Memory usage profiling
|
|
70
|
+
|
|
71
|
+
In order to check memory usage, _memory-profiler_ library is used.
|
|
72
|
+
First, install memory-profiler:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install -U memory-profiler
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
And activate the poetry virtual environment:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
poetry shell
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Then, run:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
mprof run -C -M python path_to_script.py
|
|
88
|
+
mprof plot
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
That will plot the latest profiling data.
|
|
92
|
+
|
|
93
|
+
## Generating schemas
|
|
94
|
+
|
|
95
|
+
Schema files serve as a guide to fill config files.
|
|
96
|
+
To generate a schema file for every config model, use the following command:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
poetry run python -m scripts.generate_schemas
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
In order to setup the schema in VSCode, edit `settings.json`, or the workspace file, to include:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
"yaml.schemas": {
|
|
106
|
+
"file:///path/to/cfdmod/output/schema-cfdmod.json": "**/cfdmod/**/\*.yaml"
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# cfdmod
|
|
2
|
+
|
|
3
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/testing.yaml)
|
|
4
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/pages/pages-build-deployment)
|
|
5
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/linting.yaml)
|
|
6
|
+
[](https://github.com/AeroSim-CFD/cfdmod/actions/workflows/build_and_deploy_artifacts.yaml)
|
|
7
|
+
|
|
8
|
+
Package to provide analysis and processing tools for CFD cases
|
|
9
|
+
|
|
10
|
+
## Tests
|
|
11
|
+
|
|
12
|
+
This codebase uses Pytest framework and it features tests for loft, cp, s1profile, config_models and altimetry modules. To run the tests via CLI:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
poetry run pytest <path/to/tests>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The tests can also be automated to run in different environments, and include dist build commands using <a href="https://tox.wiki/en/stable/" target="_blank">tox</a>:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
poetry run tox
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Memory usage profiling
|
|
25
|
+
|
|
26
|
+
In order to check memory usage, _memory-profiler_ library is used.
|
|
27
|
+
First, install memory-profiler:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install -U memory-profiler
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
And activate the poetry virtual environment:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
poetry shell
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then, run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mprof run -C -M python path_to_script.py
|
|
43
|
+
mprof plot
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
That will plot the latest profiling data.
|
|
47
|
+
|
|
48
|
+
## Generating schemas
|
|
49
|
+
|
|
50
|
+
Schema files serve as a guide to fill config files.
|
|
51
|
+
To generate a schema file for every config model, use the following command:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
poetry run python -m scripts.generate_schemas
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
In order to setup the schema in VSCode, edit `settings.json`, or the workspace file, to include:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
"yaml.schemas": {
|
|
61
|
+
"file:///path/to/cfdmod/output/schema-cfdmod.json": "**/cfdmod/**/\*.yaml"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Inflow analysis module"""
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
import scipy
|
|
6
|
+
from scipy.ndimage import gaussian_filter
|
|
7
|
+
|
|
8
|
+
from cfdmod.analysis.inflow.profile import InflowData, NormalizationParameters
|
|
9
|
+
|
|
10
|
+
VelocityComponents = Literal["ux", "uy", "uz"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def spectral_density_function(
|
|
14
|
+
velocity_signal: np.ndarray,
|
|
15
|
+
timestamps: np.ndarray,
|
|
16
|
+
reference_velocity: float,
|
|
17
|
+
characteristic_length: float,
|
|
18
|
+
) -> tuple[np.ndarray, np.ndarray]:
|
|
19
|
+
"""Perform a FFT over a velocity signal
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
velocity_signal (np.ndarray): Array of instantaneous velocity signal
|
|
23
|
+
timestamps (np.ndarray): Array of timestamps of the signal
|
|
24
|
+
reference_velocity (float): Value for reference velocity. For normalization
|
|
25
|
+
characteristic_length (float): Value for Characteristic length. For normalization
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
tuple[np.ndarray, np.ndarray]: Tuple with spectral density values array and normalized frequency values array
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def filter_avg_data(data: np.ndarray) -> np.ndarray:
|
|
32
|
+
filtered_data = gaussian_filter(data, sigma=3) # Sigma smooths the curve
|
|
33
|
+
return filtered_data
|
|
34
|
+
|
|
35
|
+
delta_t = timestamps[1] - timestamps[0]
|
|
36
|
+
signal_frequency = 1 / delta_t
|
|
37
|
+
|
|
38
|
+
(xf, yf) = scipy.signal.periodogram(velocity_signal, signal_frequency, scaling="density")
|
|
39
|
+
st = np.std(velocity_signal)
|
|
40
|
+
yf = xf * yf / st**2
|
|
41
|
+
xf = xf * characteristic_length / reference_velocity # Stroulhall number N = f * L / U
|
|
42
|
+
|
|
43
|
+
# Get the filter coefficients so we can check its frequency response.
|
|
44
|
+
yf = filter_avg_data(yf)
|
|
45
|
+
return xf[2:], yf[2:]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def calculate_mean_velocity(
|
|
49
|
+
inflow_data: InflowData, for_components: list[VelocityComponents]
|
|
50
|
+
) -> pd.DataFrame:
|
|
51
|
+
"""Calculates the turbulence intensity for each component given
|
|
52
|
+
The inflow data dataframe must contain the columns selected by for_components (ux, uy, uz)
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
inflow_data (InflowData): Inflow data structure containing points and hist series
|
|
56
|
+
for_components (list[VelocityComponents]): List of components to calculate mean velocity from
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
pd.DataFrame: Mean Velocity dataframe with columns for each for_components suffixed by *_mean
|
|
60
|
+
"""
|
|
61
|
+
if not all(
|
|
62
|
+
[component in inflow_data.data.columns for component in for_components + ["point_idx"]]
|
|
63
|
+
):
|
|
64
|
+
raise ValueError("Components must be inside inflow profile data columns")
|
|
65
|
+
|
|
66
|
+
group_by_point_idx = inflow_data.data.groupby("point_idx")
|
|
67
|
+
velocity_data = group_by_point_idx.agg(
|
|
68
|
+
{component: "mean" for component in for_components}
|
|
69
|
+
).reset_index()
|
|
70
|
+
# Rename columns
|
|
71
|
+
velocity_data.columns = [
|
|
72
|
+
col + "_mean" if col in for_components else col for col in velocity_data.columns
|
|
73
|
+
]
|
|
74
|
+
return velocity_data
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def calculate_turbulence_intensity(
|
|
78
|
+
inflow_data: InflowData, for_components: list[VelocityComponents]
|
|
79
|
+
) -> pd.DataFrame:
|
|
80
|
+
"""Calculates the turbulence intensity for each component given
|
|
81
|
+
The inflow data dataframe must contain the columns selected by for_components (ux, uy, uz)
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
inflow_data (InflowData): Inflow data structure containing points and hist series
|
|
85
|
+
for_components (list[VelocityComponents]): List of components to calculate turbulence intensity from
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
pd.DataFrame: Turbulence intensity dataframe with columns for each for_components preffixed by I_*
|
|
89
|
+
"""
|
|
90
|
+
if not all(
|
|
91
|
+
[component in inflow_data.data.columns for component in for_components + ["point_idx"]]
|
|
92
|
+
):
|
|
93
|
+
raise ValueError("Components must be inside inflow profile data columns")
|
|
94
|
+
|
|
95
|
+
group_by_point_idx = inflow_data.data.groupby("point_idx")
|
|
96
|
+
turbulence_data = group_by_point_idx.agg(
|
|
97
|
+
{component: ["mean", "std"] for component in for_components}
|
|
98
|
+
).reset_index()
|
|
99
|
+
# Rename columns
|
|
100
|
+
turbulence_data.columns = [
|
|
101
|
+
"_".join(col) if col[1] != "" else col[0] for col in turbulence_data.columns
|
|
102
|
+
]
|
|
103
|
+
for component in for_components:
|
|
104
|
+
turbulence_data[f"I_{component}"] = (
|
|
105
|
+
turbulence_data[f"{component}_std"] / turbulence_data[f"{component}_mean"]
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
return turbulence_data[
|
|
109
|
+
["point_idx"] + [f"I_{component}" for component in for_components]
|
|
110
|
+
].copy()
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def calculate_spectral_density(
|
|
114
|
+
inflow_data: InflowData,
|
|
115
|
+
target_index: int,
|
|
116
|
+
for_components: list[VelocityComponents],
|
|
117
|
+
normalization_params: NormalizationParameters,
|
|
118
|
+
) -> pd.DataFrame:
|
|
119
|
+
"""Calculates the spectral density for a given target point index
|
|
120
|
+
The inflow data dataframe must contain the columns selected by for_components (ux, uy, uz)
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
inflow_data (InflowData): Inflow data structure containing points and hist series
|
|
124
|
+
target_index (int): Index of the target point
|
|
125
|
+
for_components (list[VelocityComponents]): List of components to calculate turbulence intensity from
|
|
126
|
+
normalization_params (NormalizationParameters): Parameters for spectral density normalization
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
pd.DataFrame: Spectral density data with columns S (*) and f (*) for each for_components
|
|
130
|
+
"""
|
|
131
|
+
spectral_data = pd.DataFrame()
|
|
132
|
+
for component in for_components:
|
|
133
|
+
point_data = inflow_data.data.loc[inflow_data.data["point_idx"] == target_index]
|
|
134
|
+
vel_arr = point_data[component].to_numpy()
|
|
135
|
+
time_arr = point_data["time_step"].to_numpy()
|
|
136
|
+
|
|
137
|
+
spec_dens, norm_freq = spectral_density_function(
|
|
138
|
+
velocity_signal=vel_arr,
|
|
139
|
+
timestamps=time_arr,
|
|
140
|
+
reference_velocity=normalization_params.reference_velocity,
|
|
141
|
+
characteristic_length=normalization_params.characteristic_length,
|
|
142
|
+
)
|
|
143
|
+
spectral_data[f"S ({component})"] = spec_dens
|
|
144
|
+
spectral_data[f"f ({component})"] = norm_freq
|
|
145
|
+
|
|
146
|
+
return spectral_data
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def calculate_autocorrelation(
|
|
150
|
+
inflow_data: InflowData, anchor_point_idx: int, for_components: list[VelocityComponents]
|
|
151
|
+
) -> pd.DataFrame:
|
|
152
|
+
"""Calculates the autocorrelation from an anchor point
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
inflow_data (InflowData): Inflow data structure containing points and hist series
|
|
156
|
+
anchor_point_idx (int): Index of the anchor point
|
|
157
|
+
for_components (list[VelocityComponents]): List of components to calculate turbulence intensity from
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
pd.DataFrame: Autocorrelation data with columns for each for_components preffixed by coef_*
|
|
161
|
+
"""
|
|
162
|
+
anchor_data = inflow_data.data.loc[inflow_data.data["point_idx"] == anchor_point_idx].copy()
|
|
163
|
+
anchor_data = anchor_data[for_components + ["point_idx", "time_step"]]
|
|
164
|
+
for component in for_components:
|
|
165
|
+
anchor_data[f"{component}_a"] = anchor_data[f"{component}"]
|
|
166
|
+
anchor_data[f"{component}_a^2"] = anchor_data[f"{component}"] ** 2
|
|
167
|
+
data_to_merge = anchor_data[
|
|
168
|
+
["time_step"]
|
|
169
|
+
+ [f"{component}_a{symbol}" for component in for_components for symbol in ["^2", ""]]
|
|
170
|
+
]
|
|
171
|
+
merged_data = pd.merge(inflow_data.data, data_to_merge, on="time_step", how="left")
|
|
172
|
+
for component in for_components:
|
|
173
|
+
merged_data[f"{component}_{component}_a"] = (
|
|
174
|
+
merged_data[f"{component}"] * merged_data[f"{component}_a"]
|
|
175
|
+
)
|
|
176
|
+
avg_data = merged_data.groupby("point_idx").mean()
|
|
177
|
+
for component in for_components:
|
|
178
|
+
avg_data[f"coef_{component}"] = (
|
|
179
|
+
avg_data[f"{component}_{component}_a"]
|
|
180
|
+
- avg_data[f"{component}"] * avg_data[f"{component}_a"]
|
|
181
|
+
) / (avg_data[f"{component}_a^2"] - avg_data[f"{component}_a"] ** 2)
|
|
182
|
+
autocorrelation = avg_data[[f"coef_{c}" for c in for_components]].reset_index()
|
|
183
|
+
return autocorrelation
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import pathlib
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
import pandas as pd
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class NormalizationParameters:
|
|
11
|
+
reference_velocity: float
|
|
12
|
+
characteristic_length: float
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class InflowData:
|
|
16
|
+
def __init__(self, data: pd.DataFrame, points: pd.DataFrame):
|
|
17
|
+
self.data = data
|
|
18
|
+
self.points = points
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def from_files(cls, hist_series_path: pathlib.Path, points_path: pathlib.Path) -> InflowData:
|
|
22
|
+
"""Reads data from file and builds a InflowData
|
|
23
|
+
The inflow data dataframe must contain the columns (ux, uy, uz)
|
|
24
|
+
If any are missing, it won't be able to perform calculations over the components that are missing,
|
|
25
|
+
but will be able to perform calculations over the components that are present
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
hist_series_path (pathlib.Path): Path of the historic series (point_idx, ux, uy, uz velocities)
|
|
29
|
+
points_path (pathlib.Path): Path of the points information (idx, x, y, z coordinates)
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
InflowData: Inflow data object
|
|
33
|
+
"""
|
|
34
|
+
hist_series_format = hist_series_path.name.split(".")[-1]
|
|
35
|
+
if hist_series_format == "csv":
|
|
36
|
+
data = pd.read_csv(hist_series_path)
|
|
37
|
+
elif hist_series_format == "h5":
|
|
38
|
+
data_dfs = []
|
|
39
|
+
with pd.HDFStore(hist_series_path, mode="r") as data_store:
|
|
40
|
+
for key in data_store.keys():
|
|
41
|
+
df = data_store.get(key)
|
|
42
|
+
data_dfs.append(df)
|
|
43
|
+
|
|
44
|
+
data = pd.concat(data_dfs)
|
|
45
|
+
data.sort_values(
|
|
46
|
+
by=[col for col in ["time_step", "point_idx"] if col in data.columns], inplace=True
|
|
47
|
+
)
|
|
48
|
+
else:
|
|
49
|
+
raise Exception(f"Extension {hist_series_format} not supported for hist series!")
|
|
50
|
+
points = pd.read_csv(points_path)
|
|
51
|
+
return InflowData(data=data, points=points)
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import hashlib
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class HashableConfig(BaseModel):
|
|
7
|
+
def sha256(self) -> str:
|
|
8
|
+
"""Hash config dict and returns a string with the hash hexcode
|
|
9
|
+
|
|
10
|
+
Returns:
|
|
11
|
+
str: Config data object hash
|
|
12
|
+
"""
|
|
13
|
+
hash_sha256 = hashlib.sha256()
|
|
14
|
+
hash_sha256.update(self.model_dump_json().encode("utf-8"))
|
|
15
|
+
|
|
16
|
+
return hash_sha256.hexdigest()
|